Created on 02-13-2022 05:39 AM - edited 02-13-2022 05:40 AM
Hello everyone
I follow this guide https://nifi.apache.org/docs/nifi-docs/rest-api/index.html
NIFI API
and I want to run-status specific process
So how Can I do it and how to call the API
thank you
Created 02-13-2022 02:30 PM
@Saraali ,
To call the API, the first thing you need is the processor UUID, which you can find in the UI:
With the processor UUID, I can call the process API endpoints. For example, to get details about the processor I can do a GET on the /processor/{id} enpoint:
$ curl "https://nifi-1.example.org:8080/nifi-api/processors/f525c671-017e-1000-ffff-ffffa16ab615"
{
"revision": {
"clientId": "f52573c3-017e-1000-62a7-8b0be35e3b2e",
"version": 6
},
"id": "f525c671-017e-1000-ffff-ffffa16ab615",
"uri": "https://nifi-1.example.org:8080/nifi-api/processors/f525c671-017e-1000-ffff-ffffa16ab615",
"position": {
"x": 384,
"y": 176
},
...
}
To make modifications to the processor we have to pass the revision information retrieved in the command above. So, for example, to call run-status to stop the processor I can execute the following command, using the revision from the previous output:
$ curl \
-X PUT \
-H 'Content-Type: application/json' \
-d '{"state": "STOPPED","revision":{"clientId":"f52573c3-017e-1000-62a7-8b0be35e3b2e","version":6}}' \
"https://nifi-1.example.org:8080/nifi-api/processors/f525c671-017e-1000-ffff-ffffa16ab615/run-status"
Cheers,
André
Created 04-22-2022 06:23 AM
@Saraali have you resolved your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.