# DescribeEips

## 1. 接口描述

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

## 2. 请求参数

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

| 参数名称               | 必选 | 类型                                                                                                                | 描述                                                      |
| ------------------ | -- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| eipIds             | 否  | Array of String                                                                                                   | 按照 EIP 的唯一 ID 过滤。                                       |
| regionId           | 否  | String                                                                                                            | 按照 EIP 所属节点ID过滤。                                        |
| name               | 否  | String                                                                                                            | 按照 EIP 的显示名称过滤，该字段支持模糊匹配。                               |
| status             | 否  | [EipStatus](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#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                                                                                                            | 按照 IP地址过滤。                                              |
| ipAddresses        | 否  | Array of String                                                                                                   | 按照 EIP 的 IP列表过滤。                                        |
| instanceId         | 否  | String                                                                                                            | <p>按照 EIP 绑定的实例 ID 过滤。</p><p>该字段过滤出该实例所绑定的网卡上的 EIP。</p> |
| associatedId       | 否  | String                                                                                                            | 按照 EIP 绑定的资源 ID 过滤。                                     |
| cidrIds            | 否  | Array of String                                                                                                   | 按照 EIP 所属的CIDR ID列表 过滤。                                 |
| resourceGroupId    | 否  | String                                                                                                            | 按照 EIP 所属的资源组ID过滤。                                      |
| tagKeys            | 否  | Array of String                                                                                                   | <p>根据标签键进行搜索。</p><p>最长不得超过20个标签键。</p>                   |
| tags               | 否  | Array of [Tag](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#tag)                      | <p>根据标签进行搜索。</p><p>最长不得超过20个标签。</p>                     |
| internetChargeType | 否  | [InternetChargeType](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#internetchargetype) | 按照 EIP 的网络计费方式过滤。                                       |

## 3. 响应结果

| 参数名称       | 类型                                                                                                   | 描述                                                       |
| ---------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId  | String                                                                                               | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| totalCount | Integer                                                                                              | 满足过滤条件的EIP总数。                                            |
| dataSet    | Array of [EipInfo](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#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"
}


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,
        "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",
        "instanceName": "instanceName",
        "resourceGroupId": "xx",
        "resourceGroupName": "xx",
        "bandwidthCluster": null,
        "eipGeoRefs": [
          {
            "ip": "128.0.0.1",
            "dbIp": "华盛顿",
            "ipData": "华盛顿",
            "ipInfo": "华盛顿",
            "maxMind": "华盛顿",
            "standard": "华盛顿",
            "isConsistent": true
          }
        ],
        "blockInfoList": [
          {
            "ip": "128.0.0.1",
            "bps": 100,
            "pps": 200,
            "inCps": 300,
            "outCps": 400
          }
        ]
      },
        "tags":null
    ],
    "totalCount": 1
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

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

## 6. 错误码

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

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