triggerprototype.update
Descrição
object triggerprototype.update(object/array triggerPrototypes)
Este método permite atualizar os protótipos de trigger existentes.
Este método está disponível apenas para os tipos de usuário Admin e Super admin. As permissões para chamar o método podem ser revogadas nas configurações de função do usuário. Consulte User roles para obter mais informações.
Parameters
(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.
Valores de retorno
(object) Retorna um objeto contendo os IDs dos protótipos de triggers atualizados na propriedade triggerids.
Exemplos
Habilitando um protótipo de trigger
Habilite um protótipo de trigger, ou seja, defina seu status para 0.
Request:
{
"jsonrpc": "2.0",
"method": "triggerprototype.update",
"params": {
"triggerid": "13938",
"status": 0
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"triggerids": [
"13938"
]
},
"id": 1
}
Substituindo etiquetas de protótipo de trigger
Substituir etiquetas para um protótipo de trigger.
Request:
{
"jsonrpc": "2.0",
"method": "triggerprototype.update",
"params": {
"triggerid": "17373",
"tags": [
{
"tag": "volume",
"value": "{#FSNAME}"
},
{
"tag": "type",
"value": "{#FSTYPE}"
}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"triggerids": [
"17373"
]
},
"id": 1
}
Fonte
CTriggerPrototype::update() in ui/include/classes/api/services/CTriggerPrototype.php.