查询代码库,支持按代码库ID和代码库路径(Path)查询。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
GET /repository/get HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| organizationId |
string |
是 |
企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 |
60de7a6852743a5162b5f957 |
| accessToken |
string |
否 |
个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 |
f0b1e61db5961df5975a93f9129d2513 |
| identity |
string |
是 |
代码库 ID 或路径 |
2835387 或 codeup/codeup-demo |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
响应结果 |
||
| requestId |
string |
请求 ID |
37294673-00CA-5B8B-914F-A8B35511E90A |
| errorCode |
string |
错误码 |
SYSTEM_UNKNOWN_ERROR |
| errorMessage |
string |
错误信息 |
"" |
| success |
boolean |
调用是否成功 |
true |
| repository |
object |
代码库信息 |
|
| archive |
boolean |
归档标识 |
false |
| avatarUrl |
string |
代码库头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
| createdAt |
string |
创建时间,采用 ISO 8601 格式的 UTC 时间。 |
2020-06-19T04:02:00.744Z |
| creatorId |
integer |
创建者 ID |
19258 |
| defaultBranch |
string |
默认分支 |
master |
| demoProjectStatus |
boolean |
DEMO 库标识 |
false |
| description |
string |
描述 |
repo desc |
| httpUrlToRepository |
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 |
父空间 |
|
| id |
integer |
代码库所属组或企业空间的 ID。 |
100 |
| avatar |
string |
头像地址 |
https://xxx.jpg |
| createdAt |
string |
创建时间,采用 ISO 8601 格式的 UTC 时间。 |
2020-06-19T04:02:00.744Z |
| description |
string |
描述 |
repo desc |
| name |
string |
父空间名称 |
demo-group |
| ownerId |
integer |
归属者 ID 说明
即,用户主键 ID |
100 |
| path |
string |
父空间路径 |
test |
| updatedAt |
string |
更新时间,采用 ISO 8601 格式的 UTC 时间。 |
2020-06-19T04:02:00.744Z |
| visibilityLevel |
integer |
可见性 0 - 私有,仅代码库成员可见 10 - 企业内公开,企业成员可见 |
0 |
| path |
string |
路径 |
test |
| pathWithNamespace |
string |
代码库完整路径(含完整组路径) |
test/test |
| sshUrlToRepository |
string |
SSH 克隆地址 |
git@codeup.aliyun.com:xxx/test/test.git |
| visibilityLevel |
integer |
可见性 0 - 私有,仅代码库成员可见 10 - 企业内部公开,企业成员可见 |
0 |
| webUrl |
string |
页面访问地址 |
https://codeup.aliyun.com/xxx/test/test |
示例
正常返回示例
JSON格式
{
"requestId": "37294673-00CA-5B8B-914F-A8B35511E90A",
"errorCode": "SYSTEM_UNKNOWN_ERROR",
"errorMessage": "\"\"",
"success": true,
"repository": {
"archive": false,
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"createdAt": "2020-06-19T04:02:00.744Z",
"creatorId": 19258,
"defaultBranch": "master",
"demoProjectStatus": false,
"description": "repo desc",
"httpUrlToRepository": "https://codeup.aliyun.com/xxx/test/test.git",
"id": 100,
"lastActivityAt": "2020-06-19T04:02:00.744Z",
"name": "test",
"nameWithNamespace": "test / test(斜杠两侧有空格)",
"namespace": {
"id": 100,
"avatar": "https://xxx.jpg",
"createdAt": "2020-06-19T04:02:00.744Z",
"description": "repo desc",
"name": "demo-group",
"ownerId": 100,
"path": "test",
"updatedAt": "2020-06-19T04:02:00.744Z",
"visibilityLevel": 0
},
"path": "test",
"pathWithNamespace": "test/test",
"sshUrlToRepository": "git@codeup.aliyun.com:xxx/test/test.git",
"visibilityLevel": 0,
"webUrl": "https://codeup.aliyun.com/xxx/test/test"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。