nifi-api: List all processors with their configuration

2.8k views Asked by At

I want to list all my ListenHTTP processor URLs so I can select and kick off different flows.

Is it possible with Nifi API query to list all processors with their configuration (in my case looking to get 'Base Path' and 'Listening Port') ?

Looking for a query that will return this info only (not the full processor details).

I can get an individual processor by name.

https://<IP-ADDRESS>:9443/nifi-api/flow/search-results?q=MyProcessor

Then parse out the processor's id from this result.

And with id get the processor's full details.

https://<IP-ADDRESS>:9443/nifi-api/processors/<PROCESSOR-ID>

But then I would have to parse out the config properties (and would have to repeat for each processor).

This seems a roundabout way of solving the problem.

Any help would be much appreciated.

Thanks

**** EDIT:

Best solution I can see at the moment is still a 2 step approach.

Get everything for ListenHTTP

https://<IP-ADDRESS>:9443/nifi-api/flow/search-results?q=ListenHTTP

This will return multiple Json arrays, where we want the 'processorResults'

Parse this (in Java) to get processor name and id.

Then (as above) get processor by 'id' and parse out config.

https://<IP-ADDRESS>:9443/nifi-api/processors/<PROCESSOR-ID>
1

There are 1 answers

1
mattyb On

You can use Python and NiPyAPI to recurse through the flow and get all the processors, then you'd filter on ListenHttp processors. You can also use NiPyAPI to kick off the desired flows, it is a very handy tool.