Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

Solved Go to solution

Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

New Contributor

For example I want to get the ID of the process-gorup which is at root level by asking the following query http://localhost:9090/nifi-api/process-groups/root/process-groups?name=Process-group1

The problem I am facing here is this results as all the processor group that are available at root level.But I'm only interested in the particular process-group.How can I get that information only not about all processor group?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

Super Guru

@Daminee Sao,

By using restApi search url you can get the id of the process group

RestApi URL:-

curl -i -X GET http://localhost:9090/nifi-api/flow/search-results?q=<name(or)id>;

Example:-

I'm having flowfiledrop as the name of process group in my NiFi and to get the id of the flowfiledrop process group ,

RestApi url would be

curl -i -X GET http://localhost:9090/nifi-api/flow/search-results?q=flowfiledrop

As you can see in i've mentioned flowfiledrop process group name in q parameter

$ curl -i -X GET http://localhost:9090/nifi-api/flow/search-results?q=flowfiledrop
HTTP/1.1 200 OK
Date: Mon, 05 Feb 2018 18:10:03 GMT
X-Frame-Options: SAMEORIGIN
Cache-Control: private, no-cache, no-store, no-transform
Content-Type: application/json
Vary: Accept-Encoding
Vary: User-Agent
Content-Length: 336
Server: Jetty(9.4.3.v20170317)
{"searchResultsDTO":{"processorResults":[],"connectionResults":[],"processGroupResults":[{"id":"619a2801-0161-1000-a4c2-95e4430e977f","groupId":"3b738dba-0161-1000-c808-f7d38f21fcab","name":"flowfiledrop","matches":["Name: flowfiledrop"]}],"inputPortResults":[],"outputPortResults":[],"remoteProcessGroupResults":[],"funnelResults":[]}}

the id of the flowfile drop process group is 619a2801-0161-1000-a4c2-95e4430e977f.

.

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of errors.

5 REPLIES 5

Re: Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

Super Guru

@Daminee Sao,

By using restApi search url you can get the id of the process group

RestApi URL:-

curl -i -X GET http://localhost:9090/nifi-api/flow/search-results?q=<name(or)id>;

Example:-

I'm having flowfiledrop as the name of process group in my NiFi and to get the id of the flowfiledrop process group ,

RestApi url would be

curl -i -X GET http://localhost:9090/nifi-api/flow/search-results?q=flowfiledrop

As you can see in i've mentioned flowfiledrop process group name in q parameter

$ curl -i -X GET http://localhost:9090/nifi-api/flow/search-results?q=flowfiledrop
HTTP/1.1 200 OK
Date: Mon, 05 Feb 2018 18:10:03 GMT
X-Frame-Options: SAMEORIGIN
Cache-Control: private, no-cache, no-store, no-transform
Content-Type: application/json
Vary: Accept-Encoding
Vary: User-Agent
Content-Length: 336
Server: Jetty(9.4.3.v20170317)
{"searchResultsDTO":{"processorResults":[],"connectionResults":[],"processGroupResults":[{"id":"619a2801-0161-1000-a4c2-95e4430e977f","groupId":"3b738dba-0161-1000-c808-f7d38f21fcab","name":"flowfiledrop","matches":["Name: flowfiledrop"]}],"inputPortResults":[],"outputPortResults":[],"remoteProcessGroupResults":[],"funnelResults":[]}}

the id of the flowfile drop process group is 619a2801-0161-1000-a4c2-95e4430e977f.

.

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of errors.

Re: Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

New Contributor

Thanks a lot

Re: Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

New Contributor

Very helpful! Thanks @Shu.

Also, be sure to put %20 in place of spaces in the search query.

Re: Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

New Contributor

Thanks for your answer @Shu ! It is very helpful.

Is there a way to do wildcard search using this?

Re: Can we fire a NIFI rest-api query to get the process-group or any other element ID by entering the name of the element ?

New Contributor

Thanks for your answer @Shu ! It is very helpful.

Is there a way to do wildcard search using this?

Don't have an account?
Coming from Hortonworks? Activate your account here