How to stop the single processor in nifi1.1.0 using rest api

纵饮孤独 提交于 2019-12-23 10:26:41

问题


I am trying to stop the processor which is in running state using the PUT method in rest api /processors/{id}.

I am able to start the processor by changing the state in the component as follows "state": "RUNNING", and runStatus in the aggregatesnapshot as "runStatus": "Running".

Similarly I tried to stop the processor by changing the state as STOPPED but facing an error as

9204b68d-0159-1000-7d8f-720592b2a2dd is not stopped (409 error conflict nd 400 Badrequest).

Please let me know how to stop the processor.

Thanks in advance.


回答1:


you can able to stop processor using rest api.

Example:

i having GetFile(ID:9204b68d-0159-1000-7d8f-720592b2a2dd) processor in UI.

RestAPI Url:

http://<host>:<port>/nifi-api/processors/9204b68d-0159-1000-7d8f-720592b2a2dd

Here json content i have passed as PUT Request to stop processor.

{
  "status": {
    "runStatus": "STOPPED"
  },
  "component": {
    "state": "STOPPED",
    "id": "9204b68d-0159-1000-7d8f-720592b2a2dd"
  },
  "id": "9204b68d-0159-1000-7d8f-720592b2a2dd",
  "revision": {
    "version": 10,
    "clientId": "ab010dd6-0159-1000-615b-f095502a7ceb"
  }
} 

Revision and Status are most important things in stop the processor from RestAPI.

It works well for me.Try it.

And let me know if not worked.



来源:https://stackoverflow.com/questions/41713086/how-to-stop-the-single-processor-in-nifi1-1-0-using-rest-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!