Help Center/ CodeArts Pipeline/ API Reference/ API/ Pipeline Management (Old Version, Unavailable Soon)/ Obtaining the Pipeline Execution Status in a Project
Updated on 2024-05-08 GMT+08:00

Obtaining the Pipeline Execution Status in a Project

Function

This API is used to obtain the pipeline execution status in a project.

Calling Method

For details, see Calling APIs.

URI

GET /v3/pipelines/build-result

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

start_date

Yes

String

Start date. The interval between the start date and end date cannot exceed one month. The query includes the start date.

end_date

Yes

String

End date. The interval between the start date and end date cannot exceed one month. The query includes the end date.

offset

Yes

Integer

Offset, which is the position where the query starts. The value must be no less than 0.

limit

Yes

Integer

Number of records of each query.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

offset

Integer

Offset, which is the position where the query starts. The value must be no less than 0.

limit

Integer

Number of records of each query.

total

Integer

Total number of items.

build_results

Array of PipelineBuildResult objects

Execution status data list.

Table 4 PipelineBuildResult

Parameter

Type

Description

build_id

String

Pipeline execution ID.

elapse_time

String

Running duration, in milliseconds.

end_time

String

Execution end time.

outcome

String

Running result. The value can be success, error, or aborted.

pipeline_id

String

Pipeline ID.

pipeline_name

String

Pipeline name.

start_time

String

Execution start time.

status

String

Running status. The value can be waiting, running, verifying, suspending, or completed.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

error_code

String

Error code.

Example Requests

GET https://{endpoint}/v3/pipelines/build-result?project_id=8025ba36a87a4885af496708c2961817&start_date=2020-07-01&end_date=2020-07-31&offset=0&limit=10

Example Responses

Status code: 200

OK

{
  "offset" : 0,
  "limit" : 10,
  "total" : 29,
  "build_results" : [ {
    "status" : "completed",
    "outcome" : "success",
    "pipeline_id" : "fbe06e5655764f049f4d988bd2941279",
    "pipeline_name" : "API test pipeline_YN96I241",
    "build_id" : "12",
    "start_time" : "2021-08-10 00:00:01",
    "end_time" : "2021-08-10 00:00:02",
    "elapse_time" : "917"
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.