Created 07-18-2018 06:13 AM
Is there any way where we can provide nifi processor group variables when executing the process group from rest api as parameter
Created 07-18-2018 02:35 PM
-
What the actual curl command will look like depends on whether your NiFi target is secured or not and how it has been secured. I am not completely clear on what you mean by "executing the process group".
-
Here is an example curl command that can be used to create or update a key/value variable on an existing process group. This example assumes the NiFi has been secured and authorization is via LDAP.
-
# Obtain a user authentication token:
token=$(curl -k 'https://<hostname>:<port>/nifi-api/access/token' --data 'username=<username>&password=<password>’)
-
#Get current process group variable-registry details:
curl -k 'https://<hostname>:<port>/nifi-api/process-groups/<process group uuid>/variable-registry' -H "Authorization: Bearer $token"
-
#create or update a variable on a specific process group:
curl -k 'https://<hostname>:<port>/nifi-api/process-groups/<process group uuid>/variable-registry/update-requests' -H "Authorization: Bearer $token" -H 'Content-Type: application/json' --data-binary '{"processGroupRevision":{"clientId":"<client id from above response>","version":2},"variableRegistry":{"processGroupId":"<process group uuid>","variables":[{"variable":{"name":"new-pg-var","value":"testing1234"}}]}}' --compressed
-
Note: If you Target Nifi is unsecured you will not need to worry about authentication or authorization. So above command would not require "-k" or "-H "Authorization: Bearer $token". The URL in that case would also be http instead of https.
-
Thank you,
Matt
-
If you found this Answer addressed your original question, please take a moment to login and click "Accept" below the answer.
Created 07-18-2018 02:35 PM
-
What the actual curl command will look like depends on whether your NiFi target is secured or not and how it has been secured. I am not completely clear on what you mean by "executing the process group".
-
Here is an example curl command that can be used to create or update a key/value variable on an existing process group. This example assumes the NiFi has been secured and authorization is via LDAP.
-
# Obtain a user authentication token:
token=$(curl -k 'https://<hostname>:<port>/nifi-api/access/token' --data 'username=<username>&password=<password>’)
-
#Get current process group variable-registry details:
curl -k 'https://<hostname>:<port>/nifi-api/process-groups/<process group uuid>/variable-registry' -H "Authorization: Bearer $token"
-
#create or update a variable on a specific process group:
curl -k 'https://<hostname>:<port>/nifi-api/process-groups/<process group uuid>/variable-registry/update-requests' -H "Authorization: Bearer $token" -H 'Content-Type: application/json' --data-binary '{"processGroupRevision":{"clientId":"<client id from above response>","version":2},"variableRegistry":{"processGroupId":"<process group uuid>","variables":[{"variable":{"name":"new-pg-var","value":"testing1234"}}]}}' --compressed
-
Note: If you Target Nifi is unsecured you will not need to worry about authentication or authorization. So above command would not require "-k" or "-H "Authorization: Bearer $token". The URL in that case would also be http instead of https.
-
Thank you,
Matt
-
If you found this Answer addressed your original question, please take a moment to login and click "Accept" below the answer.
Created 07-24-2018 09:34 AM
@Matt Clarke above command gives the following error .
The specified resource could not be found.curl: (6) Could not resolve host: Content-Type; Name or service not known
Created 07-24-2018 09:38 AM
It works .. Thanks you