manual:api:reference:regularexpression:update

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
manual:api:reference:regularexpression:update [2021/09/14 11:01]
robertsl removed
— (current)
Line 1: Line 1:
-===== regexp.update ===== 
  
-==== Description ==== 
- 
-''​object regexp.update(object/​array **regularExpressions**)''​ 
- 
-This method allows to update existing global regular expressions. 
- 
-<​note>​This method is only available to //Super admin// user types. Permissions to call the method can be revoked in user role settings. See [[:​manual/​web_interface/​frontend_sections/​administration/​user_roles|User roles]] for more information.</​note>​ 
- 
-==== 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 [[object#​expressions_object|standard properties]],​ the method accepts the following parameters. 
- 
-^ Parameter ​    ^ [[:​manual/​api/​reference_commentary#​data_types|Type]] ​ ^ Description ​                                                             ^ 
-| expressions | array | [[:​manual/​api/​reference/​regularexpression/​object#​expressions_object|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: 
-<code java> 
-{ 
-    "​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"​ 
-        } 
-      ] 
-    }, 
-    "​auth":​ "​700ca65537074ec963db7efabda78259",​ 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-Response: 
-<code java> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​result":​ { 
-        "​regexpids":​ [ 
-            "​1"​ 
-        ] 
-    }, 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-==== Source ==== 
- 
-CRegexp::​update() in //​ui/​include/​classes/​api/​services/​CRegexp.php//​.