object discoveryrule.update(object/array lldRules)
This method allows to update existing LLD rules.
(object/array)
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.
Additionally to the standard LLD rule properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
filter | object | LLD rule filter object to replace the current filter. |
(object)
Returns an object containing the IDs of the updated LLD rules under the itemids
property.
Add a filter so that the contents of the {#FSTYPE} macro would match the @File systems for discovery regexp.
Request:
{
"jsonrpc": "2.0",
"method": "discoveryrule.update",
"params": {
"itemid": "22450",
"filter": {
"evaltype": 1,
"conditions": [
{
"macro": "{#FSTYPE}",
"value": "@File systems for discovery"
}
]
}
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CDiscoveryRule::update() in frontends/php/include/classes/api/services/CDiscoveryRule.php.