# DescribeEipPrice

## 1. 接口描述

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

## 2. 请求参数

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

| 参数名称               | 必选 | 类型                                                                                      | 描述                                                                                                                                                   |
| ------------------ | -- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| regionId           | 是  | String                                                                                  | 创建EIP所在的节点ID。                                                                                                                                        |
| internetChargeType | 是  | [InternetChargeType](/api-reference/cn/compute/zec/datastructure.md#internetchargetype) | 公网弹性IP的网络计费方式。                                                                                                                                       |
| amount             | 否  | Integer                                                                                 | <p>需要创建EIP的数量。</p><p>可选值范围：\[1, +)</p><p>默认值：1</p>                                                                                                   |
| eipV4Type \[已废弃]   | 否  | [EipNetworkType](/api-reference/cn/compute/zec/datastructure.md#eipnetworktype)         | <p>公网弹性IP的线路类型。</p><p>已废弃，请使用<code>networkLineType</code>。</p>                                                                                       |
| networkLineType    | 否  | [NetworkLineType](/api-reference/cn/compute/zec/datastructure.md#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](/api-reference/cn/compute/zec/datastructure.md#priceitem) | <p>公网弹性IP的保留价格。</p><p>如果是通过cidr创建，则保留价格为null。</p>        |
| bandwidthPrice       | [PriceItem](/api-reference/cn/compute/zec/datastructure.md#priceitem) | 公网弹性IP的带宽价格。                                             |
| remoteBandwidthPrice | [PriceItem](/api-reference/cn/compute/zec/datastructure.md#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）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/cn/compute/zec/elastic-ip/describeeipprice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
