Regular Expressions¶
Data Structures¶
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Read-only, unique regular expression identifier. |
|
|
string |
yes |
Unique, case-insensitive regular expression name. |
|
string {ml, regexp} |
yes |
Immutable. Policy type. |
|
string |
yes |
Regular expression content. |
|
datetime |
Read-only. Timestamp of creation. |
|
|
datetime |
Read-only. Timestamp of modification. |
|
|
boolean |
Read-only. |
Retrieve Available Attributes of the RegExpModel¶
Request
Method |
|
Path |
|
To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.
Get Regular Expressions List¶
Request
Method |
|
Path |
|
Example Request
GET /api/v2/regexp
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/regexp'
Response
{
"result": "success",
"regexp": [
{
"id": "9124292845052624897",
"name": "Reg_ex_1",
"regexp": "(^|[^a-zA-Z])rm[[:space:]]",
"created_at": "2024-06-14 05:46:25.34634-07",
"modified_at": "2024-06-14 05:46:25.34634-07"
}
]
}
Get Regular Expression by ID¶
Request
Method |
|
Path |
|
Example Request
GET /api/v2/regexp/<id>
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/regexp/9124292845052624897'
Response
{
"result": "success",
"regexp": {
"id": "9124292845052624897",
"name": "Reg_ex_1",
"regexp": "(^|[^a-zA-Z])rm[[:space:]]",
"created_at": "2024-06-14 05:46:25.34634-07",
"modified_at": "2024-06-14 05:46:25.34634-07"
}
}
Defining Regular Expression¶
Request
Method |
|
Path |
|
Headers |
|
Body |
|
Example Request
POST /api/v2/regexp
curl -s -k -X POST \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.0.214.98/api/v2/regexp' \
-d'{"name":"Reg_ex_2","regexp":"(^|[^a-zA-Z])rm[[:space:]]"}'
Response
{
"result": "success",
"regexp": {
"id": "9124292845052624900"
}
}
Modify Regular Expression¶
Request
Method |
|
Path |
|
Headers |
|
Body |
|
Example Request
PATCH /api/v2/regexp/<id>
curl -s -k -X PATCH \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.0.214.98/api/v2/regexp/9124292845052624897' \
-d'{"regexp":"(^|[^a-zA-Z])rm[[:space:]]"}''
Response
{
"result": "success"
}
Deleting Regular Expression¶
Request
Method |
|
Path |
|
Example Request
DELETE /api/v2/regexp/<id>
curl -s -k -X DELETE \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/regexp/9124292845052624897'
Response
{
"result": "success"
}