根据组名和仓库名查询某仓库某分支对应的提交
功能介绍
用户可根据仓库组名、仓库名和分支名获取仓库分支提交列表。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v1/repositories/{group_name}/{repository_name}/commits
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
group_name |
是 |
String |
参数解释: 仓库组名,即克隆地址中域名后面仓库名前的一段。 示例:git@repo.example.com:Demo00228/testword.git,Demo00228即为组名。 约束限制: 不涉及。 取值范围: 字符串的长度为[1-2000]。 默认取值: 不涉及。 |
repository_name |
是 |
String |
参数解释: 仓库名 约束限制: 不涉及。 取值范围: 1-2000 默认取值: 不涉及。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
page_index |
否 |
Integer |
参数解释: 分页索引。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 1 |
page_size |
否 |
Integer |
参数解释: 每页数据量。 约束限制: 不涉及。 取值范围: 1-100。 默认取值: 20 |
ref_name |
是 |
String |
参数解释: 分支或标签名,支持SHA格式。 约束限制: 不涉及。 取值范围: 1-2000 默认取值: 不涉及。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
参数解释: 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 不涉及。 取值范围: 长度为[1,100000]个字符。 默认取值: 不涉及。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
error |
Error object |
参数解释: 响应错误 取值范围: 不涉及 |
result |
CommitList object |
参数解释: 响应结果 取值范围: 不涉及 |
status |
String |
参数解释: 响应状态 取值范围:
|
参数 |
参数类型 |
描述 |
---|---|---|
code |
String |
参数解释: 错误码。 取值范围: 符合错误码格式字符串,长度[0,100]。 |
message |
String |
参数解释: 错误信息。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
commits |
Array of Commit objects |
参数解释: 提交列表。 取值范围: 不涉及。 |
total |
Integer |
参数解释: 提交总数 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
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@example.com", "committed_date" : "2019-10-15 09:40:29", "committer_name" : "repo", "committer_email" : "repo@example.com" } ] }, "status" : "success" }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
错误码
请参见错误码。