
# 查看流水线详情
#### 功能介绍
此API用于查看流水线详情。
#### URI
GET /cpepipeline/v2/pipelines/{pipeline_id}
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述     |
|:---|:---|:---|:---|
| pipeline_id | 是    | String | 流水线ID。 |
   
#### 请求消息
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                           |
|:---|:---|:---|:---|
| Content-Type | 是    | String | 消息体的类型（格式），默认取值为"application/json;charset=utf8"。                                                                                             |
| X-Auth-Token | 是    | String | 调用接口的认证方式分为Token和AK/SK两种，如果您使用的Token方式，此参数为必填，请填写Token的值。Token获取方式，请参考[获取用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)。 |
   
#### 响应消息
表3响应参数 
| 参数                  | 参数类型    | 描述                                                         |
|:---|:---|:---|
| project             | String  | 项目名称。                                                      |
| domain              | String  | 租户名称。                                                      |
| id                  | String  | 流水线ID。                                                     |
| enterpriseProjectId | String  | 企业项目ID。                                                    |
| modelVersion        | Integer | 流水线类型。                                                     |
| creator             | String  | 创建者。                                                       |
| revisor             | String  | 修订者。                                                       |
| createdAt           | Integer | 创建时间。                                                      |
| createdAt           | Integer | 修改时间。                                                      |
| failMode            | String  | 激进策略。                                                      |
| strategyType        | Integer | 触发策略。                                                      |
| pipelineDeclaration | Object  | 流水线定义，详情请见[表4]。 |
   
 表4pipelineDeclaration 
| 参数           | 参数类型             | 描述                                                         |
|:---|:---|:---|
| name         | String           | 流水线名称                                                      |
| modelVersion | Integer          | 流水线类型。                                                     |
| version      | Integer          | 流水线版本。                                                     |
| stages       | Array of objects | 流水线阶段，详情请见[表5]。 |
| configMode   | String           | 流水线创建类型。                                                   |
   
 表5stages 
| 参数          | 参数类型             | 描述                                                       |
|:---|:---|:---|
| id          | String           | 阶段ID。                                                    |
| name        | String           | 阶段名称。                                                    |
| displayName | String           | 阶段显示名称。                                                  |
| type        | String           | 阶段类型。                                                    |
| pipelineId  | String           | 流水线ID。                                                   |
| orderIndex  | String           | 阶段执行顺序。                                                  |
| status      | Integer          | 阶段状态。                                                    |
| taskGroup   | String           | 任务组。                                                     |
| tasks       | Array of objects | 流水线任务，详情请见[表6] |
   
 表6tasks 
| 参数           | 参数类型    | 描述                                                          |
|:---|:---|:---|
| id           | Integer | 任务ID。                                                       |
| name         | String  | 任务名称。                                                       |
| displayName  | String  | 任务显示名称。                                                     |
| input        | Object  | 任务输入参数，详情请见[表8]。 |
| output       | Object  | 任务输出参数                                                      |
| status       | Integer | 任务状态。                                                       |
| orderIndex   | Integer | 任务执行顺序。                                                     |
| skipped      | Boolean | 是否跳过。                                                       |
| groupIndex   | String  | 任务所在任务组。                                                    |
| delayTime    | Integer | 任务延迟执行时间。                                                   |
| errorDetails | String  | 任务报错信息。                                                     |
| stageName    | String  | 阶段类型。                                                       |
| taskTypeId   | Object  | 任务类型参数，详情请见[表7]。  |
   
 表7taskTypeId 
| 参数       | 参数类型   | 描述     |
|:---|:---|:---|
| category | String | 任务目录。  |
| owner    | String | 任务所有者。 |
| provider | String | 任务提供方。 |
| type     | String | 任务类型。  |
   
 表8input 
| 参数             | 参数类型   | 描述      |
|:---|:---|:---|
| assemblingId   | String | 构建任务ID。 |
| environment_id | String | 环境ID。   |
   
#### 请求示例
无
#### 响应示例
```
{
    "project": "cn-north-4",
    "domain": "hwstaff_pub_servicestagew3",
    "id": "c5a2abab-6c56-4b04-bb67-92470daef78f",
    "enterpriseProjectId": "0",
    "name": "testzasd",
    "enterpriseProject": "default",
    "modelVersion": 1,
    "creator": "zhangyuhao",
    "revisor": "zhangyuhao",
    "createdAt": 1753080263966,
    "updatedAt": 1753080263966,
    "failMode": "stop",
    "strategyType": 0,
    "pipelineDeclaration": {
        "name": "testzasd",
        "description": "",
        "modelVersion": 0,
        "version": 1,
        "stages": [
            {
                "id": 0,
                "name": "Artifacts",
                "approvalType": 0,
                "displayName": null,
                "type": null,
                "pipelineId": null,
                "orderIndex": 0,
                "status": null,
                "taskGroup": null,
                "tasks": [
                    {
                        "id": 0,
                        "name": "ghy-test-comp-0626-3-62e353",
                        "displayName": "Empty",
                        "taskTypeId": {
                            "category": "Build",
                            "owner": "System",
                            "provider": "Assembling",
                            "type": null
                        },
                        "input": {
                            "assemblingId": "audzvfrtnru94o8jtb9g38svx0rezi86rq43ff8m"
                        },
                        "output": {},
                        "status": null,
                        "orderIndex": 0,
                        "skipped": false,
                        "groupIndex": null,
                        "delayTime": 0,
                        "errorDetails": null,
                        "stageName": null
                    }
                ]
            },
            {
                "id": 0,
                "name": "Environments",
                "approvalType": 0,
                "displayName": null,
                "type": null,
                "pipelineId": null,
                "orderIndex": 0,
                "status": null,
                "taskGroup": null,
                "tasks": [
                    {
                        "id": 0,
                        "name": "production",
                        "displayName": "echotest-nodel",
                        "taskTypeId": {
                            "category": "Environment",
                            "owner": "System",
                            "provider": "Environment",
                            "type": null
                        },
                        "input": {
                            "environment_id": "6a67914f-8233-4a62-bd7c-5905bfde5df8"
                        },
                        "output": {},
                        "status": null,
                        "orderIndex": 0,
                        "skipped": false,
                        "groupIndex": null,
                        "delayTime": 0,
                        "errorDetails": null,
                        "stageName": null
                    }
                ]
            }
        ],
        "configMode": "ui"
    }
}
```
#### 状态码
| 状态码 | 描述     |
|:---|:---|
| 200 | 操作成功。  |
| 400 | 错误的请求。 |
   
#### 错误码
请参考[ServiceStage错误码](https://support.huaweicloud.com/api-servicestage/servicestage_06_0162.html)。
