trigger.update
Leírás
objektum trigger.update(object/array triggers)
Ez a módszer lehetővé teszi a meglévő triggerek frissítését.
Ez a módszer csak az Admin és a Kiemelt rendszergazda számára érhető el felhasználói típusok. A metódus meghívására vonatkozó engedélyek felhasználói szerepkörben visszavonhatók beállítások. Lásd: User roles további információért.
Parameters
(object/array) Trigger properties to be updated.
The triggerid property must be defined for each trigger, all other
properties are optional. Only the passed properties will be updated, all
others will remain unchanged.
Additionally to the standard trigger properties the method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| dependencies | array | Triggers that the trigger is dependent on. The triggers must have the triggerid property defined. |
| tags | array | Trigger tags. |
The trigger expression has to be given in its expanded form.
Visszatérési értékek
(object) Egy objektumot ad vissza, amely tartalmazza a frissített triggerek azonosítóit
a triggerids tulajdonság alatt.
Példák
Enabling a trigger
Enable a trigger, that is, set its status to 0.
Request:
{
"jsonrpc": "2.0",
"method": "trigger.update",
"params": {
"triggerid": "13938",
"status": 0
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"triggerids": [
"13938"
]
},
"id": 1
}
Replacing triggers tags
Replace tags for trigger.
Request:
{
"jsonrpc": "2.0",
"method": "trigger.update",
"params": {
"triggerid": "13938",
"tags": [
{
"tag": "service",
"value": "{{ITEM.VALUE}.regsub(\"Service (.*) has stopped\", \"\\1\")}"
},
{
"tag": "error",
"value": ""
}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"triggerids": [
"13938"
]
},
"id": 1
}
Lásd még
Forrás
CTrigger::update() az ui/include/classes/api/services/CTrigger.php fájlban.