This API is used to query the submission of a branch of a warehouse based on the warehouse ID. More optional parameters are provided.
Function
This API queries the submission of a branch of a warehouse based on the warehouse ID.
URI
GET /v1/repositories/{repository_id}/commits
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
repository_id |
Yes |
Integer |
Warehouse Primary Key ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
author |
No |
String |
Requester |
begin_date |
No |
String |
Submission start date, in the format of yyyy-MM-dd. |
end_date |
No |
String |
Submission end date, in the format of yyyy-MM-dd. |
message |
No |
String |
Details |
page_index |
No |
Integer |
Pagination Index Default: 1 |
page_size |
No |
Integer |
Number of records on each page. Default: 10 |
path |
No |
String |
Path |
ref_name |
Yes |
String |
Branch or label name. The SHA format is supported. |
stat_format |
No |
String |
Submitted file change details (excluding diff) |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Response error. |
result |
CommitList object |
Result |
status |
String |
Status code in a response |
Parameter |
Type |
Description |
---|---|---|
commits |
Array of Commit objects |
Submission List |
total |
Integer |
Total Submitted |
Parameter |
Type |
Description |
---|---|---|
author_email |
String |
Author Email |
author_name |
String |
Author |
authored_date |
String |
Author Submission Time |
committed_date |
String |
Submitted |
committer_email |
String |
Submit Author Email |
committer_name |
String |
Requester |
format |
Object |
Details about the file change. The format is determined by the stat_format parameter. |
id |
String |
Submit the corresponding SHA ID. |
message |
String |
Submitted Information |
parent_ids |
Array of strings |
Parent Submission ID |
Example Requests
null GET https://{endpoint}/v1/repositories/{repository_id}/commits
Example Responses
Status code: 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" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.