跳转至

添加



POST /api/v1/wksp_share/add

概述

Body 请求参数

参数名 类型 必选 说明
workspaceUUID commaArray Y 被授权的空间 ID
允许为空: False
type array Y 数据类型, ["*"] 表示全部
例子: ['metric', 'keyevent', 'network', 'rum', 'dialtest', 'billing', 'logging', 'tracing', 'object', 'custom_object', 'profiling', 'llm']
允许为空: True
indexes array Y 索引名, [""]表示全部
例子: ['
']
允许为空: False
regionCode string 被授权的空间所属站点 Code, 默认当前站点
允许为空: False
允许为空字符串: True
conditions json 过滤条件
允许为空: False
conditions.metric array 指标类型的过滤条件
允许为空: False

参数补充说明

1. 请求参数说明

参数名 说明
regionCode 被授权站点 code (可通过 workspace/website/list 接口获取), 数据访问配置的站点信息, 默认授权当前站点的数据
workspaceUUID 被授权的空间 uuid
type 授权类型,["*"]表示全部,可选类型: ["metric","keyevent","network","rum","dialtest","billing","logging","tracing","object","custom_object","profiling","llm"]
indexes 被授权的日志索引名
conditions 授权范围的过滤条件

2.conditions 字段说明

参数名 type 必选 说明
metric array N 指标类型过滤条件

3. conditions.metric 参数说明

key 类型 是否必须 说明
metric[#] dict metric 列表元素
metric[#].op string 字段名与字段值的逻辑操作符 in,not in
metric[#].name string 字段名
metric[#].logic string 多组过滤条件的 逻辑关系符 or,and, 多组条件中 逻辑关系符须相同
metric[#].value array 字段值

**4. conditions 示例如下 { "metric": [ { "name": "host", "value": [ "host1", "host2" ], "op": "in", "logic": "and" }, { "name": "service", "value": [ "guance" ], "op": "not in", "logic": "and" } ] }


请求例子

curl 'https://openapi.guance.com/api/v1/wksp_share/add' \
-H 'Content-Type: application/json' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"regionCode":"testing","workspaceUUID":"wksp_a810008c0e4e4e70ad9222c01f083287","type":["*"],"indexes":["*"]}' \
--compressed

响应

{
    "code": 200,
    "content": {
        "authorizationCode": null,
        "createAt": 1757572382,
        "creator": "wsak_7e0689c908774efda1b345c20c5d23d7",
        "declaration": {
            "asd": "aa,bb,cc,1,True",
            "asdasd": "dawdawd",
            "business": "aaa",
            "dd": "dd",
            "fawf": "afawf",
            "organization": "64fe7b4062f74d0007b46676"
        },
        "delayDeleteAt": -1,
        "deleteAt": -1,
        "id": 468,
        "indexes": [
            "*"
        ],
        "name": "doris testing",
        "regionCode": "testing",
        "status": 0,
        "toRegionCode": "testing",
        "toWorkspaceName": "doris testing",
        "toWorkspaceUUID": "wksp_a810008c0e4e4e70ad9222c01f083287",
        "type": [
            "*"
        ],
        "updateAt": -1,
        "updator": "",
        "uuid": "grant_2ee1f355abf84a038f4aacb9319fd747",
        "workspaceName": "testing workspace",
        "workspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-AF6A234D-7804-4A1C-BC38-7861088BA6B5"
} 

文档评价

文档内容是否对您有帮助? ×