You can pass the updated configuration in JSON form through a payload path or a JSON template. Whatever is handed to the Config: Set Node will deep-merge with the existing configuration (which is why you must pass a null
item to delete a trigger config object).
For example, given the following triggers
configuration retrieved from the Agent Config: Get Node …
{
"triggers": [
{
"opcuaId": "0",
"uri": "opc.tcp://dylans-mbp.lan:53530/OPCUA/SimulationServer",
"securityPolicy": "None",
"securityMode": "None",
"samplingInterval": "100",
"eventFilter": [],
"name": "opcuaSimServer",
"type": "opcua",
"monitoredItems": [
{
"nameSpace": "3",
"identifier": "i=1002"
}
]
},
{
"opcuaId": "0",
"uri": "opc.tcp://dylans-mbp.lan:53530/OPCUA/SimulationServer",
"securityPolicy": "None",
"securityMode": "None",
"samplingInterval": "100",
"eventFilter": [],
"name": "opcuaSimServer2",
"type": "opcua",
"monitoredItems": [
{
"nameSpace": "4",
"identifier": "i=1005"
}
]
}
]
}
… changing the triggers
property using the Config: Set Node and providing the following value …
{
"triggers": [
{}, // no changes to the first config
{
"name": "aDifferentName", // change the configName
"monitoredItems": [
{ "nameSpace": "3" }, // change only the nameSpace of the first monitoredItem
{"identifier": "i=1002", "nameSpace": "2"} // add another monitoredItem
]
}
]
}
… results in the following deep-merged triggers
value …
{
"triggers": [
{
"opcuaId": "0",
"uri": "opc.tcp://dylans-mbp.lan:53530/OPCUA/SimulationServer",
"securityPolicy": "None",
"securityMode": "None",
"samplingInterval": "100",
"eventFilter": [],
"name": "opcuaSimServer",
"type": "opcua",
"monitoredItems": [
{
"nameSpace": "3",
"identifier": "i=1002"
}
]
},
{
"opcuaId": "0",
"uri": "opc.tcp://dylans-mbp.lan:53530/OPCUA/SimulationServer",
"securityPolicy": "None",
"securityMode": "None",
"samplingInterval": "100",
"eventFilter": [],
"name": "aDifferentName",
"type": "opcua",
"monitoredItems": [
{
"nameSpace": "3",
"identifier": "i=1005"
},
{
"nameSpace": "2",
"identifier": "i=1002"
}
]
}
]
}