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 |
Project ID. |
pipeline_id |
Yes |
String |
Pipeline ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pipeline_run_id |
No |
String |
Pipeline run ID. |
Request 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
Parameter |
Type |
Description |
---|---|---|
id |
String |
Pipeline run ID. |
pipeline_id |
String |
Pipeline ID. |
manifest_version |
String |
Pipeline version. |
name |
String |
Pipeline name. |
description |
String |
Running description. |
is_publish |
Boolean |
Whether the pipeline is a change pipeline. |
executor_id |
String |
Executor ID. |
executor_name |
String |
Executor name. |
status |
String |
Status. |
trigger_type |
String |
Trigger type. |
run_number |
Integer |
Running number. |
start_time |
Long |
Start time. |
end_time |
Long |
End time. |
stages |
Array of StageRun objects |
Stage information. |
domain_id |
String |
Tenant ID. |
project_id |
String |
Project ID. |
region |
String |
Region. |
component_id |
String |
Component ID. |
language |
String |
Language. |
sources |
Array of RunPipelineSource objects |
Running source information. |
artifacts |
Array of PackageInfo objects |
Pipeline running product. |
subject_id |
String |
Pipeline run ID. |
group_id |
String |
Group ID. |
group_name |
String |
Group name. |
detail_url |
String |
Address of the details page. |
current_system_time |
Long |
Current system time. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Stage ID. |
category |
String |
Stage type. |
name |
String |
Stage name. |
identifier |
String |
Unique ID. |
run_always |
Boolean |
Always run or not. |
parallel |
String |
Parallel or not. |
is_select |
Boolean |
Selected or not. |
sequence |
Integer |
Serial number. |
depends_on |
Array of strings |
Dependency. |
condition |
String |
Running conditions. |
status |
String |
Status. |
start_time |
Long |
Start time. |
end_time |
Long |
End time. |
pre |
Array of StepRun objects |
Stage entry. |
post |
Array of StepRun objects |
Stage exit. |
jobs |
Array of JobRun objects |
Job. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Job ID. |
category |
String |
Job type. |
sequence |
Integer |
Serial number. |
async |
String |
Asynchronous or not. |
name |
String |
Job name. |
identifier |
String |
Unique job ID. |
depends_on |
Array of strings |
Dependency. |
condition |
String |
Running conditions. |
resource |
String |
Execution resource. |
is_select |
Boolean |
Selected or not. |
timeout |
String |
Job timeout settings. |
last_dispatch_id |
String |
Last delivery ID. |
status |
String |
Status. |
message |
String |
Error message. |
start_time |
Long |
Start time. |
end_time |
Long |
End time. |
steps |
Array of StepRun objects |
Step. |
exec_id |
String |
Job execution ID. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Step name. |
task |
String |
Step extension. |
business_type |
String |
Extension service type. |
inputs |
Array of inputs objects |
Enter a parameter. |
sequence |
Integer |
Serial number. |
official_task_version |
String |
Official extension version. |
identifier |
String |
Unique ID. |
multi_step_editable |
Integer |
Whether it is editable. |
id |
String |
Step ID. |
endpoint_ids |
Array of strings |
Endpoint. |
last_dispatch_id |
String |
ID of the last delivery task. |
status |
String |
Status. |
message |
String |
Error message. |
start_time |
Long |
Start time. |
end_time |
Long |
End time. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Enter a parameter name. |
value |
Object |
Enter a parameter value. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Source type. |
params |
params object |
Source parameters. |
Parameter |
Type |
Description |
---|---|---|
git_type |
String |
Code repository type. |
git_url |
String |
HTTPS address of the code repository. |
ssh_git_url |
String |
SSH address of the code repository. |
web_url |
String |
URL of the code repository. |
repo_name |
String |
Code repository name. |
default_branch |
String |
Default branch. |
endpoint_id |
String |
Endpoint ID. |
codehub_id |
String |
Repo repository ID. |
alias |
String |
Code repository alias. |
build_params |
build_params object |
Build parameters. |
Parameter |
Type |
Description |
---|---|---|
action |
String |
Event type of merge requests. |
build_type |
String |
By branch or by tag |
commit_id |
String |
Code repository commit ID. |
event_type |
String |
Event type for running. |
merge_id |
String |
Merge request ID. |
message |
String |
Code commit message. |
source_branch |
String |
Source branch. |
tag |
String |
Tag. |
target_branch |
String |
Target branch. |
codehub_id |
String |
Repo repository ID. |
source_codehub_id |
String |
Source Repo repository ID. |
source_codehub_url |
String |
Source Repo repository address. |
source_codehub_http_url |
String |
HTTP address of the source Repo repository. |
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 |
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.withPipelineRunId("<pipeline_run_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 |
# 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.pipeline_run_id = "<pipeline_run_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{} pipelineRunIdRequest:= "<pipeline_run_id>" request.PipelineRunId = &pipelineRunIdRequest 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