Help Center/ CodeArts Build/ API Reference/ Task APIs/ Querying the Latest Successful Build History of a Specified Code Repository
Updated on 2023-12-06 GMT+08:00

Querying the Latest Successful Build History of a Specified Code Repository

Function

Querying the Latest Successful Build History of a Specified Code Repository

Calling Method

For details, see Calling APIs.

URI

GET /v3/jobs/{project_id}/last-history

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

CodeArts project ID, which is a string of 32 digits and lowercase letters.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

repository_name

Yes

String

Name of the code repository. Chinese characters are not supported.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Obtain the value by calling the IAM service interface. (value of X-Subject-Token in the response header). Global tenant tokens are not supported. Use a region-level token whose scope is project.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

record_id

String

Build record ID, which is a unique key.

job_id

String

build task ID

job_name

String

build task Name

build_number

Integer

Build ID

start_time

String

Start time of the build.

end_time

String

End time of the build.

result

String

Build Execution Result

commit_id

String

commitId

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

Description

Example Requests

GET https://{endpoint}/v3/jobs/6ecbc5bac7c8442fb3d2563d53c13582/last-history?repository_name=maven-demo

Example Responses

Status code: 200

OK

{
  "record_id" : "20210722.16",
  "job_id" : "37be03edd1da430c8079504d546cc499",
  "job_name" : "Test Task 01",
  "build_number" : 16,
  "start_time" : "2021-07-22T16:26:52+08:00",
  "end_time" : "2021-07-22T16:27:15+08:00",
  "result" : "SUCCESS",
  "commit_id" : "e311c54476e0e536f0ecdeeba8dc184216fa2057"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.