Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

How to stop a process group in NiFi using curl command

Hi,

I am trying to stop a nifi process group from UNIX where the nifi is installed using curl command.

First I generated the access token to the URL that I am trying to POST by running the below command:

curl --tlsv1.2 https://localhost:9966/nifi-api/access/token --data 'username=*****&password=****' -k

After this, I am running the below command using the access token generated from above step:

curl --tlsv1.2 -ik -H 'Content-Type: application/json' -H 'Authorization: Bearer {token from above command}' -XPUT -d'{"id":"03bc6708-6a44-4069-8fe3-77ec056639e7","state":"STOPPED"}' https://localhost:9966/nifi-api/flow/process-groups/03bc6708-6a44-4069-8fe3-77ec056639e7

But I get the below error when I run the above command:

79516-hw-cmd-nifi.png

Can someone help me resolve this issue?

Am I running the correct commands? If not can someone give me the correct commands to GET/POST NiFi content using curl command

PS: I am able to access NiFi UI through my web browser using this link: https://nifi-host:port/nifi

79515-hw-cmd-nifi.png

4 REPLIES 4

@Harish Vaibhav Kali Perhaps not relevant but please check the spaces in your command above, specially after -d as I don't see the space there. I've personally run into problems with curl when missing spaces or due order of arguments passed. Try this

curl --tlsv1.2 -ik -H 'Content-Type: application/json' -H 'Authorization: Bearer {token from above command}' -d '{"id":"03bc6708-6a44-4069-8fe3-77ec056639e7","state":"STOPPED"}' -XPUT 'https://localhost:9966/nifi-api/flow/process-groups/03bc6708-6a44-4069-8fe3-77ec056639e7'

HTH

@Harish Vaibhav Kali Please also try using FQDN for nifi node instead of localhost ! Thanks

Explorer

I have NIFI API Link https://nifi.apache.org/docs/nifi-docs/rest-api/index.html

But dont understand how to use it? How do you know when to stop NIFI Job.. i mean how do you know all processors have processed the data? Could you please share the documentation if any about it.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.