Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Queries the submission of a branch of a repository based on the group name and repository name.
Updated on 2023-05-06 GMT+08:00

Queries the submission of a branch of a repository based on the group name and repository name.

Function

This API is used to obtain the submission list based on the repository group name, repository name, and branch.

URI

GET /v1/repositories/{group_name}/{repository_name}/commits

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

group_name

Yes

String

Repository group name (Example: git@repo.alpha.devcloud.inhuawei.com:Demo00228/testword.git Group name: Demo00228)

repository_name

Yes

String

Repository name

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

page_index

No

Integer

Pagination Index

page_size

No

Integer

Pagination Index

ref_name

Yes

String

Branch or label name. The SHA format is supported.

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

CommitList 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 CommitList

Parameter

Type

Description

commits

Array of Commit objects

Submission List

total

Integer

Total Submitted

Table 7 Commit

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

GET https://{endpoint}/v1/repositories/{group_name}/{repository_name}/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" : "a618e34bd5704be3ae3395dfede06041@huawei.com"
    } ]
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.