根据组名和仓库名查询某仓库某分支对应的提交
功能介绍
根据仓库组名、仓库名和分支获取提交列表。
URI
GET /v1/repositories/{group_name}/{repository_name}/commits
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
group_name |
是 |
String |
仓库组名(克隆地址中域名后面仓库名前的一段 示例:git@repo.alpha.devcloud.inhuawei.com:Demo00228/testword.git 组名:Demo00228 ) |
|
repository_name |
是 |
String |
仓库名 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
page_index |
否 |
Integer |
分页索引 |
|
page_size |
否 |
Integer |
每页数据量 |
|
ref_name |
是 |
String |
分支或标签名,支持SHA格式 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
参数解释: 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 必传。 取值范围: 字符串长度不少于1,不超过10万。 默认取值: 不涉及。 |
响应参数
状态码: 200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error |
Error object |
响应错误 |
|
result |
CommitList object |
响应结果 |
|
status |
String |
响应状态 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
author_email |
String |
作者邮箱 |
|
author_name |
String |
作者 |
|
authored_date |
String |
作者提交时间 |
|
committed_date |
String |
提交时间 |
|
committer_email |
String |
提交作者邮箱 |
|
committer_name |
String |
提交作者 |
|
format |
Object |
文件变更的详情信息,其格式由请求查询参数 stat_format 决定 |
|
id |
String |
提交对应的SHA id |
|
message |
String |
提交的信息 |
|
parent_ids |
Array of strings |
父提交id |
请求示例
GET https://{endpoint}/v1/repositories/{group_name}/{repository_name}/commits
响应示例
状态码: 200
OK
{
"result" : {
"total" : 1,
"commits" : [ {
"id" : "a27fafa7d8da2dd55f691bef989226d22f50d8ce",
"message" : "Initial commit",
"parent_ids" : [ ],
"authored_date" : null,
"author_name" : "repo",
"author_email" : "repo@huawei.com",
"committed_date" : "2019-10-15 09:40:29",
"committer_name" : "repo",
"committer_email" : "repo@huawei.com"
} ]
},
"status" : "success"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
OK |
错误码
请参见错误码。