Skip to content

Add



POST /api/v1/wksp_share/add

Overview

Body Request Parameters

Parameter Name Type Required Description
workspaceUUID commaArray Y Authorized workspace ID
Allow empty: False
type array Y Data type, ["*"] means all
Example: ['metric', 'keyevent', 'network', 'rum', 'dialtest', 'billing', 'logging', 'tracing', 'object', 'custom_object', 'profiling', 'llm']
Allow empty: True
indexes array Y Index name, [""] means all
Example: ['
']
Allow empty: False
regionCode string Authorized workspace site Code, default current site
Allow empty: False
Allow empty string: True
conditions json Filter conditions
Allow empty: False
conditions.metric array Filter conditions for metric type
Allow empty: False

Parameter Supplementary Explanation

1. Request Parameter Description

Parameter Name Description
regionCode Authorized site code (can be obtained through workspace/website/list interface), site information for data access configuration, defaults to authorizing data from the current site
workspaceUUID Authorized workspace uuid
type Authorization type, ["*"] means all, optional types: ["metric","keyevent","network","rum","dialtest","billing","logging","tracing","object","custom_object","profiling","llm"]
indexes Authorized log index name
conditions Filter conditions for authorization scope

2.conditions Field Description

Parameter Name type Required Description
metric array N Metric type filter conditions

3. conditions.metric Parameter Description

key Type Required Description
metric[#] dict metric list element
metric[#].op string Logical operator between field name and field value in,not in
metric[#].name string Field name
metric[#].logic string Logical relation operator for multiple filter conditions or,and, must be the same across multiple conditions
metric[#].value array Field value

**4. conditions Example { "metric": [ { "name": "host", "value": [ "host1", "host2" ], "op": "in", "logic": "and" }, { "name": "service", "value": [ "truewatch" ], "op": "not in", "logic": "and" } ] }


Request Example

curl 'https://openapi.truewatch.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

Response

{
    "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"
}