Help Center/ CodeArts Repo/ API Reference/ APIs/ Commit/ Querying Specific Submission Information of a Warehouse
Updated on 2023-05-06 GMT+08:00

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}

Table 1 Path Parameters

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.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

stats

No

Boolean

Including submission statistics. The default value is true.

Request Parameters

Table 3 Request header 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

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

SpecificCommitInfo object

Result

status

String

Status code in a response

Table 5 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 6 SpecificCommitInfo

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

Table 7 stats

Parameter

Type

Description

additions

Integer

Number of lines added due to changes

deletions

Integer

Change the number of deleted rows.

total

Integer

Total number of changed lines.

Table 8 last_pipeline

Parameter

Type

Description

id

Integer

Pipeline ID

sha

String

Submit the corresponding SHA ID.

ref

String

Branch Name

status

String

Pipeline status.

web_url

String

Pipeline URL

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.