查询镜像列表 - ListImages
功能介绍
根据不同条件查询镜像列表,例:
查询已注册的私有镜像列表: visibility=private
公共镜像: visibility=public
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
GET /v1/images
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
__imagetype | 否 | String | 镜像类型,目前支持以下类型:
|
__isregistered | 否 | String | 镜像是否可用,取值为true/false。 说明: 查询公共镜像时,该参数无效。 |
__os_type | 否 | String | 镜像系统类型,取值如下:
|
__support_arm | 否 | String | 如果镜像为ARM架构类型,取值为true,否则无该属性。 |
__support_gpu_t4 | 否 | String | 如果镜像支持GPU T4,取值为true,否则无该属性。 |
__support_kvm | 否 | String | 如果镜像支持KVM,取值为true,否则无该属性。 |
__support_kvm_ascend_310 | 否 | String | 如果镜像支持AI加速,取值为true,否则无该属性。 |
__support_kvm_gpu_type | 否 | String | 如果镜像是支持KVM虚拟化平台下的GPU类型,取值为“V100_vGPU”或者“RTX5000”,否则无该属性。 |
__support_kvm_hi1822_hiovs | 否 | String | 如果镜像支持计算增强,取值为true,否则无该属性。 |
id | 否 | String | 镜像ID,精确匹配。 |
limit | 否 | Integer | 用于分页,表示查询几条镜像记录,取值为正整数,最大(默认)取值为500 |
name | 否 | String | 镜像名称,匹配规则为精确匹配。 |
offset | 否 | Integer | 用于分页,表示查询偏移量,表示从整个列表查询结果中的该位置向后进行查询,并非页数偏移,默认取值为0,表示查询第一页。 |
protected | 否 | String | 镜像是否是受保护,取值为true/false,一般查询公共镜像时候取值为true,查询私有镜像可以不指定。 |
sort_dir | 否 | String | 用于排序,表示升序还是降序,取值为asc和desc,与sort_key一起组合使用,默认为降序desc。 |
sort_key | 否 | String | 用于排序,表示按照哪个字段排序,取值为镜像属性name、status、disk_format、created_at,默认取值为created_at。 |
status | 否 | String | 镜像状态。取值如下:
|
virtual_env_type | 否 | String | 镜像使用环境类型。 目前仅支持系统盘镜像,取值为:FusionCompute |
visibility | 否 | String | 是否被其他租户可见,取值如下:
|
__support_amd | 否 | String | 如果镜像为AMD架构类型,取值为true,否则无该属性。 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
images | Array of ImageList objects | 查询返回的镜像列表。 |
total | Integer | 列表元素个数,分页查询时返回总数。 |
参数 | 参数类型 | 描述 |
|---|---|---|
id | String | 镜像ID。 |
name | String | 镜像名称。 |
status | String | 镜像状态。 取值如下: queued:表示镜像元数据已经创建成功,等待 上传镜像文件。 saving:表示镜像 正在上传文件到后端存储。 deleted:表示镜像已经删除。 killed:表示镜像上传错误。 active:表示镜像可以正常使用 |
disk_format | String | 镜像格式。 |
min_disk | Integer | 最小系统盘(单位:GB),取值为40~1024GB。 |
min_ram | Integer | 最小内存(单位:MB),默认值为0。 |
owner | String | 镜像所属租户ID。 |
protected | Boolean | 是否受保护。 |
visibility | String | 可见性。 |
created_at | String | 创建时间。 |
updated_at | String | 更新时间。 |
self | String | 镜像链接信息。 |
deleted | Boolean | 是否是删除的镜像,取值为true或者false。 |
virtual_env_type | String | 镜像使用环境类型。 |
deleted_at | String | 删除时间,格式为UTC时间。 |
relation_job_id | String | 镜像关联的任务ID。 |
__imagetype | String | 镜像类型。 取值范围:
|
__platform | String | 镜像平台分类。 |
__os_type | String | 镜像系统类型。 取值范围:
|
__os_version | String | 镜像的操作系统具体版本。 |
__isregistered | Boolean | 是否是注册过的镜像。 |
__support_kvm | String | 如果镜像支持KVM,取值为true,否则无该属性。 |
__support_kvm_gpu_type | String | 如果镜像是支持KVM虚拟化平台下的GPU类型,取值为“V100_vGPU”或者“RTX5000”,否则无该属性。 |
__support_kvm_ascend_310 | String | 如果镜像支持AI加速,取值为true,否则无该属性。 |
__support_kvm_hi1822_hiovs | String | 如果镜像支持计算增强,取值为true,否则无该属性。 |
__support_arm | String | 如果镜像为ARM架构类型,取值为true,否则无该属性。 |
hw_firmware_type | String | 镜像启动模式,取值为uefi或bios,不指定时无该属性。 |
data_source | String | 镜像来源。
|
__support_gpu_t4 | String | 如果镜像支持GPU T4类型,取值为true,否则无该属性。 |
__support_amd | String | 是否是AMD架构类型的镜像。取值为true或者false。 |
请求示例
GET https://{endpoint}/v1/images 响应示例
状态码:200
OK
{
"images" : [ {
"id" : "633724a7-4a4e-11eb-8f73-fa1640aee23e",
"name" : "ces",
"status" : "active",
"disk_format" : "zvhd2",
"min_disk" : 40,
"min_ram" : 0,
"owner" : "2b76febbe5d34eac85d26435c1f15809",
"protected" : false,
"visibility" : "private",
"created_at" : "2020-12-30T03:23:29Z",
"updated_at" : "2020-12-30T03:30:36Z",
"self" : "/v1/self/633724a7-4a4e-11eb-8f73-fa1640aee23e",
"deleted" : false,
"virtual_env_type" : "FusionCompute",
"deleted_at" : "",
"__imagetype" : "private",
"__platform" : "CentOS",
"__os_type" : "Linux",
"__os_version" : "CentOS 7.4 64bit",
"__isregistered" : true,
"__support_arm" : "true",
"hw_firmware_type" : "uefi",
"data_source" : "instance:a7c6deda-99eb-4f58-b7b4-04a36b75401b",
"__support_gpu_t4" : "true"
} ],
"total" : 1
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
错误码
请参见错误码。

