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.

regexp.update

Description

object regexp.update(object/array regularExpressions)

This method allows to update existing global regular expressions.

This method is only available to 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) Regular expression properties to be updated.

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

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

Parameter Type Description
expressions array Expressions options.

Return values

(object) Returns an object containing the IDs of the updated regular expressions under the regexpids property.

Examples

Updating global regular expression for file systems discovery.

Request:

{
           "jsonrpc": "2.0",
           "method": "regexp.update",
           "params": {
             "regexpid": "1",
             "name": "File systems for discovery",
             "test_string": "",
             "expressions": [
               {
                 "expression": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|zfs)$",
                 "expression_type": "3",
                 "exp_delimiter": ",",
                 "case_sensitive": "0"
               },
               {
                 "expression": "^(ntfs|fat32|fat16)$",
                 "expression_type": "3",
                 "exp_delimiter": ",",
                 "case_sensitive": "0"
               }
             ]
           },
           "id": 1
       }

Response:

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

Source

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