Skip to main content
justenji
Gold ⭐️⭐️
Sep 3, 2020 6:34 AM UTC
Solved

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

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.

ashinde
ashindeAnswer
Gold ⭐️
Oct 14, 2020 10:58 AM UTC

@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

4 replies

ashinde
Gold ⭐️
Gold ⭐️
Oct 12, 2020 4:57 PM UTC

@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

Translate
justenji
justenjiAuthor
Gold ⭐️⭐️
Oct 14, 2020 10:24 AM UTC

@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.

Translate
ashinde
Gold ⭐️
ashindeAnswer
Gold ⭐️
Oct 14, 2020 10:58 AM UTC

@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

Translate