You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

discoveryruleprototype.update

Description

object discoveryruleprototype.update(object/array lldRules)

This method allows to update existing LLD rule prototypes.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) LLD rule prototype properties to be updated.

The itemid property must be defined for each LLD rule prototype, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard LLD rule prototype properties, the method accepts the following parameters.

Parameter Type Description
filter object LLD rule prototype filter to replace the existing filter.
preprocessing object/array LLD rule prototype preprocessing options to replace the existing preprocessing options.

Parameter behavior:
- read-only for inherited objects
lld_macro_paths object/array LLD rule prototype lld_macro_path options to replace the existing lld_macro_path options.

Parameter behavior:
- read-only for inherited objects
overrides object/array LLD rule prototype overrides options to replace the existing overrides options.

Parameter behavior:
- read-only for inherited objects

Return values

(object) Returns an object containing the IDs of the updated LLD rule prototypes under the itemids property.

Examples

Updating LLD rule prototype preprocessing options

Update an LLD rule prototype with a JSONPath preprocessing rule. Request:

{
           "jsonrpc": "2.0",
           "method": "discoveryruleprototype.update",
           "params": {
               "itemid": "47253",
               "preprocessing": [
                   {
                       "type": 12,
                       "params": "$.tablespaces",
                       "error_handler": 1
                   }
               ]
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "47253"
               ]
           },
           "id": 1
       }

Source

CDiscoveryRulePrototype::update() in ui/include/classes/api/services/CDiscoveryRulePrototype.php.