InquiryPriceCreateInstance

1. 接口描述

调用本接口用于创建一个实例询价。

2. 请求参数

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

3. 响应结果

4. 代码示例

1. 查询创建预付费实例的询价,带宽计费为固定带宽。

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

Request:
{
  "zoneId": "SEL-A",
  "instanceTypeId": "M6C",
  "instanceChargeType": "PREPAID",
  "instanceChargePrepaid": {
    "period": 1
  },
  "trafficPackageSize": 100,
  "internetMaxBandwidthOut": 200,
  "internetChargeType": "ByBandwidth"
}

Response:
{
  "requestId": "T01F25348-DA67-4726-97C1-538BAE714F8B",
  "response": {
    "requestId": "T01F25348-DA67-4726-97C1-538BAE714F8B",
    "instancePrice": {
      "discount": 95.0,
      "discountPrice": 426.55,
      "originalPrice": 449.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "bandwidthPrice": [
      {
        "discount": 95.0,
        "discountPrice": 1444.0,
        "originalPrice": 1520.0,
        "unitPrice": null,
        "discountUnitPrice": null,
        "chargeUnit": null,
        "stepPrices": null
      }
    ]
  }
}

2. 查询创建后付费实例的询价,带宽计费为固定带宽。

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

Request:
{
  "zoneId": "SEL-A",
  "instanceTypeId": "M6C",
  "instanceChargeType": "POSTPAID",
  "trafficPackageSize": 100,
  "internetMaxBandwidthOut": 200,
  "internetChargeType": "ByBandwidth"
}

Response:
{
  "requestId": "T3105EE4C-30C5-4FF2-9A34-688C8455376D",
  "response": {
    "requestId": "T3105EE4C-30C5-4FF2-9A34-688C8455376D",
    "instancePrice": {
      "discount": 100.0,
      "discountPrice": null,
      "originalPrice": null,
      "unitPrice": 0.63,
      "discountUnitPrice": 0.63,
      "chargeUnit": "HOUR",
      "stepPrices": null
    },
    "bandwidthPrice": [
      {
        "discount": 100.0,
        "discountPrice": null,
        "originalPrice": null,
        "unitPrice": 1.32,
        "discountUnitPrice": 1.32,
        "chargeUnit": "HOUR",
        "stepPrices": null
      }
    ]
  }
}

3. 查询创建预付费实例的询价,带宽计费为流量包。

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

Request:
{
  "zoneId": "SEL-A",
  "instanceTypeId": "M6C",
  "instanceChargeType": "PREPAID",
  "instanceChargePrepaid": {
    "period": 1
  },
  "trafficPackageSize": 100,
  "internetMaxBandwidthOut": 200,
  "internetChargeType": "ByTrafficPackage"
}

Response:
{
  "requestId": "T8CF9A34A-ECA2-4192-8515-CAC51C40592B",
  "response": {
    "requestId": "T8CF9A34A-ECA2-4192-8515-CAC51C40592B",
    "instancePrice": {
      "discount": 95.0,
      "discountPrice": 426.55,
      "originalPrice": 449.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "bandwidthPrice": [
      {
        "discount": 95.0,
        "discountPrice": 7524.0,
        "originalPrice": 7920.0,
        "unitPrice": null,
        "discountUnitPrice": null,
        "chargeUnit": null,
        "stepPrices": null
      },
      {
        "discount": 100.0,
        "discountPrice": null,
        "originalPrice": null,
        "unitPrice": null,
        "discountUnitPrice": null,
        "chargeUnit": null,
        "stepPrices": [
          {
            "stepStart": 0.0,
            "stepEnd": null,
            "unitPrice": 0.08,
            "discountUnitPrice": 0.08
          }
        ]
      }
    ]
  }
}

5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的开发工具集(SDK),未来会陆续支持更多开发语言,方便快速接入和使用Zenlayer的产品和服务。

6. 错误码

下面包含业务逻辑中遇到的错误码,其他错误码见公共错误码

最后更新于