Querying Specific Submission Information of a Warehouse
Function
Gets a specific commit identified by a commit id or the name of a branch or tag.
URI
GET /v2/projects/{repo_id}/repository/commits/{sha}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
repo_id |
Yes |
Integer |
Warehouse Short ID |
sha |
Yes |
String |
Commit ID, which is the branch name or tag name of the repository. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
stats |
No |
Boolean |
Including submission statistics. The default value is true. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Response error. |
result |
SpecificCommitInfo object |
Result |
status |
String |
Status code in a response |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Submit the corresponding SHA ID. |
short_id |
String |
Submit the corresponding short SHA ID. |
title |
String |
Submit Title |
author_name |
String |
Author |
author_email |
String |
Author Email |
committer_name |
String |
Requester |
committer_email |
String |
Submit Author Email |
created_at |
String |
Created |
message |
String |
Details |
parent_ids |
Array of strings |
Parent Submission ID |
committed_date |
String |
Submitted |
authored_date |
String |
Author Submission Time |
stats |
stats object |
Number of Changed Lines |
last_pipeline |
last_pipeline object |
Pipeline Information |
Example Requests
GET https://{endpoint}/v2/projects/859341/repository/commits/master
Example Responses
Status code: 200
OK
{ "result" : { "id" : "85a0a9d5c6e43bc9c3e443ac01f789e24eeef02b", "title" : "some commit message", "message" : "some commit message", "short_id" : "85a0a9d5", "author_name" : "repo", "author_email" : null, "committer_name" : "repo", "committer_email" : null, "created_at" : "2021-09-26T03:44:51.000Z", "parent_ids" : [ "5c114bb316dff4d4a046e09a5c44c816f2433140" ], "committed_date" : "2021-09-26T03:44:51.000Z", "authored_date" : null, "stats" : { "additions" : 1, "deletions" : 0, "total" : 1 }, "last_pipeline" : { "id" : 292811, "sha" : "2202af08836f0afd762d1b151d15ac510b974bdf", "ref" : "master", "status" : "running", "web_url" : "https://repo.devcloud.cn-north-208.ulanqab.huawei.com/Pipeline_Beta_sdcs00001/202107171926/pipelines/292811" } }, "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.