新建单个数据访问规则¶
POST /api/v1/logging_query_rule/add
概述¶
新建单个数据访问规则
Body 请求参数¶
参数名 | 类型 | 必选 | 说明 |
---|---|---|---|
indexes | array | Y | 索引名称 例子: [] 允许为空: False |
roleUUIDs | array | Y | 角色的列表 例子: [] 允许为空: False |
conditions | string | Y | 筛选搜索 例子: search 允许为空: False |
extend | json | 前端自定义扩展字段 例子: xxx 允许为空: False |
|
logic | string | Y | 逻辑字段 例子: or 允许为空: False |
参数补充说明¶
数据说明.*
- 角色授权访问说明
- 指定角色只能查询 指定查询范围内的数据
- 如果用户存在多个角色的情况下, 该用户有角色不在该规则角色中, 则该日志数据访问规则不会对该用户生效, 即不限制日志查询范围
-
一个空间中的多条日志数据访问规则之间的逻辑为 or 关系
-
请求参数说明
参数名 | type | 说明 |
---|---|---|
indexes | array | 索引名称列表 |
roleUUIDS | array | 角色UUID列表 |
conditions | string | dql删选格式条件 |
extend | dict | N |
logic | string | N |
请求例子¶
curl 'https://openapi.guance.com/api/v1/logging_query_rule/add' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw $'{"roleUUIDs":["role_44dbdc6ad4b848f0a570072c10d9e29a"],"indexes":["rp60"],"extend":{"container_id":["eefdb964e3eb5e822f12e5663449bebb37738daed0841c6c9cec44f11d073f05"]},"logic":"and","conditions":"`container_id` IN [\'eefdb964e3eb5e822f12e5663449bebb37738daed0841c6c9cec44f11d073f05\']"}' \
--compressed