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.

Truoble with creating templates and processors using api

Solved Go to solution
Highlighted

Truoble with creating templates and processors using api

New Contributor

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

Accepted Solutions

Re: Truoble with creating templates and processors using api

Master Guru
@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.

3 REPLIES 3

Re: Truoble with creating templates and processors using api

Mentor

@john y

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

Re: Truoble with creating templates and processors using api

New Contributor

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

Re: Truoble with creating templates and processors using api

Master Guru
@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.

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