> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/zec/vpc-network/havip/describehavips.md).

# DescribeHaVips

## 1. 接口描述

本接口(DescribeHaVips)用于查询一个或多个高可用虚拟IP的详细信息。

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称        | 必选 | 类型                                                         | 描述                                     |
| ----------- | -- | ---------------------------------------------------------- | -------------------------------------- |
| haVipIds    | 否  | Array of String                                            | <p>HaVip ID列表。</p><p>最多支持100个ID查询。</p> |
| name        | 否  | String                                                     | HaVip名称，支持模糊查询。                        |
| regionId    | 否  | String                                                     | 所在节点ID。                                |
| vpcIds      | 否  | Array of String                                            | 所属VPC ID列表。                            |
| subnetIds   | 否  | Array of String                                            | 所属子网ID列表。                              |
| ipAddresses | 否  | Array of String                                            | 私网IP地址列表。最多支持100个地址查询。                 |
| instanceIds | 否  | Array of String                                            | 实例ID列表，返回绑定了指定实例的高可用虚拟IP。              |
| pageSize    | 否  | Integer                                                    | <p>分页大小。</p><p>可选值范围：\[1, 1000]</p>    |
| pageNum     | 否  | Integer                                                    | <p>分页页码。</p><p>默认值：1</p>               |
| tagKeys     | 否  | Array of String                                            | <p>根据标签键进行搜索。</p><p>最多支持20个标签键。</p>    |
| tags        | 否  | Array of [Tag](/api-reference/cn/zec/datastructure.md#tag) | <p>根据标签进行搜索。</p><p>最多支持20个标签。</p>      |

## 3. 响应结果

| 参数名称       | 类型                                                                     | 描述                                                       |
| ---------- | ---------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId  | String                                                                 | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| totalCount | Integer                                                                | 符合条件的数据总数。                                               |
| dataSet    | Array of [HaVipInfo](/api-reference/cn/zec/datastructure.md#havipinfo) | HaVip结果集。                                                |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询所有HaVip。**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeHaVips
<Common Request Params>

Request：
{
  "pageNum": 1,
  "pageSize": 20
}

Response：
{
  "requestId": "T12345678-0000-0000-0000-000000000003",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000003",
    "totalCount": 1,
    "dataSet": [
      {
        "haVipId": "havip-xxxxxxxx",
        "name": "my-havip",
        "regionId": "SEA-A",
        "vpcId": "vpc-xxxxxxxx",
        "subnetId": "subnet-xxxxxxxx",
        "securityGroupId": "sg-xxxxxxxx",
        "ipAddress": "10.0.1.100",
        "associatedInstances": ["vm-xxxxxxxx", "vm-yyyyyyyy"],
        "masterInstanceId": "vm-xxxxxxxx",
        "associatedEips": [
          {
            "eipId": "eip-xxxxxxxx",
            "eipAddress": "1.2.3.4"
          },
          {
            "eipId": "eip-yyyyyyyy",
            "eipAddress": "5.6.7.8"
          }
        ],
        "createTime": "2026-01-01T00:00:00Z",
        "tags": []
      }
    ]
  }
}
```

**2. 按子网ID过滤查询。**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeHaVips
<Common Request Params>

Request：
{
  "subnetIds": ["subnet-xxxxxxxx"]
}

Response：
{
  "requestId": "T12345678-0000-0000-0000-000000000004",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000004",
    "totalCount": 1,
    "dataSet": [
      {
        "haVipId": "havip-yyyyyyyy",
        "name": "my-havip-2",
        "regionId": "SEA-A",
        "vpcId": "vpc-xxxxxxxx",
        "subnetId": "subnet-xxxxxxxx",
        "securityGroupId": "sg-xxxxxxxx",
        "ipAddress": "10.0.1.200",
        "associatedInstances": [],
        "masterInstanceId": null,
        "associatedEips": [],
        "createTime": "2026-01-02T00:00:00Z",
        "tags": []
      }
    ]
  }
}
```

**3. 按实例ID过滤，查询绑定了指定实例的HaVip。**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeHaVips
<Common Request Params>

Request：
{
  "instanceIds": ["vm-xxxxxxxx"]
}

Response：
{
  "requestId": "T12345678-0000-0000-0000-000000000005",
  "response": {
    "requestId": "T12345678-0000-0000-0000-000000000005",
    "totalCount": 1,
    "dataSet": [
      {
        "haVipId": "havip-xxxxxxxx",
        "name": "my-havip",
        "regionId": "SEA-A",
        "vpcId": "vpc-xxxxxxxx",
        "subnetId": "subnet-xxxxxxxx",
        "securityGroupId": "sg-xxxxxxxx",
        "ipAddress": "10.0.1.100",
        "associatedInstances": ["vm-xxxxxxxx", "vm-yyyyyyyy"],
        "masterInstanceId": "vm-xxxxxxxx",
        "associatedEips": [],
        "createTime": "2026-01-01T00:00:00Z",
        "tags": []
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码 | 说明 |
| ------- | --- | -- |
