Support Questions

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

How do I Set Parameter Values in a NiFi instance using CLI (not Variables...)

avatar
Explorer

The NiFi Toolkit CLI has a neat option for setting variables in a deployed NiFi flow. This is very useful for deploying a flow to different environments and then changing a few necessary variables. The commands are nifi pg-get-vars and nifi pg-set-var and would be used as follows;

 

#> nifi pg-get-vars -pgid 34x015f8-0284-1000-5488-a7c6511e5656 -u http://nifi-prod:8080
#> nifi pg-set-var -pgid 34x015f8-0284-1000-5488-a7c6511e5656 -var ListFilesInputDir -val /prod/temp -u http://nifi-prod:8080

However, using Parameters in  Parameter Contexts seems to be the new and better way of doing things and can be used among different groups in a flow, I have implemented many in my 140 processor project!

 

So my question is this: How do I now set different values for these Parameters for different environments when I deploy my flow. My deployment will be automated using the CLI in the NiFi toolkit, so I'm looking for a solution that is automated/scripted.

 

There appears to be ListParamContexts, GetParamContext and SetParam, but when I run;

 

nifi list-param-contexts -u http://localhost:8090/nifi

 

 

I get <title>Error 404 Not Found</title>

 

I am running NiFi-Toolkit version 1.11.4.

 

 

 

1 ACCEPTED SOLUTION

avatar
Explorer

Those are great suggestions, I'll give them a try.

I found out what was causing my <title>Error 404 Not Found</title>

 

It was the url parameter value I used

http://localhost:8090/nifi

 .. when it should have been

http://localhost:8090

The webapp name of "nifi" is not appropriate for a call via the CLI. My mistake..!

 

View solution in original post

3 REPLIES 3

avatar
Explorer

Those are great suggestions, I'll give them a try.

I found out what was causing my <title>Error 404 Not Found</title>

 

It was the url parameter value I used

http://localhost:8090/nifi

 .. when it should have been

http://localhost:8090

The webapp name of "nifi" is not appropriate for a call via the CLI. My mistake..!

 

avatar
Master Guru

That's good news.   That's a tricky one.   Glad things are working for you.