Skip to content

Create



POST /api/v1/data_mask_rule/add

Overview

Body Request Parameters

Parameter Name Type Required Description
name string Y Rule name
Allow null: False
Maximum length: 128
Allow empty string: False
type string Y Data type
Example: logging
Allow null: True
Possible values: ['logging', 'metric', 'object', 'custom_object', 'keyevent', 'tracing', 'rum', 'security', 'network', 'profiling', 'billing']
field string Y Field name
Allow null: False
Maximum length: 128
Allow empty string: False
reExpr string Y Regular expression
Allow null: False
Maximum length: 5000
Allow empty string: False
roleUUIDs array Y Which roles in the workspace this rule applies to for data masking
Example: ['xxx', 'xxx']
Allow null: False

Additional Parameter Notes

Request Example

curl 'https://openapi.guance.com/api/v1/data_mask_rule/add' \
-H 'Content-Type: application/json' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name":"lwcTest","type":"logging","reExpr":"\\b(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})\\b","roleUUIDs":["readOnly"],"field":"message"}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "workspaceUUID": "wksp_xxxx",
        "name": "lwcTest",
        "type": "logging",
        "field": "message",
        "reExpr": "\\b(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})\\b",
        "roleUUIDs": [
            "readOnly"
        ],
        "id": 153,
        "uuid": "wdmk_xxx",
        "status": 0,
        "creator": "acnt_xxxx",
        "updator": "acnt_xxxx",
        "createAt": 1718107343,
        "deleteAt": -1,
        "updateAt": 1718107343
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-953C271A-768B-4123-9B7C-D13B621C552B"
} 

Feedback

Is this page helpful? ×