Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ This API is used to query the submission of a branch of a warehouse based on the warehouse ID. More optional parameters are provided.
Updated on 2023-05-06 GMT+08:00

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Warehouse Primary Key ID

Table 2 Query Parameters

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

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

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

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" : "a618e34bd5704be3ae3395dfede06041@huawei.com"
    } ]
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.