Zabbix Documentation 5.0

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:api:reference: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
Next revision
Previous revision
manual:api:reference:discoveryrule:update [2019/01/07 11:13]
iivs added example fro LLD macro path update (ZBXNEXT-4877)
manual:api:reference:discoveryrule:update [2020/05/20 12:38] (current)
iivs added ZBXNEXT-3035 changes
Line 16: Line 16:
  
 ^ Parameter ^ Type ^ Description ^ ^ Parameter ^ Type ^ Description ^
-| filter | object | LLD rule filter object to replace the current filter. |+| filter | object | LLD rule [[:​manual/​api/​reference/​discoveryrule/​object#​lld_rule_filter|filter]] object to replace the current filter. ​
 +| preprocessing | array | LLD rule [[:​manual/​api/​reference/​discoveryrule/​object#​lld_rule_preprocessing|preprocessing]] options to replace the current preprocessing options. | 
 +| lld_macro_paths | array | LLD rule [[:​manual/​api/​reference/​discoveryrule/​object#​lld_macro_path|lld_macro_path]] options. ​ | 
 +| overrides | array | LLD rule [[:​manual/​api/​reference/​discoveryrule/​object#​lld_rule_overrides|overrides]] options.  ​|
  
 ==== Return values ==== ==== Return values ====
Line 27: Line 30:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 49: Line 52:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 64: Line 67:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 83: Line 86:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 101: Line 104:
 Request: Request:
  
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 116: Line 119:
 Response: Response:
  
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 127: Line 130:
 } }
 </​code>​ </​code>​
 +
 +=== Updating LLD rule preprocessing options ===
 +
 +Update an LLD rule with preprocessing rule “JSONPath”.
 +
 +Request:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​method":​ "​discoveryrule.update",​
 +    "​params":​ {
 +        "​itemid":​ "​44211",​
 +        "​preprocessing":​ [
 +            {
 +                "​type":​ "​12",​
 +                "​params":​ "​$.path.to.json",​
 +                "​error_handler":​ "​2",​
 +                "​error_handler_params":​ "​5"​
 +            }
 +        ]
 +    },
 +    "​auth":​ "​700ca65537074ec963db7efabda78259",​
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +Response:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​result":​ {
 +        "​itemids":​ [
 +            "​44211"​
 +        ]
 +    },
 +    "​id":​ 1
 +}
 +</​code>​
 +
 ==== Source ==== ==== Source ====
  
-CDiscoveryRule::​update() in //frontends/​php/​include/​classes/​api/​services/​CDiscoveryRule.php//​.+CDiscoveryRule::​update() in //ui/​include/​classes/​api/​services/​CDiscoveryRule.php//​.