如何使用Rest API在Nifi1.1.0中停止单个处理器 [英] How to stop the single processor in nifi1.1.0 using rest api

查看:260
本文介绍了如何使用Rest API在Nifi1.1.0中停止单个处理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用rest api /processors/{id}中的PUT方法停止处于运行状态的处理器.

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

我能够通过按"state": "RUNNING"的方式更改组件中的状态来启动处理器,并以"runStatus": "Running"的形式在聚合快照中运行runStatus.

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".

类似地,我试图通过将状态更改为STOPPED来停止处理器,但是遇到错误

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

9204b68d-0159-1000-7d8f-720592b2a2dd没有停止(409错误冲突nd 400 Badrequest).

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

请让我知道如何停止处理器.

Please let me know how to stop the processor.

谢谢.

推荐答案

您可以使用rest api停止处理器.

you can able to stop processor using rest api.

示例:

我在UI中具有GetFile(ID:9204b68d-0159-1000-7d8f-720592b2a2dd)处理器.

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

RestAPI网址:

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

在这里,我已将JSON内容作为PUT请求传递来停止处理器.

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"
  }
} 

修订和状态是阻止处理器从RestAPI停止的最重要的事情.

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.

这篇关于如何使用Rest API在Nifi1.1.0中停止单个处理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆