Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Rising Star

- Please follow steps mentioned in below link in order to get the list of provenance event id's :

Nifi- how to get provenance event id in nifi?

- In order to get more information about a specific event :

For Nifi running in Standalone mode :

# curl -i -X GET http://<hostname>:9090/nifi-api/provenance-events/id

For Nifi running in clustered mode:

# curl -i -X GET http://<hostname>:9090/nifi-api/provenance-events/id?clusterNodeId=<NODE UUID>   

There may be multiple events with the same event id(one on each node), so you need to specify from which node you want to return that specific event.

4,149 Views
Comments
avatar
Expert Contributor

thanks @amankumbare

could you please add how you would access the API in a secure NiFi environment - getting a token first, then use the token to access the provenance events.

avatar
Explorer

Here u go

Open bash script and put the info

 

url="https://<you environment>:9091/nifi-api/"
url_encoded="application/x-www-form-urlencoded"
accept_header="Accept: application/json"
content_type="Content-Type: application/json"
data="username=<your user name>&password=<your password"

rm -rf /tmp/a

end_point="access/token"
curl -k -X POST "${url}${end_point}" -H "${url_encoded}" --data "${data}" > /tmp/a
token=`cat /tmp/a`
bearer="Authorization: Bearer ${token}"
 
# Now you are all set to run the curl commands
 
# Get root id
end_point="process-groups/root"
curl -k -X GET "${url}${end_point}" -H "${content_type}" -H "${bearer}"
 
# Get all the components under root which includes all processgroups, process, controller service, connections and everything.   
# NOTE: the identifier id WILL NOT MATCH your NIFI id.  They are different.  but this is one stop for full automation
end_point="process-groups/root/download"
curl -k -X GET "${url}${end_point}" -H "${content_type}" -H "${bearer}"