pvillard31 commented on pull request #4298:
URL: https://github.com/apache/nifi/pull/4298#issuecomment-635972147


   In that case, would it be an option to use the CLI or REST API to set the 
parameters values after the flow has been deployed in NiFi from the NiFi 
Registry. On my side, with my k8s deployments, I'm doing something looking like 
the below
   
   ````
   # add the Registry client in NiFi (to adapt for your secured NiFi instances)
   curl 'http://nifi:8080/nifi-api/controller/registry-clients' -H 
'Content-Type: application/json' --data-binary 
'{"revision":{"version":0},"component":{"name":"NiFi 
Registry","uri":"http://nifi-registry:18080/nifi-registry"}}'
   
   # Deploy the flow in NiFi (add the logic to retrieve the bucket/flow/version)
   /opt/nifi/nifi-toolkit-1.11.4/bin/cli.sh nifi pg-import -u http://nifi:8080 
--bucketIdentifier $bucketID --flowIdentifier $flow --flowVersion $version
   
   # Get the parameter context ID
   paramContextID=`/opt/nifi/nifi-toolkit-1.11.4/bin/cli.sh nifi 
list-param-contexts -u http://nifi:8080 -ot json | grep -v cli.sh | jq -r 
'.parameterContexts[].id'`
   
   # Set the parameters values (you can do something dynamic based on your 
needs)
   /opt/nifi/nifi-toolkit-1.11.4/bin/cli.sh nifi set-param -u http://nifi:8080 
--paramContextId $paramContextID --paramName MY_PARAMETER --paramValue MY_VALUE
   
   # Start the controller services (add your logic to retrieve the PG ID)
   /opt/nifi/nifi-toolkit-1.11.4/bin/cli.sh nifi pg-enable-services -u 
http://nifi:8080 --processGroupId $pgid
   
   # Start the process group (add your logic to retrieve the PG ID)
   /opt/nifi/nifi-toolkit-1.11.4/bin/cli.sh nifi pg-start -u http://nifi:8080 
--processGroupId $pgid
   ````


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to