manual:api:reference:regularexpression:create

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:create [2021/09/14 11:02]
robertsl removed
— (current)
Line 1: Line 1:
-===== regexp.create ===== 
  
-==== Description ==== 
- 
-''​object regexp.create(object/​array **regularExpressions**)''​ 
- 
-This method allows to create new 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 expressions to create. 
- 
-Additionally to the [[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 created regular expressions under the ''​regexpids''​ property. 
- 
-==== Examples ==== 
- 
-=== Creating a new global regular expression. === 
- 
-Request: 
-<code java> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​method":​ "​regexp.create",​ 
-    "​params":​ { 
-      "​name":​ "​Storage devices for SNMP discovery",​ 
-      "​test_string":​ "/​boot",​ 
-      "​expressions":​ [ 
-        { 
-          "​expression":​ "​^(Physical memory|Virtual memory|Memory buffers|Cached memory|Swap space)$",​ 
-          "​expression_type":​ "​4",​ 
-          "​case_sensitive":​ "​1"​ 
-        } 
-      ] 
-    }, 
-    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​ 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-Response: 
-<code java> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​result":​ { 
-        "​regexpids":​ [ 
-            "​16"​ 
-        ] 
-    }, 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-==== Source ==== 
- 
-CRegexp::​create() in //​ui/​include/​classes/​api/​services/​CRegexp.php//​.