<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: start/stop processor via nifi api in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117159#M79946</link>
    <description>&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;for me it is working fine :&lt;/P&gt;&lt;P&gt;HTTP method : PUT &lt;/P&gt;&lt;P&gt;{
  "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
  }
}&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2017 14:14:24 GMT</pubDate>
    <dc:creator>uttam_mca2021</dc:creator>
    <dc:date>2017-05-02T14:14:24Z</dc:date>
    <item>
      <title>start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117144#M79931</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to start and stop processors via the nifi api version 1.0.0. I'm getting status code 409 returned and the message is "afb7dcf1-0157-1000-9450-ea0931a67e0f is not stopped."&lt;/P&gt;&lt;P&gt;I have read previous articles about the optimistic locking and I am supplying the version and client id but I'm still getting this error. Any ideas? Here is a snippet of my python code:&lt;/P&gt;&lt;PRE&gt;process_group = nifiapi.find_process_group(process_group_name)
if process_group is None:
    return None
processors = nifiapi.get_processors_by_pg(process_group["id"])
if processors is None:
    return None
for processor in processors['processors']:
    processor["revision"]["clientId"] = str(uuid.uuid4())
    processor["status"]["runStatus"] = "STOPPED"
    logging.debug("Updating processor: {}".format(json.dumps(processor)))
    nifiapi.update_processor(processor) # this makes the put request&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 01:37:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117144#M79931</guid>
      <dc:creator>frankmarit</dc:creator>
      <dc:date>2016-11-23T01:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117145#M79932</link>
      <description>&lt;P style="margin-left: 20px;"&gt;ok I figured it out. Since I was taking the processor object returned from my 'get' call and just modifying a few fields, it thought I was trying to do an update on the object. You cannot do this while it is running so that was the error message. I modified my request to only contain the minimum number of fields (i think) to stop the processor. I'm still unclear whether I need to set status.runStatus and/or component.state to STOPPED to get what I want as they both seem to indicate the same thing. Anyway, the below request works:&lt;/P&gt;&lt;PRE&gt;modified_processor = {
    'revision': {
        'version': processor["revision"]["version"],
        'clientId': str(uuid.uuid4())
    },
    'status': {
        'runStatus': status
    },
    'component': {
        'id': processor['id'],
        'state': status
    },
    'id' : processor['id']
}&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 02:57:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117145#M79932</guid>
      <dc:creator>frankmarit</dc:creator>
      <dc:date>2016-11-23T02:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117146#M79933</link>
      <description>&lt;P&gt;@ &lt;A href="https://community.hortonworks.com/users/12998/frankmarit.html"&gt;Frank Maritato&lt;/A&gt; Is there a way to start and stop processors using nifi - api??&lt;/P&gt;&lt;P&gt;Can you please elaborate with the endpoints to start/stop processors?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 23:34:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117146#M79933</guid>
      <dc:creator>hari_nagalla</dc:creator>
      <dc:date>2016-11-23T23:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117147#M79934</link>
      <description>&lt;P&gt;Sure! The endpoint for updating a processor is a PUT request against /processors/[processor_id] where you would post json similar to what I have above. The runStatus should be either "STOPPED" or "RUNNING". You have to include the clientId or the version in the request. The 'component' field is also required. I discovered all this by reading the code since there really isn't a user guide on how to use these endpoints.&lt;/P&gt;&lt;P&gt;As part of my script,  I was getting to the list of processors by the name of the process group. So my flow is:&lt;/P&gt;&lt;P&gt;GET /flow/search_results?q=[process_group_name]&lt;/P&gt;&lt;P&gt;Then I get a list of processors for that group with:&lt;/P&gt;&lt;P&gt;GET /process-groups/[process_group_id]/processors&lt;/P&gt;&lt;P&gt;I loop through each of those results with the PUT request I mentioned above. Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 02:27:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117147#M79934</guid>
      <dc:creator>frankmarit</dc:creator>
      <dc:date>2016-11-24T02:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117148#M79935</link>
      <description>&lt;P&gt;Thanks for the reply &lt;A rel="user" href="https://community.cloudera.com/users/12998/frankmarit.html" nodeid="12998"&gt;@Frank Maritato&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I tried using Put request against /processors/"processor_id" and the json is &lt;/P&gt;&lt;P&gt;{  "component":{
"id":"5444685a-0158-1000-0407-0bd70a8688ef"
},
"status":{
"runStatus":"STOPPED"
}
}.&lt;/P&gt;&lt;P&gt;But got an error saying "Revision must be specified." What is Revision? Also , you specified that clientID or version should be included. Can you please define these? and/or From where we can get these values?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 02:18:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117148#M79935</guid>
      <dc:creator>hari_nagalla</dc:creator>
      <dc:date>2016-11-30T02:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117149#M79936</link>
      <description>&lt;P&gt;You will need to do a Get on that processor first. The revision/version is contained in that json and you just pass it thru for your Put request.&lt;/P&gt;&lt;P&gt;GET /processors/{id}&lt;/P&gt;&lt;P&gt;returning json will have something like this:&lt;/P&gt;&lt;PRE&gt;{
  "status": { ... },
  "component": { ... },
  "revision": {
    "version": 1
  }
}&lt;/PRE&gt;&lt;P&gt;So you would just take that whole revision element and add it to your Put payload.&lt;/P&gt;&lt;P&gt;clientId is any string that identifies your tool/app. In my example above, I was just generating a random uuid.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 03:02:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117149#M79936</guid>
      <dc:creator>frankmarit</dc:creator>
      <dc:date>2016-11-30T03:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117150#M79937</link>
      <description>&lt;P&gt;It gave JSON syntax error, with double quotes - worked fine.&lt;/P&gt;&lt;P&gt;{
  "revision": {
    "version": 8,
    "clientId": "test"
  },
  "status": {
    "runStatus": "RUNNING"
  },
  "component": {
    "id": "8bb725ef-0158-1000-478b-da5903184807",
    "state": "RUNNING"
  },
  "id": "8bb725ef-0158-1000-478b-da5903184807"
}&lt;/P&gt;&lt;P&gt;But sometimes the GET request gets timed out - is the nifi-api service reliable?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 13:02:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117150#M79937</guid>
      <dc:creator>avijeetd</dc:creator>
      <dc:date>2016-11-30T13:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117151#M79938</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12998/frankmarit.html" nodeid="12998"&gt;@Frank Maritato&lt;/A&gt; Thanks for the Information.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 00:01:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117151#M79938</guid>
      <dc:creator>hari_nagalla</dc:creator>
      <dc:date>2016-12-02T00:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117152#M79939</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12998/frankmarit.html" nodeid="12998"&gt;@Frank Maritato&lt;/A&gt; I am trying to start a processor group.Here is the command&lt;/P&gt;&lt;P&gt;curl -i -X PUT -H 'Content-Type:application/json' -d '{"component": {"id":"&amp;lt;processorgroup_id&amp;gt;","parentGroupId":"&amp;lt;parentgroup_id&amp;gt;","state":"RUNNING"},"revision": {"clientId":"&amp;lt;client_id&amp;gt;","version": 2}}' &lt;A href="http://hostname:port/nifi-api/process-groups/&amp;lt;processorgroup_id"&gt;http://hostname:port/nifi-api/process-groups/&lt;/A&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;I am facing:&lt;/P&gt;&lt;P&gt;HTTP/1.1 400 Bad Request
Date: Tue, 20 Dec 2016 06:43:43 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Server: Jetty(9.3.9.v20160517)

Message body is malformed. Unable to map into expected format.&lt;/P&gt;&lt;P&gt;is there any issue in above api request??&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:53:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117152#M79939</guid>
      <dc:creator>gayathri2486</dc:creator>
      <dc:date>2016-12-20T14:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117153#M79940</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14950/gayathri2486.html" nodeid="14950"&gt;@Gayathri Rajendran&lt;/A&gt; My processor update json looks like this:&lt;/P&gt;&lt;PRE&gt;{
  "status": {
    "runStatus": "RUNNING"
  },
  "component": {
    "state": "RUNNING",
    "id": "01571000-f7fb-1da4-7d70-b6be89100354"
  },
  "id": "01571000-f7fb-1da4-7d70-b6be89100354",
  "revision": {
    "version": 1,
    "clientId": "c4cd2dc5-a57f-4025-aa4b-7e29118ce795"
  }
}
&lt;/PRE&gt;&lt;P&gt;You may need to add the separate "status" object in there. Also, I've never specified a parentGroupId so I'm not sure if that is necessary.&lt;/P&gt;&lt;P&gt;Lastly, you may need to add a -H 'Accept:application/json' to your curl command as well.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 01:46:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117153#M79940</guid>
      <dc:creator>frankmarit</dc:creator>
      <dc:date>2016-12-21T01:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117154#M79941</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12998/frankmarit.html" nodeid="12998"&gt;@Frank Maritato&lt;/A&gt; 
Thanks for the response&lt;/P&gt;&lt;P&gt;Here is my api call, I have updated my call like the above format. Even i am facing the same issue&lt;/P&gt;&lt;P&gt;curl -i -X PUT -H 'Content-Type:application/json' -H 'Accept: application/json' -d '{"status": {"runStatus": "RUNNING"},"component":{"state":"RUNNING","id":"&amp;lt;processorgroup_id&amp;gt;"},"id": "&amp;lt;processorgroup_id&amp;gt;", "revision": {"version": 2,"clientId":"&amp;lt;client_id&amp;gt;"}}' &lt;A href="http://host:port/nifi-api/process-groups/&amp;lt;processorgroup_id"&gt;http://host:port/nifi-api/process-groups/&lt;/A&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 19:33:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117154#M79941</guid>
      <dc:creator>gayathri2486</dc:creator>
      <dc:date>2016-12-21T19:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117155#M79942</link>
      <description>&lt;P&gt;is there a way to start stop processors group?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 01:03:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117155#M79942</guid>
      <dc:creator>sanjeev_verma82</dc:creator>
      <dc:date>2016-12-28T01:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117156#M79943</link>
      <description>&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;GET /process-groups/{id}/processors &lt;/P&gt;&lt;P&gt;and then one by one set them to RUNNING or STOPPED by doing&lt;/P&gt;&lt;P&gt;PUT /processors/{id}&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 01:51:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117156#M79943</guid>
      <dc:creator>frankmarit</dc:creator>
      <dc:date>2016-12-28T01:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117157#M79944</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10755/sanjeevverma82.html" nodeid="10755"&gt;@Sanjeev Verma&lt;/A&gt; &lt;/P&gt;&lt;P&gt;yes its possible, pls see &lt;A href="https://community.hortonworks.com/questions/69905/can-i-start-a-processgroup-using-rest-api.html#answer-69911" target="_blank"&gt;https://community.hortonworks.com/questions/69905/can-i-start-a-processgroup-using-rest-api.html#answer-69911&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 22:26:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117157#M79944</guid>
      <dc:creator>avijeetd</dc:creator>
      <dc:date>2016-12-28T22:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117158#M79945</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;any new ? somebody has the correct syntax of json for running a processor ?&lt;/P&gt;&lt;P&gt;i've used this json with HTTP CODE 405&lt;/P&gt;&lt;PRE&gt;# 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 &lt;A href="https://localhost:9443/nifi-api/processors/b0c63454-89a8-15ef-be22-959bd4a72e5a" target="_blank"&gt;https://localhost:9443/nifi-api/processors/b0c63454-89a8-15ef-be22-959bd4a72e5a&lt;/A&gt; -d @startListHDFS_1.json -vv

&lt;/PRE&gt;&lt;P&gt;help appreciate. thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 23:00:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117158#M79945</guid>
      <dc:creator>maykiwogno</dc:creator>
      <dc:date>2017-02-08T23:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117159#M79946</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;for me it is working fine :&lt;/P&gt;&lt;P&gt;HTTP method : PUT &lt;/P&gt;&lt;P&gt;{
  "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
  }
}&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 14:14:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117159#M79946</guid>
      <dc:creator>uttam_mca2021</dc:creator>
      <dc:date>2017-05-02T14:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117160#M79947</link>
      <description>&lt;P&gt;in which processor we need to use? how to specify property of that processor?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:30:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117160#M79947</guid>
      <dc:creator>na2_koihey11</dc:creator>
      <dc:date>2017-06-07T15:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: start/stop processor via nifi api</title>
      <link>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117161#M79948</link>
      <description>&lt;P&gt; @&lt;A href="https://community.hortonworks.com/users/12998/frankmarit.html"&gt;Frank Maritato&lt;/A&gt; 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.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2017 12:16:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/start-stop-processor-via-nifi-api/m-p/117161#M79948</guid>
      <dc:creator>ramkrish9198</dc:creator>
      <dc:date>2017-09-16T12:16:18Z</dc:date>
    </item>
  </channel>
</rss>

