object triggerprototype.update(object/array triggerPrototypes)
This method allows to update existing trigger prototypes.
This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object/array)
Trigger prototype properties to be updated.
The triggerid
property must be defined for each trigger prototype, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.
Additionally to the standard trigger prototype properties the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
dependencies | array | Triggers and trigger prototypes that the trigger prototype is dependent on. The triggers must have the triggerid property defined. |
tags | array | Trigger prototype tags. |
The trigger expression has to be given in its expanded form and must contain at least one item prototype.
(object)
Returns an object containing the IDs of the updated trigger prototypes under the triggerids
property.
Enable a trigger prototype, that is, set its status to "0".
{
"jsonrpc": "2.0",
"method": "triggerprototype.update",
"params": {
"triggerid": "13938",
"status": 0
},
"id": 1
}
Response:
Replace tags for one trigger prototype.
{
"jsonrpc": "2.0",
"method": "triggerprototype.update",
"params": {
"triggerid": "17373",
"tags": [
{
"tag": "volume",
"value": "{#FSNAME}"
},
{
"tag": "type",
"value": "{#FSTYPE}"
}
]
},
"id": 1
}
Response:
CTriggerPrototype::update() in ui/include/classes/api/services/CTriggerPrototype.php.