Zabbix Documentation 4.0

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

zh:manual:api:reference:trigger:adddependencies

添加依赖

Description 说明

object trigger.adddependencies(object/array triggerDependencies)

This method allows to create new trigger dependencies. 此方法允许创建新的触发器依赖关系。

Parameters 参数

(object/array) Trigger dependencies to create. (object/array)需要创建的触发器依赖。 Each trigger dependency has the following parameters: 每一个触发器依赖具有以下参数:

Parameter 参数 Type 类型 Description 说明
triggerid
(required 必须)
string 字符串 ID of the dependent trigger. 依赖触发器的ID。
dependsOnTriggerid
(required 必须)
string 字符串 ID of the trigger that the trigger depends on. 依赖触发的触发器ID。

Return values 返回值

(object) Returns an object containing the IDs of the dependent triggers under the triggerids property. (object)返回一个对象,该对象包含在triggerids属性中依赖触发器的ID。

Examples 范例

Add a trigger dependency 添加触发器依赖

Make trigger “14092” dependent on trigger “13565.” 触发器“14092”依赖于触发器“13565”。

Request 请求:

{
    "jsonrpc": "2.0",
    "method": "trigger.adddependencies",
    "params": {
        "triggerid": "14092",
        "dependsOnTriggerid": "13565"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}

Response 响应:

{
    "jsonrpc": "2.0",
    "result": {
        "triggerids": [
            "14092"
        ]
    },
    "id": 1
}

See also 参考

Source 源码

CTrigger::addDependencies() in frontends/php/include/classes/api/services/CTrigger.php. CTrigger::addDependencies()方法可在frontends/php/include/classes/api/services/CTrigger.php中参考。