获取仓库授权列表
功能介绍
获取Git仓库所有授权信息。
调试
您可以在API Explorer中调试该接口。
请求消息
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
Content-Type |
是 |
String |
消息体的类型(格式),默认取值为“application/json;charset=utf8”。 |
|
X-Auth-Token |
是 |
String |
调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值。Token获取方式,请参考获取用户Token。 |
响应消息
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
authorizations |
Array<Object> |
授权结构体,请参考表4。 |
|
count |
Integer |
仓库授权数量。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
name |
String |
仓库授权的名称。 |
|
repo_type |
String |
仓库类型。 取值范围:CodeArts、Gitee、GitHub、BitBucket、GitLab。 |
|
repo_host |
String |
仓库地址。 |
|
repo_home |
String |
您的仓库主页。 |
|
repo_user |
String |
您的仓库用户名。 |
|
avartar |
String |
您的仓库用户头像。 |
|
token_type |
String |
仓库授权方式。 |
|
create_time |
Long |
仓库授权创建时间戳。 |
|
update_time |
Long |
仓库授权修改时间戳。 |
|
status |
Integer |
仓库授权状态。 0:正常 1:过期 2:未认证 |
|
tag |
String |
授权环境的类型,默认为null。 |
请求示例
无
响应示例
{
"authorizations": [
{
"name": "test",
"repo_type": "github",
"repo_host": "https://api.github.com",
"repo_home": "https://github.com/tom-repo",
"repo_user": "tom-repo",
"avartar": "https://avatars.githubusercontent.com/u/73919200?v=4",
"token_type": "oauth",
"create_time": 1649731565642,
"update_time": 1649731565642,
"tag": null,
"status": 0
}
],
"count": 1
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
操作成功。 |
|
400 |
错误的请求。 |
错误码
错误码格式为:SVCSTG.REPO.[Error_ID],例如:SVCSTG.REPO.0401。错误码说明请参考ServiceStage错误码。