Modify a Single Data Access Rule¶
POST /api/v1/data_query_rule/{query_rule_uuid}/modify
Overview¶
Modify a single data access rule, v2 supports cross-site data access configuration.
Route Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
query_rule_uuid | string | Y | The UUID of the rule |
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Y | Name Allow empty: False Allow empty string: False Max length: 64 |
desc | string | Description Example: Description1 Allow empty: False Allow empty string: True Max length: 256 |
|
regionCode | string | Y | Site-based data access authorization Allow empty: False Allow empty string: False |
indexes | array | Log type, this field is required, index UUID, [""] means all Example: [''] Allow empty: False |
|
sources | array | Resource UUID, ["*"] means all Example: ['appid_96357a78f84041d28b5d7aaa6201a424'] Allow empty: False |
|
roleUUIDs | array | Y | List of roles Example: [] Allow empty: False |
conditions | string | Filter search Example: search Allow empty: False Allow empty string: True |
|
extend | json | Custom Example: xxx Allow empty: False |
|
logic | string | Logic field Example: or Allow empty: False |
|
maskFields | string | Masking fields, multiple fields separated by commas Example: message,host Allow empty: False Allow empty string: True |
|
reExprs | array | Regular expressions Example: [{'name': 'AA', 'reExpr': 'ss', 'enable': 0}, {'name': 'BB', 'reExpr': '.*', 'enable': 1}] Allow empty: False |
Parameter Additional Notes¶
1. Request Parameter Description
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Y | Name |
desc | String | N | Description |
indexes | array | Y | Required when type is logging, for non-workspace (must be workspace authorized) index authorization, use workspaceUUID:indexUUID, example: ["wksp_111:lgim_222", "wksp_333:lgim_444"] |
sources | array | Y | Required when type is non-logging, when type is RUM, it is appId list, when type is tracing, it is service name list, when type is metric, it is measurement list |
roleUUIDs | array | Y | List of role UUIDs |
conditions | string | N | Actual data range filter conditions, example: "device IN ['PC'] and session_has_replay IN ['1']" |
extend | dict | Y | Extended field, stores the structure content of conditions, used for front-end display, example: |
logic | string | N | Logic field, and/or, used to connect filter conditions |
maskFields | string | N | Masking fields, multiple fields separated by commas |
reExprs | array | N | Regular expressions, example: [{"name":"1111","enable":true,"reExpr":"tkn_[\da-z]*"},{"name":"liuyltest","enable":true,"reExpr":"test"}] |
regionCode | string | Y | Site code (can be obtained through workspace/website/list interface) |
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"
}