Zabbix Documentation 2.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:appendix:api:discoveryrule:update

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
manual:appendix:api:discoveryrule:update [2014/09/30 12:54]
manual:appendix:api:discoveryrule:update [2019/01/28 14:49] (current)
sasha <code js> => <code java>
Line 1: Line 1:
 +===== discoveryrule.update =====
  
 +==== Description ====
 +
 +''​object discoveryrule.update(object/​array **lldRules**)''​
 +
 +This method allows to update existing LLD rules.
 +
 +==== Parameters ====
 +
 +''​(object/​array)''​ [[definitions#​lld_rule|LLD rule properties]] to be updated.
 +
 +The ''​itemid''​ property must be defined for each LLD rule, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.
 +==== Return values ====
 +
 +''​(object)''​ Returns an object containing the IDs of the updated LLD rules under the ''​itemids''​ property.
 +
 +==== Examples ====
 +
 +=== Adding a filter to an LLD rule ===
 +
 +Add a filter so that the contents of the //​{#​FSTYPE}//​ macro would match the //@File systems for discovery// regexp.
 +
 +Request:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​method":​ "​discoveryrule.update",​
 +    "​params":​ {
 +        "​itemid":​ "​22450",​
 +        "​filter":​ "​{#​FSTYPE}:​@File systems for discovery"​
 +    },
 +    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +Response:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​result":​ {
 +        "​itemids":​ [
 +            "​22450"​
 +        ]
 +    },
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +==== Source ====
 +
 +CDiscoveryRule::​update() in //​frontends/​php/​api/​classes/​CDiscoveryRule.php//​.