文档

GetRepository - 查询代码库

更新时间:

查询单个代码库详情。

适用版本

企业专属版、企业标准版

服务接入点与授权信息

请求语法

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

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

请求参数

参数

类型

位置

是否必填

描述

示例值

organizationId

string

path

组织 ID。

99d1****71d4

repositoryId

string

path

代码库 ID 或者 URL-Encoder 编码的全路径。

2835387 或 codeup-org-id%2Fcodeup-demo

请求示例

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

返回参数

参数

类型

描述

示例值

-

object

accessLevel

integer

当前用户在该代码库上的权限类型。20-浏览者,30-开发者,40-管理员。

20

adminSettingLanguage

string

仓库主要编程语言。

Java

allowPush

boolean

是否允许推送。

false

archived

boolean

是否归档。

false

avatarUrl

string

代码库头像地址。

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

cloneDownloadControlGray

boolean

克隆/下载控制组织维度灰度开关。

false

createdAt

string

创建时间。

2020-06-19T04:02:00.744Z

creatorId

integer

创建者 user id。

19258

defaultBranch

string

代码库默认分支。

master

demoProject

boolean

是否是 demo 库。

false

description

string

代码库描述。

repo desc

enableCloneDownloadControl

boolean

是否开启代码克隆下载管控。

false

forkCount

integer

fork 数量。

1

httpUrlToRepo

string

HTTP 地址。

https://codeup.aliyun.com/xxx/test/test.git

id

integer

代码库 ID。

100

lastActivityAt

string

最后活跃时间。

2020-06-19T04:02:00.744Z

name

string

代码库名称。

test

nameWithNamespace

string

代码库完整名称(含完整组名称)。

test / test(斜杠两侧有空格)

namespace

object

avatar

string

头像地址。

https://xxx.jpg

createdAt

string

创建时间。

2020-06-19T04:02:00.744Z

description

string

描述。

repo desc

id

integer

ID。

100

name

string

名称。

xxx

ownerId

integer

归属者 ID。

100

path

string

路径。

test

updatedAt

string

更新时间。

2020-06-19T04:02:00.744Z

visibility

string

可见性。private:私有, internal:内部公开; public: 公开。

private

openCloneDownloadControl

boolean

是否开启克隆下载控制。

false

owner

object

avatarUrl

string

用户头像地址。

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

email

string

用户邮箱。

username@example.com

id

integer

无业务意义主键 ID。

100

name

string

用户名称。

xxx

state

string

用户状态,可为{active, blocked}。

active

userId

string

云效用户 ID。

100

username

string

用户登录名。

test

webUrl

string

页面访问地址。

""

path

string

代码库路径。

test-create-group

pathWithNamespace

string

代码库完整路径(含完整组路径)。

codeup-test-org/test-create-group

permissions

object

权限简介。

groupAccess

object

accessLevel

integer

组权限,可选{20-浏览者,30-开发者,40-管理员}。

30

notificationLevel

integer

保留信息。

projectAccess

object

accessLevel

integer

库权限,可选{20-浏览者,30-开发者,40-管理员}。

30

notificationLevel

integer

保留信息。

projectType

integer

代码库类型:1-普通代码库,2-模板代码库。

1

sshUrlToRepo

string

仓库 ssh 克隆地址。

git@codeup.xxx.com:xxx/test/test.git

starCount

integer

收藏数量。

5

updatedAt

string

更新时间。

2022-01-14T21:08:26+08:00

visibility

string

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

private

webUrl

string

页面访问时的 URL。

""

返回示例

{
    "accessLevel": 0,
    "adminSettingLanguage": "Java",
    "allowPush": false,
    "archived": false,
    "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
    "cloneDownloadControlGray": false,
    "createdAt": "2020-06-19T04:02:00.744Z",
    "creatorId": 0,
    "defaultBranch": "master",
    "demoProject": false,
    "description": "描述信息的具体内容",
    "enableCloneDownloadControl": false,
    "forkCount": 1,
    "httpUrlToRepo": "https://codeup.aliyun.com/xxx/test/test.git",
    "id": 100,
    "lastActivityAt": "2022-01-14T21:08:26+08:00",
    "name": "test",
    "nameWithNamespace": "codeup-test-org / test-create-group (斜杠两侧有空格)",
    "namespace": {
        "avatar": "",
        "createdAt": "2022-01-14T21:08:26+08:00",
        "description": "描述信息的具体内容",
        "id": 0,
        "name": "test",
        "ownerId": 0,
        "path": "",
        "updatedAt": "2022-01-14T21:08:26+08:00",
        "visibility": "private"
    },
    "openCloneDownloadControl": false,
    "owner": {
        "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
        "email": "username@example.com",
        "id": 100,
        "name": "xxx",
        "state": "active",
        "userId": "100",
        "username": "test",
        "webUrl": "xxx"
    },
    "path": "test-create-group",
    "pathWithNamespace": "codeup-test-org/test-create-group",
    "permissions": {
        "groupAccess": {
            "accessLevel": 30,
            "notificationLevel": 0
        },
        "projectAccess": {
            "accessLevel": 30,
            "notificationLevel": 0
        }
    },
    "projectType": 1,
    "sshUrlToRepo": "gi*@xxx.aliyun.com:xxx/test/test.git",
    "starCount": 5,
    "updatedAt": "2022-01-14T21:08:26+08:00",
    "visibility": "private",
    "webUrl": ""
}

错误码

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