Updated on 2023-06-25 GMT+08:00

Obtaining Project Commits

Function

This API is used to obtain the latest ten project commits.

URI

GET /v1/{project_id}/git/repos/{namespace}/{project}/commits

Table 1 describes the parameters.

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

namespace

String

Yes

Namespace ID or URL code name.

project

String

Yes

Repository project ID or URL code name. If the value contains a slash (/), replace it with a colon (:).

Table 2 Query parameters

Parameter

Type

Mandatory

Description

ref

String

No

Branch or tag name. If it is not provided, use the default branch.

Request

Request parameters

None

Response

Response parameters

Table 3 Response parameters

Parameter

Type

Description

commits

Array<Object>

Project commits structure. For details, see Table 4.

Table 4 commits parameters

Parameter

Type

Description

sha

String

Commit SHA value.

message

String

Commit description.

authored_date

String

Import time.

Example

Example request

None

Example response

{
  "commits": [
    {
      "sha": "string",
      "message": "string",
      "authored_date": "string"
    }
  ]

Status Code

Table 5 Status codes

Status Code

Description

200

OK

400

Bad Request

Error Code

Error code must be in the format of SVCSTG.REPO.[Error_ID]. Example: SVCSTG.REPO.0401. See ServiceStage Error Codes.