Zabbix Documentation 5.0

3.04.05.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.24.4Guidelines

User Tools

Site Tools


manual:api:reference:discoveryrule:copy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
manual:api:reference:discoveryrule:copy [2019/01/28 14:51]
sasha <code js> => <code java>
manual:api:reference:discoveryrule:copy [2019/10/07 06:35]
127.0.0.1 external edit
Line 1: Line 1:
 +===== discoveryrule.copy =====
  
 +==== Description ====
 +
 +''​object discoveryrule.copy(object **parameters**)''​
 +
 +This method allows to copy LLD rules with all of the prototypes to the given hosts.
 +
 +==== Parameters ====
 +
 +''​(object)''​ Parameters defining the LLD rules to copy and the target hosts.
 +
 +^ Parameter ^ Type ^ Description ^
 +| discoveryids | array | IDs of the LLD rules to be copied. |
 +| hostids | array | IDs of the hosts to copy the LLD rules to. |
 +
 +==== Return values ====
 +
 +''​(boolean)''​ Returns ''​true''​ if the copying was successful.
 +
 +==== Examples ====
 +
 +=== Copy an LLD rule to multiple hosts ===
 +
 +Copy an LLD rule to two hosts.
 +
 +Request:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​method":​ "​discoveryrule.copy",​
 +    "​params":​ {
 +        "​discoveryids":​ [
 +            "​27426"​
 +        ],
 +        "​hostids":​ [
 +            "​10196",​
 +            "​10197"​
 +        ]
 +    },
 +    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +Response:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​result":​ true,
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +==== Source ====
 +
 +CDiscoveryrule::​copy() in //​frontends/​php/​include/​classes/​api/​services/​CDiscoveryRule.php//​.