查询实例券价格
更新时间:2026-04-02
该接口用于查询预留实例券实例规格对应的价格。
请求结构
Plain Text
1POST /v{version}/reservedInstance/price HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "specId": specId,
6 "spec": spec,
7 "scope": scope,
8 "offeringType": offeringType,
9 "reservedInstanceTime": reservedInstanceTime,
10 "zoneName": zoneName,
11 "reservedInstanceCount": reservedInstanceCount,
12 "priceTimeUnit": priceTimeUnit
13}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号 |
| specId | String | 是 | RequestBody参数 | 实例规格族 |
| spec | String | 是 | RequestBody参数 | 实例套餐规格 |
| offeringType | String | 是 | RequestBody参数 | 付费方式,可选值:FullyPrepay:全预付;半预付:PartPrepay;0预付:NoPrepay。 |
| reservedInstanceTime | String | 是 | RequestBody参数 | 实例券购买时长,[1,2,3,4,5,6,7,8,9,12,24,36],单位:月。 |
| scope | String | 否 | RequestBody参数 | 实例券的可用范围;默认:AZ可用区级券:AZ地域级券:Region |
| zoneName | String | 是 | RequestBody参数 | 可用区名称 |
| reservedInstanceCount | int | 否 | RequestBody参数 | 查询在指定实例套餐规格下,任意数量实例的总价格,必须为大于0的整数,可选参数,缺省为1 |
| priceTimeUnit | int | 否 | RequestBody参数 | 后付费计价时间单位,可选值: month:按月计费; hour:按小时计费,缺省值。 |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| requestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
| spec | String | 实例券规格。 |
| catagoryPrice | double | 实例券目录价格。 |
| prePaidSpecPrice | double | 实例券预付价。 |
| postPaidSpecTimeUnitPrice | double | 实例券后付价,根据入参 priceTimeUnit 返回按小时计价格或按月计价格。 |
| tradePrice | double | 实例券最终价,即优惠后订单实付价格。 |
| prePaidTradePrice | double | 实例券折后预付价。 |
| postPaidTradeTimeUnitPrice | double | 实例券折后后付价,根据入参 priceTimeUnit 返回按小时计价格或按月计价格。 |
请求示例
Plain Text
1POST /v2/reservedInstance/price HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5{
6 "spec": "bcc.g5.c1m4",
7 "specId": "g5",
8 "offeringType": "partPrepay",
9 "scope": "AZ",
10 "zoneName": "cn-bj-a",
11 "reservedInstanceCount": 1,
12 "priceTimeUnit": "hour",
13 "reservedInstanceTime": 1,
14 "purchaseNum": 1
15}
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 186e6d9b-4c89-47eb-ba4d-b4117bc81cf0
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "requestId": "186e6d9b-4c89-47eb-ba4d-b4117bc81cf0",
8 "spec": "bcc.g5.c1m4",
9 "categoryPrice": {
10 "prePayCategoryPrice": 1.00,
11 "postPayCategoryPrice": 0.1000000000
12 },
13 "tradePrice": {
14 "prePayTradePrice": 1.00,
15 "postPayTradePrice": 0.1000000000
16 }
17}
评价此篇文章
