可以获取流水线的运行历史。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetPipelineInstHistory | 系统规定参数。取值:GetPipelineInstHistory。 |
OrgId | String | 是 | 5ebbc0228123212b59xxxxx | 企业标识,也称企业id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrgId】 |
PipelineId | Long | 是 | 1x3 | 流水线ID,可在流水线链接中获取,如 https://flow.aliyun.com/pipelines/【PipelineId】/current |
UserPk | String | 否 | 123xxxxx14543321 | 用户pk,非必填,只有调用接口使用的ak和用户pk不一致时,才需要 |
StartTime | String | 是 | 2020-12-08 08:00:00 | 流水线开始运行时间区间起点,如2020-12-08 08:00:00 |
EndTime | String | 否 | 2020-12-20 08:00:00 | 流水线开始运行时间区间结束点,如2020-12-20 08:00:00 |
PageStart | Long | 是 | 0 | 起始记录索引,从0开始.pageStart=(pageNum-1)*pageSize |
PageSize | Long | 是 | 10 | 每页数据大小,最大值为20 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | ASSDS-ASSASX-XSAXSA-XSAXSAXS | 请求id,每次请求都是唯一值,便于后续排查问题 |
ErrorMessage | String | "" | 错误信息 |
Success | Boolean | true | true 接口调用成功,false 接口调用失败 |
ErrorCode | String | "" | 错误码 |
Data | Object | 运行历史 |
|
Total | Integer | 10 | 运行历史总数 |
DataList | Array of PipelineInst | 运行历史列表 |
|
Status | String | SUCCES | 状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
CreateTime | Long | 1607448066000 | 运行开始时间 |
StatusName | String | 已完成 | 流水线运行状态 |
TriggerMode | Integer | 1 | 触发模式 1人工触发 2定时触发 3代码提交触发 |
PipelineConfigId | Integer | 123 | 流水线配置id |
Deletion | String | Deletion | N未删除,Y已删除 |
Creator | String | 5e6f6c1403283833284xxxx | 运行人 |
InstNumber | Integer | 1 | 构建号 |
Modifier | String | 5e6f6c1403283833284xxxx | 修改人 |
Packages | String | [] | 构建包信息 |
FlowInstId | Integer | 123 | 流水线运行实例ID |
PipelineId | Integer | 123 | 流水线ID |
Id | Integer | 123 | 历史ID |
ModifyTime | Long | 1607448066000 | 运行结束时间 |
FlowInstance | Object | 运行实例 |
|
Status | String | SUCCESS | 状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
Stages | Map | 阶段列表 |
|
CreateTime | Long | 1607448066000 | 运行开始时间 |
StatusName | String | 已完成 | 运行状态 |
RunningStatus | String | SUCCESS | 状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
Creator | String | 5e6f6c1403283833284xxxx | 运行人 |
StageTopo | String | [ [ "Group0-Stage0" ] ] | 阶段列表 |
Modifier | String | 5e6f6c1403283833284xxxx | 修改人 |
AutoDrivenStatus | Boolean | true | 自动运行 |
ResultStatus | String | SUCCESS | 状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
Id | Integer | 123 | ID |
SystemCode | String | AONE | 系统 Code |
ModifyTime | Long | 1607448066000 | 运行结束时间 |
SystemId | String | 1198382 | 系统 ID |
Groups | Array of Group | 分组列表 |
|
Status | String | SUCCESS | 状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
CreateTime | Long | 1607448066000 | 运行时间 |
DeleteStatus | String | N | N 未删除 Y 已删除 |
IdExtent | Integer | 0 | 0 |
Creator | String | 5e6f6c1403283833284xxxx | 运行人 |
EndTime | Long | 1607448066000 | 结束时间 |
StartTime | Long | 1607448066000 | 开始时间 |
Modifier | String | 5e6f6c1403283833284xxxx | 修改人 |
ResultStatus | String | SUCCESS | 状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
FlowInstId | Integer | 1234 | 运行实例 ID |
Name | String | 构建 | 分组名称 |
Id | Integer | 12 | 分组 ID |
ModifyTime | Long | 1607448066000 | 修改时间 |
Result | Object | 返回结果 |
|
EnginePipelineNumber | Integer | 1 | 流水线实例构建号 |
MixFlowInstId | String | 1 | 实例 ID |
EnginePipelineName | String | 流水线1 | 流水线名称 |
EnginePipelineId | Integer | 123 | 流水线 ID |
EnginePipelineInstId | Integer | 123 | 流水线实例 ID |
TimeStamp | String | 1607448066000 | 运行的时间戳 |
TriggerMode | String | 1 | 1 手动触发 2定时触发 3代码提交触发 |
Sources | String | "[]" | 代码信息 |
Caches | String | "[]" | 缓存信息 |
DateTime | String | 1607448066000 | 时间戳 |
示例
请求示例
POST /?Action=GetPipelineInstHistory&公共请求参数 HTTP/1.1
Content-Type:application/x-www-form-urlencoded
OrgId=5ebbc0228123212b59xxxxx&UserPk=123xxxxx14543321&StartTime=2020-12-08 08:00:00&EndTime=2020-12-20 08:00:00&PageStart=0&PageSize=10
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<GetPipelineInstHistoryResponse>
<RequestId>ASSDS-ASSASX-XSAXSA-XSAXSAXS</RequestId>
<ErrorMessage>""</ErrorMessage>
<Success>true</Success>
<ErrorCode>""</ErrorCode>
<Data>
<Total>10</Total>
<DataList>
<Status>SUCCES</Status>
<CreateTime>1607448066000</CreateTime>
<StatusName>已完成</StatusName>
<TriggerMode>1</TriggerMode>
<PipelineConfigId>123</PipelineConfigId>
<Deletion>Deletion</Deletion>
<Creator>5e6f6c1403283833284xxxx</Creator>
<InstNumber>1</InstNumber>
<Modifier>5e6f6c1403283833284xxxx</Modifier>
<Packages>[]</Packages>
<FlowInstId>123</FlowInstId>
<PipelineId>123</PipelineId>
<Id>123</Id>
<ModifyTime>1607448066000</ModifyTime>
<FlowInstance>
<Status>SUCCESS</Status>
<CreateTime>1607448066000</CreateTime>
<StatusName>已完成</StatusName>
<RunningStatus>SUCCESS</RunningStatus>
<Creator>5e6f6c1403283833284xxxx</Creator>
<StageTopo>[ [ "Group0-Stage0" ] ]</StageTopo>
<Modifier>5e6f6c1403283833284xxxx</Modifier>
<AutoDrivenStatus>true</AutoDrivenStatus>
<ResultStatus>SUCCESS</ResultStatus>
<Id>123</Id>
<SystemCode>AONE</SystemCode>
<ModifyTime>1607448066000</ModifyTime>
<SystemId>1198382</SystemId>
<Groups>
<Status>SUCCESS</Status>
<CreateTime>1607448066000</CreateTime>
<DeleteStatus>N</DeleteStatus>
<IdExtent>0</IdExtent>
<Creator>5e6f6c1403283833284xxxx</Creator>
<EndTime>1607448066000</EndTime>
<StartTime>1607448066000</StartTime>
<Modifier>5e6f6c1403283833284xxxx</Modifier>
<ResultStatus>SUCCESS</ResultStatus>
<FlowInstId>1234</FlowInstId>
<Name>构建</Name>
<Id>12</Id>
<ModifyTime>1607448066000</ModifyTime>
</Groups>
<Result>
<EnginePipelineNumber>1</EnginePipelineNumber>
<MixFlowInstId>1</MixFlowInstId>
<EnginePipelineName>流水线1</EnginePipelineName>
<EnginePipelineId>123</EnginePipelineId>
<EnginePipelineInstId>123</EnginePipelineInstId>
<TimeStamp>1607448066000</TimeStamp>
<TriggerMode>1</TriggerMode>
<Sources>"[]"</Sources>
<Caches>"[]"</Caches>
<DateTime>1607448066000</DateTime>
</Result>
</FlowInstance>
</DataList>
</Data>
</GetPipelineInstHistoryResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"ErrorMessage" : "\"\"",
"Success" : true,
"ErrorCode" : "\"\"",
"Data" : {
"Total" : 10,
"DataList" : [ {
"Status" : "SUCCES",
"CreateTime" : 1607448066000,
"StatusName" : "已完成",
"TriggerMode" : 1,
"PipelineConfigId" : 123,
"Deletion" : "Deletion",
"Creator" : "5e6f6c1403283833284xxxx",
"InstNumber" : 1,
"Modifier" : "5e6f6c1403283833284xxxx",
"Packages" : "[]",
"FlowInstId" : 123,
"PipelineId" : 123,
"Id" : 123,
"ModifyTime" : 1607448066000,
"FlowInstance" : {
"Status" : "SUCCESS",
"CreateTime" : 1607448066000,
"StatusName" : "已完成",
"RunningStatus" : "SUCCESS",
"Creator" : "5e6f6c1403283833284xxxx",
"StageTopo" : "[ [ \"Group0-Stage0\" ] ]",
"Modifier" : "5e6f6c1403283833284xxxx",
"AutoDrivenStatus" : true,
"ResultStatus" : "SUCCESS",
"Id" : 123,
"SystemCode" : "AONE",
"ModifyTime" : 1607448066000,
"SystemId" : "1198382",
"Groups" : [ {
"Status" : "SUCCESS",
"CreateTime" : 1607448066000,
"DeleteStatus" : "N",
"IdExtent" : 0,
"Creator" : "5e6f6c1403283833284xxxx",
"EndTime" : 1607448066000,
"StartTime" : 1607448066000,
"Modifier" : "5e6f6c1403283833284xxxx",
"ResultStatus" : "SUCCESS",
"FlowInstId" : 1234,
"Name" : "构建",
"Id" : 12,
"ModifyTime" : 1607448066000
} ],
"Result" : {
"EnginePipelineNumber" : 1,
"MixFlowInstId" : "1",
"EnginePipelineName" : "流水线1",
"EnginePipelineId" : 123,
"EnginePipelineInstId" : 123,
"TimeStamp" : "1607448066000",
"TriggerMode" : "1",
"Sources" : "\"[]\"",
"Caches" : "\"[]\"",
"DateTime" : "1607448066000"
}
}
} ]
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidUser.UserNotInCurrentOrganization | The user does not belong to the specified organization. | 当前用户不属于该企业 |
404 | InvalidPipeline.NotFound | The specified pipeline does not exist. | 未找到流水线 |
404 | InvalidUser.NotFound | The specified user does not exist. | 用户数据有误,未找到该用户 |
404 | InvalidOrganization.NotFound | The specified organization doe not exist. | 企业信息有误,未找到该企业 |
500 | SystemError.UnKnownError | An error occurred while processing your request. | 系统未知异常 |
访问错误中心查看更多错误码。