How to create Connection and Delete of a processor in apache Nifi using Curl

a 夏天 提交于 2019-12-11 07:06:59

问题


1)Please let me know the process for creating a apache Nifi connection using curl? 2)How to delete a processor using Curl? 3)also Please let me know How to find lastModifier value of a processor.


回答1:


1/ to understand nifi api: https://nifi.apache.org/docs/nifi-docs/rest-api/

2/ use chrome devtools (f12) / network to trace requests from browser to nifi server, do required actions, and just copy requests as curl. below curls for connection creation and processor deletion.

3/ create connection

curl -X POST 'http://localhost:8080/nifi-api/process-groups/fd6ba415-015b-1000-b8ee-13ea77e54502/connections' \
 -H 'Content-Type: application/json' \
 -H 'Accept: application/json' \
 --data-binary '{
    "revision": {
        "clientId": "439a9b14-015c-1000-5924-200a7fdaf626",
        "version": 0
    },
    "component": {
        "name": "",
        "source": {
            "id": "439b2f6c-015c-1000-6eb1-59309b64c5dd",
            "groupId": "fd6ba415-015b-1000-b8ee-13ea77e54502",
            "type": "PROCESSOR"
        },
        "destination": {
            "id": "439b565d-015c-1000-320b-5db5df870c12",
            "groupId": "fd6ba415-015b-1000-b8ee-13ea77e54502",
            "type": "PROCESSOR"
        },
        "selectedRelationships": ["success"],
        "flowFileExpiration": "0 sec",
        "backPressureDataSizeThreshold": "1 GB",
        "backPressureObjectThreshold": "10000",
        "bends": [],
        "prioritizers": []
    }
}' 

4/ delete processor (you have to delete incoming connections before)

curl -X DELETE \
'http://localhost:8080/nifi-api/processors/439b565d-015c-1000-320b-5db5df870c12?version=2&clientId=439a9b14-015c-1000-5924-200a7fdaf626' 


来源:https://stackoverflow.com/questions/44195119/how-to-create-connection-and-delete-of-a-processor-in-apache-nifi-using-curl

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