Created 01-24-2017 05:54 AM
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.
Created 01-24-2017 09:45 AM
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.
Created 01-24-2017 09:45 AM
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.
Created 01-24-2017 06:39 PM
Fantastic advice - thanks! That'll help immensely moving forward
Created 07-31-2018 01:02 PM
@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.
Created 05-02-2017 10:21 AM
Thanks for the information. it is working.
Created 10-02-2017 06:26 AM
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 ?