Skip to main content
EddyChan
Silver ⭐️⭐️⭐️
October 2, 2023
Solved

Set the Global Parameter Processor Configuration via NIFI REST API

Hi Support,

Would like to ask is that possible to set the Global_parameter in processor configuration via nifi rest api instead of using UI ?

EddyChan_0-1696223084319.png

 

cotopaul
cotopaulAnswer
Platinum ⭐️
October 2, 2023

@EddyChan, if I understood correctly, you want to set an already created Parameter Context in a Process Group, right?
If so, you can do that using RestAPI with PUT as Request Method and the payload as:

{
"revision": {
"clientId": "6df050ee-0002-1de6-27e5-05edebf761b0",
"version": 0
},
"disconnectedNodeAcknowledged": false,
"component": {
"id": "6dbf7e4e-849e-39ad-a2dd-dbe3f890a1d0",
"name": "test",
"comments": "",
"parameterContext": {
"id": "b2ce1579-0187-1000-ffff-ffffb8598d34"
},
"flowfileConcurrency": "UNBOUNDED",
"flowfileOutboundPolicy": "STREAM_WHEN_AVAILABLE",
"defaultFlowFileExpiration": "0 sec",
"defaultBackPressureObjectThreshold": "10000",
"defaultBackPressureDataSizeThreshold": "1 GB"
}
}

What you need to know is the ID of the parameter context you would like to set in your process group and you are all done. Of course you will need to know the ID of the Process Group you are trying to modify as well.

2 replies

cotopaul
cotopaulAnswer
Platinum ⭐️
October 2, 2023

@EddyChan, if I understood correctly, you want to set an already created Parameter Context in a Process Group, right?
If so, you can do that using RestAPI with PUT as Request Method and the payload as:

{
"revision": {
"clientId": "6df050ee-0002-1de6-27e5-05edebf761b0",
"version": 0
},
"disconnectedNodeAcknowledged": false,
"component": {
"id": "6dbf7e4e-849e-39ad-a2dd-dbe3f890a1d0",
"name": "test",
"comments": "",
"parameterContext": {
"id": "b2ce1579-0187-1000-ffff-ffffb8598d34"
},
"flowfileConcurrency": "UNBOUNDED",
"flowfileOutboundPolicy": "STREAM_WHEN_AVAILABLE",
"defaultFlowFileExpiration": "0 sec",
"defaultBackPressureObjectThreshold": "10000",
"defaultBackPressureDataSizeThreshold": "1 GB"
}
}

What you need to know is the ID of the parameter context you would like to set in your process group and you are all done. Of course you will need to know the ID of the Process Group you are trying to modify as well.

Translate
EddyChan
EddyChanAuthor
Silver ⭐️⭐️⭐️
October 4, 2023

Yes correct, and thank you worked. 

Translate