
# 查询应用版本详情
#### 功能介绍
查询应用版本详情
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IoTEdge/doc?api=ShowEdgeApplicationVersion)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
GET /v2/{project_id}/edge-apps/{edge_app_id}/versions/{version}
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                        |
|:---|:---|:---|:---|
| project_id  | 是    | String | 项目ID。获取方法请参见 [获取项目ID](https://support.huaweicloud.com/api-iotedge/iotedge_api_0032.html)。 |
| edge_app_id | 是    | String | 应用ID，应用唯一。                                                                                |
| version     | 是    | String | 应用版本,应用内版本唯一。                                                                             |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务 [获取IAM用户Token](https://support.huaweicloud.com/api-iam/iam_30_0001.html)接口获取，接口返回的响应消息头中"X-Subject-Token"就是需要获取的用户Token。简要的获取方法样例请参见 [Token认证](https://support.huaweicloud.com/api-iothub/iot_06_v5_0091.html#section0)。 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                    | 参数类型                                                                                                                     | 描述                  |
|:---|:---|:---|
| edge_app_id           | String                                                                                                                   | 应用ID                |
| name                  | String                                                                                                                   | 应用名称                |
| deploy_type           | String                                                                                                                   | 部署类型docker\|process |
| deploy_multi_instance | Boolean                                                                                                                  | 是否允许部署多实例           |
| version               | String                                                                                                                   | 应用版本                |
| sdk_version           | String                                                                                                                   | 应用集成的边缘SDK版本        |
| description           | String                                                                                                                   | 应用描述                |
| create_time           | String                                                                                                                   | 创建时间                |
| update_time           | String                                                                                                                   | 最后一次修改时间            |
| state                 | String                                                                                                                   | 应用版本状态              |
| liveness_probe        | [ProbeDTO] object                         | 工作负载存活探针            |
| readiness_probe       | [ProbeDTO] object                         | 工作负载业务探针            |
| arch                  | Array of strings                                                                                                         | 架构                  |
| command               | Array of strings                                                                                                         | 启动命令                |
| args                  | Array of strings                                                                                                         | 启动参数                |
| container_settings    | [ContainerSettingsDTO] object | 容器相关配置              |
| outputs               | Array of strings                                                                                                         | 应用输出路由端点            |
| inputs                | Array of strings                                                                                                         | 应用输入路由              |
| services              | Array of strings                                                                                                         | 应用实现的服务列表           |
| publish_time          | String                                                                                                                   | 发布时间                |
| off_shelf_time        | String                                                                                                                   | 下线时间                |
| supplier              | String                                                                                                                   | 驱动厂商                |
| tpl_id                | String                                                                                                                   | 模板id                |
| pre_upgrade_probe     | [PreUpgradeProbeDTO] object     | 升级前检查探针             |
   
 表4ProbeDTO 
| 参数                    | 参数类型                                                                                                     | 描述                |
|:---|:---|:---|
| exec_command          | String                                                                                                   | 执行探测的命令行命令        |
| tcp_socket            | [TcpSocketDTO] object | 执行tcp探测           |
| http_get              | [HttpGetDTO] object     | 执行http探测          |
| initial_delay_seconds | Integer                                                                                                  | 表示从工作负载启动后从多久开始探测 |
| timeout_seconds       | Integer                                                                                                  | 表示探测超时时间          |
| period_seconds        | Integer                                                                                                  | 检查周期              |
| failure_threshold     | Integer                                                                                                  | 失败多少次算不健康         |
   
 表5TcpSocketDTO 
| 参数   | 参数类型    | 描述 |
|:---|:---|:---|
| port | Integer | 端口 |
   
 表6HttpGetDTO 
| 参数     | 参数类型    | 描述   |
|:---|:---|:---|
| path   | String  | 请求路径 |
| port   | Integer | 端口   |
| host   | String  | 主机地址 |
| scheme | String  | 协议类型 |
   
 表7ContainerSettingsDTO 
| 参数            | 参数类型                                                                                                                   | 描述                                                           |
|:---|:---|:---|
| configs       | [ContainerConfigsDTO] object | 容器特殊参数                                                       |
| image_url     | String                                                                                                                 | 镜像存储地址                                                       |
| envs          | Object                                                                                                                 | 环境变量                                                         |
| volumes       | Array of [VolumeDTO] objects           | 卷配置                                                          |
| npu_type      | String                                                                                                                 | NPU类型                                                        |
| vnpu_template | String                                                                                                                 | NPU算力切分模板，可在对应芯片的机器上通过npu-smi info -t template-info命令查询其详细信息 |
| resources     | [ResourceDTO] object                 | 资源配额                                                         |
| ext_devices   | Array of [ExtDevice] objects           | 外挂设备配置                                                       |
   
 表8ContainerConfigsDTO 
| 参数                  | 参数类型                                                                                                                       | 描述                   |
|:---|:---|:---|
| privileged          | Boolean                                                                                                                    | 开启容器特权模式             |
| host_network        | Boolean                                                                                                                    | 是否使用主机网络模式           |
| restart_policy      | String                                                                                                                     | 重启策略，容器执行健康检查后失败后的策略 |
| container_port_list | Array of [ContainerPortDTO] objects | 容器端口映射值              |
   
 表9ContainerPortDTO 
| 参数             | 参数类型    | 描述               |
|:---|:---|:---|
| container_port | Integer | 构成一对映射的容器端口      |
| host_port      | Integer | 构成一对映射的物理机对应网卡端口 |
| host_ip        | String  | 对应网卡地址           |
   
 表10VolumeDTO 
| 参数          | 参数类型    | 描述      |
|:---|:---|:---|
| name        | String  | 卷名称     |
| type        | String  | 挂载类型    |
| source      | String  | 源路径     |
| destination | String  | 卷挂载路径   |
| read_only   | Boolean | 只读，默认只读 |
   
 表11ResourceDTO 
| 参数       | 参数类型                                                                                                               | 描述          |
|:---|:---|:---|
| limits   | [ResourceConfigDTO] object | 允许容器使用的最大资源 |
| requests | [ResourceConfigDTO] object | 容器需要使用的最小资源 |
   
 表12ResourceConfigDTO 
| 参数     | 参数类型  | 描述           |
|:---|:---|:---|
| cpu    | Float | cpu个数        |
| memory | Float | 内存大小         |
| gpu    | Float | gpu内存大小，单位为M |
| npu    | Float | 使用npu加速卡个数   |
   
 表13ExtDevice 
| 参数                 | 参数类型   | 描述       |
|:---|:---|:---|
| source             | String | 源路径      |
| destination        | String | 卷挂载路径    |
| cgroup_permissions | String | 只读，默认MRW |
   
 表14PreUpgradeProbeDTO 
| 参数             | 参数类型                                                                                                                                     | 描述   |
|:---|:---|:---|
| port           | Integer                                                                                                                                  | 端口   |
| path           | String                                                                                                                                   | 请求路径 |
| interval       | Integer                                                                                                                                  | 轮询间隔 |
| protocol       | String                                                                                                                                   | 协议类型 |
| timeout_config | [UpgradeProbeTimeoutConfigDTO] object | 超时配置 |
   
 表15UpgradeProbeTimeoutConfigDTO 
| 参数                | 参数类型    | 描述   |
|:---|:---|:---|
| timeout           | Integer | 超时时间 |
| failure_threshold | Integer | 失败阈值 |
   
#### 请求示例
```
GET https://{endpoint}/v2/{project_id}/edge-apps/{edge_app_id}/versions/{version}
```
#### 响应示例
**状态码：200**
OK
```
{
  "edge_app_id" : "string",
  "name" : "string",
  "deploy_type" : "string",
  "deploy_multi_instance" : false,
  "version" : "string",
  "sdk_version" : "string",
  "description" : "string",
  "create_time" : "string",
  "update_time" : "string",
  "state" : "DRAFT",
  "liveness_probe" : {
    "exec_command" : "string",
    "tcp_socket" : {
      "port" : 65535
    },
    "http_get" : {
      "path" : "string",
      "port" : 65535,
      "host" : "string",
      "scheme" : "HTTP"
    },
    "initial_delay_seconds" : 3600,
    "timeout_seconds" : 3600,
    "period_seconds" : 30,
    "failure_threshold" : 3
  },
  "readiness_probe" : {
    "exec_command" : "string",
    "tcp_socket" : {
      "port" : 65535
    },
    "http_get" : {
      "path" : "string",
      "port" : 65535,
      "host" : "string",
      "scheme" : "HTTP"
    },
    "initial_delay_seconds" : 3600,
    "timeout_seconds" : 3600,
    "period_seconds" : 30,
    "failure_threshold" : 3
  },
  "arch" : [ "string" ],
  "command" : [ "string" ],
  "args" : [ "string" ],
  "container_settings" : {
    "configs" : {
      "privileged" : false,
      "host_network" : true,
      "restart_policy" : "string",
      "container_port_list" : [ {
        "container_port" : 65535,
        "host_port" : 65535,
        "host_ip" : "string"
      } ]
    },
    "image_url" : "string",
    "envs" : { },
    "volumes" : [ {
      "name" : "string",
      "type" : "string",
      "source" : "string",
      "destination" : "string",
      "read_only" : true
    } ],
    "resources" : {
      "limits" : {
        "cpu" : 1000,
        "memory" : 1024000,
        "gpu" : 1024000,
        "npu" : 1000
      },
      "requests" : {
        "cpu" : 1000,
        "memory" : 1024000,
        "gpu" : 1024000,
        "npu" : 1000
      }
    },
    "ext_devices" : [ {
      "source" : "string",
      "destination" : "string",
      "cgroup_permissions" : "string"
    } ]
  },
  "outputs" : [ "string" ],
  "inputs" : [ "string" ],
  "services" : [ "string" ],
  "publish_time" : "2020-05-28T11:31:29.740Z",
  "off_shelf_time" : "2020-05-28T11:31:29.740Z",
  "supplier" : "华为",
  "tpl_id" : "sys_general_opcua"
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 401 | Bad Request           |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-iotedge/ErrorCode.html)。
