object regexp.create(object/array regularExpressions)
This method allows to create new 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.
(object/array)
Regular expressions to create.
Additionally to the standard properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
expressions | array | Expressions options. Parameter behavior: - required |
(object)
Returns an object containing the IDs of the created regular expressions under the regexpids
property.
{
"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"
}
]
},
"id": 1
}
Response:
CRegexp::create() in ui/include/classes/api/services/CRegexp.php.