
# 查询应用部署列表
#### 功能介绍
该API用于查询应用部署列表。
#### URI
GET /v2/{project_id}/edgemgr/deployments?{name=xxx,limit=xxx,offset=xxx}
表1Path参数 
| 名称         | 是否必选 | 说明                                                                            |
|:---|:---|:---|
| project_id | 是    | 项目ID，获取方法请参见[获取项目ID](https://support.huaweicloud.com/api-ief/projectid.html)。 |
   
表2查询参数 
| 名称      | 是否必选 | 参数类型   | 说明                                                          |
|:---|:---|:---|:---|
| limit   | 否    | String | 每页显示的条目数量                                                   |
| offset  | 否    | String | 查询的起始位置                                                     |
| name    | 否    | String | deployment的名称                                               |
| node_id | 否    | String | 节点ID                                                        |
| tags    | 否    | String | 标签的key和value通过点连接，多个标签通过逗号连接，如：tags=key1.value1,key2.value2 |
   
![](https://support.huaweicloud.com/api-ief/public_sys-resources/note_3.0-zh-cn.png)
- 如果不携带任何检索参数，将返回该租户的所有实例信息。
- tags可以和多个其他检索参数同时生效。
 
#### 请求消息
表3请求Header参数 
| 参数           | 是否必选 | 类型     | 描述                                                                                                                                                                                                                                                       |
|:---|:---|:---|:---|
| Content-Type | 是    | String | 消息体的类型（格式） 推荐您使用默认值application/json。                                                                                                                                                                  |
| X-Auth-Token | 是    | String | 用户Token 调用接口的认证方式分为Token和AK/SK两种，如果您使用Token方式，此参数为必填，请填写Token的值，获取方式请参见[Token认证](https://support.huaweicloud.com/api-ief/ief_02_0011.html#ief_02_0011__zh-cn_topic_0121671869_section2417768214391)。 |
   
#### 响应消息
**响应参数**
表4响应Body参数 
| 名称          | 参数类型                                                                                                            | 说明      |
|:---|:---|:---|
| deployments | Array of [表18](https://support.huaweicloud.com/api-ief/ief_02_1001.html#ief_02_1001__table136713167268) objects | 部署列表    |
| count       | Integer                                                                                                         | 满足条件的个数 |
   
**响应示例**
```
{
    "count": 1,
    "deployments": [
        {
            "created_at": "2020-05-30 09:42:49.055868 +0000 UTC",
            "replicas": 1,
            "description": "",
            "group_id": "",
            "group_name": "",
            "id": "7a7ffbc6-a247-4898-a24b-4020226978c5",
            "name": "e-deployment-auto-qe77",
            "project_id": "e78acc02d9d141eda5ca8e88fa35f6f8",
            "updated_at": "2020-05-30 09:42:49.132984 +0000 UTC",
            "instances": [
                {
                    "id": "12429567-c9dd-4ad7-8a6b-0b1eabf7cef0",
                    "node_id": "f73b8f40-237a-4994-94ec-e58d4db882b3",
                    "name": "e-deployment-auto-qe77-65f6c67d7-zptfx",
                    "image_url": "test-app:latest",
                    "version": "latest",
                    "configs": {
                        "host_network": false,
                        "restart_policy": "Always",
                        "privileged": false
                    },
                    "envs": [],
                    "volumes": [],
                    "message": "",
                    "state": "RUNNING",
                    "liveness_probe": {
                        "initial_delay_seconds": 30,
                        "timeout_seconds": 60,
                        "http_get": {
                            "path": "/",
                            "port": 80,
                            "scheme": "HTTP"
                        }
                    },
                    "readiness_probe": {
                        "initial_delay_seconds": 30,
                        "timeout_seconds": 60,
                        "http_get": {
                            "path": "/",
                            "port": 80,
                            "scheme": "HTTP"
                        }
                    },
                    "resources": {
                    },
                    "reason": "",
                    "is_ready": "ABNORMAL",
                    "restarts": 0
                }
            ],
            "visibility": ""
        }
    ]
}
```
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-ief/ErrorCode.html)。
