Help Center/ CodeArts Pipeline/ API Reference/ API/ Pipeline Management/ Obtaining Pipeline Status/Obtaining Pipeline Execution Details
Updated on 2025-09-08 GMT+08:00

Obtaining Pipeline Status/Obtaining Pipeline Execution Details

Function

This API is used to obtain the pipeline status/pipeline execution details. Only the data with execution records is returned.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/api/pipelines/{pipeline_id}/pipeline-runs/detail

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

pipeline_id

Yes

String

Definition:

Pipeline ID. Obtain the ID by calling the API for querying pipelines. pipelines.pipelineId indicates the pipeline ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

pipeline_run_id

No

String

Definition:

Pipeline run ID. The return value of the API for running a pipeline is the pipeline run ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including only digits and letters.

Default value:

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition:

User token. Obtain a token (the value of the X-Subject-Token response header) by calling the IAM API forobtaining a user token.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

String

Definition:

Pipeline run ID. The return value of the API for starting a pipeline is the pipeline run ID.

Value range:

The value consists of 32 characters, including only digits and letters.

pipeline_id

String

Parameter description:

Pipeline ID.

Value range:

32 characters, including only digits and letters.

manifest_version

String

Parameter description:

Pipeline version.

Value range:

The default value is 3.0.

name

String

Parameter description:

Pipeline name.

Value range:

The value can contain only letters, digits, hyphens (-), and underscores (_). The length is 1128 characters.

description

String

Definition:

Pipeline running description.

Value range:

Max. 1,024 characters.

is_publish

Boolean

Definition:

Whether the pipeline is a change-triggered pipeline.

Value range:

  • true: The pipeline is a change-triggered pipeline.

  • false: The pipeline is not a change-triggered pipeline.

executor_id

String

Definition:

Operator ID, which is the user ID.

Value range:

The value consists of 32 characters, including only digits and letters.

executor_name

String

Parameter description:

Executor name.

Value range:

None.

status

String

Definition:

Pipeline run status.

Value range:

  • COMPLETED: The instance is completed.

  • RUNNING: The instance is running.

  • FAILED: The instance failed.

  • CANCELED: The instance is canceled.

  • PAUSED: The instance is paused.

  • SUSPEND: The instance is suspended.

  • IGNORED: The instance is ignored.

trigger_type

String

Definition:

Pipeline trigger type.

  • Manual: triggered manually.

  • Scheduler: triggered by a scheduled task.

  • MR: triggered by an MR.

  • Push: triggered by a push event.

  • CreateTag: triggered by a tag.

  • Issue: triggered by an issue.

  • Note: triggered by a comment.

Value range:

N/A

run_number

Integer

Parameter description:

Pipeline running sequence number.

Value range:

No less than 1.

start_time

Long

Definition:

Pipeline start time.

Value range:

N/A

end_time

Long

Definition:

Pipeline end time.

Value range:

N/A

stages

Array of StageRun objects

Parameter description:

Stage running information, including the detailed running information of each stage.

Constraints:

N/A.

domain_id

String

Definition:

Tenant ID, that is, domain ID of a user account.

Value range:

The value consists of 32 characters, including only digits and letters.

project_id

String

Parameter description:

Project ID.

Value range:

32 characters, including only digits and letters.

region

String

Parameter description:

Region.

Value range:

None.

component_id

String

Definition:

Microservice ID. Obtain the ID by calling the API for querying microservices. data.id indicates the microservice ID.

Value range:

N/A

language

String

Parameter description:

Language. Currently, only Chinese and English are supported.

Value range:

zh-cn, en-us.

sources

Array of RunPipelineSource objects

Parameter description:

Pipeline source information.

Value range:

None.

artifacts

Array of PackageInfo objects

Parameter description:

Artifacts after running a pipeline.

Value range:

None.

subject_id

String

Definition:

Pipeline run ID. The return value of the API for starting a pipeline is the pipeline run ID.

Value range:

N/A

group_id

String

Definition:

Group ID.

Value range:

The value consists of 32 characters, including digits and letters.

group_name

String

Parameter description:

Group name.

Value range:

None.

detail_url

String

Parameter description:

Address of the details page.

Value range:

None.

current_system_time

Long

Parameter description:

Current system time.

Value range:

None.

Table 5 StageRun

Parameter

Type

Description

id

String

Definition:

Stage ID.

Value range:

The value consists of 32 characters, including digits and letters.

category

String

Parameter description:

Stage type.

Value range:

None.

name

String

Parameter description:

Stage name.

Value range:

Enter only letters, digits, hyphens (-), underscores (_), commas (,), semicolons (;), colons (:), periods (.), slashes (/), parentheses (), and spaces. The name cannot start or end with a space, and the length is 1128 characters.

identifier

String

Parameter description:

Unique identifier of a stage.

Value range:

None.

run_always

Boolean

Definition:

Whether to always run.

Value range:

  • true: always run.

  • false: not always run.

parallel

String

Parameter description:

Whether to execute jobs in parallel.

Value range:

None.

is_select

Boolean

Definition:

Selected or not.

Value range:

  • true: selected.

  • false: not selected.

sequence

Integer

Parameter description:

Serial number.

Value range:

No less than 0.

depends_on

Array of strings

Definition:

Identifier of the dependency stage.

Value range:

N/A

condition

String

Parameter description:

Running conditions.

Value range:

None.

status

String

Definition:

Status.

Value range:

  • INIT: The stage is being initialized.

  • QUEUED: The stage is queuing.

  • RUNNING: The stage is running.

  • CANCELED: The stage is canceled.

  • COMPLETED: The stage is completed.

  • FAILED: The stage is failed.

  • SKIPPED: The stage is skipped.

  • IGNORED: The stage is ignored.

  • PAUSED: The stage is paused.

  • SUSPEND: The stage is suspended.

  • ASYNC_RUNNING: The stage is running asynchronously.

  • ASYNC_FAILED: The pipeline failed during asynchronous execution.

  • UNSELECTED: The stage is unselected.

  • REDISPATCH: The stage is rescheduled.

start_time

Long

Definition:

Stage start time.

Value range:

N/A

end_time

Long

Definition:

Stage end time.

Value range:

N/A

pre

Array of StepRun objects

Parameter description:

Stage entry.

Value range:

None.

post

Array of StepRun objects

Parameter description:

Stage exit.

Value range:

None.

jobs

Array of JobRun objects

Definition:

Jobs.

Value range:

N/A

Table 6 JobRun

Parameter

Type

Description

id

String

Parameter description:

Job ID.

Value range:

None.

category

String

Parameter description:

Job type.

Value range:

None.

sequence

Integer

Parameter description:

Serial number.

Value range:

None.

async

String

Definition:

Asynchronous or not.

Value range:

  • true: asynchronous.

  • false: non-asynchronous.

name

String

Parameter description:

Job name.

Value range:

None.

identifier

String

Parameter description:

Unique identifier of a job.

Value range:

None.

depends_on

Array of strings

Parameter description:

Dependency.

Value range:

None.

condition

String

Parameter description:

Running conditions.

Value range:

None.

resource

String

Parameter description:

Execution resources.

Value range:

None.

is_select

Boolean

Definition:

Selected or not.

Value range:

  • true: selected.

  • false: not selected.

timeout

String

Parameter description:

Job timeout settings.

Value range:

None.

last_dispatch_id

String

Parameter description:

ID of the job delivered last time.

Value range:

None.

status

String

Definition:

Status.

Value range:

  • INIT: The stage is being initialized.

  • QUEUED: The stage is queuing.

  • RUNNING: The stage is running.

  • CANCELED: The stage is canceled.

  • COMPLETED: The stage is completed.

  • FAILED: The stage is failed.

  • SKIPPED: The stage is skipped.

  • IGNORED: The stage is ignored.

  • PAUSED: The stage is paused.

  • SUSPEND: The stage is suspended.

  • ASYNC_RUNNING: The stage is running asynchronously.

  • ASYNC_FAILED: The pipeline failed during asynchronous execution.

  • UNSELECTED: The stage is unselected.

  • REDISPATCH: The job is rescheduled.

message

String

Parameter description:

Error message.

Value range:

None.

start_time

Long

Definition:

Job start time.

Value range:

N/A

end_time

Long

Definition:

Job end time.

Value range:

N/A

steps

Array of StepRun objects

Parameter description:

Step.

Value range:

None.

exec_id

String

Parameter description:

Job execution ID.

Value range:

None.

Table 7 StepRun

Parameter

Type

Description

name

String

Parameter description:

Step name.

Value range:

None.

task

String

Parameter description:

Step extension name.

Value range:

None.

business_type

String

Definition:

Extension type.

Value range:

  • Normal.

  • Build.

  • Test.

  • Check.

  • Deploy.

inputs

Array of inputs objects

Parameter description:

Enter a parameter.

Value range:

None.

sequence

Integer

Parameter description:

Serial number.

Value range:

None.

official_task_version

String

Parameter description:

Official extension version.

Value range:

None.

identifier

String

Parameter description:

Unique identifier.

Value range:

None.

multi_step_editable

Integer

Definition:

Editable parameter or not.

Value range:

  • true: editable.

  • false: not editable.

id

String

Definition:

Step ID.

Value range:

The value consists of 32 characters, including digits and letters.

endpoint_ids

Array of strings

Parameter description:

Endpoint ID list.

Value range:

None.

last_dispatch_id

String

Definition:

ID of the last delivered task.

Value range:

The value consists of 32 characters, including digits and letters.

status

String

Definition:

Status.

Value range:

  • RUNNING: Running.

  • CANCELED: The stage is canceled.

  • COMPLETED: The stage is completed.

  • FAILED: Failed.

message

String

Parameter description:

Error message.

Value range:

None.

start_time

Long

Definition:

Step start time.

Value range:

N/A

end_time

Long

Definition:

Step end time.

Value range:

N/A

Table 8 inputs

Parameter

Type

Description

key

String

Parameter description:

Enter the parameter name.

Value range:

None.

value

Object

Parameter description:

Enter the parameter value.

Value range:

None.

Table 9 RunPipelineSource

Parameter

Type

Description

type

String

Parameter description:

Source type.

Value range:

Currently, the code type is supported.

params

params object

Parameter description:

Code source parameters.

Value range:

N/A

Table 10 params

Parameter

Type

Description

git_type

String

Definition:

Code repository type.

Value range:

  • CodeArts Repo.

  • Gitee.

  • GitHub.

  • GitCode.

  • GitLab.

git_url

String

Parameter description:

HTTPS address of the code repository.

Value range:

None.

ssh_git_url

String

Parameter description:

SSH address of the code repository.

Value range:

None.

web_url

String

Parameter description:

Address of the code repository page.

Value range:

None.

repo_name

String

Parameter description:

Code repository name.

Value range:

None.

default_branch

String

Parameter description:

Default branch.

Value range:

None.

endpoint_id

String

Parameter description:

Endpoint ID.

Value range:

None.

codehub_id

String

Parameter description:

Repo code repository ID.

Value range:

None.

alias

String

Parameter description:

Code repository alias.

Value range:

None.

build_params

build_params object

Parameter description:

Build parameters.

Value range:

N/A

Table 11 build_params

Parameter

Type

Description

action

String

Definition:

Merge request type.

Value range:

  • open: The merge request is opened.

  • reopen: The merge request is reopened.

  • update: The merge request is updated.

  • merge: The merge request is merged.

build_type

String

Definition:

Triggered by a branch or a tag.

Value range:

  • branch: triggered by a branch.

  • tag: triggered by a tag.

commit_id

String

Parameter description:

Code repository commit ID.

Value range:

None.

event_type

String

Definition:

CodeArts project ID.

Value range:

  • Manual: triggered manually.

  • Scheduler: triggered by a scheduled task.

  • MR: triggered by an MR.

  • Push: triggered by a push event.

  • CreateTag: triggered by a tag.

  • Issue: triggered by an issue.

  • Note: triggered by a comment.

merge_id

String

Parameter description:

Merge request ID.

Value range:

None.

message

String

Parameter description:

Code commit message.

Value range:

None.

source_branch

String

Parameter description:

Source branch.

Value range:

None.

tag

String

Parameter description:

Tag.

Value range:

None.

target_branch

String

Parameter description:

Target branch.

Value range:

None.

codehub_id

String

Parameter description:

Repo code repository ID.

Value range:

None.

source_codehub_id

String

Parameter description:

ID of the source Repo code repository.

Value range:

None.

source_codehub_url

String

Parameter description:

Address of the source Repo code repository.

Value range:

None.

source_codehub_http_url

String

Parameter description:

HTTP address of the source Repo code repository.

Value range:

None.

Table 12 PackageInfo

Parameter

Type

Description

name

String

Parameter description:

Artifact name.

Value range:

None.

packageType

String

Parameter description:

Artifact type.

Value range:

None.

version

String

Parameter description:

Artifact version number.

Value range:

None.

downloadUrl

String

Parameter description:

Artifact download address.

Value range:

None.

Example Requests

GET https://{endpoint}/v5/54f90b75fc1447b1b65e8d3a9f77923d/api/pipelines/e5460d1d403146a1935c2d4b68ef506c/pipeline-runs/detail

Example Responses

Status code: 200

OK

{
  "id" : "25adfa6784124cfc9b9274ceaecf9957",
  "pipeline_id" : "98b6ea1536374df883bcc3b129bca4e9",
  "manifest_version" : "3.0",
  "name" : "Sub-pipeline qqq",
  "description" : null,
  "is_publish" : false,
  "executor_id" : "847a5317086c41798469d0868535943a",
  "executor_name" : "Beta environment account",
  "status" : "COMPLETED",
  "trigger_type" : "Manual",
  "run_number" : 1,
  "start_time" : 1674207197000,
  "end_time" : 1674207197000,
  "stages" : [ {
    "id" : "aac8063fbf084eec9722c77ece6dd283",
    "category" : null,
    "name" : "Phase_1",
    "identifier" : "0",
    "run_always" : false,
    "parallel" : null,
    "is_select" : true,
    "sequence" : 0,
    "depends_on" : [ ],
    "condition" : null,
    "status" : "COMPLETED",
    "start_time" : 1674207197000,
    "end_time" : 1674207197000,
    "pre" : [ {
      "name" : null,
      "task" : "official_devcloud_autoTrigger",
      "business_type" : null,
      "inputs" : null,
      "sequence" : 0,
      "official_task_version" : null,
      "identifier" : null,
      "multi_step_editable" : 0,
      "id" : "5a03bdb6ad2848ac972ba21744627a8c",
      "endpoint_ids" : null,
      "last_dispatch_id" : "6b3fa4c664844f33abc02053ddd76f62",
      "status" : "COMPLETED",
      "message" : null,
      "start_time" : 1674207197000,
      "end_time" : 1674207197000
    } ],
    "post" : [ ],
    "jobs" : [ {
      "id" : "1cde6a3815164cd18d0fa4038f876e46",
      "category" : null,
      "sequence" : 0,
      "async" : null,
      "name" : "Creating a Job",
      "identifier" : "1674207161661b4a41d77-a478-4538-870b-ffb589c1af06",
      "depends_on" : [ ],
      "condition" : null,
      "resource" : null,
      "is_select" : true,
      "timeout" : "",
      "last_dispatch_id" : null,
      "status" : "COMPLETED",
      "message" : "not found steps",
      "start_time" : 1674207197000,
      "end_time" : 1674207197000,
      "steps" : [ ]
    } ]
  } ],
  "domain_id" : "ce8df55870164338a72d7e828a966a2a",
  "project_id" : "6428c2e2b4b64affa14ec80896695c49",
  "region" : "{region}",
  "component_id" : "",
  "language" : "zh-cn",
  "sources" : [ {
    "type" : "code",
    "params" : {
      "git_type" : "codehub",
      "git_url" : "https://example.com/clsyz00001/aaaaa.git",
      "ssh_git_url" : "git@example.com:clsyz00001/aaaaa.git",
      "web_url" : "",
      "repo_name" : "aaaaa",
      "default_branch" : "master",
      "endpoint_id" : "",
      "codehub_id" : "2111677704",
      "alias" : "",
      "build_params" : {
        "action" : null,
        "build_type" : "branch",
        "commit_id" : "990ea057751d299f5575aac25bf97e88a60b461e",
        "event_type" : "Manual",
        "merge_id" : null,
        "message" : "Creating a Dockerfile",
        "source_branch" : null,
        "tag" : null,
        "target_branch" : "master",
        "codehub_id" : "2111677704"
      }
    }
  } ],
  "artifacts" : null,
  "subject_id" : "25adfa6784124cfc9b9274ceaecf9957"
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.codeartspipeline.v2.region.CodeArtsPipelineRegion;
import com.huaweicloud.sdk.codeartspipeline.v2.*;
import com.huaweicloud.sdk.codeartspipeline.v2.model.*;


public class ShowPipelineRunDetailSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");

        ICredential auth = new BasicCredentials()
                .withAk(ak)
                .withSk(sk);

        CodeArtsPipelineClient client = CodeArtsPipelineClient.newBuilder()
                .withCredential(auth)
                .withRegion(CodeArtsPipelineRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowPipelineRunDetailRequest request = new ShowPipelineRunDetailRequest();
        request.withProjectId("{project_id}");
        request.withPipelineId("{pipeline_id}");
        try {
            ShowPipelineRunDetailResponse response = client.showPipelineRunDetail(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcodeartspipeline.v2.region.codeartspipeline_region import CodeArtsPipelineRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcodeartspipeline.v2 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]

    credentials = BasicCredentials(ak, sk)

    client = CodeArtsPipelineClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CodeArtsPipelineRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowPipelineRunDetailRequest()
        request.project_id = "{project_id}"
        request.pipeline_id = "{pipeline_id}"
        response = client.show_pipeline_run_detail(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    codeartspipeline "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartspipeline/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartspipeline/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartspipeline/v2/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        Build()

    client := codeartspipeline.NewCodeArtsPipelineClient(
        codeartspipeline.CodeArtsPipelineClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ShowPipelineRunDetailRequest{}
	request.ProjectId = "{project_id}"
	request.PipelineId = "{pipeline_id}"
	response, err := client.ShowPipelineRunDetail(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.