manual:api:reference:regularexpression:get

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:get [2021/09/14 11:01]
robertsl removed
— (current)
Line 1: Line 1:
-===== regexp.get ===== 
  
-==== Description ==== 
- 
-''​integer/​array regexp.get(object **parameters**)''​ 
- 
-The method allows to retrieve global regular expressions according to the given parameters. 
- 
-<​note>​This method is available only to //Super Admin//. 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)''​ Parameters defining the desired output. 
- 
-The method supports the following parameters. 
- 
-^ Parameter ^ [[:​manual/​api/​reference_commentary#​data_types|Type]] ^ Description ^ 
-| regexpids | string/​array | Return only regular expressions with the given IDs. | 
-^ ||| 
-| selectExpressions | query | Return a ''​[[:​manual/​api/​reference/​regularexpression/​object#​expressions_object|expressions]]''​ property. | 
-^ ||| 
-| sortfield | string/​array | Sort the result by the given properties. \\ \\ Possible values are: ''​regexpid''​ and ''​name''​. ​ | 
-| countOutput |boolean|These parameters being common for all ''​get''​ methods are described in detail in the [[manual:​api:​reference_commentary#​common_get_method_parameters|reference commentary]]. ​ | 
-| editable |boolean|:::​| 
-| excludeSearch |boolean|:::​| 
-| filter | object |:::| 
-| limit |integer|:::​| 
-| output |query|:::| 
-| preservekeys |boolean|:::​| 
-| search | object |:::| 
-| searchByAny |boolean|:::​| 
-| searchWildcardsEnabled |boolean|:::​| 
-| sortorder | string/​array | ::: | 
-| startSearch |boolean|:::​| 
-==== Return values ==== 
- 
-''​(integer/​array)''​ Returns either: 
-  * an array of objects; 
-  * the count of retrieved objects, if the ''​countOutput''​ parameter has been used. 
- 
-==== Examples ==== 
- 
-=== Retrieving global regular expressions. === 
- 
-Request: 
-<code java> 
-{ 
- "​jsonrpc":​ "​2.0",​ 
- "​method":​ "​regexp.get",​ 
- "​params":​ { 
- "​output":​ ["​regexpid",​ "​name"​],​ 
- "​selectExpressions":​ ["​expression",​ "​expression_type"​],​ 
- "​regexpids":​ [1, 2], 
- "​preservekeys":​ true 
- }, 
- "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​ 
- "​id":​ 1 
-} 
-</​code>​ 
- 
-Response: 
-<code java> 
-{ 
-  "​jsonrpc":​ "​2.0",​ 
-  "​result":​ { 
-    "​1":​ { 
-      "​regexpid":​ "​1",​ 
-      "​name":​ "File systems for discovery",​ 
-      "​expressions":​ [ 
-        { 
-          "​expression":​ "​^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$",​ 
-          "​expression_type":​ "​3"​ 
-        } 
-      ] 
-    }, 
-    "​2":​ { 
-      "​regexpid":​ "​2",​ 
-      "​name":​ "​Network interfaces for discovery",​ 
-      "​expressions":​ [ 
-        { 
-          "​expression":​ "​^Software Loopback Interface",​ 
-          "​expression_type":​ "​4"​ 
-        }, 
-        { 
-          "​expression":​ "​^(In)?​[Ll]oop[Bb]ack[0-9._]*$",​ 
-          "​expression_type":​ "​4"​ 
-        }, 
-        { 
-          "​expression":​ "​^NULL[0-9.]*$",​ 
-          "​expression_type":​ "​4"​ 
-        }, 
-        { 
-          "​expression":​ "​^[Ll]o[0-9.]*$",​ 
-          "​expression_type":​ "​4"​ 
-        }, 
-        { 
-          "​expression":​ "​^[Ss]ystem$",​ 
-          "​expression_type":​ "​4"​ 
-        }, 
-        { 
-          "​expression":​ "​^Nu[0-9.]*$",​ 
-          "​expression_type":​ "​4"​ 
-        } 
-      ] 
-    } 
-  }, 
-  "​id":​ 1 
-} 
-</​code>​ 
- 
-==== Source ==== 
- 
-CRegexp::​get() in //​ui/​include/​classes/​api/​services/​CRegexp.php//​.