-
Type:
Problem report
-
Resolution: Won't fix
-
Priority:
Trivial
-
None
-
Affects Version/s: 6.0.35rc1, 7.0.5rc1, 7.2.0alpha1
-
Component/s: API (A)
-
None
Triggerprototype.get API request has two optional parameters: hostids and templateids. The documentation says that both parameters return trigger prototypes that belong only to hosts/templates. In practice, I can get template triggers using the template ID while specifying the hostids key, and vice versa (host ID using the templateids key).
Steps to reproduce:
- Create new host with LLD and trigger prototype,
- Send triggerprototype.get request using just created Host ID and templateids key:
{
"jsonrpc": "2.0",
"method": "triggerprototype.get",
"params": {
"output": "extend",
"selectFunctions": "extend",
"templateids": [10636] // host ID
},
"id": 1
}
Result:
You will get just created host trigger prototype:
{
"jsonrpc": "2.0",
"result": [
{
"triggerid": "23798",
"expression": "{33950}<>0",
"description": "trigger prototype {#ID}",
"url": "",
"status": "0",
"value": "0",
"priority": "0",
"lastchange": "0",
"comments": "",
"error": "",
"templateid": "0",
"type": "0",
"state": "0",
"flags": "2",
"recovery_mode": "0",
"recovery_expression": "",
"correlation_mode": "0",
"correlation_tag": "",
"manual_close": "1",
"opdata": "",
"discover": "0",
"event_name": "",
"uuid": "",
"url_name": "",
"functions": [
{
"functionid": "33950",
"itemid": "47584",
"triggerid": "23798",
"parameter": "$",
"function": "last"
}
]
}
],
"id": 1
}
Expected:
Empty response:
{
"jsonrpc": "2.0",
"result": [],
"id": 1
}
Documentation link - triggerprototype.get