Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

NiFi rest api creating parameter context

avatar
Frequent Visitor

Hi,

 

I noticed that in NiFi rest api documentation for version 1.9.0 the parameter context endpoints have been removed, even though they existed in version 1.15.2

MeAndB_0-1641707745629.png

Furthermore, I am using NiFi version 1.13.2 and I can see that in my browser's debugging tools, in the network tab, whenever I create a parameter context, a post request is sent to 

and the following payload is being sent :

{
    "component": {
        "name": "aaaaaaaaaaa",
        "description": "aaaaaaaaaaaaaaaa",
        "parameters": []
    },
    "revision": {
        "clientId": "3d3697c2-017e-1000-0610-31b28073cf9b",
        "version": 0
    }
}

 

The parameter context is successfully created. However when I attempt to send a post request from an external API or even hit the previously mentioned endpoint through the browser using the same payload, I get:

HTTP 405 Method Not Allowed

 My questions are:

1. Is anyone aware whether these endpoints have been removed/restricted intentionally?

2. If they are not remove/restricted, has anyone been able to successfully send a post request and create a parameter context through NiFi's rest api?

1 ACCEPTED SOLUTION

avatar
Frequent Visitor

Hi,

 

I figured it out. It had to do with me not serialising the data to json properly before passing it as json and also I should have used the following for the header:

 

 

headers={"Content-type": "application/json", "Accept": "application/json"}

 

 

Also, this means, that even though the parameter context endpoints are not listed in version 1.9.0., they are still available.

View solution in original post

1 REPLY 1

avatar
Frequent Visitor

Hi,

 

I figured it out. It had to do with me not serialising the data to json properly before passing it as json and also I should have used the following for the header:

 

 

headers={"Content-type": "application/json", "Accept": "application/json"}

 

 

Also, this means, that even though the parameter context endpoints are not listed in version 1.9.0., they are still available.