# DescribeEipPrice

## 1. 接口描述

本接口(DescribeEipPrice)用于创建公网弹性IP询价。

## 2. 请求参数

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

| 参数名称               | 必选 | 类型                                                                                                                | 描述                                                                                                                                                   |
| ------------------ | -- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| regionId           | 是  | String                                                                                                            | 创建EIP所在的节点ID。                                                                                                                                        |
| internetChargeType | 是  | [InternetChargeType](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#internetchargetype) | 公网弹性IP的网络计费方式。                                                                                                                                       |
| amount             | 否  | Integer                                                                                                           | <p>需要创建EIP的数量。</p><p>可选值范围：\[1, +)</p><p>默认值：1</p>                                                                                                   |
| eipV4Type \[已废弃]   | 否  | [EipNetworkType](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#eipnetworktype)         | <p>公网弹性IP的线路类型。</p><p>已废弃，请使用<code>networkLineType</code>。</p>                                                                                       |
| networkLineType    | 否  | [NetworkLineType](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#networklinetype)       | 公网弹性IP的线路类型。                                                                                                                                         |
| bandwidth          | 否  | Integer                                                                                                           | <p>公网弹性IP的带宽限速。</p><p>单位：Mbps。</p><p>可选值范围：\[1, +)</p>                                                                                               |
| flowPackage        | 否  | Float                                                                                                             | <p>公网IPv6的流量包大小。</p><p>单位为TB。</p><p>值要求为0或0.1的倍数。</p><p>当子网的堆栈类型包括V6且为公网时，且网络计费方式是流量计费(<code>ByTrafficPackage</code>)需要指定。</p><p>可选值范围：\[0.0, +)</p> |
| cidrId             | 否  | String                                                                                                            | <p>指定CIDR ID，使用CIDR内分配弹性IP。</p><p>该字段和<code>eipV4Type</code>不能同时指定。</p>                                                                              |
| clusterId          | 否  | String                                                                                                            | <p>公网IPv6所指定的共享带宽包ID。</p><p>当子网的堆栈类型包括V6且为公网时，且网络计费方式是共享带宽包计费(<code>BandwidthCluster</code>)需要指定。</p>                                                |
| peerRegionId       | 否  | String                                                                                                            | 远端的节点ID。                                                                                                                                             |

## 3. 响应结果

| 参数名称                 | 类型                                                                                              | 描述                                                       |
| -------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId            | String                                                                                          | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| eipPrice             | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#priceitem) | <p>公网弹性IP的保留价格。</p><p>如果是通过cidr创建，则保留价格为null。</p>        |
| bandwidthPrice       | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#priceitem) | 公网弹性IP的带宽价格。                                             |
| remoteBandwidthPrice | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/compute/datastructure#priceitem) | Remote IPT的带宽价格。                                         |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询一个BGP公网IP的价格，网络计费采用流量包计费。流量包大小为10TB。**

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

Request：
{
  "regionId": "asia-east-1",
  "amount": 1,
  "name": "Test-EIP",
  "internetChargeType": "ByTrafficPackage",
  "networkLineType": "PremiumBGP",
  "bandwidth": 50,
  "flowPackage": 10
}


Response：
  {
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "eipPrice": {
      "discount": 95.0,
      "discountPrice": 100.0,
      "originalPrice": 100.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
     "bandwidthPrice": {
        "discount": 95.0,
        "discountPrice": 100.0,
        "originalPrice": 100.0,
        "unitPrice": null,
        "discountUnitPrice": null,
        "chargeUnit": null,
        "stepPrices": null
      },
     "remoteBandwidthPrice": null
  }
}
```

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