# InquiryPriceCreateLoadBalancer

## 1. 接口描述

本接口用于查询创建负载均衡的价格。

## 2. 请求参数

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

| 参数名称               | 必选 | 类型                                                                                                                   | 描述                                                                                                                                            |
| ------------------ | -- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| regionId           | 是  | String                                                                                                               | 区域节点ID。                                                                                                                                       |
| internetChargeType | 是  | [InternetChargeType](https://docs.console.zenlayer.com/api-reference/cn/networking/datastructure#internetchargetype) | IP网络计费模式。                                                                                                                                     |
| ipNetworkType      | 是  | [EipNetworkType](https://docs.console.zenlayer.com/api-reference/cn/networking/datastructure#eipnetworktype)         | IP 的网络类型。                                                                                                                                     |
| bandwidthMbps      | 否  | Integer                                                                                                              | <p>EIP的最大出带宽。</p><p>单位为Mbps。</p><p>最大限制通常为10000，如果有额外要求， 请联系Support。</p><p>可选值范围：\[1, +)。</p>                                                 |
| trafficPackageSize | 否  | Float                                                                                                                | <p>流量包大小。</p><p>指定此参数时，IP网络计费模式(<code>internetChargeType</code>) 需为<code>ByTrafficPackage</code>, 否则该参数不生效。</p><p>可选值范围：\[0.0, 999999.0]。</p> |
| bandwidthClusterId | 否  | String                                                                                                               | <p>共享带宽包ID。</p><p>指定此参数时，IP网络计费模式(<code>internetChargeType</code>) 需为<code>BandwidthCluster</code>, 否则该参数不生效。</p>                             |

## 3. 响应结果

| 参数名称                      | 类型                                                                                                 | 描述                                                       |
| ------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId                 | String                                                                                             | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| loadBalancerInstancePrice | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/networking/datastructure#priceitem) | 负载均衡实例的价格。                                               |
| eipPrice                  | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/networking/datastructure#priceitem) | 弹性IP的价格。                                                 |
| eipNetworkPrice           | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/networking/datastructure#priceitem) | 弹性IP的网络计费的价格。                                            |
| lcuPrice                  | [PriceItem](https://docs.console.zenlayer.com/api-reference/cn/networking/datastructure#priceitem) | 负载均衡实例LCU的价格。                                            |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
\*\*1.查询创建一个公网负载均衡实例价格。 \*\*

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

Request：
{
  "regionId" : "asia-east-1",
  "vpcId" : "<vpcId>",
  "internetChargeType" : "ByBandwidth",
  "ipNetworkType" : "BGPLine",
  "bandwidthMbps" : 2,
  "trafficPackageSize" : null,
  "number" : 1
}

Response：
{
  "requestId": "T775F300E-F989-4CC8-BB6E-0452A4C7EA03",
  "response": {
    "lcuPrice": {
      "unitPrice": null,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": [
        {
          "unitPrice": 1,
          "stepStart": 0,
          "discountUnitPrice": 1,
          "stepEnd": null
        }
      ],
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": null,
      "chargeUnit": "HOUR",
      "amountUnit": "LCU",
      "excessDiscountUnitPrice": null
    },
    "loadBalancerInstancePrice": {
      "unitPrice": 0.016806,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.016806,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "requestId": "T775F300E-F989-4CC8-BB6E-0452A4C7EA03",
    "eipPrice": {
      "unitPrice": 0.076389,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.076389,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipNetworkPrice": {
      "unitPrice": 0.061112,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.061112,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": 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)
