Obtaining the Pipeline List
Function
This API is used to obtain the pipeline list.
Calling Method
For details, see Calling APIs.
URI
POST /v3/pipelines/list
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Obtain a token by calling the IAM API forobtaining a user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pipeline_name |
No |
String |
Definition: Pipeline name. Fuzzy match by name. Constraints: N/A Value range: N/A Default value: N/A |
project_ids |
No |
String |
Definition: (Optional) Project ID. If there are multiple project IDs, separate them with commas (,). The number of IDs ranges from 0 to 10. If this parameter is specified, the pipeline list of the corresponding project is obtained. If not, the pipeline list of all projects on which the user has permission is obtained. Constraints: N/A Value range: N/A Default value: N/A |
creator_ids |
No |
String |
Definition: (Optional) Creator ID. If there are multiple values, separate them with commas (,). The number of IDs ranges from 0 to 10. Constraints: N/A Value range: N/A Default value: N/A |
executor_ids |
No |
String |
Definition: ID of the user who executes the pipeline. (Optional) If there are multiple values, separate them with commas (,). The number of IDs ranges from 0 to 10. Constraints: N/A Value range: N/A Default value: N/A |
status |
No |
String |
Definition: Pipeline running status. Constraints: N/A Value range:
Default value: N/A |
outcome |
No |
String |
Definition: Pipeline execution result. Constraints: N/A Value range:
Default value: N/A |
sort_key |
No |
String |
Definition: (Optional) Field for sorting. Constraints: N/A Value range: N/A Default value: N/A |
sort_dir |
No |
String |
Definition: Sorting method. Constraints: N/A Value range:
Default value: N/A |
git_url |
No |
String |
Definition: Code repository address. Only CodeArts Repo repositories are supported, for example, git@codehub.XXX.git. Constraints: N/A Value range: N/A Default value: N/A |
offset |
No |
Integer |
Definition: Offset where the query starts. Constraints: N/A Value range: The offset value must be no less than 0. Default value: N/A |
limit |
No |
Integer |
Definition: Number of records of each query. Constraints: N/A Value range: 10–50. Default value: 10. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
offset |
Integer |
Definition: Offset where the query starts. Value range: The value is no less than 0. |
limit |
Integer |
Definition: Number of records of each query. Value range: The value is no less than 0. |
total |
Integer |
Definition: Total number of items. Value range: The value is no less than 0. |
result |
Array of PipelineBasicInfo objects |
Definition: Pipeline list. Value range: N/A |
Parameter |
Type |
Description |
---|---|---|
project_id |
String |
Definition: Project ID. Value range: The value consists of 32 characters, including digits and letters. |
project_name |
String |
Definition: Project name. Value range: N/A |
pipeline_id |
String |
Definition: Pipeline ID. Value range: The value consists of 32 characters, including digits and letters. |
pipeline_name |
String |
Definition: Pipeline name. Value range: N/A |
creator_id |
String |
Definition: Pipeline creator ID. Value range: The value consists of 32 characters, including digits and letters. |
creator_name |
String |
Definition: Pipeline creator name. Value range: N/A |
executor_id |
String |
Definition: ID of the user who executes the pipeline. Value range: The value consists of 32 characters, including digits and letters. |
executor_name |
String |
Definition: Name of the user who executes the pipeline. Value range: N/A |
start_time |
String |
Definition: Start time. Value range: N/A |
create_time |
String |
Definition: Creation time. Value range: N/A |
watched |
String |
Definition: Whether the user favorites the pipeline. Value range:
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Parameter description: Error message. Value range: N/A |
error_code |
String |
Parameter description: Error code. Value range: N/A |
Example Requests
This API is used to obtain the pipeline list.
Example: The project ID is e12ed176898d4841aa9881fe9b933c87 and the creator ID is 847a5317086c41798469d0868535943a. Pipelines are sorted by pipeline name in descending order.
POST https://{endpoint}/v3/pipelines/list { "pipeline_name" : "", "project_ids" : "e12ed176898d4841aa9881fe9b933c87", "creator_ids" : "847a5317086c41798469d0868535943a", "executor_ids" : "847a5317086c41798469d0868535943a", "status" : "waiting,running,verifying,handling,suspending,completed", "outcome" : "error,success,aborted", "sort_key" : "pipeline_name", "sort_dir" : "desc", "git_url" : "", "offset" : 4, "limit" : 10 }
Example Responses
Status code: 200
OK
{ "offset" : 0, "limit" : 10, "total" : 88, "result" : [ { "project_id" : "e12ed176898d4841aa9881fe9b933c87", "project_name" : "Pipeline_Beta_Automatic Test", "pipeline_id" : "d33f98177c3e44f8841b005e1badcaed", "pipeline_name" : "Ma Yunduo Cang", "creator_id" : "847a5317086c41798469d0868535943a", "creator_name" : "Big beta test account", "executor_id" : "847a5317086c41798469d0868535943a", "executor_name" : "Big beta test account", "start_time" : "2022-09-08 17:08:02", "create_time" : "2022-07-28 17:02:11", "watched" : "true" }, { "project_id" : "e12ed176898d4841aa9881fe9b933c87", "project_name" : "Pipeline_Beta_Automatic Test", "pipeline_id" : "2ec08a45031c4d2896292a48b7fb1a30", "pipeline_name" : "Dedicated Test for Access Control_Do Not Delete", "creator_id" : "847a5317086c41798469d0868535943a", "creator_name" : "Big beta test account", "executor_id" : "847a5317086c41798469d0868535943a", "executor_name" : "Big beta test account", "start_time" : "2022-09-08 16:52:03", "create_time" : "2020-10-29 17:05:02", "watched" : "true" } ] }
SDK Sample Code
The SDK sample code is as follows.
This API is used to obtain the pipeline list.
Example: The project ID is e12ed176898d4841aa9881fe9b933c87 and the creator ID is 847a5317086c41798469d0868535943a. Pipelines are sorted by pipeline name in descending order.
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 48 49 50 51 52 53 54 55 56 57 58 |
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 ListPipelineSimpleInfoSolution { 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(); ListPipelineSimpleInfoRequest request = new ListPipelineSimpleInfoRequest(); ListPipelineSimpleInfoRequestBody body = new ListPipelineSimpleInfoRequestBody(); body.withLimit(10); body.withOffset(4); body.withGitUrl(""); body.withSortDir("desc"); body.withSortKey("pipeline_name"); body.withOutcome("error,success,aborted"); body.withStatus("waiting,running,verifying,handling,suspending,completed"); body.withExecutorIds("847a5317086c41798469d0868535943a"); body.withCreatorIds("847a5317086c41798469d0868535943a"); body.withProjectIds("e12ed176898d4841aa9881fe9b933c87"); body.withPipelineName(""); request.withBody(body); try { ListPipelineSimpleInfoResponse response = client.listPipelineSimpleInfo(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()); } } } |
This API is used to obtain the pipeline list.
Example: The project ID is e12ed176898d4841aa9881fe9b933c87 and the creator ID is 847a5317086c41798469d0868535943a. Pipelines are sorted by pipeline name in descending order.
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 |
# 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 = ListPipelineSimpleInfoRequest() request.body = ListPipelineSimpleInfoRequestBody( limit=10, offset=4, git_url="", sort_dir="desc", sort_key="pipeline_name", outcome="error,success,aborted", status="waiting,running,verifying,handling,suspending,completed", executor_ids="847a5317086c41798469d0868535943a", creator_ids="847a5317086c41798469d0868535943a", project_ids="e12ed176898d4841aa9881fe9b933c87", pipeline_name="" ) response = client.list_pipeline_simple_info(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
This API is used to obtain the pipeline list.
Example: The project ID is e12ed176898d4841aa9881fe9b933c87 and the creator ID is 847a5317086c41798469d0868535943a. Pipelines are sorted by pipeline name in descending order.
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 48 49 50 51 52 53 54 55 56 57 58 59 |
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.ListPipelineSimpleInfoRequest{} limitListPipelineSimpleInfoRequestBody:= int32(10) offsetListPipelineSimpleInfoRequestBody:= int32(4) gitUrlListPipelineSimpleInfoRequestBody:= "" sortDirListPipelineSimpleInfoRequestBody:= "desc" sortKeyListPipelineSimpleInfoRequestBody:= "pipeline_name" outcomeListPipelineSimpleInfoRequestBody:= "error,success,aborted" statusListPipelineSimpleInfoRequestBody:= "waiting,running,verifying,handling,suspending,completed" executorIdsListPipelineSimpleInfoRequestBody:= "847a5317086c41798469d0868535943a" creatorIdsListPipelineSimpleInfoRequestBody:= "847a5317086c41798469d0868535943a" projectIdsListPipelineSimpleInfoRequestBody:= "e12ed176898d4841aa9881fe9b933c87" pipelineNameListPipelineSimpleInfoRequestBody:= "" request.Body = &model.ListPipelineSimpleInfoRequestBody{ Limit: &limitListPipelineSimpleInfoRequestBody, Offset: &offsetListPipelineSimpleInfoRequestBody, GitUrl: &gitUrlListPipelineSimpleInfoRequestBody, SortDir: &sortDirListPipelineSimpleInfoRequestBody, SortKey: &sortKeyListPipelineSimpleInfoRequestBody, Outcome: &outcomeListPipelineSimpleInfoRequestBody, Status: &statusListPipelineSimpleInfoRequestBody, ExecutorIds: &executorIdsListPipelineSimpleInfoRequestBody, CreatorIds: &creatorIdsListPipelineSimpleInfoRequestBody, ProjectIds: &projectIdsListPipelineSimpleInfoRequestBody, PipelineName: &pipelineNameListPipelineSimpleInfoRequestBody, } response, err := client.ListPipelineSimpleInfo(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 |
400 |
Bad request |
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