1. 查询创建预付费实例的询价,带宽计费为固定带宽。
POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryPriceCreateInstance
<Common Request Params>
Request:
{
"zoneId":"SAO-A",
"instanceType":"c.1c2g",
"imageId":"img-yKK4q6XybymPgfx7ynUUqC3N8",
"instanceChargeType":"PREPAID",
"internetChargeType":"ByBandwidth",
"instanceChargePrepaid":{
"period":1
},
"internetMaxBandwidthOut":1,
"systemDisk":{
"diskSize":10
}
}
Response:
{
"requestId":"T03681166-F646-4F6A-AE6E-6CFF08DE60B3",
"response":{
"requestId":"T03681166-F646-4F6A-AE6E-6CFF08DE60B3",
"instancePrice":{
"discount":95,
"discountPrice":13.3,
"originalPrice":14
},
"bandwidthPrice":[
{
"discount":95,
"discountPrice":3.8,
"originalPrice":4
}
],
"systemDiskPrice":{
"discount":96,
"discountPrice":0.48,
"originalPrice":0.5
}
}
}
2. 查询创建后付费实例的询价,带宽计费为固定带宽。
POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryPriceCreateInstance
<Common Request Params>
Request:
{
"zoneId":"SAO-A",
"instanceType":"c.1c2g",
"imageId":"img-yKK4q6XybymPgfx7ynUUqC3N8",
"instanceChargeType":"POSTPAID",
"internetChargeType":"ByBandwidth",
"internetMaxBandwidthOut":1,
"systemDisk":{
"diskSize":10
}
}
Response:
{
"requestId": "T3105EE4C-30C5-4FF2-9A34-688C8455376D",
"response": {
"requestId": "T3105EE4C-30C5-4FF2-9A34-688C8455376D",
"instancePrice": {
"discount": 100.0,
"discountPrice": null,
"originalPrice": null,
"unitPrice": 0.13,
"discountUnitPrice": 0.13,
"chargeUnit": "HOUR",
"stepPrices": null
},
"systemDiskPrice": {
"discount": 100.0,
"discountPrice": null,
"originalPrice": null,
"unitPrice": 3.12,
"discountUnitPrice": 0.00625,
"chargeUnit": "HOUR",
"stepPrices": null
},
"bandwidthPrice": [
{
"discount": 100.0,
"discountPrice": null,
"originalPrice": null,
"unitPrice": 1.32,
"discountUnitPrice": 0.014,
"chargeUnit": "HOUR",
"stepPrices": null
}
]
}
}
3. 查询创建预付费实例的询价,带宽计费为流量包。
POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: InquiryPriceCreateInstance
<Common Request Params>
Request:
{
"zoneId":"SAO-A",
"instanceType":"c.1c2g",
"imageId":"img-yKK4q6XybymPgfx7ynUUqC3N8",
"instanceChargeType":"PREPAID",
"internetChargeType":"ByTrafficPackage",
"trafficPackageSize":10,
"instanceChargePrepaid":{
"period":1
},
"internetMaxBandwidthOut":1,
"systemDisk":{
"diskSize":10
}
}
Response:
{
"requestId":"T70B50FA0-A8CB-4DC3-BA38-22E22AA9FB57",
"response":{
"requestId":"T70B50FA0-A8CB-4DC3-BA38-22E22AA9FB57",
"instancePrice":{
"discount":95,
"discountPrice":13.3,
"originalPrice":14
},
"bandwidthPrice":[
{
"discount":100,
"discountPrice":0,
"originalPrice":0
},
{
"discount":100,
"stepPrices":[
{
"stepStart":0,
"unitPrice":0.5,
"discountUnitPrice":0.5
}
]
}
],
"systemDiskPrice":{
"discount":96,
"discountPrice":0.48,
"originalPrice":0.5
}
}
}