Help Center/ CodeArts Pipeline/ API Reference/ API/ Pipeline Management/ Obtaining Pipeline Status/Obtaining Pipeline Execution Details
Updated on 2025-03-25 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

Parameter description:

CodeArts project ID.

Constraints:

N/A.

Value Range:

The value contains 32 characters.

Default value:

N/A.

pipeline_id

Yes

String

Parameter description:

Pipeline ID.

Constraints:

N/A.

Value Range:

The value contains 32 characters.

Default value:

N/A.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

pipeline_run_id

No

String

Parameter description:

Pipeline run ID.

Constraints:

None.

Value range:

32 characters, including only digits and letters.

Default value:

None.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Parameter description:

User token.

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

Constraints:

None.

Value range:

None.

Default value:

None.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

String

Parameter description:

Pipeline run ID.

Value range:

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

Parameter description:

Pipeline running description.

Value range:

Up to 1024 characters.

is_publish

Boolean

Parameter description:

Whether the pipeline is a change-triggered pipeline.

Value Range:

The value can be "true" or "false".

executor_id

String

Parameter description:

Executor ID.

Value range:

32 characters, including only digits and letters.

executor_name

String

Parameter description:

Executor name.

Value range:

None.

status

String

Parameter description:

Pipeline run status.

Value Range:

COMPLETED: completed; RUNNING: running; FAILED: failed; CANCELED: canceled; PAUSED: paused; SUSPEND: suspended; IGNORED: ignored.

trigger_type

String

Parameter description:

Trigger type.

Value range:

Manual: manual trigger; Scheduler: scheduled task; Rollback: rollback execution; Webhook, which includes: CreateTag: tag trigger; Note: Gitee repository comment; Issue: Gitee repository issue; MR: merge request; Push: code push.

run_number

Integer

Parameter description:

Pipeline running sequence number.

Value range:

No less than 1.

start_time

Long

Parameter description:

Start time.

Value range:

None.

end_time

Long

Parameter description:

End time.

Value range:

None.

stages

Array of StageRun objects

Parameter description:

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

Constraints:

N/A.

domain_id

String

Parameter description:

Tenant ID.

Value range:

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

Parameter description:

Microservice ID.

Value range:

None.

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

Parameter description:

Pipeline run ID.

Value range:

None.

group_id

String

Parameter description:

Group ID.

Value range:

32 characters.

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

Parameter description:

Stage ID.

Value range:

32 characters.

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

Parameter description:

Whether to always run.

Value Range:

The value can be "true" or "false".

parallel

String

Parameter description:

Whether to execute jobs in parallel.

Value range:

None.

is_select

Boolean

Parameter description:

Whether to select.

Value range:

None.

sequence

Integer

Parameter description:

Serial number.

Value range:

No less than 0.

depends_on

Array of strings

Parameter description:

Dependency.

Value range:

None.

condition

String

Parameter description:

Running conditions.

Value range:

None.

status

String

Parameter description:

Status.

Value Range:

INIT: initialization; QUEUED: queuing; RUNNING: running; CANCELED: canceled; COMPLETED: completed; FAILED: failed; SKIPPED: skipped; IGNORED: ignored; PAUSED: paused, SUSPEND: suspended; ASYNC_RUNNING: asynchronous running; ASYNC_FAILED: asynchronous failure; UNSELECTED: not selected; REDISPATCH: rescheduling.

start_time

Long

Parameter description:

Start time.

Value range:

None.

end_time

Long

Parameter description:

End time.

Value range:

None.

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

Parameter description:

Job.

Value range:

None.

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

Parameter description:

Whether it is asynchronous.

Value Range:

The value can be "true" or "false".

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

Parameter description:

Whether the parameter is selected.

Value Range:

The value can be "true" or "false".

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

Parameter description:

Status.

Value Range:

INIT: initialization; QUEUED: queuing; RUNNING: running; CANCELED: canceled; COMPLETED: completed; FAILED: failed; SKIPPED: skipped; IGNORED: ignored; PAUSED: paused, SUSPEND: suspended; ASYNC_RUNNING: asynchronous running; ASYNC_FAILED: asynchronous failure; UNSELECTED: not selected; REDISPATCH: rescheduling.

message

String

Parameter description:

Error message.

Value range:

None.

start_time

Long

Parameter description:

Start time.

Value range:

None.

end_time

Long

Parameter description:

End time.

Value range:

None.

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

Parameter description:

Extension type.

Value Range:

Normal, Build, Test, Check, and 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

Parameter description:

Whether the parameter is editable.

Value Range:

The value can be "true" or "false".

id

String

Parameter description:

Step ID.

Value range:

32 characters.

endpoint_ids

Array of strings

Parameter description:

Endpoint ID list.

Value range:

None.

last_dispatch_id

String

Parameter description:

ID of the last delivery job.

Value range:

32 characters.

status

String

Parameter description:

Status.

Value range:

RUNNING, CANCELED, COMPLETED, and FAILED.

message

String

Parameter description:

Error message.

Value range:

None.

start_time

Long

Parameter description:

Start time.

Value range:

None.

end_time

Long

Parameter description:

End time.

Value range:

None.

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

Parameter description:

Code repository type.

Value range:

The options include CodeHub, Gitee, GitHub, GitCode, and 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

Parameter description:

Merge request event type.

Value range:

The value can be open, reopen, update, or merge.

build_type

String

Parameter description:

Triggered by branch or by 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

Parameter description:

CodeArts project ID.

Value range:

Manual: manual trigger; Scheduler: scheduled task; Rollback: rollback execution; Webhook, which includes: CreateTag: tag trigger; Note: Gitee repository comment; Issue: Gitee repository issue; MR: merge request; Push: code push.

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" : "region01",
  "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.