创建自定义镜像
更新时间:2025-08-05
创建自定义镜像
接口描述
本接口用于创建自定义镜像
请求结构
JSON
1POST /v1/bvd/images
2Host: bec.baidubce.com
3Authorization: authorization string
4X-Bce-Accesskey: accesskey
5
6{
7 "desktopId": "",
8 "imageName": ""
9}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
desktopId | 桌面ID | body | true | string |
imageName | 镜像名称 | body | true | string |
响应头域
除公共头域外,无其它特殊头域。
响应状态
状态码 | 说明 |
---|---|
200 | OK |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
响应参数
参数名称 | 参数说明 | 类型 |
---|---|---|
result | 返回结果 | ImageVo |
imageId | 镜像ID | string |
name | 镜像名称 | string |
imageType | 镜像类型: custom自定义 | string |
size | 镜像大小 | integer |
osType | 系统类型 | string |
osName | 系统名称 | string |
错误码
请参照错误返回章节的内容。
请求示例
JSON
1POST /v1/bvd/images HTTP/1.1
2Host: bec.baidubce.com
3Authorization: bce-auth-v1/xxxxx
4
5{
6 "desktopId": "vd-5oxyo2hw-cn-baoding-ix-derdg",
7 "imageName": "myimage"
8}
响应示例
JSON
1200 OK
2
3{
4 "result": {
5 "imageId": "im-c7ogwfrw",
6 "name": "test_custom_image",
7 "imageType": "custom",
8 "size": 100,
9 "osType": "windows",
10 "osName": "Windows"
11 }
12}