drule.update

Description

object drule.update(object/array discoveryRules)

This method allows to update existing discovery rules.

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) Discovery rule properties to be updated.

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

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

Parameter Type Description
dchecks array Discovery checks to replace existing checks.

Return values

(object) Returns an object containing the IDs of the updated discovery rules under the druleids property.

Examples

Change the IP range of a discovery rule

Change the IP range of a discovery rule to "192.168.2.1-255".

Request:

{
           "jsonrpc": "2.0",
           "method": "drule.update",
           "params": {
               "druleid": "6",
               "iprange": "192.168.2.1-255"
           },
           "id": 1
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "druleids": [
                   "6"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

See also

Source

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

To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.