This method is deprecated and will be removed in the future. Instead, you can configure LLD rules on templates and apply these templates to other templates or hosts, effectively copying the LLD rules to the specified targets.
object discoveryrule.copy(object parameters)
このメソッドで、すべてのプロトタイプを含むLLDルールを指定されたホストにコピーできます。
このメソッドはAdminおよびSuper adminユーザータイプでのみ使用できます。 メソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。 詳細についてはユーザーの役割を参照してください。
(object)
コピーするLLDルールとターゲットホストを定義するパラメーター。
パラメータ | タイプ | 説明 |
---|---|---|
discoveryids | array | コピーするLLDルールのID |
hostids | array | LLDルールをコピーするホストのID |
(boolean)
コピーが成功した場合はtrue
を返します。
LLDルールを2つのホストにコピー
Request:
{
"jsonrpc": "2.0",
"method": "discoveryrule.copy",
"params": {
"discoveryids": [
"27426"
],
"hostids": [
"10196",
"10197"
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CDiscoveryRule::copy() in ui/include/classes/api/services/CDiscoveryRule.php.