GetPipelineInstHistory

接口描述

获取单条流水线的运行历史信息

API

GetPipelineInstHistory

请求参数

参数

类型

是否必须

说明

OrgId

string

企业 Id

PipelineId

long

流水线 Id

StartTime

string

流水线开始运行时间区间起点,如2020-12-08 08:00:00

EndTime

string

流水线开始运行时间区间结束点,如2020-12-20 08:00:00

PageStart

long

起始记录索引,从0开始

PageSize

long

每页数据大小,最大值为20

该请求做了分页处理,响应体中有Total字段,标识当前筛选条件命中了多少条记录。PageStart为起始记录索引,从0 开始,PageSize为每页数据 。假如总记录是30,PageStart为0,PageSize为10,则会返回前10记录。如果PageStart为10,PageSize为10,则会返回第11-20条记录。

响应示例

{
  "RequestId": "2FC3E86D-9954-40DB-869E-790B0FBF3539",
  "Data": {
    "DataList": [
      {
        "Status": "SUCCESS",
        "ModifyTime": 1607448171000,
        "FlowInstance": {
          "Status": "FINISH",
          "ModifyTime": 1607448172000,
          "ResultStatus": "SUCCESS",
          "CreateTime": 1607448066000,
          "SystemCode": "AONE",
          "Stages": {
            "Group0-Stage0": {
              "latestCptEndTime": 1607448172000,
              "components": [
                {
                  "creator": "5e6f6c1403283833284f3a95",
                  "componentId": 41,
                  "flowComponentSign": "10_1607448052744",
                  "modifier": "5e6f6c1403283833284f3a95",
                  "histories": [],
                  "stageInstId": 5242780,
                  "buttonList": [
                    {
                      "data": "[{\"downloadUrl\":\"/execution-component/downloadLog?jobId=4464892\",\"nodeUrl\":\"/execution-component/log?jobId=4464892\",\"rawUrl\":\"/execution-component/rawLog?jobId=4464892\",\"treeUrl\":\"/execution-component/logList?jobId=4464892\"}]",
                      "method": "get",
                      "disable": false,
                      "scope": "Task",
                      "name": "构建日志",
                      "style": "DEFAULT",
                      "type": "LOG"
                    }
                  ],
                  "params": "{\"sources\":[{\"data\":{\"commitMsg\":\"[{\\\"commitTime\\\": \\\"Mon Aug 17 10:23:23 2020 +0800\\\", \\\"commitAuthor\\\": \\\"\\\\u7827\\\\u6728\\\", \\\"commitMsg\\\": \\\"add%20node-sass\\\", \\\"commitId\\\": \\\"0cba6ec519cb9276435832bfdc012f4a74b6faea\\\"}]\",\"repo\":\"https://code.aliyun.com/flow-example/node-expressjs.git\",\"language\":\"nodejs\",\"label\":\"flow-example/node-expressjs\",\"commitId\":\"0cba6ec519cb9276435832bfdc012f4a74b6faea\",\"branch\":\"master\"},\"name\":\"flow-example_node-expressjs_upnM\",\"sign\":\"flow-example_node-expressjs_upnM\",\"label\":\"flow-example/node-expressjs\",\"type\":\"gitSample\"}],\"caches\":\"[\\\"/root/.m2\\\",\\\"/root/.gradle/caches\\\",\\\"/root/.npm\\\",\\\"/root/.yarn\\\",\\\"/go/pkg/mod\\\",\\\"/root/.cache\\\"]\",\"ENGINE_PIPELINE_ID\":1198382,\"mixFlowInstId\":\"11113108\",\"ENGINE_PIPELINE_PORTAL_URL\":\"https://pre-flow.aliyun.com\",\"ENGINE_TASK_SIGN\":\"10_1607448052744\",\"ENGINE_PIPELINE_CONFIG_ID\":567810,\"steps\":[{\"stepType\":\"node_build-staging\",\"USE_NPM_CACHE\":true,\"name\":\"Node.js 构建(预发)\",\"stepIdentifier\":\"10_1607448052744__11_1607448052744\",\"version\":\"pre-14.8\",\"command\":\"# input your command here\\nnpm install\\n\"}],\"HIDDEN_VALUES\":\"[]\",\"ENGINE_PIPELINE_NAME\":\"流水线 2020-12-09\",\"ENGINE_PIPELINE_INST_NUMBER\":1,\"DATETIME\":\"2020-12-09-01-21-06\",\"parentMixFlowInstId\":\"0\",\"rootMixActionCode\":\"ENTER\",\"TIMESTAMP\":\"1607448066429\",\"appId\":\"0\",\"ENGINE_PIPELINE_CREATOR_ALIYUN_PK\":\"1370514479907250\",\"buildNodeGroup\":\"K8S-16\",\"triggerMode\":\"1\",\"ENGINE_PIPELINE_INST_ID\":2119978}",
                  "type": "NORMAL",
                  "isSync": false,
                  "url": "http://pre-devops-execution.aliyun-inc.com/execution-component/command",
                  "flowInstId": 52120155,
                  "result": "{\"data\":{\"outputsToEnv.CI_COMMIT_REF_NAME\":\"master\",\"RELEASE_INFO\":\"[]\",\"outputsToEnv.CI_COMMIT_ID\":\"0cba6ec5\",\"outputsToEnv.CI_COMMIT_TITLE\":\"add node-sass\",\"https://code.aliyun.com/flow-example/node-expressjs.git.master.commitMsg\":\"[{\\\"commitTime\\\": \\\"Mon Aug 17 10:23:23 2020 +0800\\\", \\\"commitAuthor\\\": \\\"\\\\u7827\\\\u6728\\\", \\\"commitMsg\\\": \\\"add%20node-sass\\\", \\\"commitId\\\": \\\"0cba6ec519cb9276435832bfdc012f4a74b6faea\\\"}]\",\"ARTIFACTS\":\"[]\",\"outputsToEnv.CI_COMMIT_SHA\":\"0cba6ec519cb9276435832bfdc012f4a74b6faea\"},\"requestId\":\"7bf407d0-0497-4e62-80da-041933ff9a21\",\"successful\":true}",
                  "resultStatus": "SUCCESS",
                  "paramsMap": "{\"ENGINE_PIPELINE_INST_NUMBER\":\"${INPUTS.ENGINE_PIPELINE_INST_NUMBER}\",\"ENGINE_PIPELINE_ID\":\"${INPUTS.ENGINE_PIPELINE_ID}\",\"buildNodeGroup\":\"K8S-16\",\"steps\":[{\"stepType\":\"node_build-staging\",\"USE_NPM_CACHE\":true,\"name\":\"Node.js 构建(预发)\",\"stepIdentifier\":\"10_1607448052744__11_1607448052744\",\"version\":\"pre-14.8\",\"command\":\"# input your command here\\nnpm install\\n\"}]}",
                  "name": "Node.js 构建",
                  "statusName": "已完成",
                  "startTime": 1607448066000,
                  "endTime": 1607448172000,
                  "id": 55382690,
                  "isHistory": false,
                  "idx": 0,
                  "elapsedTime": 106,
                  "status": "FINISH"
                }
              ],
              "creator": "5e6f6c1403283833284f3a95",
              "modifier": "5e6f6c1403283833284f3a95",
              "flowStageSign": "Group0-Stage0",
              "flowInstId": 52120155,
              "resultStatus": "SUCCESS",
              "name": "Group0-Stage0",
              "statusName": "已完成",
              "startTime": 1607448066000,
              "endTime": 1607448172000,
              "id": 5242780,
              "idx": 0,
              "status": "FINISH"
            }
          },
          "SystemId": "1198382",
          "StatusName": "已完成",
          "Creator": "5e6f6c1403283833284f3a95",
          "AutoDrivenStatus": true,
          "Result": {
            "MixFlowInstId": "11113108",
            "EnginePipelineId": 1198382,
            "EnginePipelineName": "流水线 2020-12-09",
            "Caches": "[\"/root/.m2\",\"/root/.gradle/caches\",\"/root/.npm\",\"/root/.yarn\",\"/go/pkg/mod\",\"/root/.cache\"]",
            "TriggerMode": "1",
            "Sources": "[{\"data\":{\"repo\":\"https://code.aliyun.com/flow-example/node-expressjs.git\",\"language\":\"nodejs\",\"label\":\"flow-example/node-expressjs\",\"branch\":\"master\"},\"name\":\"flow-example_node-expressjs_upnM\",\"sign\":\"flow-example_node-expressjs_upnM\",\"label\":\"flow-example/node-expressjs\",\"type\":\"gitSample\"}]",
            "DateTime": "2020-12-09-01-21-06",
            "TimeStamp": "1607448066429",
            "EnginePipelineNumber": 1,
            "EnginePipelineInstId": 2119978
          },
          "RunningStatus": "SUCCESS",
          "Groups": [
            {
              "Status": "FINISH",     //阶段状态
              "ModifyTime": 1607448172000,
              "EndTime": 1607448172000,
              "ResultStatus": "SUCCESS",  //阶段结果
              "CreateTime": 1607448066000,
              "StartTime": 1607448066000,
              "Creator": "5e6f6c1403283833284f3a95",
              "DeleteStatus": "N",
              "Name": "构建",  //阶段名称
              "IdExtent": 0,
              "Id": 4276461,
              "Modifier": "5e6f6c1403283833284f3a95",
              "FlowInstId": 52120155
            }
          ],
          "StageTopo": [
            [
              "Group0-Stage0"
            ]
          ],
          "Id": 52120155,
          "Modifier": "5e6f6c1403283833284f3a95"
        },
        "CreateTime": 1607448066000,
        "StatusName": "已完成", //流水线状态
        "Creator": "5e6f6c1403283833284f3a95",
        "TriggerMode": 1,
        "Packages": [],
        "Deletion": "N",
        "PipelineId": 1198382, //流水线ID
        "Id": 2119978,
        "Modifier": "5e6f6c1403283833284f3a95",
        "PipelineConfigId": 567810,
        "FlowInstId": 52120155,
        "InstNumber": 1
      }
    ],
    "Total": 1  //命中的总记录数
  },
  "Success": true
}