Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 12-05-2016 06:06 AM
Hi,
I am able to start/stop processors using rest-api, can we do the same to process groups? The GET api doesn't show any status tag. What is the JSON we can POST to start/stop it?
Thanks,
Avijeet
{ "revision": { "version": 0 }, "id": "8619c3f4-0158-1000-a750-24884f23ea60", "uri": "http://localhsot:8080/nifi-api/process-groups/8619c3f4-0158-1000-a750-24884f23ea60", "position": { "x": 0, "y": 0 }, "permissions": { "canRead": true, "canWrite": true }, "bulletins": [], "component": { "id": "8619c3f4-0158-1000-a750-24884f23ea60", "position": { "x": 0, "y": 0 }, "name": "NiFi Flow", "comments": "", "runningCount": 0, "stoppedCount": 7, "invalidCount": 0, "disabledCount": 0, "activeRemotePortCount": 0, "inactiveRemotePortCount": 0, "inputPortCount": 0, "outputPortCount": 0 }, "status": { "id": "8619c3f4-0158-1000-a750-24884f23ea60", "name": "NiFi Flow", "statsLastRefreshed": "06:00:52 UTC", "aggregateSnapshot": { "id": "8619c3f4-0158-1000-a750-24884f23ea60", "name": "NiFi Flow", "flowFilesIn": 0, "bytesIn": 0, "input": "0 (0 bytes)", "flowFilesQueued": 36, "bytesQueued": 1536, "queued": "36 (1.5 KB)", "queuedCount": "36", "queuedSize": "1.5 KB", "bytesRead": 296384, "read": "289.44 KB", "bytesWritten": 209649, "written": "204.74 KB", "flowFilesOut": 0, "bytesOut": 0, "output": "0 (0 bytes)", "flowFilesTransferred": 1519, "bytesTransferred": 592128, "transferred": "1,519 (578.25 KB)", "bytesReceived": 92325, "flowFilesReceived": 75, "received": "75 (90.16 KB)", "bytesSent": 0, "flowFilesSent": 0, "sent": "0 (0 bytes)", "activeThreadCount": 0 } }, "runningCount": 0, "stoppedCount": 7, "invalidCount": 0, "disabledCount": 0, "activeRemotePortCount": 0, "inactiveRemotePortCount": 0, "inputPortCount": 0, "outputPortCount": 0 }
Created 12-05-2016 06:34 AM
Yes, you can do the same to process groups. Please refer NiFi Rest Api PUT /flow/processor-groups/{id} endpoint.
You can start a process group by sending PUT request to the endpoint a JSON like this:
{"id":"cda85e6e-0158-1000-150a-cb88f801e860","state":"RUNNING"}Hope this helps,
Koji
Created 12-05-2016 06:34 AM
Yes, you can do the same to process groups. Please refer NiFi Rest Api PUT /flow/processor-groups/{id} endpoint.
You can start a process group by sending PUT request to the endpoint a JSON like this:
{"id":"cda85e6e-0158-1000-150a-cb88f801e860","state":"RUNNING"}Hope this helps,
Koji
Created 12-05-2016 06:38 AM
I tried this but got - Message body is malformed. Unable to map into expected format.
Also in GET resonse I don't see any "state" tag
Created 12-05-2016 06:44 AM
I was able to start a process group with following cURL command:
curl -i -H 'Content-Type: application/json' -XPUT -d '{"id":"cdb54c9a-0158-1000-5566-c45ca9692f85","state":"RUNNING"}' localhost:8080/nifi-api/flow/process-groups/cdb54c9a-0158-1000-5566-c45ca9692f85Is there any difference with your request? I think GET response doesn't contain 'state' element because a process group doesn't have its own state, just a container of child processors.
Created 12-06-2016 06:11 AM
Hi, thanks it worked, I was using a URL like below...then noticed the 'flow', used it and worked fine.
localhost:8080/nifi-api/process-groups/cdb54c9a-0158-1000-5566-c45ca9692f85