Support Questions

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

Truoble with creating templates and processors using api

avatar
Explorer

Hi there!

I set up standalone NIFI 1.8.0 and now try to communicate with it using node through his api.

  1. I am trying to deploy template which already exist on nifi (made it through GUI) :
    POST to "www.localhost:8080/nifi-api/process-groups/{THE_TEMPLATE_ID}/template-instance" but recieving error 415 status : media type not supported.
    I cant figure out what is worng with the request.
  2. I did not set up any authentication, but still when i tried to make any change like creating processor i am getting error 405 : not allowed. How is that possible?

love for some help,

john

1 ACCEPTED SOLUTION

avatar
Super Mentor
@john y

-

The rest-api endpoint you are using is incorrect for instantiating an existing template on the canvas. You should instead be using a curl command that looks something like this:

# curl 'http://localhost:8080/nifi-api/process-groups/<PROCESS GROUP UUID>/template-instance' -H 'Content-Type: application/json' --data-binary '{"templateId":"<THE_TEMPLATE_UUID>","originX":100,"originY":100,"disconnectedNodeAcknowledged":false}' —compressed

-

The rest-api endpoint contains the UUID of the process group in which you will be instantiating your template. You need to include a header like above that defines the content type and then provide "--data-binary" json that includes the template's UUID and the x coordinates on the graph where the template should be placed.

-

Thank you,

Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.

View solution in original post

3 REPLIES 3

avatar
Master Mentor

@john y

Can you use http:// localhost:8080 instead of www !

avatar
Explorer

Already changed it, but still i am getting the same answer. This is not the issue.

avatar
Super Mentor
@john y

-

The rest-api endpoint you are using is incorrect for instantiating an existing template on the canvas. You should instead be using a curl command that looks something like this:

# curl 'http://localhost:8080/nifi-api/process-groups/<PROCESS GROUP UUID>/template-instance' -H 'Content-Type: application/json' --data-binary '{"templateId":"<THE_TEMPLATE_UUID>","originX":100,"originY":100,"disconnectedNodeAcknowledged":false}' —compressed

-

The rest-api endpoint contains the UUID of the process group in which you will be instantiating your template. You need to include a header like above that defines the content type and then provide "--data-binary" json that includes the template's UUID and the x coordinates on the graph where the template should be placed.

-

Thank you,

Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.