Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

start/stop processor via nifi api

Solved Go to solution

Re: start/stop processor via nifi api

New Contributor

@Frank Maritato Thanks for the response

Here is my api call, I have updated my call like the above format. Even i am facing the same issue

curl -i -X PUT -H 'Content-Type:application/json' -H 'Accept: application/json' -d '{"status": {"runStatus": "RUNNING"},"component":{"state":"RUNNING","id":"<processorgroup_id>"},"id": "<processorgroup_id>", "revision": {"version": 2,"clientId":"<client_id>"}}' http://host:port/nifi-api/process-groups/>

HTTP/1.1 400 Bad Request Date: Wed, 21 Dec 2016 11:08:27 GMT Content-Type: text/plain Transfer-Encoding: chunked Server: Jetty(9.3.9.v20160517) Message body is malformed. Unable to map into expected format

Re: start/stop processor via nifi api

New Contributor

is there a way to start stop processors group?

Re: start/stop processor via nifi api

Contributor

No, not from what I was able to find. If you want to start all processors in a processor group, you need to get the list of all processors in that group by calling

GET /process-groups/{id}/processors

and then one by one set them to RUNNING or STOPPED by doing

PUT /processors/{id}

Hope this helps!

Re: start/stop processor via nifi api

Expert Contributor

Re: start/stop processor via nifi api

New Contributor

Hi all,

any new ? somebody has the correct syntax of json for running a processor ?

i've used this json with HTTP CODE 405

# more startListHDFS_1.json
{
  "status": {
    "runStatus": "RUNNING"
  },
  "component": {
    "state": "RUNNING",
    "id": "b0c63454-89a8-15ef-be22-959bd4a72e5a"
  },
  "id": "b0c63454-89a8-15ef-be22-959bd4a72e5a",
  "revision": {
    "version": 1,
    "clientId": "test"
  }
}
# curl -H "Content-type: application/json" --cacert nifi-cert.pem --cert ./client.p12 -XPOST https://localhost:9443/nifi-api/processors/b0c63454-89a8-15ef-be22-959bd4a72e5a -d @startListHDFS_1.json -vv

help appreciate. thanks

Re: start/stop processor via nifi api

New Contributor

Hi all,

for me it is working fine :

HTTP method : PUT

{ "status": { "runStatus": "STOPPED" }, "component": { "state": "STOPPED", "id": "b2e9b4eb-015b-1000-765d-c01c0a2fa6ce" //processor id }, "id": "b2e9b4eb-015b-1000-765d-c01c0a2fa6ce", //processor id "revision": { "clientId": "b2e5a8bb-015b-1000-31c1-0ee3b952dcbe", "version": 8 } }

Re: start/stop processor via nifi api

New Contributor

in which processor we need to use? how to specify property of that processor?

Re: start/stop processor via nifi api

New Contributor

@Frank Maritato Can i run your python code in ExecuteScript processor - which means i am stopping an processor from another one within nifi. If yes? will your code work if security for nifi is enabled like LDAP authentication. Can you show light on "nifiapi" is it an api provided by nifi.

Don't have an account?
Coming from Hortonworks? Activate your account here