Reputation: 4132
I'm exploring the rest API functionalities provided by NiFi. I have a question: can we get the ID of a component, be it a processor, processor group, controller services,etc., using NiFi-API
by querying the component's name?
I tried http://localhost:8080/nifi-api/flow/search-results?q=sample
I have a processor group named sample in my NiFi Flow.
And I have a GetFile
processor named sample get file
and I queried this: http://localhost:8080/nifi-api/controller/search-results/q='sample get file'
. None of them seem to work. The NiFi-API documentation wasn't quite helpful in these aspects. So guide me how to achieve this.
Upvotes: 3
Views: 6524
Reputation: 3496
De Santa,
If you wants to get id of the processor u have to know process group ID of the processor.
Here i have simple example in which gets the id of the processors in root.
http://localhost:8080/nifi-api/controller/process-groups/root/processors
Above code works in nifi-0.6.1.
EDIT1
In NiFi-1.1.1
You have to use below rest api to collect processors
Process group id:515eeb84-646b-4b33-eaf7-2028420a9fcb
http://localhost:8089/nifi-api/process-groups/515eeb84-646b-4b33-eaf7-2028420a9fcb/processors
Above API collects number of processors in mentioned Process group id.
[OR]
Process group id:root
http://localhost:8089/nifi-api/process-groups/root/processors
It collects the number of available processors in Root Canvas.
So if you know ID of the process group in which processor besides then easy to get processor ID.
Upvotes: 7