You need to enable JavaScript to run this app.
文档中心
持续交付

持续交付

复制全文
下载 pdf
流水线
CreatePipeline
复制全文
下载 pdf
CreatePipeline
创建流水线。​
请求说明​
为获得低延迟,建议您根据资源所在的地域选择对应的服务地址,详情参见 服务地址。​
  • 请求方式:POST​
  • 请求地址:https://cp.cn-beijing.volcengineapi.com?Action=CreatePipeline&Version=2023-05-01​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
CreatePipeline​
接口名称。当前 API 的名称为 CreatePipeline。​
Version​
String​
是​
2023-05-01​
接口版本。当前 API 的版本为 2023-05-01。​
WorkspaceId​
String​
是​
18be9d623fba45a1aca409f5e19c****​
工作区 ID。支持通过 CreateWorkspace 或 ListWorkspaces 获取。​
Name​
String​
是​
Automated Iterative Build Pipeline​
流水线的名称,支持任意字符,长度限制为 2~50 个字符,且在同一个工作区下名称唯一。​
Description​
String​
否​
Automated build and release pipeline for daily iterative versions.​
用于补充说明流水线的相关信息,支持任意字符,长度限制为 0~256 个字符,未传入时默认值为空字符串。​
Spec​
String​
否​
version: 2.0.0\nagentPool: public/prod-v2-public\nstages:\n - stage: exec-cmd\n displayName: Execute Command\n tasks:\n - task: exec-cmd\n displayName: Execute Command\n steps:\n - step: exec-cmd\n displayName: Execute Command\n component: exec@1.0.0\n inputs:\n shell: BASH\n cmd: echo hello\n workspace: {}\n dependsOn: []\n resourcesPolicy: all\n timeout: 2h\n resources:\n limits:\n cpu: 1C\n memory: 2Gi\n​
以 YAML 格式编写的流水线核心配置内容,用于定义流水线的完整执行逻辑,包含代码源、执行步骤、触发规则等核心配置项,参数详细说明和示例参见 通过 YAML 创建流水线。​
Parameters​
Array of PipelineParameter​
否​
-​
用于静态替换流水线配置中 $(parameter.xxx) 占位符的变量集合,最多可配置 100 个变量,未传入时默认值为空列表。​
Caches​
Array of PipelineCache​
否​
-​
流水线缓存配置列表。​
​
PipelineParameter​
​
参数​
类型​
是否必选​
示例值​
描述​
Key​
String​
否​
build_branch​
流水线变量的名称。​
Value​
String​
否​
release-v2.3.1​
流水线变量的具体取值。​
Secret​
Boolean​
否​
false​
变量是否开启隐私设置。​
  • true:开启隐私设置。变量的默认值展示为***。​
  • false:默认值,关闭隐私设置。变量的默认值明文展示。​
Dynamic​
Boolean​
否​
false​
变量是否开启动态设置。​
  • true:变量为动态变量。支持在运行流水线时修改当前变量的运行值。​
  • false:默认值,变量为非动态变量。运行流水线时使用默认值。​
OptionValues​
Array of String​
否​
["release-v2.3.1","develop-v2.4.0","hotfix-v2.3.2"]​
当变量配置为单选选项类型时,用于指定该变量可选择的所有可选值列表,可选值为字符串类型且长度小于 16KB。​
Description​
String​
否​
Specifies the build branch for the iterative version.​
变量的备注。​
​
PipelineCache​
​
参数​
类型​
是否必选​
示例值​
描述​
Key​
String​
是​
cache-test​
缓存目录的名称。​
Path​
String​
是​
$(CP_WORKSPACE)/.m2​
缓存的路径,需要设置为$(CP_WORKSPACE)的子目录。​
Description​
String​
否​
Stores the initial version.​
缓存目录的备注。​
​
请求示例​
​
POST https://cp.cn-beijing.volcengineapi.com?Action=CreatePipeline&Version=2023-05-01 HTTP/1.1​
Content-Type: application/json​
{​
"WorkspaceId": "18be9d623fba45a1aca409f5e19c****",​
"Name": "Automated Iterative Build Pipeline",​
"Description": "Automated build and release pipeline for daily iterative versions.",​
"Spec": "version: 2.0.0\\nagentPool: public/prod-v2-public\\nstages:\\n - stage: exec-cmd\\n displayName: Execute Command\\n tasks:\\n - task: exec-cmd\\n displayName: Execute Command\\n steps:\\n - step: exec-cmd\\n displayName: Execute Command\\n component: exec@1.0.0\\n inputs:\\n shell: BASH\\n cmd: echo hello\\n workspace: {}\\n dependsOn: []\\n resourcesPolicy: all\\n timeout: 2h\\n resources:\\n limits:\\n cpu: 1C\\n memory: 2Gi\\n",​
"Parameters": [​
{​
"Key": "build_branch",​
"Value": "release-v2.3.1",​
"Secret": false,​
"Dynamic": false,​
"Description": "Specifies the build branch for the iterative version.",​
"OptionValues": [​
"release-v2.3.1",​
"develop-v2.4.0",​
"hotfix-v2.3.2"​
]​
}​
],​
"Caches": [​
{​
"Key": "cache-test",​
"Path": "$(CP_WORKSPACE)/.m2",​
"Description": "Stores the initial version."​
}​
]​
}
​
返回参数​
​
参数​
类型​
示例值​
描述​
Id​
String​
18be9d623fba45a1aca409f5e19c****​
流水线 ID。​
​
返回示例​
​
HTTP/1.1 200 OK​
Content-Type: application/json​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "CreatePipeline",​
"Version": "2023-05-01",​
"Service": "cp",​
"Region": "cn-beijing"​
},​
"Result": {​
"Id": "18be9d623fba45a1aca409f5e19c****"​
}​
}
​
错误码​
当前接口暂无独立错误码,若接口调用返回异常,可参考 公共错误码 进行故障排查。​
最近更新时间:2026.11.04 15:20:27
这个页面对您有帮助吗?
有用
有用
无用
无用