Skip to main content
Absolute_Z
Silver ⭐️
January 12, 2023
Solved

Nifi: Context Parameter usage

Hello

 

I'm trying to implement an automation process to instanciate a nifi cluster and I have a problem with Context Parameters.

Using the nifi REST API with curl commands (or python scripts), I have found how to create a context parameter, how to populate it with parameters, how to bound it to a process group, but I do not find how to unbind it from a processor group (like if I want to reset the "Process Group Parameter Context" of the processor group configuration window scrolling menu to "No parameter context")

 

I meen it is possible (it is possible using the GUI)

Does anyone have any idea how to do this.
Thanks

Best regards,
Absolute Z

MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
January 12, 2023

@Absolute_Z 
You can use the NiFi rest-api to set the parameter context on a NiFi Process Group (PG) back to "No Parameter Context".

Example:

 

curl 'http://<nifi hostname>:<nifi port>/nifi-api/process-groups/<PG UUID>' -X 'PUT' -H 'Content-Type: application/json' --data-raw '{"revision":{"clientId":"a723bd7b-0185-1000-efb1-be534ab7a455","version":1},"disconnectedNodeAcknowledged":false,"component":{"id":"<PG UUID>","name":"<PG name>","comments":"","parameterContext":{"id":null},"flowfileConcurrency":"UNBOUNDED","flowfileOutboundPolicy":"STREAM_WHEN_AVAILABLE","defaultFlowFileExpiration":"0 sec","defaultBackPressureObjectThreshold":"10000","defaultBackPressureDataSizeThreshold":"1 GB"}}'

 

You'll notice in the data passed I have "parameterContext":{"id":null} which will clear all set parameter contexts on the specified Process Group.


If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

 

2 replies

MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
January 12, 2023

@Absolute_Z 
You can use the NiFi rest-api to set the parameter context on a NiFi Process Group (PG) back to "No Parameter Context".

Example:

 

curl 'http://<nifi hostname>:<nifi port>/nifi-api/process-groups/<PG UUID>' -X 'PUT' -H 'Content-Type: application/json' --data-raw '{"revision":{"clientId":"a723bd7b-0185-1000-efb1-be534ab7a455","version":1},"disconnectedNodeAcknowledged":false,"component":{"id":"<PG UUID>","name":"<PG name>","comments":"","parameterContext":{"id":null},"flowfileConcurrency":"UNBOUNDED","flowfileOutboundPolicy":"STREAM_WHEN_AVAILABLE","defaultFlowFileExpiration":"0 sec","defaultBackPressureObjectThreshold":"10000","defaultBackPressureDataSizeThreshold":"1 GB"}}'

 

You'll notice in the data passed I have "parameterContext":{"id":null} which will clear all set parameter contexts on the specified Process Group.


If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

 

Translate
Absolute_Z
Silver ⭐️
January 19, 2023

Hello,
Thank you Matt for your quick response (and sorry for my late response).

It work perfectly.

 

Best Regards

 

Translate