object discoveryrule.copy(object parameters)
This method allows to copy LLD rules with all of the prototypes to the given hosts.该方法允许将LLD规则与所有原型复制到给定的主机
(object)
Parameters defining the LLD rules to copy and the target hosts.定义要复制的LLD规则和目标主机的参数。
属性 类 | 说明 | |
---|---|---|
discoveryids | array | IDs of the LLD rules to be copied. 要复制的LLD规则的ID。 |
hostids | array | IDs of the hosts to copy the LLD rules to.要将LLD规则复制到的主机的ID。 |
(boolean)
Returns true
if the copying was successful.(boolean)
如果复制成功,则返回true
。
Copy an LLD rule to two hosts.
Request:
{
"jsonrpc": "2.0",
"method": "discoveryrule.copy",
"params": {
"discoveryids": [
"27426"
],
"hostids": [
"10196",
"10197"
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CDiscoveryrule::copy() in frontends/php/include/classes/api/services/CDiscoveryRule.php.