查询实例价格
更新时间:2026-09-22
该接口用于查询指定网关套餐、BLB 规格和 Pod 数量的价格,并可按需返回新购 EIP 和服务网卡报价。
请求结构
Plain Text
1POST /?action=DescribeInstancePrice HTTP/1.1
2Host: apigw-control.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "spec": spec,
7 "blbSpec": blbSpec,
8 "podCnt": podCnt,
9 "purchaseNum": purchaseNum,
10 "billingModel": {
11 "chargeType": chargeType,
12 "period": period,
13 "periodUnit": periodUnit,
14 "autoRenew": autoRenew,
15 "autoRenewPeriodUnit": autoRenewPeriodUnit,
16 "autoRenewPeriod": autoRenewPeriod,
17 "spotPriceLimit": spotPriceLimit,
18 "spotStrategy": spotStrategy
19 },
20 "eipConfig": {
21 "name": name,
22 "bandwidthInMbps": bandwidthInMbps,
23 "routeType": routeType,
24 "billingMethod": billingMethod
25 },
26 "snicConfig": {
27 "bandwidth": bandwidth
28 }
29}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| spec | String | 是 | RequestBody参数 | 套餐 |
| blbSpec | String | 是 | RequestBody参数 | BLB 规格类型 |
| podCnt | int | 是 | RequestBody参数 | 网关 Pod 数量 |
| purchaseNum | int | 否 | RequestBody参数 | 购买数量 |
| billingModel | BillingModel | 否 | RequestBody参数 | 计费信息 |
| eipConfig | EipConfigReq | 否 | RequestBody参数 | 新购 EIP 询价配置 |
| snicConfig | SnicConfigReq | 否 | RequestBody参数 | 服务网卡询价配置 |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| spec | String | 套餐 |
| price | Double | 折后单价 |
| catalogPrice | Double | 目录单价 |
| discountRate | Double | 用户当前折扣率 |
| eipPriceInfo | EipPriceInfo | EIP 询价明细,未询价时为空 |
| snicPriceInfo | SnicPriceInfo | 服务网卡询价明细,未询价时为空 |
错误码
| 错误码 | 错误描述 | HTTP状态码 | 中文解释 |
|---|---|---|---|
| MethodArgumentNotValidException | MethodArgumentNotValidException: spec must not be blank | 400 | 必填参数缺失或格式不合法,spec 不能为空 |
| HttpMessageNotReadable | Http Message Not Readable: JSON parse error | 400 | 请求体不是合法 JSON,无法解析,请检查 JSON 语法和字段类型 |
| ResourcePermissionDeny | Resource permission deny. | 401 | 无权限访问指定资源,请确认使用正确的账号凭证且资源属于当前账号 |
| Instance.HpasFlavorNotExist | instance flavor not exist. | 404 | 实例套餐不存在 |
| HttpMediaTypeException | HttpMediaTypeException: Content-Type 'text/plain' is not supported | 415 | 请求的 Content-Type 不受支持,请使用 application/json |
请求示例
Plain Text
1POST /?action=DescribeInstancePrice HTTP/1.1
2Host: apigw-control.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "spec": "spec-1",
7 "blbSpec": "medium1",
8 "podCnt": 2,
9 "purchaseNum": 1,
10 "billingModel": {
11 "chargeType": "Prepaid",
12 "period": 1,
13 "periodUnit": "month",
14 "autoRenew": true,
15 "autoRenewPeriod": 1,
16 "autoRenewPeriodUnit": "month"
17 }
18}
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "spec": "spec-1",
9 "price": 1036,
10 "catalogPrice": 1295,
11 "discountRate": 0.8
12}
评价此篇文章
