콘텐츠로 이동

조회 가능한 워크스페이스 목록



GET /api/v1/wksp_share/granted_ws_list

개요

현재 API Key가 속한 워크스페이스에서 조회할 수 있는 권한 부여 워크스페이스를 나열합니다.

Query 요청 매개변수

매개변수 이름 유형 필수 설명
namespace commaArray 권한이 부여된 데이터 유형별로 조회 가능한 워크스페이스를 필터링합니다. 여러 namespace는 쉼표로 구분합니다.
빈 값 허용: False
regionCode string 권한 부여자 사이트별로 필터링합니다. 반환된 그룹의 regionCode는 query_data의 query.targetRegion으로 사용할 수 있습니다.
빈 값 허용: False
filterWsUUIDs commaArray 권한 부여자 워크스페이스 UUID로 필터링합니다. 여러 UUID는 쉼표로 구분합니다.
빈 값 허용: False
search string 이름 검색
빈 값 허용: False
pageIndex integer 페이지 번호
빈 값 허용: False
예시: 10
$minValue: 1
pageSize integer 페이지당 반환 개수
빈 값 허용: False
예시: 10
$minValue: 1
$maxValue: 100

매개변수 추가 설명

이 API는 query_data에서 대상 워크스페이스 UUID와 query.targetRegion을 가져올 때 권장되는 인터페이스입니다.

  • content[j].regionCode는 해당 그룹 내 권한 부여 워크스페이스가 속한 사이트를 나타내며, query.targetRegion으로 직접 사용할 수 있습니다. 그룹 내 data[k].regionCode도 동일한 의미입니다.
  • content[j].data에서 workspaceUUID로 대상 워크스페이스를 찾은 후 같은 그룹의 regionCode를 사용하세요. toRegionCode를 대상 사이트로 사용하지 마세요. toRegionCode는 권한 부여 대상, 즉 현재 API Key가 속한 워크스페이스의 사이트를 나타냅니다.
  • namespace로 권한이 부여된 데이터 유형을 필터링할 수 있습니다. 예를 들어 로그를 조회할 때는 namespace=logging을 전달합니다.
  • 이 API는 각 regionCode 그룹별로 별도로 페이지네이션되며, pageInfo.count는 현재 페이지의 개수일 뿐입니다. 처음에는 regionCode를 전달하지 않고 대상 사이트를 확인한 뒤, 각 대상 사이트에 대해 regionCode를 명시적으로 전달하고 pageIndex=1부터 별도로 페이지를 넘기세요. 해당 사이트의 pageInfo.totalCount에 도달하거나 pageIndex * pageSize >= totalCount 조건을 충족하면 중지합니다. 권한 uuid와 (regionCode, workspaceUUID)를 기준으로 중복을 제거하는 것을 권장합니다.

구체적인 요청 구성 방법은 OpenAPI 사이트 간 데이터 조회를 참고하세요.

1. 응답 매개변수 설명:

매개변수 이름 매개변수 설명
regionCode 권한 부여 사이트
regionName 권한 부여 사이트 이름
workspaceName 권한 부여 워크스페이스 이름
workspaceUUID 권한 부여 워크스페이스 UUID
toRegionCode 권한 부여 대상 워크스페이스 사이트
toRegionName 권한 부여 대상 워크스페이스 사이트 이름
toWorkspaceName 권한 부여 대상 워크스페이스 이름
toWorkspaceUUID 권한 부여 대상 워크스페이스 UUID
type 워크스페이스 권한 유형입니다. network, object, dialtest, billing, logging, tracing, metric, rum, keyevent, custom_object, security, profiling이며 *는 전체 유형 권한을 의미합니다.
indexes 권한이 부여된 로그 인덱스 이름이며 *는 전체를 의미합니다.

참고: 반환되는 content는 권한 부여자 사이트별로 그룹화된 배열입니다. 각 요소의 data는 해당 사이트의 현재 페이지에서 조회 가능한 워크스페이스 정보입니다.

2. 예시 설명: 권한을 부여받은 쪽은 권한을 부여한 쪽이 승인한 데이터를 조회할 수 있습니다. 아래 예시에서 XX 워크스페이스는 YY 워크스페이스에 로그 testing 인덱스 조회 권한을 부여합니다. 즉, YY 워크스페이스는 XX 워크스페이스의 로그 testing 인덱스 데이터를 조회할 수 있습니다.

 {
          "createAt": 1749542060,
          "creator": "acnt_c956fd23a9c2427b96ee372c88ea9b60",
          "creatorInfo": {

          },
          "delayDeleteAt": -1,
          "deleteAt": -1,
          "id": 442,
          "indexes": [
              "testing"
          ],
          "regionCode": "daily",
          "regionName": "开发环境(daily)",
          "status": 0,
          "toRegionCode": "testing",
          "toRegionName": "测试环境(testing)",
          "toWorkspaceName": "YY",
          "toWorkspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d",
          "type": [
              "logging"
          ],
          "updateAt": -1,
          "updator": "",
          "updatorInfo": {

          },
          "uuid": "grant_02b04aec78c74f869151e3e8c3e54dae",
          "workspaceName": "XX",
          "workspaceUUID": "wksp_6e310e0c1cbd45b4a27a19bda0fd7582"
}

요청 예시

curl 'https://openapi.guance.com/api/v1/wksp_share/granted_ws_list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--compressed 

응답

{
    "code": 200,
    "content": [
        {
            "data": [
                {
                    "authorizationCode": "4248e561808c42868397a7a695a2d654",
                    "createAt": 1749542060,
                    "creator": "acnt_c956fd23a9c2427b96ee372c88ea9b60",
                    "delayDeleteAt": -1,
                    "deleteAt": -1,
                    "id": 442,
                    "indexes": [
                        "mysql",
                        "*"
                    ],
                    "regionCode": "daily",
                    "regionName": "Development Environment(daily)",
                    "status": 0,
                    "toRegionCode": "testing",
                    "toRegionName": "Test Environment(testing)",
                    "toWorkspaceName": "【Doris】for Developer",
                    "toWorkspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d",
                    "type": [
                        "logging"
                    ],
                    "updateAt": -1,
                    "updator": "",
                    "uuid": "grant_02b04aec78c74f869151e3e8c3e54dae",
                    "workspaceName": "daily for testing",
                    "workspaceUUID": "wksp_6e310e0c1cbd45b4a27a19bda0fd7582"
                },
                {
                    "authorizationCode": "52f146179ec54f4b920f28c800ae9b3e",
                    "createAt": 1749541984,
                    "creator": "acnt_c956fd23a9c2427b96ee372c88ea9b60",
                    "delayDeleteAt": -1,
                    "deleteAt": -1,
                    "id": 441,
                    "indexes": [
                        "*"
                    ],
                    "regionCode": "daily",
                    "regionName": "Development Environment(daily)",
                    "status": 0,
                    "toRegionCode": "testing",
                    "toRegionName": "Test Environment(testing)",
                    "toWorkspaceName": "【Doris】for Developer",
                    "toWorkspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d",
                    "type": [
                        "logging",
                        "billing",
                        "dialtest",
                        "tracing"
                    ],
                    "updateAt": -1,
                    "updator": "",
                    "uuid": "grant_5eab9ac478614c64a5ac5cdc9f363921",
                    "workspaceName": "Guance Cloud(Test Environment)Monitoring",
                    "workspaceUUID": "wksp_dbfb60524bf44dfea84a4e1d73484e41"
                }
            ],
            "declaration": {
                "asd": "aa,bb,cc,1,True",
                "asdasd": "dawdawd",
                "business": "aaa",
                "dd": "dd",
                "fawf": "afawf",
                "organization": "64fe7b4062f74d0007b46676"
            },
            "pageInfo": {
                "count": 2,
                "pageIndex": 1,
                "pageSize": 100,
                "totalCount": 2
            },
            "regionCode": "daily",
            "regionName": "Development Environment(daily)"
        },
        {
            "data": [
                {
                    "authorizationCode": "b081a0bec4c34bc899b05ee99b64ea04",
                    "createAt": 1748240284,
                    "creator": "acnt_06d1380440d54f2d845cb1dd3c896e45",
                    "delayDeleteAt": -1,
                    "deleteAt": -1,
                    "id": 434,
                    "indexes": [],
                    "regionCode": "testing",
                    "regionName": "Test Environment(testing)",
                    "status": 0,
                    "toRegionCode": "testing",
                    "toRegionName": "Test Environment(testing)",
                    "toWorkspaceName": "【Doris】for Developer",
                    "toWorkspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d",
                    "type": [
                        "custom_object"
                    ],
                    "updateAt": -1,
                    "updator": "",
                    "uuid": "grant_7419f57582664a2e8755ea63cab11491",
                    "workspaceName": "WayneTest Workspace",
                    "workspaceUUID": "wksp_dc1b82a836ba4f71a4c136c99f119a11"
                },
                {
                    "authorizationCode": null,
                    "createAt": 1747139040,
                    "creator": "acnt_154f255afd8644779c78d28411454772",
                    "delayDeleteAt": -1,
                    "deleteAt": -1,
                    "id": 426,
                    "indexes": [
                        "*"
                    ],
                    "regionCode": "testing",
                    "regionName": "Test Environment(testing)",
                    "status": 0,
                    "toRegionCode": "testing",
                    "toRegionName": "Test Environment(testing)",
                    "toWorkspaceName": "【Doris】for Developer",
                    "toWorkspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d",
                    "type": [
                        "*"
                    ],
                    "updateAt": -1,
                    "updator": "",
                    "uuid": "grant_14ea52f7b22c483785db5f783610dab2",
                    "workspaceName": "huangdong testing",
                    "workspaceUUID": "wksp_aef7103dc5a44397a9f4d0442517a15e"
                }
            ],
            "declaration": {
                "asd": "aa,bb,cc,1,True",
                "asdasd": "dawdawd",
                "business": "aaa",
                "dd": "dd",
                "fawf": "afawf",
                "organization": "64fe7b4062f74d0007b46676"
            },
            "pageInfo": {
                "count": 100,
                "pageIndex": 1,
                "pageSize": 100,
                "totalCount": 107
            },
            "regionCode": "testing",
            "regionName": "Test Environment(testing)"
        }
    ],
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-900225FA-E0C1-44D4-BA1A-5C8F39F9D108"
} 

문서 평가

이 페이지가 도움이 되었나요?