文档

GetNamespace - 查询代码组空间信息

更新时间:

通过 OpenAPI 查询代码组空间信息,可根据 ID 或路径获取单个空间或者代码组的信息。

适用版本

企业专属版、企业标准版

服务接入点与授权信息

请求语法

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/namespaces/{namespaceId}

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

pt-0fh3****0fbG_35af****0484

请求参数

参数

类型

位置

是否必填

描述

示例值

organizationId

string

path

组织 ID。

99d1****71d4

namespaceId

string

path

空间或者代码组 ID,或者全路径。

51888

请求示例

curl -X 'GET' \
  'https://test.rdc.aliyuncs.com/oapi/v1/codeup/organizations/{organizationId}/namespaces/{namespaceId}' \
  -H 'accept: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

返回参数

参数

类型

描述

示例值

-

object

avatarUrl

string

头像地址。

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

fullPath

string

空间完整路径。

codeup-test-org/test-group-detail

id

integer

ID。

36612

kind

string

默认取值为 group。

Group

name

string

名称。

test-group-detail

nameWithNamespace

string

完整名称。

codeup-test-org / test-group-detail(斜杠两侧有空格)

parentId

integer

上级路径的 ID。

26842

path

string

路径。

test-group-detail

pathWithNamespace

string

完整路径。

codeup-test-org/test-group-detail

visibility

string

可见性,包括{private-私有,internal-组织内公开,public-公开}。

private

webUrl

string

页面访问时的 URL。

""

返回示例

{
    "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
    "fullPath": "codeup-test-org/test-group-detail",
    "id": 0,
    "kind": "Group",
    "name": "test-create-group",
    "nameWithNamespace": "codeup-test-org / test-group-detail(斜杠两侧有空格)",
    "parentId": 0,
    "path": "test-create-group",
    "pathWithNamespace": "codeup-test-org/test-group-detail",
    "visibility": "private",
    "webUrl": "\"\""
}

错误码

访问错误码中心查看 API 相关错误码。