BLB询价
更新时间:2024-08-14
BLB支持询价接口
请求结构
POST /v{version}/blb/price HTTP/1.1
Host: blb.bj.baidubce.com
Authorization: authorization string
{
"blbType":"ipv6Application",
"performanceLevel":"small1",
"count":1,
"billing": {
"paymentTiming": "Prepaid",
"reservation":{
"reservationLength":1
}
}
}
请求头域
除公共头域外,无其他特殊头域
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值1 |
blbType | String | 否 | RequestBody参数 | blb类型,不传默认是普通型blb。 取值可以为"normal"代表普通型,"application"代表应用型,"ipv6"代表普通型IPv6,"ipv6Application"代表应用型IPv6 |
performanceLevel | String | 否 | RequestBody参数 | 性能规格参数,不传默认为共享型。取值如下:"small1"标准型1,"small2"标准型2,"medium1"增强型1,"medium2"增强型1,"large1"超大型1,"large2"超大型2,"large3"超大型3 |
count | Integer | 否 | RequestBody参数 | 购买数量,不传默认是1 |
billing | Billing | 否 | RequestBody参数 | 订单相关信息 |
Billing
参数名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
paymentTiming | String | 是 | 付款时间,预支付(Prepaid)和后支付(Postpaid) |
billingMethod | String | 否 | 计费方式,预付费的时候不要传,后付费的时候传,按固定规格计费(BySpec)和按使用量计费(ByCapacityUnit) |
reservation | Reservation | 否 | 保留信息,支付方式为后支付时不需要设置,预支付时必须设置 |
Reservation
参数名称 | 类型 | 是否必选 | 描述 |
---|---|---|---|
reservationLength | Integer | 是 | 购买月份时长,取值范围为:[1,2,3,4,5,6,7,8,9,12,24,36] |
返回状态码
成功返回200,失败返回见错误码
返回头域
除公共头域外,无其他特殊头域
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
prices | List<Price> | 返回的价格信息 |
Price
参数名称 | 类型 | 描述 |
---|---|---|
chargeItem | String | 计费项,比如取值"instance"代表实例费用;比如"netraffic"代表流量费用 |
discountPrice | String | 折扣价,单位都是元。预付费的时候,返回值比如:"150",后付费的时候,返回值比如:"0.00028" |
originalPrice | String | 原价 |
chargeUnit | String | 计费单位。后付费的时候取值,比如"minute"。minute:表示计价单元是按每分钟来计算。GB:表示计价单元是按每GB来计算。 "lcu"代表按每lcu单位计费 |
预付费请求示例
PUT /v1/blb/price?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST blb.bj.baidubce.com
Authorization: authorization string
{
"blbType":"ipv6Application",
"performanceLevel":"small1",
"count":1,
"billing": {
"paymentTiming": "Prepaid",
"reservation":{
"reservationLength":1
}
}
}
预付费响应示例
HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2024 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"prices": [
{
"chargeItem": "instance",
"originalPrice": "190",
"discountPrice": "20.90"
}
]
}
后付费请求示例
PUT /v1/blb/price?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST blb.bj.baidubce.com
Authorization: authorization string
{
"blbType":"ipv6Application",
"performanceLevel":"small1",
"count":1,
"billing": {
"paymentTiming": "Postpaid",
"billingMethod":"ByCapacityUnit"
}
}
后付费响应示例
HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2024 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"prices": [
{
"chargeItem": "instance",
"originalPrice": "0.01056",
"discountPrice": "0.00116",
"chargeUnit": "minute"
},
{
"chargeItem": "lcu",
"originalPrice": "0.04",
"discountPrice": "0.04",
"chargeUnit": "lcu"
}
]
}