创建云桌面实例
接口描述
本接口用于创建云桌面实例。本接口正常返回后,桌面实例进入创建阶段,可以用返回的桌面ID调用查询桌面详情接口来获取桌面实例的状态。
请求结构
POST /v1/bvd/desktops?clientToken={clientToken}
Host: bec.baidubce.com
Authorization: authorization string
X-Bce-Accesskey: accesskey
{
"purchaseInstances": [
{
"purchaseCount": 1,
"regionId": "",
"vpcId": ""
"subnetId": ""
}
],
"rootDisk": {
"name": "",
"sizeInGB": 50,
"storageType": "CDS_SSD, CDS_HDD, NVME, SATA"
},
"spec": "",
"billing": {
"paymentTiming": "Postpaid、Prepaid",
"reservation": {
"length": 0,
"timeUnit": ""
},
"autoRenew": {
"length": 1,
"timeUnit": "month、year"
}
},
"dataDiskList": [
{
"id": "",
"name": "",
"resourceId": "",
"sizeInGB": 0,
"storageType": "CDS_SSD, CDS_HDD, NVME, SATA"
}
],
"imageId": "",
"name": "",
"networkCapacityInMbps": 0,
"networkType": "NAT, PUBLIC_IP"
}
请求头域
参数名称 |
参数说明 |
请求类型 |
是否必须 |
数据类型 |
X-Bce-Accesskey |
BEC加密接口返回的accessKeyId,用作虚机实例管理员密码解密。参考密码加密传输规范 |
header |
否 |
string |
请求参数
参数名称 |
参数说明 |
请求类型 |
是否必须 |
数据类型 |
schema |
name |
桌面名称 |
|
true |
string |
|
purchaseInstances |
指定地域节点 |
|
true |
array |
PurchaseInstance |
purchaseCount |
购买数量 |
|
true |
integer |
|
regionId |
节点ID |
|
true |
string |
|
vpcId |
VPC ID。不填为默认VPC |
|
false |
string |
|
subnetId |
子网ID。不填为默认子网 |
|
false |
string |
|
spec |
云桌面规格,包含了CPU、内存、vGPU |
|
true |
string |
|
imageId |
云桌面镜像ID |
|
true |
string |
|
rootDisk |
系统盘 |
|
true |
DiskModel |
DiskModel |
name |
云磁盘名称 |
|
false |
string |
|
sizeInGB |
磁盘容量 |
|
false |
integer |
|
storageType |
磁盘类型。枚举值为CDS_SSD/NVME/SATA,分别表示云磁盘SSD、本地盘SSD、本地盘HDD |
|
false |
string |
|
dataDiskList |
数据盘 |
|
true |
array |
DiskModel |
name |
磁盘名称 |
|
false |
string |
|
sizeInGB |
磁盘容量 |
|
false |
integer |
|
storageType |
磁盘类型。枚举值为CDS_SSD/NVME/SATA,分别表示云磁盘SSD、 本地盘SSD、本地盘HDD |
|
false |
string |
|
billing |
订单、计费相关参数 |
|
false |
Billing |
Billing |
paymentTiming |
付费方式。Postpaid:后付费,Prepaid:预付费 |
|
true |
string |
|
reservation |
预付费时长信息 |
|
false |
PaymentTime |
PaymentTime |
length |
时长 |
|
false |
integer |
|
timeUnit |
时长单位: month或year |
|
false |
string |
|
autoRenew |
预付费自动续费时长信息 |
|
false |
PaymentTime |
PaymentTime |
length |
时长 |
|
false |
integer |
|
timeUnit |
时长单位: month或year |
|
false |
string |
|
networkType |
公网类型, NAT或PUBLIC_IP。不需要则留空,可用值:NAT,PUBLIC_IP |
|
true |
string |
|
networkCapacityInMbps |
网络类型为PUBLIC_IP时指定公网带宽,单位为Mbps。为0表示不分配公网IP,默认为0Mbps。 |
|
false |
integer(int32) |
|
响应状态
状态码 |
说明 |
schema |
200 |
OK |
CreateDesktopResponse |
201 |
Created |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
Not Found |
|
响应参数
参数名称 |
参数说明 |
类型 |
schema |
desktops |
桌面实例 |
array |
DesktopModelVo |
name |
桌面名称 |
string |
|
desktopId |
桌面ID |
string |
|
orderId |
桌面订单ID |
string |
|
请求示例
{
"name": "我的云桌面",
"purchaseInstances": [
{
"purchaseCount": 1,
"regionId": "cn-jinan-cm",
"subnetId": "sbn-oafkhzgj",
"vpcId": "vpc-zflkrjga"
}
],
"billing": {
"paymentTiming": "Postpaid"
},
"rootDisk": {
"name": "system",
"sizeInGB": 50,
"storageType": "CDS_SSD"
},
"spec": "bvd.g4.c4m8"
"dataDiskList": [
{
"name": "disk1",
"sizeInGB": 100,
"storageType": "CDS_SSD"
}
],
"imageId": "im-txalqlfi",
"networkType": "NAT"
}
响应示例
{
"desktops": [
{
"desktopId": "vd-hqmf4tzi-cn-jinan-cm-oan4e",
"name": "我的云桌面"
}
],
"orderId": ""
}