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.

ParameterTypeDescription
discoveryidsarrayIDs of the LLD rules to be copied.
hostidsarrayIDs 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:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "discoveryrule.copy",
  4. "params": {
  5. "discoveryids": [
  6. "27426"
  7. ],
  8. "hostids": [
  9. "10196",
  10. "10197"
  11. ]
  12. },
  13. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  14. "id": 1
  15. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": true,
  4. "id": 1
  5. }

Source

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