[comment]: # ({b227b327-2462f4f8})
# discoveryruleprototype.update

[comment]: # ({/b227b327-2462f4f8})

[comment]: # ({4638797b-98154a0c})
### Description

`object discoveryruleprototype.update(object/array lldRules)`

This method allows to update existing LLD rule prototypes. 

Note that the updating of already discovered prototypes is limited.

::: noteclassic
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](/manual/web_interface/frontend_sections/users/user_roles)
for more information.
:::

[comment]: # ({/4638797b-98154a0c})

[comment]: # ({82c679cd-d614a120})
### 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](object#lld-rule-prototype), the
method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|filter|object|[LLD rule prototype filter](/manual/api/reference/discoveryruleprototype/object#lld-rule-prototype-filter) to replace the existing filter.|
|preprocessing|object/array|[LLD rule prototype preprocessing](/manual/api/reference/discoveryruleprototype/object#lld-rule-prototype-preprocessing) options to replace the existing preprocessing options.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *read-only* for inherited objects|
|lld\_macro\_paths|object/array|LLD rule prototype [lld\_macro\_path](/manual/api/reference/discoveryruleprototype/object#lld-macro-path) options to replace the existing lld\_macro\_path options.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *read-only* for inherited objects|
|overrides|object/array|[LLD rule prototype overrides](/manual/api/reference/discoveryruleprototype/object#lld-rule-prototype-overrides) options to replace the existing overrides options.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *read-only* for inherited objects|

[comment]: # ({/82c679cd-d614a120})

[comment]: # ({64c78d26-5eea7c23})
### Return values

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

[comment]: # ({/64c78d26-5eea7c23})

[comment]: # ({b41637d2-2373188b})
### Examples

[comment]: # ({/b41637d2-2373188b})

[comment]: # ({f552d438-8909b822})
#### Updating LLD rule prototype preprocessing options

Update an LLD rule prototype with a JSONPath preprocessing rule.
[Request](/manual/api#performing-requests):

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

Response:

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

[comment]: # ({/f552d438-8909b822})

[comment]: # ({57022646-ebead5e6})
### Source

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

[comment]: # ({/57022646-ebead5e6})
