获取仓库分支列表-j9九游会登录
功能介绍
获取仓库分支列表
调试
您可以在中调试该接口,支持自动认证鉴权。api explorer可以自动生成sdk代码示例,并提供sdk代码示例调试功能。
uri
get /v2/repositories/{repository_id}/branches
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
repository_id |
是 |
integer |
仓库短id |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
page |
否 |
string |
分页页数 |
|
per_page |
否 |
string |
每页数据数 |
|
match |
否 |
string |
匹配条件 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
x-auth-token |
是 |
string |
用户token。 通过调用iam服务获取用户token接口获取(响应消息头中x-subject-token的值)。 |
响应参数
状态码: 200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error |
error object |
响应错误 |
|
result |
branchresponse object |
响应结果 |
|
status |
string |
响应状态 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
code |
string |
错误码 |
|
message |
string |
错误信息 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
branches |
array of branchesitem objects |
分支信息 |
|
total |
double |
总数 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
commit |
commitv2 object |
提交信息 |
|
diverging_commit_counts |
divergingcommitcounts object |
提交差异数量 |
|
name |
string |
分支名 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
committed_date |
string |
提交时间 |
|
committer_name |
string |
提交者 |
|
id |
string |
提交id |
|
message |
string |
提交信息 |
|
short_id |
string |
提交短id |
|
title |
string |
提交标题 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
ahead |
double |
领先提交数 |
|
behind |
double |
滞后提交数 |
请求示例
get https://{endpoint}/v2/repositories/{repository_id}/branches
响应示例
状态码: 200
ok
{
"result" : {
"total" : 1,
"branches" : [ {
"name" : "master",
"commit" : {
"id" : "2912b8f2328e798f7d544272ffaebfccccb598ab",
"title" : "initial commit",
"message" : "initial commit",
"committed_date" : "2021-12-06t09:24:50.000 08:00",
"short_id" : "2912b8f2",
"committer_name" : "repo"
},
"diverging_commit_counts" : {
"behind" : 0,
"ahead" : 0
}
} ]
},
"status" : "success"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
ok |
错误码
请参见错误码。
相关文档
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨