文档首页/ 流水线 CodeArts Pipeline/ API参考/ API/ 流水线管理/ 查询流水线运行使用的参数
更新时间:2024-08-29 GMT+08:00
分享

查询流水线运行使用的参数

功能介绍

查询流水线运行使用的参数

调用方法

请参见如何调用API

URI

GET /v5/{project_id}/api/pipelines/{pipeline_id}/pipeline-runs/{pipelineRunId}/run-variables

表1 路径参数

参数

是否必选

参数类型

描述

pipelineRunId

String

流水线运行实例ID

project_id

String

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

pipeline_id

String

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

表2 Query参数

参数

是否必选

参数类型

描述

mode

Integer

查询模式,0-系统参数;1-自定义参数;2-参数组参数

请求参数

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

[数组元素]

Array of ListRunVariablesResp objects

响应体

表4 ListRunVariablesResp

参数

参数类型

描述

name

String

参数名称

sequence

String

参数序列号

type

String

参数类型

value

String

参数值

is_secret

Boolean

是否私密参数

description

String

描述

is_runtime

String

是否运行时设置

limits

String

参数限制值

is_reset

Boolean

是否重置

latest_value

String

最后一次运行的参数值

required

Boolean

是否必输

variableGroupName

String

参数组名称

请求示例

https://(endpoint)/v5/071112d87d3e4ed49130c691936202e9/api/pipelines/53acae73a3f44b2994f9b20a710721c6/pipeline-runs/13a48f79f7104f9785720cf2c11890ba/run-variables?mode=0

响应示例

状态码: 200

响应体

[ {
  "name" : "PROJECT_ID",
  "sequence" : null,
  "type" : "string",
  "value" : "071112d87d3e4ed49130c691936202e9",
  "is_secret" : false,
  "description" : "当前流水线所属项目ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "PIPELINE_ID",
  "sequence" : null,
  "type" : "string",
  "value" : "53acae73a3f44b2994f9b20a710721c6",
  "is_secret" : false,
  "description" : "当前流水线ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "PIPELINE_NUMBER",
  "sequence" : null,
  "type" : "string",
  "value" : "34",
  "is_secret" : false,
  "description" : "流水线执行编号",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "COMMIT_ID",
  "sequence" : null,
  "type" : "string",
  "value" : "fc315b91f027d252be756ade0b4263f6b6be58f4",
  "is_secret" : false,
  "description" : "执行时代码最后一次提交的ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "COMMIT_ID_SHORT",
  "sequence" : null,
  "type" : "string",
  "value" : "fc315b91",
  "is_secret" : false,
  "description" : "执行时代码最后一次提交的短ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "TIMESTAMP",
  "sequence" : null,
  "type" : "string",
  "value" : "20240621144916",
  "is_secret" : false,
  "description" : "流水线执行时间戳。例如:20211222124301",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "PIPELINE_TRIGGER_TYPE",
  "sequence" : null,
  "type" : "string",
  "value" : "Manual",
  "is_secret" : false,
  "description" : "流水线触发类型,包括Manual,Scheduler,RollBack,以及WebHook类型:CreateTag,Note,Issue,MR,Push",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "REPO_URL",
  "sequence" : null,
  "type" : "string",
  "value" : "https://001/test.git",
  "is_secret" : false,
  "description" : "代码仓地址(HTTPS)",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "PIPELINE_RUN_ID",
  "sequence" : null,
  "type" : "string",
  "value" : "13a48f79f7104f9785720cf2c11890ba",
  "is_secret" : false,
  "description" : "流水线执行ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_REPOSITORY_NAME",
  "sequence" : null,
  "type" : "string",
  "value" : "test",
  "is_secret" : false,
  "description" : "仓库名称",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_SOURCE_BRANCH",
  "sequence" : null,
  "type" : "string",
  "value" : "",
  "is_secret" : false,
  "description" : "仓库运行源分支名称",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_TARGET_BRANCH",
  "sequence" : null,
  "type" : "string",
  "value" : "branch-001",
  "is_secret" : false,
  "description" : "仓库运行目标分支名称",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_TAG",
  "sequence" : null,
  "type" : "string",
  "value" : "",
  "is_secret" : false,
  "description" : "仓库标签名称",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_COMMIT_ID",
  "sequence" : null,
  "type" : "string",
  "value" : "fc315b91f027d252be756ade0b4263f6b6be58f4",
  "is_secret" : false,
  "description" : "仓库执行时代码最后一次提交的ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_COMMIT_ID_SHORT",
  "sequence" : null,
  "type" : "string",
  "value" : "fc315b91",
  "is_secret" : false,
  "description" : "执行时代码最后一次提交的短ID",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
}, {
  "name" : "test_REPO_URL",
  "sequence" : null,
  "type" : "string",
  "value" : "https://1/test.git",
  "is_secret" : false,
  "description" : "代码仓地址(HTTPS)",
  "is_runtime" : null,
  "limits" : null,
  "is_reset" : false,
  "latest_value" : null,
  "required" : true,
  "variableGroupName" : null
} ]

状态码

状态码

描述

200

响应体

错误码

请参见错误码

相关文档