Avinash
Avinash

Reputation: 21

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

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.

Upvotes: 2

Views: 2638

Answers (1)

daggett
daggett

Reputation: 28634

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' 

Upvotes: 7

Related Questions