This is a translation of the original English documentation page. Help us make it better.

discoveryrule.copy

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ルールを複数のホストにコピーします

LLDルールを2つのホストにコピー

Request:

{
           "jsonrpc": "2.0",
           "method": "discoveryrule.copy",
           "params": {
               "discoveryids": [
                   "27426"
               ],
               "hostids": [
                   "10196",
                   "10197"
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": true,
           "id": 1
       }

ソース

CDiscoveryRule::copy() in ui/include/classes/api/services/CDiscoveryRule.php.