获取BEC规格套餐
更新时间:2022-01-05
接口描述
本接口用于获取BEC规格套餐。
请求结构
GET /v1/resource/package/{type}?policy={policy} HTTP/1.1
Host: bec.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
type | String | 是 | URL参数 | 套餐类型,取值为container、vm,分别表示容器、虚机 |
policy | String | 否 | Query参数 | 套餐策略,取值为 random:随机分配策略,spec:自选机型策略。不传默认random。 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
success | Boolean | 是否成功,true:表示成功;false:表示失败 |
result | List<BecResourcePackageVo> | 套餐列表 |
错误码
请参照错误返回章节的内容。
请求示例
容器套餐
GET /v1/resource/package/container HTTP/1.1
Host: bec.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
虚机分机型套餐
GET /v1/resource/package/vm?policy=spec HTTP/1.1
Host: bec.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
容器套餐
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Date: Wed, 08 Jul 2015 03:28:11 GMT
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Server: BWS
{
"result": [
{
"name": "通用型1C2G",
"cpu": 1,
"memory": 2,
"gpu": null,
"code": null,
"interBandwidth": 100,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型1C4G",
"cpu": 1,
"memory": 4,
"gpu": null,
"code": null,
"interBandwidth": 100,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型2C4G",
"cpu": 2,
"memory": 4,
"gpu": null,
"code": null,
"interBandwidth": 200,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型2C8G",
"cpu": 2,
"memory": 8,
"gpu": null,
"code": null,
"interBandwidth": 200,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型4C8G",
"cpu": 4,
"memory": 8,
"gpu": null,
"code": null,
"interBandwidth": 400,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型4C16G",
"cpu": 4,
"memory": 16,
"gpu": null,
"code": null,
"interBandwidth": 400,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型8C16G",
"cpu": 8,
"memory": 16,
"gpu": null,
"code": null,
"interBandwidth": 800,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型8C32G",
"cpu": 8,
"memory": 32,
"gpu": null,
"code": null,
"interBandwidth": 800,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型16C32G",
"cpu": 16,
"memory": 32,
"gpu": null,
"code": null,
"interBandwidth": 1000,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型16C64G",
"cpu": 16,
"memory": 64,
"gpu": null,
"code": null,
"interBandwidth": 1000,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型32C64G",
"cpu": 32,
"memory": 64,
"gpu": null,
"code": null,
"interBandwidth": 2000,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
},
{
"name": "通用型32C96G",
"cpu": 32,
"memory": 96,
"gpu": null,
"code": null,
"interBandwidth": 2000,
"innerBandwidth": null,
"cpuModel": null,
"dataDiskList": null,
"systemDisk": null,
"storagePartition": null,
"networkPacketData": 0
}
],
"success": true
}
虚机分机型套餐
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Date: Wed, 08 Jul 2015 03:28:11 GMT
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Server: BWS
{
"result":[
{
"name":"bec.g4.c1m4",
"cpu":1,
"memory":4,
"spec":"bec.g4.c1m4",
"interBandwidth":100,
"innerBandwidth":1.5,
"cpuModel":"Intel_Xeon_Gold_6271C",
"networkPacketData":0,
"enabled":true,
"cpuGHz":"2.6",
"specId":"g4",
"specType":"g",
"flavorTypePostpay":"generationBEC4",
"flavorTypePrepay":"generationBEC4"
},
{
"name":"bec.g4.c2m8",
"cpu":2,
"memory":8,
"spec":"bec.g4.c2m8",
"interBandwidth":200,
"innerBandwidth":1.5,
"cpuModel":"Intel_Xeon_Gold_6271C",
"networkPacketData":0,
"enabled":true,
"cpuGHz":"2.6",
"specId":"g4",
"specType":"g",
"flavorTypePostpay":"generationBEC4",
"flavorTypePrepay":"generationBEC4"
}
],
"success":true
}
Model对象定义
BecResourcePackageVo
参数名称 | 类型 | 描述 |
---|---|---|
name | String | 名称 |
cpu | Integer | cpu数量 |
memory | Integer | 内存数量 |
spec | String | 分机型套餐规格族, 例如 bec.g4.c1m4 |
cpuModel | String | 分机型套餐cpu型号,例如 Intel_Xeon_Gold_6271C |
cpuGHz | String | 分机型套餐cpu主频,单位GHz,例如 2.6 |