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.

ParameterTypeDescription
expressionsarrayExpressions 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:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "regexp.update",
  4. "params": {
  5. "regexpid": "1",
  6. "name": "File systems for discovery",
  7. "test_string": "",
  8. "expressions": [
  9. {
  10. "expression": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|zfs)$",
  11. "expression_type": "3",
  12. "exp_delimiter": ",",
  13. "case_sensitive": "0"
  14. },
  15. {
  16. "expression": "^(ntfs|fat32|fat16)$",
  17. "expression_type": "3",
  18. "exp_delimiter": ",",
  19. "case_sensitive": "0"
  20. }
  21. ]
  22. },
  23. "auth": "700ca65537074ec963db7efabda78259",
  24. "id": 1
  25. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "regexpids": [
  5. "1"
  6. ]
  7. },
  8. "id": 1
  9. }

Source

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