Support Questions

Find answers, ask questions, and share your expertise

NiFi Toolkit 2.0, the nifi create-reg-client command does not provide a parameter to specify the registry client type GitLabFlowRegistryClient 2.0.0

avatar
New Contributor

Hello,

In NiFi Toolkit 2.0, the nifi create-reg-client command does not provide a parameter to specify the registry client type (GitLabFlowRegistryClient 2.0.0 ). Are there any workarounds for setting up a registry client in the apache/nifi:2.0 Docker image for a CI pipeline?

Best regards 

Wojtek

 

 

1 ACCEPTED SOLUTION

avatar
New Contributor

Edited:Fixed typo in snippet

This should work, although I haven't tested it yet

 

 

#!/bin/bash

#Request access token
my_token="$(curl "https://${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}:${NIFI_WEB_HTTPS_PORT:-8443}/nifi-api/access/token?username=${SINGLE_USER_CREDENTIALS_USERNAME:-admin}&password=${SINGLE_USER_CREDENTIALS_PASSWORD:-password}" \
      -H 'Content-type:application/x-www-form-urlencoded' \
      -X POST)"

#Create gitlab registry client
curl "https://${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}:${NIFI_WEB_HTTPS_PORT:-8443}/nifi-api/controller/registry-clients" \
  -H 'content-type: application/json' \
  -H "authorization: bearer ${my_token}" \
  --data-raw "{\"revision\":{\"version\":0},\"disconnectedNodeAcknowledged\":false,\"component\":{\"name\":\"${GITLAB_REGISTRY_CLIENT_NAME:-gitlab_reg_client}\",\"type\":\"org.apache.nifi.gitlab.GitLabFlowRegistryClient\",\"description\":\"${GITLAB_REGISTRY_CLIENT_DESCRIPTION:-gitlab_reg_description}\", \"properties\":{\"GitLab API URL\":\"https://${GITLAB_REGISTRY_WEB_HTTPS_HOST:-gitlab.com}:${GITLAB_REGISTRY_WEB_HTTPS_HOST:-443}\",\"Repository Namespace\":\"${GITLAB_REGISTRY_CLIENT_REPOSITORY_NAMESPACE:-default}\",\"Repository Name\":\"${GITLAB_REGISTRY_CLIENT_REPOSITORY_NAME:-default}\",\"Access Token\":\"${GITLAB_REGISTRY_CLIENT_REPOSITORY_ACESS_TOKEN:-insert-your-token}\"}}}" 

 

 

 Best regards

Wojtek

View solution in original post

2 REPLIES 2

avatar
Community Manager

@wkwi Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @MattWho @mburgess  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
New Contributor

Edited:Fixed typo in snippet

This should work, although I haven't tested it yet

 

 

#!/bin/bash

#Request access token
my_token="$(curl "https://${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}:${NIFI_WEB_HTTPS_PORT:-8443}/nifi-api/access/token?username=${SINGLE_USER_CREDENTIALS_USERNAME:-admin}&password=${SINGLE_USER_CREDENTIALS_PASSWORD:-password}" \
      -H 'Content-type:application/x-www-form-urlencoded' \
      -X POST)"

#Create gitlab registry client
curl "https://${NIFI_WEB_HTTPS_HOST:-$HOSTNAME}:${NIFI_WEB_HTTPS_PORT:-8443}/nifi-api/controller/registry-clients" \
  -H 'content-type: application/json' \
  -H "authorization: bearer ${my_token}" \
  --data-raw "{\"revision\":{\"version\":0},\"disconnectedNodeAcknowledged\":false,\"component\":{\"name\":\"${GITLAB_REGISTRY_CLIENT_NAME:-gitlab_reg_client}\",\"type\":\"org.apache.nifi.gitlab.GitLabFlowRegistryClient\",\"description\":\"${GITLAB_REGISTRY_CLIENT_DESCRIPTION:-gitlab_reg_description}\", \"properties\":{\"GitLab API URL\":\"https://${GITLAB_REGISTRY_WEB_HTTPS_HOST:-gitlab.com}:${GITLAB_REGISTRY_WEB_HTTPS_HOST:-443}\",\"Repository Namespace\":\"${GITLAB_REGISTRY_CLIENT_REPOSITORY_NAMESPACE:-default}\",\"Repository Name\":\"${GITLAB_REGISTRY_CLIENT_REPOSITORY_NAME:-default}\",\"Access Token\":\"${GITLAB_REGISTRY_CLIENT_REPOSITORY_ACESS_TOKEN:-insert-your-token}\"}}}" 

 

 

 Best regards

Wojtek