
# 查询应用版本列表
#### 功能介绍
查询应用版本列表
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IoTEdge/doc?api=BatchListEdgeAppVersions)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
GET /v2/{project_id}/edge-apps/{edge_app_id}/versions
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                        |
|:---|:---|:---|:---|
| project_id  | 是    | String | 项目ID。获取方法请参见 [获取项目ID](https://support.huaweicloud.com/api-iotedge/iotedge_api_0032.html)。 |
| edge_app_id | 是    | String | 应用版本,应用内版本唯一。                                                                             |
   
表2Query参数 
| 参数           | 是否必选 | 参数类型    | 描述                       |
|:---|:---|:---|:---|
| version      | 否    | String  | 应用版本搜索关键字                |
| offset       | 否    | Integer | 查询的起始位置，取值范围为非负整数，默认为0   |
| limit        | 否    | Integer | 每页记录数，默认值为10，取值区间为1-1000 |
| ai_card_type | 否    | String  | ai加速卡类型                  |
| arch         | 否    | String  | 支持架构                     |
| state        | 否    | String  | 应用版本状态                   |
| deploy_type  | 否    | String  | 应用部署类型                   |
   
#### 请求参数
表3请求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**
表4响应Body参数 
| 参数        | 参数类型                                                                                                                                                             | 描述    |
|:---|:---|:---|
| count     | Integer                                                                                                                                                          | 总记录数  |
| page_info | [PageInfoDTO] object                                                           | 分页信息  |
| versions  | Array of [QueryEdgeAppVersionBriefResponseDTO] objects | 每页记录数 |
   
 表5PageInfoDTO 
| 参数     | 参数类型    | 描述    |
|:---|:---|:---|
| offset | Integer | 页码    |
| limit  | Integer | 每页记录数 |
   
 表6QueryEdgeAppVersionBriefResponseDTO 
| 参数                    | 参数类型             | 描述                  |
|:---|:---|:---|
| edge_app_id           | String           | 应用ID                |
| name                  | String           | 应用名称                |
| version               | String           | 应用名称                |
| sdk_version           | String           | 应用集成的边缘SDK版本        |
| description           | String           | 应用描述                |
| deploy_type           | String           | 部署类型docker\|process |
| deploy_multi_instance | Boolean          | 是否允许部署多实例           |
| create_time           | String           | 创建时间                |
| update_time           | String           | 最后一次修改时间            |
| state                 | String           | 应用版本状态              |
| arch                  | Array of strings | 架构                  |
| publish_time          | String           | 发布时间                |
| off_shelf_time        | String           | 下线时间                |
   
#### 请求示例
```
GET https://{endpoint}/v2/{project_id}/edge-apps/{edge_app_id}/versions
```
#### 响应示例
**状态码：200**
OK
```
{
  "count" : 0,
  "page_info" : {
    "offset" : 0,
    "limit" : 0
  },
  "versions" : [ {
    "edge_app_id" : "test-app",
    "version" : "1.0.0",
    "description" : "this is a test app",
    "deploy_type" : "string",
    "create_time" : "2020-05-28T11:31:29.740Z",
    "update_time" : "2020-05-28T11:31:29.740Z",
    "state" : "PUBLISHED",
    "arch" : [ null ],
    "publish_time" : "2020-05-28T11:31:29.740Z",
    "off_shelf_time" : "2020-05-28T11:31:29.740Z"
  } ]
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 401 | Bad Request           |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-iotedge/ErrorCode.html)。
