You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by "heqingyong101@163.com" <he...@163.com> on 2016/11/14 10:13:18 UTC

Question: How could I use Rest api to control a single processor to start or stop .

Dear Sir/Madam,   Sorry to bother you. This is Younge, I am just studying nifi for collecting data. I would much appreciate if you could kindly help me, below are some questions I have:    How could I use Rest api to control a single processor to start or stop .     I just tried /nifi-api/processors/{id} with PUT method, using json encoded data as upload body data, I modified key's value (["status"] ["runStatus"]) to "Start", it's useless. But when I modified key's value(["component"]["config"]["comments"]), I found it works.    Would you mind give me the uri in the rest api or give me something else details about this question.    Would you please get me back , many thanks.    Best regards,
    Younge


heqingyong101@163.com

Re: Question: How could I use Rest api to control a single processor to start or stop .

Posted by Matt Gilman <ma...@gmail.com>.
Younge,

Thanks for checking out Apache NiFi. To start or stop a Processor the
request would look like this:

curl '
http://localhost:8080/nifi-api/processors/62b951cb-0158-1000-169b-13bb56ade28a'
-X PUT -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Content-Type:
application/json' -H 'Accept: application/json, text/javascript, */*;
q=0.01' --data-binary
'{"revision":{"clientId":"62b9169e-0158-1000-b6f8-027bf22830e9","version":2},"component":{"id":"62b951cb-0158-1000-169b-13bb56ade28a","state":"RUNNING"}}'
--compressed

The state will be either RUNNING or STOPPED.

The client id is a string that represents your client. It can be anything
you want. The version is the current version of this component. NiFi
employs optimistic locking to ensure that each client acknowledges they
have the latest version of each component (or they were the last client who
performed a modification).

As always, pop open the Dev Tools in your browser to see these endpoints in
action. Thanks again!

Matt



On Mon, Nov 14, 2016 at 5:13 AM, heqingyong101@163.com <
heqingyong101@163.com> wrote:

> Dear Sir/Madam,   Sorry to bother you. This is Younge, I am just studying
> nifi for collecting data. I would much appreciate if you could kindly help
> me, below are some questions I have:    How could I use Rest api to control
> a single processor to start or stop .     I just tried
> /nifi-api/processors/{id} with PUT method, using json encoded data as
> upload body data, I modified key's value (["status"] ["runStatus"]) to
> "Start", it's useless. But when I modified key's
> value(["component"]["config"]["comments"]), I found it works.    Would
> you mind give me the uri in the rest api or give me something else details
> about this question.    Would you please get me back , many thanks.    Best
> regards,
>     Younge
>
>
> heqingyong101@163.com
>