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
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 |
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
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
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:
|
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:
|
trigger_type |
String |
Definition: Pipeline trigger type.
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. |
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:
|
parallel |
String |
Parameter description: Whether to execute jobs in parallel. Value range: None. |
is_select |
Boolean |
Definition: Selected or not. Value range:
|
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:
|
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 |
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:
|
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:
|
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:
|
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. |
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:
|
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:
|
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:
|
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 |
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. |
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 |
Parameter |
Type |
Description |
---|---|---|
git_type |
String |
Definition: Code repository type. Value range:
|
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 |
Parameter |
Type |
Description |
---|---|---|
action |
String |
Definition: Merge request type. Value range:
|
build_type |
String |
Definition: Triggered by a branch or a tag. Value range:
|
commit_id |
String |
Parameter description: Code repository commit ID. Value range: None. |
event_type |
String |
Definition: CodeArts project ID. Value range:
|
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. |
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot