- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How do I Set Parameter Values in a NiFi instance using CLI (not Variables...)
- Labels:
-
Apache NiFi
Created on ‎08-05-2020 09:07 AM - edited ‎08-05-2020 09:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎08-06-2020 01:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..!
Created ‎08-05-2020 10:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe set via file https://community.cloudera.com/t5/Community-Articles/Exploring-Apache-NiFi-1-10-Parameters-and-State...
https://nifi.apache.org/docs/nifi-docs/rest-api/
https://nifi.apache.org/docs/nifi-registry-docs/rest-api/rest-api.html#_versionedparameter
Created ‎08-06-2020 01:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..!
Created ‎08-06-2020 06:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's good news. That's a tricky one. Glad things are working for you.
