可以获取流水线运行实例。
接口说明
API 名称:GetPipelineRun
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
GET /organization/{organizationId}/pipelines/{pipelineId}/pipelineRuns/{pipelineRunId} HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| organizationId |
string |
是 |
企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 |
5ebbc0228123212b59xxxxx |
| pipelineId |
integer |
是 |
流水线 ID,可在流水线链接中获取,如 https://flow.aliyun.com/pipelines/【PipelineId】/current |
12222 |
| pipelineRunId |
integer |
是 |
流水线运行实例 id |
1 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
当前API无需请求参数
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| requestId |
string |
请求 id,每次请求都是唯一值,便于后续排查问题 |
ASSDS-ASSASX-XSAXSA-XSAXSAXS |
| errorMessage |
string |
错误信息 |
"" |
| pipelineRun |
object |
流水线运行实例 |
|
| creatorAccountId |
string |
创建者阿里云账号 id |
1111111111 |
| createTime |
integer |
创建时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| updateTime |
integer |
更新时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| modifierAccountId |
string |
更新人阿里云账号 id |
11111111111 |
| pipelineId |
integer |
流水线 Id |
1234 |
| pipelineRunId |
integer |
流水线运行实例 id |
1 |
| status |
string |
状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
SUCCESS |
| triggerMode |
integer |
|
1 |
| stageGroup |
array |
阶段拓扑信息 |
|
|
array |
Group |
||
|
string |
阶段 |
阶段名称 |
|
| sources |
array<object> |
代码源 |
|
|
array<object> |
代码源 |
||
| sign |
string |
代码源唯一标识 |
assaaaaaasasasa |
| type |
string |
代码库类型 Codeup codeup 代码源 aliyunGit 阿里云 code giteeGit 码云 |
Codeup |
| data |
object |
代码源信息 |
|
| branch |
string |
代码分支 |
master |
| commint |
string |
提交信息 JSON 数据 |
{} |
| repo |
string |
代码库地址 |
http://codeup.aliyun.com/a.git |
| stages |
array<object> |
阶段信息 |
|
|
array<object> |
|||
| name |
string |
阶段名称 |
Java构建 |
| stageInfo |
object |
阶段详情 |
|
| endTime |
integer |
结束时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| startTime |
integer |
开始时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| name |
string |
阶段名称 |
Java构建 |
| status |
string |
状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
RUNNING |
| jobs |
array<object> |
任务 |
|
|
array<object> |
|||
| endTime |
integer |
结束时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| id |
integer |
任务 Id |
21212 |
| name |
string |
任务名称 |
Java构建 |
| params |
string |
触发参数 |
{} |
| status |
string |
状态 FAIL 运行失败 SUCCESS 运行成功 RUNNING 运行中 |
RUNNING |
| startTime |
integer |
开始时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| actions |
array<object> |
后续操作,具体参考文档 https://help.aliyun.com/document_detail/2360596.html |
|
|
array<object> |
|||
| type |
string |
参考文档 https://help.aliyun.com/document_detail/2360596.html |
PassPipelineValidate |
| disable |
boolean |
参考文档 https://help.aliyun.com/document_detail/2360596.html |
true |
| params |
object |
参考文档 https://help.aliyun.com/document_detail/2360596.html |
{} |
|
any |
后续操作的参数值,具体内容取决于操作类型 |
1111111 |
|
| success |
boolean |
true 接口调用成功,false 接口调用失败 |
true |
| errorCode |
string |
错误码 |
"" |
示例
正常返回示例
JSON格式
{
"requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"errorMessage": "\"\"",
"pipelineRun": {
"creatorAccountId": "1111111111",
"createTime": 1586863220000,
"updateTime": 1586863220000,
"modifierAccountId": "11111111111",
"pipelineId": 1234,
"pipelineRunId": 1,
"status": "SUCCESS",
"triggerMode": 1,
"stageGroup": [
[
"阶段名称"
]
],
"sources": [
{
"sign": "assaaaaaasasasa",
"type": "Codeup",
"data": {
"branch": "master",
"commint": "{}",
"repo": "http://codeup.aliyun.com/a.git"
}
}
],
"stages": [
{
"name": "Java构建",
"stageInfo": {
"endTime": 1586863220000,
"startTime": 1586863220000,
"name": "Java构建",
"status": "RUNNING",
"jobs": [
{
"endTime": 1586863220000,
"id": 21212,
"name": "Java构建",
"params": "{}",
"status": "RUNNING",
"startTime": 1586863220000,
"actions": [
{
"type": "PassPipelineValidate",
"disable": true,
"params": {
"key": "1111111"
}
}
]
}
]
}
}
]
},
"success": true,
"errorCode": "\"\""
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParam.ParamNotPresent | The parameter is invalid. | 参数有误,请检查参数 |
| 400 | InvalidUser.NotFound | The user that is invoking the API service is not a registered user. | 调用 API 的用户,未注册为云效用户 |
| 403 | Forbidden.UserNotInCurrentOrganization | The user is not in the organization and is not authorized to perform the operation. | 当前用户不在该企业中,无权进行操作。 |
| 404 | InvalidOrganization.NotFound | The organization is not found. | 企业不存在,请检查企业ID是否正确 |
| 404 | InvalidPipeline.NotFound | The pipeline is not found. | 流水线不存在 |
| 404 | InvalidPipelineRun.NotFound | The pipeline execution instance is not found. | 流水线运行实例不存在 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。