Skip to content

Modify a Single Data Access Rule



POST /api/v1/data_query_rule/{query_rule_uuid}/modify

Overview

Modify a single data access rule

Route Parameters

Parameter Name Type Required Description
query_rule_uuid string Y Rule UUID

Body Request Parameters

Parameter Name Type Required Description
name string Y Name
Allow empty: False
Allow empty string: False
Maximum length: 64
desc string N Description
Example: Description1
Allow empty: False
Allow empty string: True
Maximum length: 256
indexes array N Log type, this field is required, index UUIDs, [""] indicates all
Example: ['
']
Allow empty: False
sources array N Resource UUIDs, ["*"] indicates all
Example: ['appid_96357a78f84041d28b5d7aaa6201a424']
Allow empty: False
roleUUIDs array Y List of role UUIDs
Example: []
Allow empty: False
conditions string N Filtering condition for the actual data range used, e.g., "device IN ['PC'] and session_has_replay IN ['1']"
Allow empty: False
Allow empty string: True
extend json Y Custom fields
Example: xxx
Allow empty: False
logic string N Logical operator
Example: or
Allow empty: False
maskFields string N Sensitive fields, multiple fields separated by commas
Example: message,host
Allow empty: False
Allow empty string: True
reExprs array N Regular expressions
Example: [{'name': 'AA', 'reExpr': 'ss', 'enable': 0}, {'name': 'BB', 'reExpr': '.*', 'enable': 1}]
Allow empty: False

Additional Parameter Notes

1. Explanation of Request Parameters

Parameter Name Type Required Description
name string Y Name
desc string N Description
indexes array Y Required when type is logging; if it's an index from another workspace (authorization must be obtained), use WorkspaceUUID:IndexUUID, e.g., ["wksp_111:lgim_222", "wksp_333:lgim_444"]
sources array Y Required when type is not logging; when type is rum, it's a list of app IDs; when type is tracing, it's a list of service names; when type is metric, it's a list of measurement sets
roleUUIDs array Y List of role UUIDs
conditions string N Actual filtering condition used for the data range, e.g., "device IN ['PC'] and session_has_replay IN ['1']"
extend dict Y Extended fields, storing structured content of conditions for frontend display, e.g.,
logic string N Logical operator, and/or, used to connect filtering conditions
maskFields string N Sensitive fields, multiple fields separated by commas
reExprs array N Regular expressions, e.g., [{"name":"1111","enable":true,"reExpr":"tkn_[\da-z]*"},{"name":"liuyltest","enable":true,"reExpr":"test"}]

Request Example

curl 'https://openapi.guance.com/api/v1/data_query_rule/lqrl_xxx/modify' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw $'{"name":"rum test","desc":"","roleUUIDs":["role_a1e8215c25474f0bb3809f2d56749ed9","role_aa49795a5a5a4753a2a6350ab57f9497"],"indexes":[],"sources":["a2727170_7b1a_11ef_9de6_855cb2bccffb"],"extend":{"env":["front"],"province":["jiangsu"]},"maskFields":"source","logic":"and","conditions":"`env` IN [\'front\'] and `province` IN [\'jiangsu\']","reExprs":[{"name":"liuyl","reExpr":".*","enable":true}]}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "conditions": "`env` IN ['front'] and `province` IN ['jiangsu']",
        "createAt": 1730532068,
        "creator": "wsak_cd83804176e24ac18a8a683260ab0746",
        "declaration": {
            "asd": "aa,bb,cc,1,True",
            "asdasd": "dawdawd",
            "business": "aaa",
            "dd": "dd",
            "fawf": "afawf",
            "organization": "64fe7b4062f74d0007b46676"
        },
        "deleteAt": -1,
        "desc": "",
        "extend": {
            "env": [
                "front"
            ],
            "province": [
                "jiangsu"
            ]
        },
        "id": 351,
        "indexes": [],
        "logic": "and",
        "maskFields": "source",
        "name": "rum test",
        "reExprs": [
            {
                "enable": true,
                "name": "liuyl",
                "reExpr": ".*"
            }
        ],
        "roleUUIDs": [
            "role_a1e8215c25474f0bb3809f2d56749ed9",
            "role_aa49795a5a5a4753a2a6350ab57f9497"
        ],
        "sources": [
            "a2727170_7b1a_11ef_9de6_855cb2bccffb"
        ],
        "status": 0,
        "type": "rum",
        "updateAt": 1730532375.5740402,
        "updator": "wsak_cd83804176e24ac18a8a683260ab0746",
        "uuid": "lqrl_dfe6330883ef4311afae5d380e2294a1",
        "workspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-289325B8-AA1E-4AE3-BDB8-D1BE195FB8A8"
} 

Feedback

Is this page helpful? ×