Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 12-28-2024 12:49 PM
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
Created on 01-05-2025 07:38 AM - edited 01-05-2025 07:47 AM
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
Created 12-30-2024 06:23 AM
@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,Created on 01-05-2025 07:38 AM - edited 01-05-2025 07:47 AM
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