Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance (CCI)
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying Pipeline Details

Function

Querying Pipeline Details

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/api/pipelines/{pipeline_id}

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.

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

id

String

Parameter description:

Pipeline ID.

Value range:

32 characters, including only digits and letters.

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 description.

Value range:

Up to 1024 characters.

manifest_version

String

Parameter description:

Pipeline version.

Value range:

The default value is 3.0.

region

String

Parameter description:

Region.

Value range:

None.

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.

component_id

String

Parameter description:

Microservice ID.

Value range:

None.

is_publish

Boolean

Parameter description:

Whether the pipeline is a change-triggered pipeline.

Value Range:

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

creator_id

String

Parameter description:

Creator ID.

Value range:

32 characters, including only digits and letters.

creator_name

String

Parameter description:

Creator name.

Value range:

None.

updater_id

String

Parameter description:

Updater ID.

Value range:

32 characters, including only digits and letters.

create_time

Long

Parameter description:

Creation time.

Value range:

None.

update_time

Long

Parameter description:

Update time.

Value range:

None.

is_collect

Boolean

Parameter description:

Whether the pipeline is added to favorites.

Value Range:

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

sources

Array of PipelineSource objects

Parameter description:

Pipeline source.

Value range:

None.

variables

Array of PipelineVariable objects

Parameter description:

Custom pipeline parameters.

Value range:

None.

schedules

Array of PipelineSchedule objects

Parameter description:

Settings of pipeline scheduled tasks.

Value range:

None.

triggers

Array of PipelineTrigger objects

Parameter description:

Settings of pipeline event triggers.

Value range:

None.

group_id

String

Parameter description:

ID of the group to which the pipeline belongs.

Value range:

None.

definition

String

Parameter description:

Pipeline definition JSON.

Value range:

None.

Table 4 PipelineSource

Parameter

Type

Description

type

String

Parameter description:

Pipeline source type.

Value range:

N/A

params

PipelineSourceParam object

Parameter description:

Pipeline source parameters.

Value range:

N/A

Table 5 PipelineSourceParam

Parameter

Type

Description

alias

String

Parameter description:

Code/Artifact source parameter – Alias of the code repository/artifact source.

Value range:

The value can contain a maximum of 128 characters, including letters, digits, and underscores (_).

git_type

String

Parameter description:

Git type.

Value range:

N/A

codehub_id

String

Parameter description:

Repo ID.

Value range:

N/A

endpoint_id

String

Parameter description:

Endpoint ID.

Value range:

N/A

default_branch

String

Parameter description:

Default branch.

Value range:

N/A

git_url

String

Parameter description:

Git URL.

Value range:

N/A

ssh_git_url

String

Parameter description:

ssh_git URL.

Value range:

N/A

web_url

String

Parameter description:

Web page URL.

Value range:

N/A

repo_name

String

Parameter description:

Pipeline source name.

Value range:

N/A

artifact_type

String

Parameter description:

Artifact source type.

Value range:

generic and docker are available.

artifact_type_name

String

Parameter description:

Artifact source type name.

Value range:

N/A

branch_filter

String

Parameter description:

Branch filter.

Value range:

N/A

directory

String

Parameter description:

Directory.

Value range:

N/A

directory_id

String

Parameter description:

Directory ID.

Value range:

N/A

organization

String

Parameter description:

Docker organization.

Value range:

N/A

package_name

String

Parameter description:

Package name.

Value range:

N/A

version

String

Parameter description:

Version.

Value range:

N/A

version_strategy

String

Parameter description:

Policy to obtain the artifact source version.

Value range:

latest and specificVersion are available.

source_system

String

Parameter description:

Artifact source name.

Value range:

N/A

Table 6 PipelineVariable

Parameter

Type

Description

name

String

Parameter description:

Parameter name.

Value range:

N/A

sequence

Integer

Parameter description:

Sequence number.

Value range:

1–2147483647

type

String

Parameter description:

Type.

Value range:

N/A

value

String

Parameter description:

Default value.

Value range:

N/A

is_secret

Boolean

Parameter description:

Whether the parameter is private.

Value range:

true: private; false: not private.

description

String

Parameter description:

Description.

Value range:

N/A

is_runtime

Boolean

Parameter description:

Whether a parameter can be set during runtime.

Value range:

true: The parameter can be set during runtime; false: The parameter cannot be set during runtime.

limits

Array of strings

Parameter description:

List of limited enumerated values.

Value range:

N/A

is_reset

Boolean

Parameter description:

Whether an auto-increment parameter is reset.

Value range:

true: reset; false: not reset.

latest_value

String

Parameter description:

The latest value of an auto-increment parameter.

Value range:

N/A

Table 7 PipelineSchedule

Parameter

Type

Description

uuid

String

Parameter description:

ID of a scheduled task.

Constraints:

None.

Value range:

None.

Default value:

None.

type

String

Parameter description:

Job type.

Constraints:

None.

Value range:

Only fixed is supported.

Default value:

None.

name

String

Parameter description:

Job name.

Constraints:

None.

Value range:

None.

Default value:

None.

enable

String

Parameter description:

Whether to enable.

Constraints:

None.

Value range:

None.

Default value:

None.

days_of_week

Array of integers

Parameter description:

Specific execution day in a week. Sunday to Saturday: 1 to 7.

Constraints:

N/A.

Value Range:

N/A.

Default value:

N/A.

time_zone

String

Parameter description:

Time zone.

Constraints:

None.

Value range:

"China Standard Time", "GMT Standard Time", "South Africa Standard Time", "Russian Standard Time", "SE Asia Standard Time", "Singapore Standard Time", "Pacific SA Standard Time", "E. South America Standard Time", "Central Standard Time (Mexico)", "Egypt Standard Time", "Saudi Arabia Standard Time".

Default value:

None.

Table 8 PipelineTrigger

Parameter

Type

Description

pipeline_id

String

Parameter description:

Pipeline ID.

Constraints:

None.

Value range:

32 characters, including letters and digits.

Default value:

None.

git_url

String

Parameter description:

Git repository URL.

Constraints:

None.

Value range:

32 characters, including letters and digits.

Default value:

None.

git_type

String

Parameter description:

Git repository type.

Constraints:

None.

Value range:

The options include CodeHub, Gitee, GitHub, GitCode, and GitLab.

Default value:

None.

is_auto_commit

Boolean

Parameter description:

Whether to automatically commit code. This feature is only available for Gitee repositories. After a webhook triggers a pipeline, a comment is automatically added.

Constraints:

N/A.

Value Range:

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

Default value:

N/A.

events

Array of CodeEvent objects

Parameter description:

Trigger event list.

Constraints:

None.

Value range:

None.

Default value:

None.

hook_id

String

Parameter description:

Callback ID generated by the system.

Constraints:

None.

Value range:

None.

Default value:

None.

repo_id

String

Parameter description:

Repo repository ID.

Constraints:

None.

Value range:

None.

Default value:

None.

endpoint_id

String

Parameter description:

Code source endpoint ID.

Constraints:

N/A.

Value Range:

The value contains 32 characters, including letters and digits.

Default value:

N/A.

callback_url

String

Parameter description:

Callback URL, which is generated when a webhook is registered.

Constraints:

None.

Value range:

None.

Default value:

None.

security_token

String

Parameter description:

User token, which is generated when a webhook is registered.

Constraints:

None.

Value range:

None.

Default value:

None.

Table 9 CodeEvent

Parameter

Type

Description

type

String

Parameter description:

Event type.

Constraints:

N/A

Value range:

merge_request: MR; push: code push; tag_push: tag; issue: Gitee repository issue; note: Gitee repository comment.

Default value:

N/A

enable

Boolean

Parameter description:

Whether it is available.

Constraints:

N/A.

Value Range:

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

Default value:

N/A.

Example Requests

GET https://{endpoint}/v5/6428c2e2b4b64affa14ec80896695c49/api/pipelines/633839ac12a2465ba86dfc5cd212ee1a

Example Responses

Status code: 200

OK

{
  "id" : "9777b6f14dca47ab8e411512b8301698",
  "name" : "New Pipeline - 20230222110358",
  "description" : "",
  "manifest_version" : "3.0",
  "region" : "region",
  "domain_id" : "ce8df55870164338a72d7e828a966a2a",
  "project_id" : "f83ef803e04e4fe8834ddaf18ffd9d8f",
  "component_id" : "",
  "is_publish" : false,
  "creator_id" : "847a5317086c41798469d0868535943a",
  "creator_name" : "Beta environment account",
  "updater_id" : "847a5317086c41798469d0868535943a",
  "create_time" : 1676116509000,
  "update_time" : 1690785914000,
  "is_collect" : true,
  "sources" : [ ],
  "variables" : [ ],
  "schedules" : [ {
    "uuid" : "38e10252a4ea48c594f744bb4fc1411c",
    "type" : "fixed",
    "name" : "Scheduled task_1",
    "enable" : true,
    "days_of_week" : [ 2, 3, 4, 5, 6 ],
    "time_zone" : "China Standard Time"
  } ],
  "triggers" : [ ],
  "group_id" : null,
  "definition" : "{\"stages\":[{\"name\":\"Delayed execution of phase _1\",\"sequence\":\"0\",\"jobs\":[{\"id\":\"\",\"stage_id\":1677035050256,\"identifier\":\"167703505025720bcc960-2929-457f-91e5-9099556cc478\",\"name\": \"\",\"depends_on\":[] ,\"timeout\":\"\",\"timeout_unit\":\"\",\"steps\": [{\"name\":\"Delayed execution of \",\"task\":\"official_devcloud_delay\",\"sequence\":0,\"inputs\":[{\"key\":\"timer_type\",\"value\":\"delay\"},{\"key\":\"delay_time\",\"value\":10},{\"key\":\"scheduled_time\",\"value\":\"\"},{\"key\":\"time_zone\",\"value\":\"China Standard Time\"}] ,\"business_type\":\"Normal\",\"runtime_attribution\":\"agentless\",\"identifier\":\"1677035056887f508df54-eff9-4f47-b67d-0629917599e9\",\"multi_step_editable\":0,\"official_task_version\":\"0.0.3\"}],\"exec_type\":\"AGENTLESS_JOB\",\"sequence\":0,\"pipeline_id\":\"62bc8c36ab1a4ef9831df98e88c33c69\"}],\"identifier\":\"0\",\"pre\":[{\"task\":\"official_devcloud_autoTrigger\",\"sequence\":0}],\"post\":null,\"depends_on\":[],\"run_always\":false,\"pipeline_id\":\"62bc8c36ab1a4ef9831df98e88c33c69\"}]}"
}

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 ShowPipelineDetailSolution {

    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();
        ShowPipelineDetailRequest request = new ShowPipelineDetailRequest();
        request.withProjectId("{project_id}");
        request.withPipelineId("{pipeline_id}");
        try {
            ShowPipelineDetailResponse response = client.showPipelineDetail(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 = ShowPipelineDetailRequest()
        request.project_id = "{project_id}"
        request.pipeline_id = "{pipeline_id}"
        response = client.show_pipeline_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.ShowPipelineDetailRequest{}
	request.ProjectId = "{project_id}"
	request.PipelineId = "{pipeline_id}"
	response, err := client.ShowPipelineDetail(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.

 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 ShowPipelineDetailSolution {

    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();
        ShowPipelineDetailRequest request = new ShowPipelineDetailRequest();
        request.withProjectId("{project_id}");
        request.withPipelineId("{pipeline_id}");
        try {
            ShowPipelineDetailResponse response = client.showPipelineDetail(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 = ShowPipelineDetailRequest()
        request.project_id = "{project_id}"
        request.pipeline_id = "{pipeline_id}"
        response = client.show_pipeline_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.ShowPipelineDetailRequest{}
	request.ProjectId = "{project_id}"
	request.PipelineId = "{pipeline_id}"
	response, err := client.ShowPipelineDetail(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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback