可以获取流水线信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
GET /organization/{organizationId}/pipelines/{pipelineId} HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| organizationId |
string |
是 |
企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 |
5ebbc0228123212b59xxxxx |
| pipelineId |
integer |
是 |
流水线 ID,可在流水线链接中获取,如 https://flow.aliyun.com/pipelines/【PipelineId】/current |
234 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
当前API无需请求参数
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| requestId |
string |
请求 id,每次请求都是唯一值,便于后续排查问题 |
ASSDS-ASSASX-XSAXSA-XSAXSAXS |
| errorMessage |
string |
错误信息 |
"" |
| pipeline |
object |
流水线 |
|
| creatorAccountId |
string |
创建者阿里云账号 id |
112222122 |
| envId |
integer |
环境 id 0 日常环境 1 预发环境 2 正式环境 |
0 |
| envName |
string |
环境名称 |
日常环境 |
| createTime |
integer |
创建时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| updateTime |
integer |
更新时间,使用 Unix 时间戳,单位为毫秒。 |
1586863220000 |
| groupId |
integer |
流水线分组 id |
1111 |
| modifierAccountId |
string |
更新人阿里云账号 id |
112222122 |
| name |
string |
流水线名称 |
流水线 |
| tagList |
array<object> |
标签 |
|
|
object |
|||
| id |
integer |
标签 id |
22 |
| name |
string |
标签名称 |
标签1 |
| pipelineConfig |
object |
流水线配置 |
|
| flow |
string |
流水线配置信息 |
schema: tb pipeline: - name: 执行命令 stages: - driven: AUTO jobs: - displayName: 执行命令 task: execution-component-production@10 identifier: '10_1626147407245' templateType: task templateSign: '' templateBatchUpdate: 'N' extraInfo: '' params: version1: pre-jdk1.62 steps: - name: 执行命令 stepType: exec-shell stepIdentifier: '10_1626147407245__11_1626147407249' command: | # input your command here echo hello,world! ARTIFACTS: '' JSONEncoding: true freeInTaskGroupModeFields: - ARTIFACTS source: 132504-sss_ddd_3mvJ ENGINE_PIPELINE_NAME: '${INPUTS.ENGINE_PIPELINE_NAME}' ENGINE_PIPELINE_ID: '${INPUTS.ENGINE_PIPELINE_ID}' ENGINE_PIPELINE_INST_ID: '${INPUTS.ENGINE_PIPELINE_INST_ID}' ENGINE_PIPELINE_INST_NUMBER: '${INPUTS.ENGINE_PIPELINE_INST_NUMBER}' buildNodeGroup: K8S-4 plugins: [] output: [] freeInTaskGroupModeFields: [] |
| settings |
string |
流水线环境变量等 |
{} |
| sources |
array<object> |
代码源 |
|
|
array<object> |
|||
| sign |
string |
代码源唯一标识 |
xxsxsxs |
| type |
string |
代码源类型 aliyunGit 阿里云代码库 customGitlab 自建 git giteeGit 码云 codeup Codeup git 通用 git gitlab gitlab bitbucket bitbucket githubOAuth github |
Codeup |
| data |
object |
代码数据 |
|
| branch |
string |
分支 |
master |
| serviceConnectionId |
integer |
服务连接 Id |
12 |
| label |
string |
代码源显示标签 |
cdup/ss |
| isTrigger |
boolean |
是否提交触发 |
true |
| repo |
string |
代码库地址 |
https://codeup.aliyun.com/test.git |
| triggerFilter |
string |
触发过滤条件 |
.* |
| webhook |
string |
webhhook 地址 |
https://flow.aliyun/webhook/asassasa |
| events |
array |
触发事件 |
|
|
string |
事件 |
push |
|
| isBranchMode |
boolean |
是否分支模式 |
false |
| isSubmodule |
boolean |
是否子模块 |
false |
| isCloneDepth |
boolean |
是否设置 clone 深度 |
true |
| cloneDepth |
integer |
克隆深度 |
1 |
| credentialId |
integer |
证书 Id |
222 |
| credentialType |
string |
证书类型 |
region-ssh |
| credentialLabel |
string |
证书显示名称 |
企业公钥 |
| namespace |
string |
github 命名空间 |
asasasas |
| success |
boolean |
true 接口调用成功,false 接口调用失败 |
true |
| errorCode |
string |
错误码 |
"" |
示例
正常返回示例
JSON格式
{
"requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"errorMessage": "\"\"",
"pipeline": {
"creatorAccountId": "112222122",
"envId": 0,
"envName": "日常环境",
"createTime": 1586863220000,
"updateTime": 1586863220000,
"groupId": 1111,
"modifierAccountId": "112222122",
"name": "流水线",
"tagList": [
{
"id": 22,
"name": "标签1"
}
],
"pipelineConfig": {
"flow": "schema: tb pipeline: - name: 执行命令 stages: - driven: AUTO jobs: - displayName: 执行命令 task: execution-component-production@10 identifier: '10_1626147407245' templateType: task templateSign: '' templateBatchUpdate: 'N' extraInfo: '' params: version1: pre-jdk1.62 steps: - name: 执行命令 stepType: exec-shell stepIdentifier: '10_1626147407245__11_1626147407249' command: | # input your command here echo hello,world! ARTIFACTS: '' JSONEncoding: true freeInTaskGroupModeFields: - ARTIFACTS source: 132504-sss_ddd_3mvJ ENGINE_PIPELINE_NAME: '${INPUTS.ENGINE_PIPELINE_NAME}' ENGINE_PIPELINE_ID: '${INPUTS.ENGINE_PIPELINE_ID}' ENGINE_PIPELINE_INST_ID: '${INPUTS.ENGINE_PIPELINE_INST_ID}' ENGINE_PIPELINE_INST_NUMBER: '${INPUTS.ENGINE_PIPELINE_INST_NUMBER}' buildNodeGroup: K8S-4 plugins: [] output: [] freeInTaskGroupModeFields: []",
"settings": "{}",
"sources": [
{
"sign": "xxsxsxs",
"type": "Codeup",
"data": {
"branch": "master",
"serviceConnectionId": 12,
"label": "cdup/ss",
"isTrigger": true,
"repo": "https://codeup.aliyun.com/test.git",
"triggerFilter": ".*",
"webhook": "https://flow.aliyun/webhook/asassasa",
"events": [
"push"
],
"isBranchMode": false,
"isSubmodule": false,
"isCloneDepth": true,
"cloneDepth": 1,
"credentialId": 222,
"credentialType": "region-ssh",
"credentialLabel": "企业公钥",
"namespace": "asasasas"
}
}
]
}
},
"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. | 流水线不存在 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。