获取BEC虚机镜像列表
更新时间:2021-08-03
接口描述
本接口用于获取BEC虚机自定义镜像列表、公共镜像列表。
请求结构
GET /v1/vm/image HTTP/1.1
Host: bec.baidubce.com
Content-Type: application/json; charset=utf-8
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
pageNo | Integer | 否 | Query参数 | 页数,缺省值为1 |
pageSize | Integer | 否 | Query参数 | 每页个数,取值范围1~1000,缺省值为1000 |
keywordType | String | 否 | Query参数 | 查询类型,取值范围为imageId、name,分别表示镜像Id、镜像名字 |
keyword | String | 否 | Query参数 | 查询的关键字,即对应查询类型的具体字段。 |
order | String | 否 | Query参数 | 排序,取值为ASC、DESC,分别表示升序、降序 |
orderBy | String | 否 | Query参数 | 排序字段取值为createTime、systemDisk,分别表示镜像创建时间、系统盘大小 |
status | String | 否 | Query参数 | 状态筛选(SUCCEEDED,IMAGING) |
osName | String | 否 | Query参数 | 操作系统名称筛取值为CentOS、Ubuntu、Debian、opensuse |
type | String | 否 | Query参数 | 镜像类型(becCommon公共镜像,becCustom私有镜像),缺省为becCustom |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
result | List<VmImageVo> | 列表数据 |
orderBy | String | 排序字段 |
order | String | 排序,取值为ASC、DESC,分别表示升序、降序 |
pageNo | Integer | 页码 |
pageSize | Integer | 每页结果数 |
totalCount | Integer | 结果总数 |
错误码
请参照错误返回章节的内容。
请求示例
GET /v1/vm/image?type=becCommon HTTP/1.1
Host: bec.baidubce.com
Content-Type: application/json; charset=utf-8
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": {
"order": "desc",
"orderBy": "createTime",
"orders": null,
"pageNo": 1,
"pageSize": 1000,
"result": [{
"accountId": "becCommon",
"bccImageId": "im-DSzFfneF",
"createTime": "2021-04-22T02:49:33Z",
"imageId": "im-DSzFfneF",
"imageType": "becCommon",
"name": "centos7.1",
"osArch": "x86_64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "CentOS",
"osType": "linux",
"osVersion": "7.1",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:49Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-IqkgobHQ",
"createTime": "2021-04-22T09:23:26Z",
"imageId": "im-IqkgobHQ",
"imageType": "becCommon",
"name": "centos7.2",
"osArch": "x86_64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "CentOS",
"osType": "linux",
"osVersion": "7.2",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:48Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-LcSjEXvD",
"createTime": "2021-04-22T11:11:36Z",
"imageId": "im-LcSjEXvD",
"imageType": "becCommon",
"name": "centos7.3",
"osArch": "x86_64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "CentOS",
"osType": "linux",
"osVersion": "7.3",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:48Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-dNgl59ys",
"createTime": "2021-04-22T12:30:09Z",
"imageId": "im-dNgl59ys",
"imageType": "becCommon",
"name": "centos7.4",
"osArch": "x86_64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "CentOS",
"osType": "linux",
"osVersion": "7.4",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:48Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-DqQdV8VQ",
"createTime": "2021-04-22T12:30:09Z",
"imageId": "im-DqQdV8VQ",
"imageType": "becCommon",
"name": "centos7.5",
"osArch": "x86_64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "CentOS",
"osType": "linux",
"osVersion": "7.5",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:48Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-eBHbN3gg",
"createTime": "2021-04-22T12:30:11Z",
"imageId": "im-eBHbN3gg",
"imageType": "becCommon",
"name": "centos7.6",
"osArch": "x86_64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "CentOS",
"osType": "linux",
"osVersion": "7.6",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:48Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-3kKaN3vb",
"createTime": "2021-04-22T07:21:19Z",
"imageId": "im-3kKaN3vb",
"imageType": "becCommon",
"name": "debian9.1.0",
"osArch": "amd64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "Debian",
"osType": "linux",
"osVersion": "9.1.0",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-26T14:28:05Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-iYHEjowb",
"createTime": "2021-04-22T08:34:09Z",
"imageId": "im-iYHEjowb",
"imageType": "becCommon",
"name": "debian9.9.0",
"osArch": "amd64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "Debian",
"osType": "linux",
"osVersion": "9.9.0",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-26T14:28:59Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-IgMe2uwt",
"createTime": "2021-04-22T06:03:25Z",
"imageId": "im-IgMe2uwt",
"imageType": "becCommon",
"name": "ubuntu16.04",
"osArch": "amd64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "Ubuntu",
"osType": "linux",
"osVersion": "16.04 LTS",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:41Z"
}, {
"accountId": "becCommon",
"bccImageId": "im-1MGfmLNt",
"createTime": "2021-04-22T07:58:39Z",
"imageId": "im-1MGfmLNt",
"imageType": "becCommon",
"name": "ubuntu18.04",
"osArch": "amd64 (64bit)",
"osBuild": "2020122100",
"osLang": "ENG",
"osName": "Ubuntu",
"osType": "linux",
"osVersion": "18.04 LTS",
"status": null,
"systemDisk": 40,
"updateTime": "2021-04-27T03:56:41Z"
}],
"totalCount": 10
},
"success": true
}
Model对象定义
VmImageVo
参数名称 | 类型 | 描述 |
---|---|---|
imageId | String | 虚机镜像ID |
name | String | 虚机镜像名称 |
status | String | 虚机镜像状态(IMAGING,SUCCEEDED) |
bccImageId | String | 基准镜像ID |
accountId | String | 用户ID,公共镜像时为becCommon |
imageType | String | 镜像类型 |
systemDisk | Integer | 系统盘大小 |
osType | String | 操作系统类型 |
osVersion | String | 操作系统版本 |
osBuild | String | 基准镜像构建时间 |
osLang | String | 操作系统语言 |
osArch | String | 操作系统处理器架构 |
createTime | String | 创建时间 |
updateTime | String | 更新时间 |