I am writing a script that will dynamically create a process group with a given name based on user input. I then am wanting to deploy a template inside of this process group immediately after it gets created. Since NiFi generates the UUID for the new process group after the POST to the API, I am stumped on how to get the UUID of the newly created process group. How can I accomplish this so I can then deploy a template inside of it?
I tried generating a UUID myself for the process group in bash by using `uuidgen` so I could easily track this in a variable, however the POST fails for some reason when I send this along with the name.
Here is the curl that is failing when I provide a uuid I generated.
curl -k -X POST -v -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{"revision":{"clientID":"'$uuid'","version":0},"component":{"name":"'$CLUSTER_NAME' '$FLOW_NAME'"}}' https://myhost.com:9091/nifi-api/process-groups/$EXISTING_PROCESS_GROUP/process-groups/
If I remove the `clientID` part of the JSON, the POST works and NiFi generates a UUID for me, which results in my original problem.