Created on 07-18-2018 11:04 PM - edited 08-17-2019 11:55 PM
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:
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
Created 07-18-2018 11:09 PM
Created 07-19-2018 02:16 PM
@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
Created 07-19-2018 02:20 PM
@Harish Vaibhav Kali Please also try using FQDN for nifi node instead of localhost ! Thanks
Created 05-21-2019 01:46 PM
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.