Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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 ?

avatar

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

avatar
Master 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.

View solution in original post

5 REPLIES 5

avatar
Master 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.

avatar

Thanks a lot

avatar
New Contributor

Very helpful! Thanks @Shu.

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

avatar
New Contributor

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

Is there a way to do wildcard search using this?

avatar
New Contributor

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

Is there a way to do wildcard search using this?