Support Questions

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

Create process groups using NiFi 1.x REST API?

avatar

I'm able to make GET calls just fine, though the NiFi docs for PUT/POST are a bit cryptic. As I understand it, we need to call POST on /process-groups/{id}/process-groups to create a process group before we can upload a template. However, after reading through the API docs, I can't seem to figure out what is required in the body (API docs suggest everything is optional).

I'll repeatedly get "Process group details must be specified" despite trying different requests. Anyone happen to have examples of creating a process group, preferably up to and including uploading a template?

I was using the following resources from Andrew and Matthew, but unfortunately not compatible with the new API.

https://github.com/aperepel/nifi-api-deploy

https://github.com/mattyb149/nifi-client

1 ACCEPTED SOLUTION

avatar

Hi @Edgar Orendain,

The best way to understand the REST API is to open the developer view of your browser when being on NiFi UI and do what you want through the UI to see what are the REST API calls performed in the background: the UI is strictly using the same API.

Regarding your question, here is what I have:

Request sent to

http://localhost:8080/nifi-api/process-groups/8f83b1c2-0159-1000-c091-37f5eb918bca/process-groups

Where

8f83b1c2-0159-1000-c091-37f5eb918bca

is the ID of my root process group.

The content of my request is the following JSON:

{"revision":{"clientId":"cfc9c5fd-0159-1000-e150-054ac8339ef7","version":0},"component":{"name":"test","position":{"x":647.5,"y":-299.5}}}

test is the name of the process group I created and you have the coordinates of the process group.

Based on your needs, you can remove some data in the JSON but the name is required if I recall correctly.

Hope this helps.

View solution in original post

5 REPLIES 5

avatar

Hi @Edgar Orendain,

The best way to understand the REST API is to open the developer view of your browser when being on NiFi UI and do what you want through the UI to see what are the REST API calls performed in the background: the UI is strictly using the same API.

Regarding your question, here is what I have:

Request sent to

http://localhost:8080/nifi-api/process-groups/8f83b1c2-0159-1000-c091-37f5eb918bca/process-groups

Where

8f83b1c2-0159-1000-c091-37f5eb918bca

is the ID of my root process group.

The content of my request is the following JSON:

{"revision":{"clientId":"cfc9c5fd-0159-1000-e150-054ac8339ef7","version":0},"component":{"name":"test","position":{"x":647.5,"y":-299.5}}}

test is the name of the process group I created and you have the coordinates of the process group.

Based on your needs, you can remove some data in the JSON but the name is required if I recall correctly.

Hope this helps.

avatar

Fantastic advice - thanks! That'll help immensely moving forward

avatar
Expert Contributor

@Pierre Villard This works for me if I leave out the `clientID` part as NiFi will generate it's own, but I have a use case where I would like to provide my own UUID. Is this possible? I tried using `uuidgen` to get a UUID in bash but the POST then fails.

avatar

Thanks for the information. it is working.

avatar
Contributor

how to do GET calls can you please send me some URL ? This will give only json .. if i want UI . Like through Html i will do rest -call and that processer will show on UI ? That is possible How?i have one more question how to create processer-group through programme ?