Created on 08-02-2018 08:58 AM - edited 09-16-2022 06:32 AM
Hello, I have a question.
I hope to get variables data on NiFi Flow in REST API.
But, I found processor group variables data, not found flow's variables data api.
How do I do it?
Thank you
Created on 08-02-2018 09:39 AM - edited 08-17-2019 09:16 PM
Hi @Seongmin Park
The "NiFi Flow" itself is also a process group, see on the left hand side when you log in, note the Process group ID that belongs to my NiFi Flow. I will also set a var on the NiFi Flow and retrieve it with REST:
Setting a random var on it;
And getting the variable data of the NiFi Flow over REST:
[root@c3175-node4 ~]# curl -i -X GET http://172.25.35.14:9090/nifi-api/process-groups/dadadbcd-0164-1000-16c1-6c50ce94361e/variable-regis... HTTP/1.1 200 OK Date: Thu, 02 Aug 2018 09:34:52 GMT Content-Type: application/json Content-Length: 362 {"processGroupRevision":{"clientId":"f9e30047-0164-1000-e3ba-51b6ec77ae6f","version":3},"variableRegistry":{"variables":[{"variable":{"name":"FlowVarExample","value":"This is a flow variable example : - )","processGroupId":"dadadbcd-0164-1000-16c1-6c50ce94361e","affectedComponents":[]},"canWrite":true}],"processGroupId":"dadadbcd-0164-1000-16c1-6c50ce94361e"}}
Created on 08-02-2018 09:39 AM - edited 08-17-2019 09:16 PM
Hi @Seongmin Park
The "NiFi Flow" itself is also a process group, see on the left hand side when you log in, note the Process group ID that belongs to my NiFi Flow. I will also set a var on the NiFi Flow and retrieve it with REST:
Setting a random var on it;
And getting the variable data of the NiFi Flow over REST:
[root@c3175-node4 ~]# curl -i -X GET http://172.25.35.14:9090/nifi-api/process-groups/dadadbcd-0164-1000-16c1-6c50ce94361e/variable-regis... HTTP/1.1 200 OK Date: Thu, 02 Aug 2018 09:34:52 GMT Content-Type: application/json Content-Length: 362 {"processGroupRevision":{"clientId":"f9e30047-0164-1000-e3ba-51b6ec77ae6f","version":3},"variableRegistry":{"variables":[{"variable":{"name":"FlowVarExample","value":"This is a flow variable example : - )","processGroupId":"dadadbcd-0164-1000-16c1-6c50ce94361e","affectedComponents":[]},"canWrite":true}],"processGroupId":"dadadbcd-0164-1000-16c1-6c50ce94361e"}}