Created 08-01-2018 05:55 AM
Hello,
Can I get 'variables' in NiFI on REST API?
I found to get variables in NiFi's rest api document, but not found.
variables is : picture.
is it provided?
Created on 08-01-2018 08:36 AM - edited 08-17-2019 09:22 PM
Hi @Seongmin Park
Yes, this is possible with the REST API. For example, I made a process group with 1 variable "TestVariable" and content "Hello Seongmin"
Now to get this using REST, I run;
curl -i -X GET http://172.25.36.20:9090/nifi-api/process-groups/<your group id here>/variable-registry
And the output from that rest query
HTTP/1.1 200 OK Date: Wed, 01 Aug 2018 08:33:32 GMT Content-Type: application/json Content-Length: 337 {"processGroupRevision":{"clientId":"f49c73f5-0164-1000-48ef-ef1af0585eca","version":4},"variableRegistry":{"variables":[{"variable":{"name":"TestVariable","value":"Hello Seongmin","processGroupId":"f49c4d0a-0164-1000-ffff-ffffb54b15e2","affectedComponents":[]},"canWrite":true}],"processGroupId":"f49c4d0a-0164-1000-ffff-ffffb54b15e2"}}
Created on 08-01-2018 08:36 AM - edited 08-17-2019 09:22 PM
Hi @Seongmin Park
Yes, this is possible with the REST API. For example, I made a process group with 1 variable "TestVariable" and content "Hello Seongmin"
Now to get this using REST, I run;
curl -i -X GET http://172.25.36.20:9090/nifi-api/process-groups/<your group id here>/variable-registry
And the output from that rest query
HTTP/1.1 200 OK Date: Wed, 01 Aug 2018 08:33:32 GMT Content-Type: application/json Content-Length: 337 {"processGroupRevision":{"clientId":"f49c73f5-0164-1000-48ef-ef1af0585eca","version":4},"variableRegistry":{"variables":[{"variable":{"name":"TestVariable","value":"Hello Seongmin","processGroupId":"f49c4d0a-0164-1000-ffff-ffffb54b15e2","affectedComponents":[]},"canWrite":true}],"processGroupId":"f49c4d0a-0164-1000-ffff-ffffb54b15e2"}}
Created 08-02-2018 01:28 AM
Thank you sir!