更新时间:2024-08-29 GMT+08:00
分享

修改流水线信息

功能介绍

修改流水线信息

调用方法

请参见如何调用API

URI

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

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释: CodeArts项目ID。 约束限制: 不涉及 取值范围: 32位字符。 默认取值: 不涉及。

pipeline_id

String

参数解释: 流水线ID。 约束限制: 不涉及 取值范围: 32位字符。 默认取值: 不涉及。

表2 Query参数

参数

是否必选

参数类型

描述

component_id

String

微服务ID

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释: 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

表4 请求Body参数

参数

是否必选

参数类型

描述

name

String

参数解释: 流水线名称。 约束限制: 不涉及。 取值范围: 仅包含中文、大小写英文字母、数字、'-'和'_',且长度为[1,128]个字符。 默认取值: 不涉及。

description

String

参数解释: 流水线描述。 约束限制: 不涉及。 取值范围: 最长1024字符。 默认取值: 不涉及。

is_publish

Boolean

参数解释: 是否为变更流水线。 约束限制: 不涉及。 取值范围: true - 变更流水线、false - 非变更流水线。 默认取值: 不涉及。

sources

Array of CodeSource objects

参数解释: 流水线源信息。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

variables

Array of CustomVariable objects

参数解释: 流水线自定义全局变量列表。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

schedules

Array of PipelineSchedule objects

参数解释: 流水线定时执行配置列表。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

triggers

Array of PipelineTrigger objects

参数解释: 流水线代码事件触发配置。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

manifest_version

String

参数解释: 流水线结构定义版本。 约束限制: 不涉及。 取值范围: 默认为3.0。 默认取值: 不涉及。

definition

String

参数解释: 流水线结构定义JSON。该字段结构复杂,建议使用页面编辑流水线后,从流水线详情接口获取。 约束限制: 不涉及。 取值范围: 默认为3.0。 默认取值: 不涉及。

project_name

String

参数解释: 项目名称。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

group_id

String

参数解释: 流水线组ID。 约束限制: 不涉及。 取值范围: 32位字符,仅由数字和字母组成。 默认取值: 不涉及。

id

String

参数解释: 复制场景使用,为流水线组ID。 约束限制: 不涉及。 取值范围: 32位字符,仅由数字和字母组成。 默认取值: 不涉及。

concurrency_control

PipelineConcurrencyMgmt object

参数解释: 流水线并发控制信息。 约束限制: 不涉及。 取值范围: 32位字符串。 默认取值: 不涉及。

表5 CodeSource

参数

是否必选

参数类型

描述

type

String

参数解释: 流水线源类型。 约束限制: 不涉及。 取值范围: 目前支持“code”代码源类型。 默认取值: 不涉及。

params

params object

参数解释: 流水线源参数,包含流水线源的详细信息。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

表6 params

参数

是否必选

参数类型

描述

git_type

String

参数解释: 代码仓类型。 约束限制: 不涉及。 取值范围: 目前支持“codhub”,“gitee”,“github”,“gitcode”,“gitlab”代码仓类型。 默认取值: 不涉及。

codehub_id

String

参数解释: CodeArts Repo代码仓ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

endpoint_id

String

参数解释: 代码源扩展点ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

default_branch

String

参数解释: 默认分支。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

git_url

String

参数解释: Git仓库https地址,例如https://example.com/CloudPipelinezycs00001/2000.git。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

ssh_git_url

String

参数解释: ssh_git链接地址,例如https://example.com/CloudPipelinezycs00001/2000.git。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

web_url

String

参数解释: 网页url。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

repo_name

String

参数解释: 流水线源名称。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

alias

String

参数解释: 代码仓别名。别名仅支持输入大小写英文字母、数字、“_”,至多128个字符。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

表7 CustomVariable

参数

是否必选

参数类型

描述

pipeline_id

String

参数解释: 流水线ID。 约束限制: 不涉及。 取值范围: 32位字符。 默认取值: 不涉及。

name

String

参数解释: 自定义参数名称。 约束限制: 不涉及。 取值范围: 32位字符。 默认取值: 不涉及。

sequence

Integer

参数解释: 参数序号,从1开始。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

type

String

参数解释: 自定义参数类型。 约束限制: 不涉及。 取值范围: autoIncrement - 自增长参数,enum - 枚举参数,string - 字符串参数。 默认取值: 不涉及。

value

String

参数解释: 自定义参数默认值。 约束限制: 不涉及。 取值范围: 最长8192字符。 默认取值: 不涉及。

is_secret

Boolean

参数解释: 是否私密参数。 约束限制: 不涉及。 取值范围: true - 是私密参数,false - 不是私密参数。 默认取值: false。

description

String

参数解释: 参数描述。 约束限制: 不涉及。 取值范围: 最长1024字符。 默认取值: 不涉及。

is_runtime

Boolean

参数解释: 是否运行时设置参数。 约束限制: 不涉及。 取值范围: true - 是运行时设置参数,false - 不是运行时设置参数。 默认取值: false。

limits

Array of objects

参数解释: 枚举值列表。 约束限制: 不涉及。 取值范围: 每个枚举值不超过1024字符。 默认取值: 不涉及。

is_reset

Boolean

参数解释: 是否重置。自增长参数被编辑,则使用编辑后的值,否则进行末位数字递增。 约束限制: 不涉及。 取值范围: true - 使用编辑后的参数值,false - 使用自增长参数。 默认取值: false

latest_value

String

参数解释: 最后一次参数值。 约束限制: 不涉及。 取值范围: 最长8192字符。 默认取值: 不涉及。

runtime_value

String

参数解释: 运行时传入值。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

表8 PipelineSchedule

参数

是否必选

参数类型

描述

uuid

String

参数解释: 定时任务ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

type

String

参数解释: 任务类型。 约束限制: 不涉及。 取值范围: 只支持fixed。 默认取值: 不涉及。

name

String

参数解释: 任务名称。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

enable

String

参数解释: 是否启用。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

days_of_week

Array of integers

参数解释: 一周内具体执行日。周日至周六对应1-7 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

time_zone

String

参数解释: 时区。 约束限制: 不涉及。 取值范围: "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"。 默认取值: 不涉及。

表9 PipelineTrigger

参数

是否必选

参数类型

描述

pipeline_id

String

参数解释: 流水线ID。 约束限制: 不涉及。 取值范围: 32位字符,包含中英文、数字。 默认取值: 不涉及。

git_url

String

参数解释: 代码仓git链接。 约束限制: 不涉及。 取值范围: 32位字符,包含中英文、数字。 默认取值: 不涉及。

git_type

String

参数解释: git代码仓类型。 约束限制: 不涉及。 取值范围: 可选codehub,gitee,github,gitcode,gitlab。 默认取值: 不涉及。

is_auto_commit

Boolean

参数解释: 是否自动提交。gitee仓库特有,webhook触发流水线后,自动添加评论。 约束限制: 不涉及。 取值范围: true、false。 默认取值: 不涉及。

events

Array of CodeEvent objects

参数解释: 触发事件列表。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

hook_id

String

参数解释: 系统生成的回调ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

repo_id

String

参数解释: Repo仓库ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

endpoint_id

String

参数解释: 代码源扩展点ID。 约束限制: 不涉及 取值范围: 32位字符,包含中英文、数字。 默认取值: 不涉及

callback_url

String

参数解释: 回调链接,注册Webhook时生成。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

security_token

String

参数解释: 用户token,注册Webhook时生成。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

表10 CodeEvent

参数

是否必选

参数类型

描述

type

String

参数解释: 事件类型。 约束限制: 不涉及。 取值范围: merge_request - MR 触发,push - 代码Push触发,tag_push - 标签触发,issue - Gitee仓库ISSUE触发,note - Gitee仓库评论触发。 默认取值: 不涉及。

enable

Boolean

参数解释: 是否可用。 约束限制: 不涉及。 取值范围: true、false。 默认取值: 不涉及。

表11 PipelineConcurrencyMgmt

参数

是否必选

参数类型

描述

pipeline_id

String

参数解释: 流水线ID。 约束限制: 不涉及。 取值范围: 32位字符串。 默认取值: 不涉及。

concurrency_number

Integer

参数解释: 流水线并发个数,最大并发受套餐和购买并发数限制。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

exceed_action

String

参数解释: 超出情况下策略。 约束限制: 不涉及。 取值范围: ABORT - 忽略不执行,QUEUE - 排队等待。 默认取值: 不涉及。

create_time

Long

参数解释: 创建时间。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

update_time

Long

参数解释: 更新时间。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。

enable

Boolean

参数解释: 是否启用。 约束限制: 不涉及。 取值范围: true,false。 默认取值: 不涉及。

响应参数

状态码: 200

表12 响应Body参数

参数

参数类型

描述

pipeline_id

String

参数解释: 流水线ID。 取值范围: 32位字符,仅由数字和字母组成。

请求示例

PUT https://{endpoint}/v5/d80a8a6530324b7bac972cbb8a9f28ec/api/pipelines/dab5232b7b354b6db37e695690218c9b

{
  "id" : "c0473f77481c4a12b254012876df71b6",
  "name" : "新建流水线-20240202101359",
  "description" : null,
  "manifest_version" : 3.0,
  "is_publish" : false,
  "sources" : [ ],
  "variables" : [ ],
  "schedules" : null,
  "triggers" : [ ],
  "project_name" : null,
  "group_id" : null,
  "concurrency_control" : {
    "pipeline_id" : null,
    "concurrency_number" : 5,
    "exceed_action" : "ABORT",
    "create_time" : null,
    "update_time" : null,
    "enable" : false
  },
  "definition" : "{\"stages\":[{\"name\":\"阶段_1\",\"sequence\":\"0\",\"jobs\":[{\"id\":\"\",\"stage_id\":1706840051315,\"identifier\":\"JOB_HwdAJ\",\"name\":\"Subpipeline\",\"depends_on\":[],\"timeout\":\"\",\"timeout_unit\":\"\",\"steps\":[{\"name\":\"Subpipeline\",\"task\":\"official_devcloud_subPipeline\",\"sequence\":0,\"inputs\":[{\"key\":\"SYSTEM_DEVCLOUD_SUBPIPELINE_TRIGGER_ID\",\"value\":\"dab5232b7b354b6db37e695690218c9b\"},{\"key\":\"_OFFICIAL_DEVCLOUD_JOB_NAME_\",\"value\":\"新建流水线-空\"},{\"key\":\"_OFFICIAL_DEVCLOUD_JOB_VERSION_\",\"value\":\"3.0\"}],\"business_type\":\"Normal\",\"runtime_attribution\":\"agent\",\"identifier\":\"1706840079615af0c7bda-8885-4c31-b9e8-1b393b5b0e97\",\"multi_step_editable\":0,\"official_task_version\":\"0.0.18\",\"endpoint_ids\":[]}],\"resource\":\"{\\\"type\\\":\\\"system\\\",\\\"arch\\\":\\\"x86\\\"}\",\"condition\":\"${{ default() }}\",\"exec_type\":\"OCTOPUS_JOB\",\"sequence\":0,\"pipeline_id\":\"c0473f77481c4a12b254012876df71b6\"}],\"identifier\":\"1706840051315bca51592-c211-49fe-ab76-bcf86f5efa84\",\"pre\":[{\"task\":\"official_devcloud_autoTrigger\",\"sequence\":0}],\"post\":null,\"depends_on\":[],\"run_always\":false,\"pipeline_id\":\"c0473f77481c4a12b254012876df71b6\"}]}"
}

响应示例

状态码: 200

OK

{
  "pipeline_id" : "8bfbd69eac154a0da341705a36294aca"
}

SDK代码示例

SDK代码示例如下。

 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 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.*;

import java.util.List;
import java.util.ArrayList;

public class UpdatePipelineInfoSolution {

    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();
        UpdatePipelineInfoRequest request = new UpdatePipelineInfoRequest();
        PipelineDTO body = new PipelineDTO();
        PipelineConcurrencyMgmt concurrencyControlbody = new PipelineConcurrencyMgmt();
        concurrencyControlbody.withConcurrencyNumber(5)
            .withExceedAction("ABORT")
            .withEnable(false);
        body.withConcurrencyControl(concurrencyControlbody);
        body.withId("c0473f77481c4a12b254012876df71b6");
        body.withDefinition("{"stages":[{"name":"阶段_1","sequence":"0","jobs":[{"id":"","stage_id":1706840051315,"identifier":"JOB_HwdAJ","name":"Subpipeline","depends_on":[],"timeout":"","timeout_unit":"","steps":[{"name":"Subpipeline","task":"official_devcloud_subPipeline","sequence":0,"inputs":[{"key":"SYSTEM_DEVCLOUD_SUBPIPELINE_TRIGGER_ID","value":"dab5232b7b354b6db37e695690218c9b"},{"key":"_OFFICIAL_DEVCLOUD_JOB_NAME_","value":"新建流水线-"},{"key":"_OFFICIAL_DEVCLOUD_JOB_VERSION_","value":"3.0"}],"business_type":"Normal","runtime_attribution":"agent","identifier":"1706840079615af0c7bda-8885-4c31-b9e8-1b393b5b0e97","multi_step_editable":0,"official_task_version":"0.0.18","endpoint_ids":[]}],"resource":"{\"type\":\"system\",\"arch\":\"x86\"}","condition":"${{ default() }}","exec_type":"OCTOPUS_JOB","sequence":0,"pipeline_id":"c0473f77481c4a12b254012876df71b6"}],"identifier":"1706840051315bca51592-c211-49fe-ab76-bcf86f5efa84","pre":[{"task":"official_devcloud_autoTrigger","sequence":0}],"post":null,"depends_on":[],"run_always":false,"pipeline_id":"c0473f77481c4a12b254012876df71b6"}]}");
        body.withManifestVersion("3.0");
        body.withIsPublish(false);
        body.withName("新建流水线-20240202101359");
        request.withBody(body);
        try {
            UpdatePipelineInfoResponse response = client.updatePipelineInfo(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
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 = UpdatePipelineInfoRequest()
        concurrencyControlbody = PipelineConcurrencyMgmt(
            concurrency_number=5,
            exceed_action="ABORT",
            enable=False
        )
        request.body = PipelineDTO(
            concurrency_control=concurrencyControlbody,
            id="c0473f77481c4a12b254012876df71b6",
            definition="{"stages":[{"name":"阶段_1","sequence":"0","jobs":[{"id":"","stage_id":1706840051315,"identifier":"JOB_HwdAJ","name":"Subpipeline","depends_on":[],"timeout":"","timeout_unit":"","steps":[{"name":"Subpipeline","task":"official_devcloud_subPipeline","sequence":0,"inputs":[{"key":"SYSTEM_DEVCLOUD_SUBPIPELINE_TRIGGER_ID","value":"dab5232b7b354b6db37e695690218c9b"},{"key":"_OFFICIAL_DEVCLOUD_JOB_NAME_","value":"新建流水线-"},{"key":"_OFFICIAL_DEVCLOUD_JOB_VERSION_","value":"3.0"}],"business_type":"Normal","runtime_attribution":"agent","identifier":"1706840079615af0c7bda-8885-4c31-b9e8-1b393b5b0e97","multi_step_editable":0,"official_task_version":"0.0.18","endpoint_ids":[]}],"resource":"{\"type\":\"system\",\"arch\":\"x86\"}","condition":"${{ default() }}","exec_type":"OCTOPUS_JOB","sequence":0,"pipeline_id":"c0473f77481c4a12b254012876df71b6"}],"identifier":"1706840051315bca51592-c211-49fe-ab76-bcf86f5efa84","pre":[{"task":"official_devcloud_autoTrigger","sequence":0}],"post":null,"depends_on":[],"run_always":false,"pipeline_id":"c0473f77481c4a12b254012876df71b6"}]}",
            manifest_version="3.0",
            is_publish=False,
            name="新建流水线-20240202101359"
        )
        response = client.update_pipeline_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)
 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
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.UpdatePipelineInfoRequest{}
	concurrencyNumberConcurrencyControl:= int32(5)
	exceedActionConcurrencyControl:= "ABORT"
	enableConcurrencyControl:= false
	concurrencyControlbody := &model.PipelineConcurrencyMgmt{
		ConcurrencyNumber: &concurrencyNumberConcurrencyControl,
		ExceedAction: &exceedActionConcurrencyControl,
		Enable: &enableConcurrencyControl,
	}
	idPipelineDto:= "c0473f77481c4a12b254012876df71b6"
	manifestVersionPipelineDto:= "3.0"
	request.Body = &model.PipelineDto{
		ConcurrencyControl: concurrencyControlbody,
		Id: &idPipelineDto,
		Definition: "{"stages":[{"name":"阶段_1","sequence":"0","jobs":[{"id":"","stage_id":1706840051315,"identifier":"JOB_HwdAJ","name":"Subpipeline","depends_on":[],"timeout":"","timeout_unit":"","steps":[{"name":"Subpipeline","task":"official_devcloud_subPipeline","sequence":0,"inputs":[{"key":"SYSTEM_DEVCLOUD_SUBPIPELINE_TRIGGER_ID","value":"dab5232b7b354b6db37e695690218c9b"},{"key":"_OFFICIAL_DEVCLOUD_JOB_NAME_","value":"新建流水线-"},{"key":"_OFFICIAL_DEVCLOUD_JOB_VERSION_","value":"3.0"}],"business_type":"Normal","runtime_attribution":"agent","identifier":"1706840079615af0c7bda-8885-4c31-b9e8-1b393b5b0e97","multi_step_editable":0,"official_task_version":"0.0.18","endpoint_ids":[]}],"resource":"{\"type\":\"system\",\"arch\":\"x86\"}","condition":"${{ default() }}","exec_type":"OCTOPUS_JOB","sequence":0,"pipeline_id":"c0473f77481c4a12b254012876df71b6"}],"identifier":"1706840051315bca51592-c211-49fe-ab76-bcf86f5efa84","pre":[{"task":"official_devcloud_autoTrigger","sequence":0}],"post":null,"depends_on":[],"run_always":false,"pipeline_id":"c0473f77481c4a12b254012876df71b6"}]}",
		ManifestVersion: &manifestVersionPipelineDto,
		IsPublish: false,
		Name: "新建流水线-20240202101359",
	}
	response, err := client.UpdatePipelineInfo(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。

状态码

状态码

描述

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

错误码

请参见错误码

相关文档