> 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/elastic-ip/describeeips.md).

# DescribeEips

## 1. 接口描述

本接口(DescribeEips)用于指定条件查询已创建的弹性IPv4的信息。用户可以根据ID、名称等信息来搜索。

## 2. 请求参数

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

| 参数名称               | 必选 | 类型                                                                              | 描述                                                                                                                                                     |
| ------------------ | -- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| eipIds             | 否  | Array of String                                                                 | 按照EIP的唯一ID过滤。                                                                                                                                          |
| regionId           | 否  | String                                                                          | <p>按照EIP所属节点ID过滤。</p><p>可通过调用 <a href="/api-reference/cn/zec/location/describeregions.md">DescribeRegions</a> 获取。</p>                                  |
| name               | 否  | String                                                                          | 按照EIP的显示名称过滤，该字段支持模糊匹配。                                                                                                                                |
| status             | 否  | [EipStatus](/api-reference/cn/zec/datastructure.md#eipstatus)                   | 按照EIP的状态过滤。                                                                                                                                            |
| isDefault          | 否  | Boolean                                                                         | 按照EIP的默认属性进行过滤。                                                                                                                                        |
| pageSize           | 否  | Integer                                                                         | <p>返回的分页大小。</p><p>默认为20，最大为1000。</p>                                                                                                                   |
| pageNum            | 否  | Integer                                                                         | <p>返回的分页页码。</p><p>默认值：1</p>                                                                                                                            |
| privateIpAddress   | 否  | String                                                                          | 按照EIP绑定的内网IP过滤。                                                                                                                                        |
| ipAddress          | 否  | String                                                                          | 按照EIP的IP过滤。                                                                                                                                            |
| ipAddresses        | 否  | Array of String                                                                 | 按照EIP的IP列表过滤。                                                                                                                                          |
| instanceId         | 否  | String                                                                          | <p>按照EIP绑定的实例ID过滤。</p><p>该字段过滤出该实例所绑定的网卡上的EIP。</p><p>可通过调用 <a href="/api-reference/cn/zec/instance/describeinstances.md">DescribeInstances</a> 获取。</p> |
| associatedId       | 否  | String                                                                          | 按照EIP绑定的资源ID过滤。                                                                                                                                        |
| cidrIds            | 否  | Array of String                                                                 | <p>按照EIP所属的CIDR ID过滤。</p><p>可通过调用 <a href="/api-reference/cn/zec/cidr-block/describecidrs.md">DescribeCidrs</a> 获取。</p>                                |
| resourceGroupId    | 否  | String                                                                          | 按照EIP所属的资源组ID过滤。                                                                                                                                       |
| 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>                                                                                                                    |
| internetChargeType | 否  | [InternetChargeType](/api-reference/cn/zec/datastructure.md#internetchargetype) | 按照EIP的网络计费方式过滤。                                                                                                                                        |
| prefixLength       | 否  | Integer                                                                         | <p>按照EIP的掩码长度过滤。</p><p>32表示单IP，20–31表示网段。</p><p>可选值范围：\[20, 32]</p>                                                                                    |

## 3. 响应结果

| 参数名称       | 类型                                                                 | 描述                                                       |
| ---------- | ------------------------------------------------------------------ | -------------------------------------------------------- |
| requestId  | String                                                             | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| totalCount | Integer                                                            | 满足过滤条件的EIP总数。                                            |
| dataSet    | Array of [EipInfo](/api-reference/cn/zec/datastructure.md#eipinfo) | 返回的EIP列表。                                                |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 1. 根据公网IP查询匹配的IP列表。**

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

Request：
{
  "ipAddress": "128.0.0.1",
  "prefixLength": 32
}


Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E",
    "dataSet": [
      {
        "eipId": "<eip id>",
        "regionId": "na-east-1",
        "privateIpAddress": "10.0.0.1",
        "publicIpAddresses": [
          "128.0.0.1"
        ],
        "internetChargeType": "ByBandwidth",
        "bandwidth": 1000,
        "rateLimitMode": "LOOSE",
        "cidrId": "<cidr id>",
        "isDefault": true,
        "eipV4Type": "ChinaUnicom",
        "networkLineType": "CUG",
        "createTime": "2022-09-25T16:53:38Z",
        "expiredTime": "2022-10-25T16:53:38Z",
        "name": "EIP-na-east-1-1",
        "status": "BINDED",
        "bindType": "FullNat",
        "flowPackage": null,
        "peerRegionId": null,
        "nicId": "<nic id>",
        "instanceId": "<instance id>",
        "associatedId": "<nic id>",
        "associatedType": "NIC",
        "resourceGroupId": "xx",
        "resourceGroupName": "xx",
        "bandwidthCluster": null,
        "eipGeoRefs": [
          {
            "ip": "128.0.0.1",
            "dbIp": "华盛顿",
            "ipData": "华盛顿",
            "ipInfo": "华盛顿",
            "maxMind": "华盛顿",
            "ipGeoLocation": "华盛顿",
            "standard": "华盛顿",
            "isConsistent": true
          }
        ],
        "blockInfoList": [
          {
            "ip": "128.0.0.1",
            "bps": 100,
            "pps": 200,
            "inCps": 300,
            "outCps": 400
          }
        ],
        "prefixLength": 32,
        "tags": null
      }
    ],
    "totalCount": 1
  }
}
```

{% 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状态码 | 错误码 | 说明 |
| ------- | --- | -- |
