-
Problem report
-
Resolution: Won't fix
-
Trivial
-
None
-
6.0.28, 7.0.0beta3
-
None
As described in the summary - the API cannot be used to update triggers created using trigger prototypes.
trigger.update returns an error:
"data": "Cannot update \"tags\" for a discovered trigger"
Here's example of running sample query to a usual trigger, and discovered one, with the responses.
Manually created trigger:
Request:
{ "jsonrpc": "2.0", "method": "trigger.update", "params": { "triggerid": "23289", "tags": [ { "tag": "scope", "value": "test" }, { "tag": "error", "value": "" } ] }, "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "triggerids": [ "23289" ] }, "id": 1 }
Trigger updated, new tags applied.
Discovered trigger:
Request:
{ "jsonrpc": "2.0", "method": "trigger.update", "params": { "triggerid": "23292", "tags": [ { "tag": "scope", "value": "test" }, { "tag": "error", "value": "" } ] }, "id": 1 }
Response:
{ "jsonrpc": "2.0", "error": { "code": -32500, "message": "Application error.", "data": "Cannot update \"tags\" for a discovered trigger \"/: Disk space is critically low\".", "debug": [ { "file": "/usr/share/zabbix/include/classes/api/CApiService.php", "line": 1201, "function": "exception", "class": "CApiService", "type": "::" }, { "file": "/usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php", "line": 1182, "function": "checkPartialValidator", "class": "CApiService", "type": "->" }, { "file": "/usr/share/zabbix/include/classes/api/services/CTrigger.php", "line": 568, "function": "validateUpdate", "class": "CTriggerGeneral", "type": "->" }, { "file": "/usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php", "line": 131, "function": "update", "class": "CTrigger", "type": "->" }, { "file": "/usr/share/zabbix/include/classes/core/CJsonRpc.php", "line": 104, "function": "callMethod", "class": "CLocalApiClient", "type": "->" }, { "file": "/usr/share/zabbix/api_jsonrpc.php", "line": 63, "function": "execute", "class": "CJsonRpc", "type": "->" } ] }, "id": 1 }