
# 查询实例列表
#### 功能介绍
查询实例列表。
![](https://support.huaweicloud.com/api-hrm/public_sys-resources/note_3.0-zh-cn.png)
当前页面API为历史版本API，未来可能停止维护。请使用[查询所有实例列表](https://support.huaweicloud.com/api-hrm/ListInstances.html)。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-hrm/api-call-process.html)。
#### URI
GET /v1.0/{project_id}/instances
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                               |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID，获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-hrm/hrm-api-0011.html)。 |
   
#### 请求参数
无
#### 响应参数
**状态码： 200**
表2响应Body参数 
| 参数           | 参数类型                                                                             | 描述    |
|:---|:---|:---|
| instances    | Array of [ShowInstanceResp] objects | 实例列表。 |
| instance_num | Integer                                                                          | 实例数量。 |
   
 表3ShowInstanceResp 
| 参数                         | 参数类型                                                               | 描述                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|
| name                       | String                                                             | 实例名称。                                                                                                                                                                                                                                                                                                                                                         |
| engine                     | String                                                             | 引擎。                                                                                                                                                                                                                                                                                                                                                           |
| status                     | String                                                             | 状态。                                                                                                                                                                                                                                                                                                                                                           |
| description                | String                                                             | 消息描述。                                                                                                                                                                                                                                                                                                                                                         |
| type                       | String                                                             | 实例类型：集群，cluster。                                                                                                                                                                                                                                                                                                                                              |
| specification              | String                                                             | 实例规格。                                                                                                                                                                                                                                                                                                                                                         |
| engine_version             | String                                                             | 版本。                                                                                                                                                                                                                                                                                                                                                           |
| instance_id                | String                                                             | 实例ID。                                                                                                                                                                                                                                                                                                                                                         |
| charging_mode              | Integer                                                            | 付费模式，1表示按需计费，0表示包年/包月计费。                                                                                                                                                                                                                                                                                                                                      |
| vpc_id                     | String                                                             | 私有云ID。                                                                                                                                                                                                                                                                                                                                                        |
| vpc_name                   | String                                                             | 私有云名称。                                                                                                                                                                                                                                                                                                                                                        |
| created_at                 | String                                                             | 完成创建时间。 格式为时间戳，指从格林威治时间1970年01月01日00时00分00秒起至指定时间的偏差总毫秒数。                                                                                                                                                                                                                                                                   |
| product_id                 | String                                                             | 产品标识。                                                                                                                                                                                                                                                                                                                                                         |
| security_group_id          | String                                                             | 安全组ID。                                                                                                                                                                                                                                                                                                                                                        |
| security_group_name        | String                                                             | 租户安全组名称。                                                                                                                                                                                                                                                                                                                                                      |
| subnet_id                  | String                                                             | 子网ID。                                                                                                                                                                                                                                                                                                                                                         |
| subnet_name                | String                                                             | 子网名称。                                                                                                                                                                                                                                                                                                                                                         |
| subnet_cidr                | String                                                             | 子网路由（仅RocketMQ 5.x版本会显示此字段）。                                                                                                                                                                                                                                                                                                                                  |
| available_zones            | Array of strings                                                   | 可用区ID列表。                                                                                                                                                                                                                                                                                                                                                      |
| available_zone_names       | Array of strings                                                   | 可用区名称列表。                                                                                                                                                                                                                                                                                                                                                      |
| user_id                    | String                                                             | 用户ID。                                                                                                                                                                                                                                                                                                                                                         |
| user_name                  | String                                                             | 用户名。                                                                                                                                                                                                                                                                                                                                                          |
| maintain_begin             | String                                                             | 维护时间窗开始时间，格式为HH:mm:ss。                                                                                                                                                                                                                                                                                                                                        |
| maintain_end               | String                                                             | 维护时间窗结束时间，格式为HH:mm:ss。                                                                                                                                                                                                                                                                                                                                        |
| enable_log_collection      | Boolean                                                            | 是否开启消息收集功能。                                                                                                                                                                                                                                                                                                                                                   |
| storage_space              | Integer                                                            | 存储空间，单位：GB。                                                                                                                                                                                                                                                                                                                                                   |
| used_storage_space         | Integer                                                            | 已用消息存储空间，单位：GB。                                                                                                                                                                                                                                                                                                                                               |
| enable_publicip            | Boolean                                                            | 是否开启公网。                                                                                                                                                                                                                                                                                                                                                       |
| publicip_id                | String                                                             | 实例绑定的弹性IP地址的ID。以英文逗号隔开多个弹性IP地址的ID。如果开启了公网访问功能（即enable_publicip为true），该字段为必选。                                                                                                                                                                                                                                                                                  |
| publicip_address           | String                                                             | 公网IP地址。                                                                                                                                                                                                                                                                                                                                                       |
| ssl_enable                 | Boolean                                                            | 是否开启SSL。                                                                                                                                                                                                                                                                                                                                                      |
| cross_vpc_info             | String                                                             | 跨VPC访问信息。                                                                                                                                                                                                                                                                                                                                                     |
| storage_resource_id        | String                                                             | 存储资源ID。                                                                                                                                                                                                                                                                                                                                                       |
| storage_spec_code          | String                                                             | 存储规格代码。                                                                                                                                                                                                                                                                                                                                                       |
| service_type               | String                                                             | 服务类型。                                                                                                                                                                                                                                                                                                                                                         |
| storage_type               | String                                                             | 存储类型。                                                                                                                                                                                                                                                                                                                                                         |
| extend_times               | Long                                                               | 扩展时间。                                                                                                                                                                                                                                                                                                                                                         |
| ipv6_enable                | Boolean                                                            | 是否开启IPv6。                                                                                                                                                                                                                                                                                                                                                     |
| support_features           | String                                                             | 实例支持的特性功能。                                                                                                                                                                                                                                                                                                                                                    |
| disk_encrypted             | Boolean                                                            | 是否开启磁盘加密。                                                                                                                                                                                                                                                                                                                                                     |
| ces_version                | String                                                             | 云监控版本。                                                                                                                                                                                                                                                                                                                                                        |
| node_num                   | Integer                                                            | 节点数。                                                                                                                                                                                                                                                                                                                                                          |
| new_spec_billing_enable    | Boolean                                                            | 是否启用新规格计费。                                                                                                                                                                                                                                                                                                                                                    |
| enable_acl                 | Boolean                                                            | 是否开启访问控制列表。                                                                                                                                                                                                                                                                                                                                                   |
| broker_num                 | Integer                                                            | 节点数（仅RocketMQ 4.8.0版本会显示此字段）。                                                                                                                                                                                                                                                                                                                                 |
| dns_enable                 | Boolean                                                            | 实例是否开启域名访问功能。 - true：开启   - false：未开启    |
| namesrv_address            | String                                                             | 元数据地址。                                                                                                                                                                                                                                                                                                                                                        |
| namesrv_domain_name        | String                                                             | 元数据域名。                                                                                                                                                                                                                                                                                                                                                        |
| broker_address             | String                                                             | 业务数据地址。                                                                                                                                                                                                                                                                                                                                                       |
| public_namesrv_address     | String                                                             | 公网元数据地址。                                                                                                                                                                                                                                                                                                                                                      |
| public_namesrv_domain_name | String                                                             | 公网元数据域名。                                                                                                                                                                                                                                                                                                                                                      |
| public_broker_address      | String                                                             | 公网业务数据地址。                                                                                                                                                                                                                                                                                                                                                     |
| grpc_address               | String                                                             | grpc连接地址（仅RocketMQ 5.x版本会显示此字段）。                                                                                                                                                                                                                                                                                                                              |
| grpc_domain_name           | String                                                             | grpc连接域名（仅RocketMQ 5.x版本会显示此字段）。                                                                                                                                                                                                                                                                                                                              |
| public_grpc_address        | String                                                             | 公网grpc连接地址（仅RocketMQ 5.x版本会显示此字段）。                                                                                                                                                                                                                                                                                                                            |
| public_grpc_domain_name    | String                                                             | 公网grpc连接域名（仅RocketMQ 5.x版本会显示此字段）。                                                                                                                                                                                                                                                                                                                            |
| enterprise_project_id      | String                                                             | 企业项目ID。                                                                                                                                                                                                                                                                                                                                                       |
| tags                       | Array of [TagEntity] objects | 标签列表。                                                                                                                                                                                                                                                                                                                                                         |
| total_storage_space        | Integer                                                            | 总存储空间。                                                                                                                                                                                                                                                                                                                                                        |
| resource_spec_code         | String                                                             | 资源规格。                                                                                                                                                                                                                                                                                                                                                         |
   
 表4TagEntity 
| 参数    | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| key   | String | 标签键。 - 不能为空。   - 对于同一个实例，Key值唯一。   - 长度为1\~128个字符（中文也可以输入128个字符）。   - 由任意语种字母、数字、空格和字符组成，字符仅支持_ . : = + - @   - 首尾字符不能为空格。    |
| value | String | 标签值。 - 长度为0\~255个字符（中文也可以输入255个字符）。   - 由任意语种字母、数字、空格和字符组成，字符仅支持_ . : = + - @   - 首尾字符不能为空格。                                                                                                                                                                                                                                                                              |
   
#### 请求示例
```
GET https://{endpoint}/v1.0/dms/{project_id}/instances
```
#### 响应示例
**状态码： 200**
查询成功。
```
{
  "instances" : [ {
    "name" : "reliability-ztest",
    "engine" : "reliability",
    "status" : "RUNNING",
    "description" : "",
    "type" : "cluster",
    "specification" : "c6.4u8g.cluster * 1 broker",
    "engine_version" : "4.8.0",
    "instance_id" : "68fdc9a8-805e-439d-8dd9-25adc1c58bf6",
    "resource_spec_code" : "",
    "charging_mode" : 1,
    "vpc_id" : "3db8490c-4d6d-4d8f-8d3f-047b0de4c5cf",
    "vpc_name" : "vpc-1101840",
    "created_at" : "1636699753874",
    "product_id" : "c6.4u8g.cluster",
    "security_group_id" : "23c5977f-ff33-4b95-a73e-08d8a0bc4e6c",
    "security_group_name" : "Sys-default",
    "subnet_id" : "0a0f1fcb-f019-458d-b9e5-301867394d50",
    "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ],
    "available_zone_names" : [ "AZ3" ],
    "user_id" : "0b01fbb53600d4671fa8c00673c71260",
    "user_name" : "",
    "maintain_begin" : "02:00:00",
    "maintain_end" : "06:00:00",
    "enable_log_collection" : false,
    "storage_space" : 558,
    "total_storage_space" : 600,
    "used_storage_space" : 28,
    "enable_publicip" : false,
    "ssl_enable" : false,
    "cross_vpc_info" : "{\"192.168.1.21\":{\"advertised_ip\":\"192.168.1.21\",\"broker_port\":\"-\",\"port_id\":\"fa020857-d899-497c-a5f8-8dd90ed67ff7\",\"namesrv_port\":\"8301\"},\"192.168.1.246\":{\"advertised_ip\":\"192.168.1.246\",\"broker_port\":\"10100\",\"port_id\":\"c0f0586f-a4ee-41b5-a7f1-b4e554bbf12d\",\"namesrv_port\":\"-\"},\"192.168.1.77\":{\"advertised_ip\":\"192.168.1.77\",\"broker_port\":\"10101\",\"port_id\":\"8eb1d144-4315-402f-8498-37c9a10b630c\",\"namesrv_port\":\"-\"},\"192.168.1.159\":{\"advertised_ip\":\"192.168.1.159\",\"broker_port\":\"-\",\"port_id\":\"d35b22af-a202-4329-bda4-26e1bdf2aa8e\",\"namesrv_port\":\"8300\"},\"192.168.1.14\":{\"advertised_ip\":\"192.168.1.14\",\"broker_port\":\"10102\",\"port_id\":\"5fcb50fd-3af5-4123-a455-a67f1b926026\",\"namesrv_port\":\"-\"}}",
    "storage_resource_id" : "164bdaef-2e67-4fd5-be8b-a18f91d455a2",
    "storage_spec_code" : "dms.physical.storage.ultra.v2",
    "service_type" : "advanced",
    "storage_type" : "hec",
    "enterprise_project_id" : "0",
    "extend_times" : 0,
    "ipv6_enable" : false,
    "support_features" : "kafka.crossvpc.domain.enable,feature.physerver.kafka.topic.accesspolicy,rabbitmq.plugin.management,rocketmq.acl,roma_app_enable,auto_topic_switch,feature.physerver.kafka.user.manager,enable.new.authinfo,route,kafka.config.dynamic.modify.enable,kafka.new.pod.port,feature.physerver.kafka.topic.modify,message_trace_enable,features.pod.token.access,kafka.ssl.cert.modify.enable,roma.user.manage.no.support,feature.physerver.kafka.pulbic.dynamic,features.log.collection,kafka.config.static.modify.enable",
    "disk_encrypted" : false,
    "ces_version" : "linux,v1,v2",
    "node_num" : 5,
    "new_spec_billing_enable" : true,
    "broker_num" : 1,
    "namesrv_address" : "***",
    "broker_address" : "***",
    "public_namesrv_address" : "***",
    "public_broker_address" : "***",
    "grpc_address" : "***",
    "public_grpc_address" : "***"
  } ],
  "instance_num" : 1
}
```
#### 状态码
| 状态码 | 描述    |
|:---|:---|
| 200 | 查询成功。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-hrm/ErrorCode.html)。
