Regular Expressions


Data Structures

RegExpModel

Attribute

Type

Required

Description

id

string

Read-only, unique regular expression identifier.

name

string

yes

Unique, case-insensitive regular expression name.

type

string {ml, regexp}

yes

Immutable. Policy type.

regexp

string

yes

Regular expression content.

created_at

datetime

Read-only. Timestamp of creation.

modified_at

datetime

Read-only. Timestamp of modification.

removed

boolean

Read-only.

Retrieve Available Attributes of the RegExpModel

Request

Method

GET

Path

/api/v2/objspec/regexp

To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.


Get Regular Expressions List

Request

Method

GET

Path

/api/v2/regexp

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

GET

Path

/api/v2/regexp/<id>

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

POST

Path

/api/v2/regexp

Headers

Content-Type: Application/json

Body

RegExpModel

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

PATCH

Path

/api/v2/regexp/<id>

Headers

Content-Type: Application/json

Body

RegExpModel

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

DELETE

Path

/api/v2/regexp/<id>

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"
}