根据仓库ID查询仓库某分支对应的提交,提供更多可选参数
功能介绍
根据仓库id查询仓库某分支对应的提交。
URI
GET /v1/repositories/{repository_id}/commits
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| repository_id | 是 | Integer | 仓库主键id |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| author | 否 | String | 提交作者 |
| begin_date | 否 | String | 起始提交日期,格式为yyyy-MM-dd |
| end_date | 否 | String | 终止提交日期,格式为yyyy-MM-dd |
| message | 否 | String | 提交信息 |
| page_index | 否 | Integer | 分页索引 缺省值:1 |
| page_size | 否 | Integer | 每页数据量 缺省值:10 |
| path | 否 | String | 文件路径 |
| ref_name | 是 | String | 分支或标签名,支持SHA格式 |
| stat_format | 否 | String | 提交的文件变更详情信息(不包含diff) |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码: 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 |
请求示例
null
GET https://{endpoint}/v1/repositories/{repository_id}/commits 响应示例
状态码: 200
OK
{
"result" : {
"total" : 1,
"commits" : [ {
"id" : "a27fafa7d8da2dd55f691bef989226d22f50d8ce",
"message" : "Initial commit",
"parent_ids" : [ ],
"authored_date" : null,
"author_name" : "repo",
"author_email" : "repo@test.com",
"committed_date" : "2019-10-15 09:40:29",
"committer_name" : "repo",
"committer_email" : "repo@test.com"
} ]
},
"status" : "success"
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
错误码
请参见错误码。