Querying Pipeline Details
Function
Querying Pipeline Details
Calling Method
For details, see Calling APIs.
URI
GET /v5/{project_id}/api/pipelines/{pipeline_id}
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
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
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. |
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 |
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 |
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 |
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. |
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. |
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.
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