Skip to content

Latest commit

 

History

History
490 lines (444 loc) · 17.3 KB

get-the-status-of-the-pipeline.md

File metadata and controls

490 lines (444 loc) · 17.3 KB

获取流水线状态

请求方法/请求路径

GET /ms/openapi/api/apigw/v3/projects/{projectId}/pipelines/{pipelineId}/status

资源描述

获取流水线状态

输入参数说明

Path参数

参数名称 参数类型 必须 参数说明 默认值
projectId string 项目ID
pipelineId string 流水线ID

响应

HTTP代码 说明 参数类型
200 successful operation 数据返回包装模型流水线模型-列表信息

请求样例

curl -X GET '[请替换为API地址栏请求地址]' \
-H 'X-DEVOPS-UID:xxx'

HEADER样例

accept: application/json
Content-Type: application/json
X-DEVOPS-UID:xxx

返回样例-200

{
  "data" : {
    "latestBuildUserId" : "String",
    "creator" : "String",
    "latestBuildEndTime" : 0,
    "buildCount" : 0,
    "latestBuildTaskName" : "String",
    "groupLabel" : [ {
      "groupName" : "String",
      "labelName" : "string"
    } ],
    "updateTime" : 0,
    "pipelineDesc" : "String",
    "pipelineId" : "String",
    "latestBuildStartTime" : 0,
    "pipelineName" : "String",
    "canManualStartup" : true,
    "pipelineVersion" : 0,
    "taskCount" : 0,
    "latestBuildId" : "String",
    "createTime" : 0,
    "runningBuildCount" : 0,
    "latestBuildStatus" : "ENUM",
    "lock" : true,
    "model" : {
      "latestVersion" : 0,
      "pipelineCreator" : "String",
      "name" : "String",
      "stages" : [ {
        "canRetry" : true,
        "checkIn" : {
          "ruleIds" : "string",
          "reviewParams" : [ {
            "valueType" : "ENUM",
            "options" : [ {
              "value" : "String",
              "key" : "String"
            } ],
            "chineseName" : "String",
            "value" : {
              "string" : "string"
            },
            "key" : "String",
            "required" : true,
            "desc" : "String"
          } ],
          "manualTrigger" : true,
          "checkTimes" : 0,
          "reviewDesc" : "String",
          "reviewGroups" : [ {
            "name" : "String",
            "id" : "String",
            "suggest" : "String",
            "params" : [ {
              "valueType" : "ENUM",
              "options" : [ {
                "value" : "String",
                "key" : "String"
              } ],
              "chineseName" : "String",
              "value" : {
                "string" : "string"
              },
              "key" : "String",
              "required" : true,
              "desc" : "String"
            } ],
            "reviewers" : "string",
            "operator" : "String",
            "reviewTime" : 0,
            "status" : "String"
          } ],
          "timeout" : 0,
          "status" : "String"
        },
        "customBuildEnv" : {
          "string" : "string"
        },
        "finally" : true,
        "name" : "String",
        "containers" : [ {
          "canRetry" : true,
          "elementElapsed" : 0,
          "startEpoch" : 0,
          "executeCount" : 0,
          "jobId" : "String",
          "containPostTaskFlag" : true,
          "systemElapsed" : 0,
          "elements" : [ {
            "canRetry" : true,
            "errorType" : "String",
            "errorCode" : 0,
            "canSkip" : true,
            "startEpoch" : 0,
            "version" : "String",
            "executeCount" : 0,
            "templateModify" : true,
            "elementEnable" : true,
            "errorMsg" : "String",
            "elapsed" : 0,
            "atomCode" : "String",
            "additionalOptions" : {
              "enableCustomEnv" : true,
              "continueWhenFailed" : true,
              "manualRetry" : true,
              "pauseBeforeExec" : true,
              "retryCount" : 0,
              "manualSkip" : true,
              "timeout" : 0,
              "customVariables" : [ {
                "value" : "String",
                "key" : "String"
              } ],
              "otherTask" : "String",
              "customEnv" : [ {
                "value" : "String",
                "key" : "String"
              } ],
              "retryWhenFailed" : true,
              "enable" : true,
              "subscriptionPauseUser" : "String",
              "customCondition" : "String",
              "runCondition" : "ENUM",
              "elementPostInfo" : {
                "parentElementId" : "String",
                "postCondition" : "String",
                "parentElementJobIndex" : 0,
                "parentElementName" : "String",
                "postEntryParam" : "String"
              }
            },
            "taskAtom" : "String",
            "name" : "String",
            "id" : "String",
            "classType" : "String",
            "status" : "String"
          } ],
          "name" : "String",
          "id" : "String",
          "startVMStatus" : "String",
          "containerId" : "String",
          "classType" : "String",
          "status" : "String"
        } ],
        "id" : "String",
        "stageControlOption" : {
          "triggered" : true,
          "reviewParams" : [ {
            "valueType" : "ENUM",
            "options" : [ {
              "value" : "String",
              "key" : "String"
            } ],
            "chineseName" : "String",
            "value" : {
              "string" : "string"
            },
            "key" : "String",
            "required" : true,
            "desc" : "String"
          } ],
          "manualTrigger" : true,
          "enable" : true,
          "customCondition" : "String",
          "triggerUsers" : "string",
          "reviewDesc" : "String",
          "runCondition" : "ENUM",
          "timeout" : 0,
          "customVariables" : [ {
            "value" : "String",
            "key" : "String"
          } ]
        },
        "checkOut" : {
          "ruleIds" : "string",
          "reviewParams" : [ {
            "valueType" : "ENUM",
            "options" : [ {
              "value" : "String",
              "key" : "String"
            } ],
            "chineseName" : "String",
            "value" : {
              "string" : "string"
            },
            "key" : "String",
            "required" : true,
            "desc" : "String"
          } ],
          "manualTrigger" : true,
          "checkTimes" : 0,
          "reviewDesc" : "String",
          "reviewGroups" : [ {
            "name" : "String",
            "id" : "String",
            "suggest" : "String",
            "params" : [ {
              "valueType" : "ENUM",
              "options" : [ {
                "value" : "String",
                "key" : "String"
              } ],
              "chineseName" : "String",
              "value" : {
                "string" : "string"
              },
              "key" : "String",
              "required" : true,
              "desc" : "String"
            } ],
            "reviewers" : "string",
            "operator" : "String",
            "reviewTime" : 0,
            "status" : "String"
          } ],
          "timeout" : 0,
          "status" : "String"
        },
        "fastKill" : true
      } ],
      "templateId" : "String",
      "srcTemplateId" : "String",
      "tips" : "String",
      "desc" : "String",
      "labels" : "string",
      "instanceFromTemplate" : true
    },
    "latestBuildNum" : 0,
    "projectId" : "String"
  },
  "message" : "String",
  "status" : 0
}

数据返回包装模型流水线模型-列表信息

参数名称 参数类型 必须 参数说明
data 流水线模型-列表信息 数据
message string 错误信息
status integer 状态码

流水线模型-列表信息

参数名称 参数类型 必须 参数说明
latestBuildUserId string 最后执行人id
creator string 流水线创建人
latestBuildEndTime integer 最后构建结束时间
buildCount integer 构建次数
latestBuildTaskName string 最后构建任务名称
groupLabel List<PipelineGroupLabels> 流水线分组和标签
updateTime integer 部署时间
pipelineDesc string 流水线描述
pipelineId string 流水线ID
latestBuildStartTime integer 最后构建启动时间
pipelineName string 流水线名称
canManualStartup boolean 是否可手工启动
pipelineVersion integer 编排文件版本号
taskCount integer 流水线任务数量
latestBuildId string 最后构建实例ID
createTime integer 流水线创建时间
runningBuildCount integer 当前运行的构建的个数
latestBuildStatus ENUM(SUCCEED, FAILED, CANCELED, RUNNING, TERMINATE, REVIEWING, REVIEW_ABORT, REVIEW_PROCESSED, HEARTBEAT_TIMEOUT, PREPARE_ENV, UNEXEC, SKIP, QUALITY_CHECK_FAIL, QUEUE, LOOP_WAITING, CALL_WAITING, TRY_FINALLY, QUEUE_TIMEOUT, EXEC_TIMEOUT, QUEUE_CACHE, RETRY, PAUSE, STAGE_SUCCESS, QUOTA_FAILED, DEPENDENT_WAITING, UNKNOWN, ) 最后构建状态
lock boolean 运行锁定
model 流水线模型-创建信息 编排详情
latestBuildNum integer 最后构建版本号
projectId string 项目ID

PipelineGroupLabels

参数名称 参数类型 必须 参数说明
groupName string groupName
labelName List labelName

流水线模型-创建信息

参数名称 参数类型 必须 参数说明
latestVersion integer 提交时流水线最新版本号
pipelineCreator string 创建人
name string 名称
stages List<流水线模型-阶段> 阶段集合
templateId string 模板ID
srcTemplateId string 源模版ID
tips string 提示
desc string 描述
labels List 标签
instanceFromTemplate boolean 是否从模板中实例化出来的

流水线模型-阶段

参数名称 参数类型 必须 参数说明
canRetry boolean 当前Stage是否能重试
checkIn StagePauseCheck 当前Stage是否能重试
customBuildEnv object 用户自定义环境变量
finally boolean 标识是否为FinallyStage,每个Model只能包含一个FinallyStage,并且处于最后位置
name string 阶段名称
containers List<流水线模型-多态基类> 容器集合
id string 阶段ID
stageControlOption StageControlOption 流程控制选项
checkOut StagePauseCheck 当前Stage是否能重试
fastKill boolean 是否启用容器失败快速终止阶段

StagePauseCheck

参数名称 参数类型 必须 参数说明
ruleIds List ruleIds
reviewParams List<人工审核-自定义参数> reviewParams
manualTrigger boolean manualTrigger
checkTimes integer checkTimes
reviewDesc string reviewDesc
reviewGroups List<Stage审核组信息> reviewGroups
timeout integer timeout
status string status

人工审核-自定义参数

参数名称 参数类型 必须 参数说明
valueType ENUM(STRING, TEXTAREA, BOOLEAN, ENUM, MULTIPLE, ) 参数类型
options List<人工审核-自定义参数-下拉框列表剑> 下拉框列表
chineseName string 中文名称
value object 参数内容
key string 参数名
required boolean 是否必填
desc string 参数描述

人工审核-自定义参数-下拉框列表剑

参数名称 参数类型 必须 参数说明
value string 参数内容
key string 参数名

Stage审核组信息

参数名称 参数类型 必须 参数说明
name string 审核组名称
id string 审核组ID(后台生成)
suggest string 审核建议
params List<人工审核-自定义参数> 审核传入变量
reviewers List 审核人员
operator string 审核操作人
reviewTime integer 审核操作时间
status string 审核结果(枚举)

流水线模型-多态基类

参数名称 参数类型 必须 参数说明
canRetry boolean canRetry
elementElapsed integer elementElapsed
startEpoch integer startEpoch
executeCount integer executeCount
jobId string jobId
containPostTaskFlag boolean containPostTaskFlag
systemElapsed integer systemElapsed
elements List<Element> elements
name string name
id string id
startVMStatus string startVMStatus
containerId string containerId
classType string classType
status string status

Element

参数名称 参数类型 必须 参数说明
canRetry boolean canRetry
errorType string errorType
errorCode integer errorCode
canSkip boolean canSkip
startEpoch integer startEpoch
version string version
executeCount integer executeCount
templateModify boolean templateModify
elementEnable boolean elementEnable
errorMsg string errorMsg
elapsed integer elapsed
atomCode string atomCode
additionalOptions ElementAdditionalOptions additionalOptions
taskAtom string taskAtom
name string name
id string id
classType string classType
status string status

ElementAdditionalOptions

参数名称 参数类型 必须 参数说明
enableCustomEnv boolean enableCustomEnv
continueWhenFailed boolean continueWhenFailed
manualRetry boolean manualRetry
pauseBeforeExec boolean pauseBeforeExec
retryCount integer retryCount
manualSkip boolean manualSkip
timeout integer timeout
customVariables List<NameAndValue> customVariables
otherTask string otherTask
customEnv List<NameAndValue> customEnv
retryWhenFailed boolean retryWhenFailed
enable boolean enable
subscriptionPauseUser string subscriptionPauseUser
customCondition string customCondition
runCondition ENUM(PRE_TASK_SUCCESS, PRE_TASK_FAILED_BUT_CANCEL, PRE_TASK_FAILED_EVEN_CANCEL, PRE_TASK_FAILED_ONLY, OTHER_TASK_RUNNING, CUSTOM_VARIABLE_MATCH, CUSTOM_VARIABLE_MATCH_NOT_RUN, CUSTOM_CONDITION_MATCH, PARENT_TASK_CANCELED_OR_TIMEOUT, PARENT_TASK_FINISH, ) runCondition
elementPostInfo 元素post信息 elementPostInfo

NameAndValue

参数名称 参数类型 必须 参数说明
value string value
key string key

元素post信息

参数名称 参数类型 必须 参数说明
parentElementId string 父元素ID
postCondition string 执行条件
parentElementJobIndex integer 父元素在job中的位置
parentElementName string 父元素名称
postEntryParam string 入口参数

StageControlOption

参数名称 参数类型 必须 参数说明
triggered boolean triggered
reviewParams List<人工审核-自定义参数> reviewParams
manualTrigger boolean manualTrigger
enable boolean enable
customCondition string customCondition
triggerUsers List triggerUsers
reviewDesc string reviewDesc
runCondition ENUM(AFTER_LAST_FINISHED, CUSTOM_VARIABLE_MATCH, CUSTOM_VARIABLE_MATCH_NOT_RUN, CUSTOM_CONDITION_MATCH, ) runCondition
timeout integer timeout
customVariables List<NameAndValue> customVariables