Support Questions
Find answers, ask questions, and share your expertise

NiFi - REST-API - searching for information about versioned processgroups

Solved Go to solution
Highlighted

NiFi - REST-API - searching for information about versioned processgroups

Expert Contributor

Hi all, I want to build a flow which brings up information about all versioned processgroup on this system. What I need is:
- name of each processgroup
- version of each processgroup
- timestamp when this version was brought to this system

 

Now I tested with NiFi-REST-API but I can not find the right request to do this.
Could someone help me to get this works?
Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: NiFi - REST-API - searching for information about versioned processgroups

Cloudera Employee

@justenji 

The timestamp details are not exposed by NiFi on Flow but NiFi does maintain it in flow history. [Only if NiFi is secured with SSL]

So you can try https://${hostname}:${NIFI_PORT}/nifi-api/flow/history/components/{componentId} to get the details. But it will provide all history of that component you have to parse it as per your need. Note that this info gets purged as per flow history parameters in nifi.properties so you will have these details not from beginning but beginning of the date [days/hours] mentioned in properties.

If you are looking for flow timestamp when it is exported to NiFi-Registry then checkout for 

https://${hostname}:${NR_PORT}//nifi-registry-api/buckets/{bucketId}/flows/{flowId} 

 

Br,

Akash

View solution in original post

4 REPLIES 4
Highlighted

Re: NiFi - REST-API - searching for information about versioned processgroups

Cloudera Employee

@justenji  It is not possible yet to get all info in one NiFi API call as you desired but you can try below call to get the versioning info about particular process group

curl -v -X GET "https://$HOSTNAME:9091/nifi-api/versions/process-groups/{id}" -H "Authorization: Bearer $TOKEN" -H "Connection: close" -k

 

Br,

Akash

Re: NiFi - REST-API - searching for information about versioned processgroups

Expert Contributor

@ashinde   Thanks for this information.
Tested the command with InvokeHTTP from NiFi itselfe.
So I would have to deliver a list of Processgroup-IDs to check with this request...

 

At the moment I try getting information with
https://${hostname(true)}:${NIFI_PORT}/nifi-api/process-groups/${PG_ID}/process-groups
starting with root-pg-id, split and doing the same for each therein found processgroup in a loop.

So I can get component-name, component-version, pg-id.

 

One info I still miss is timestamp when a processgroup was brought to a NiFi-instance (imported from registry) or when it was last updated (change of version).

Do you have a tip where to find this? Thanks.

Highlighted

Re: NiFi - REST-API - searching for information about versioned processgroups

Cloudera Employee

@justenji 

The timestamp details are not exposed by NiFi on Flow but NiFi does maintain it in flow history. [Only if NiFi is secured with SSL]

So you can try https://${hostname}:${NIFI_PORT}/nifi-api/flow/history/components/{componentId} to get the details. But it will provide all history of that component you have to parse it as per your need. Note that this info gets purged as per flow history parameters in nifi.properties so you will have these details not from beginning but beginning of the date [days/hours] mentioned in properties.

If you are looking for flow timestamp when it is exported to NiFi-Registry then checkout for 

https://${hostname}:${NR_PORT}//nifi-registry-api/buckets/{bucketId}/flows/{flowId} 

 

Br,

Akash

View solution in original post

Highlighted

Re: NiFi - REST-API - searching for information about versioned processgroups

Expert Contributor

Thanks for your help @ashinde !
I see I was looking at the wrong section of rest-api.

OK I have to go on nifi rest-api section flow/history.
I will have a look on the nifi.properties but because my report is running every night I suppose the purging doesn't matter.

 

Second option you mentioned concerning when a flow was brought to registry doesn't interest... at the moment.