Updated on 2024-05-08 GMT+08:00

Obtaining the Pipeline Status

Function

This API is used to obtain the pipeline status, stage, and job information.

Calling Method

For details, see Calling APIs.

URI

GET /v3/pipelines/{pipeline_id}/status

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

pipeline_id

Yes

String

ID of the pipeline whose status is to be obtained.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

build_id

No

String

Execution ID of the pipeline whose status is to be obtained.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

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 4 Response body parameters

Parameter

Type

Description

pipeline_id

String

Pipeline ID.

pipeline_name

String

Pipeline name.

executor

String

Executor.

build_id

String

Pipeline execution ID.

start_time

String

Execution start time.

end_time

String

Execution end time.

parameters

Array of PipelineParameter objects

Pipeline parameters.

states

Array of PipelineStateStatus objects

Pipeline execution status.

elapsed_time

String

Execution duration.

status

String

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

outcome

String

Pipeline execution result. The value can be success, error, or aborted.

detail_url

String

URL of the pipeline details page.

Table 5 PipelineParameter

Parameter

Type

Description

name

String

Parameter name.

value

String

Parameter value.

Table 6 PipelineStateStatus

Parameter

Type

Description

id

String

Stage or job ID.

name

String

Stage or job name.

type

String

Type (stage/job)

start_time

String

Execution start time.

end_time

String

Execution end time.

elapsed_time

String

Running duration.

status

String

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

outcome

String

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

error_code

String

Error code.

error_msg

String

Error message.

children

Array of PipelineStateStatus objects

Subtask running information (empty for a task)

detail_url

String

URL of job running records.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Error message.

error_code

String

Error code.

Example Requests

GET https://{endpoint}/v3/pipelines/8025ba36a87a4dd5af496708c2961817/status?build_id=2

Example Responses

Status code: 200

OK

{
  "executor" : null,
  "status" : null,
  "outcome" : null,
  "pipeline_id" : "75c562a081574ff28224fb2c123a0643",
  "pipeline_name" : "pipeline-1185523_Cx2Ur",
  "build_id" : null,
  "start_time" : "2022-04-01 19:44:16",
  "end_time" : null,
  "elapsed_time" : null,
  "detail_url" : "https://example.com",
  "parameters" : [ {
    "name" : "seviceName",
    "value" : "pipeline-23"
  }, {
    "name" : "codeBranch",
    "value" : "master"
  } ],
  "states" : [ {
    "id" : "state_4",
    "name" : "Build",
    "type" : "stage",
    "status" : null,
    "outcome" : null,
    "children" : [ {
      "id" : "Task_1",
      "name" : "Manual review",
      "type" : "task",
      "status" : null,
      "outcome" : null,
      "start_time" : null,
      "end_time\"" : null,
      "elapsed_time" : null,
      "error_code" : null,
      "error_msg" : null,
      "detail_url" : null
    } ],
    "start_time" : null,
    "end_time" : null,
    "elapsed_time" : null
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.