更新时间:2024-01-24 GMT+08:00
分享

查询产品镜像列表

功能介绍

该接口用于查询云桌面支持的产品镜像列表。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/images

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目id。

表2 Query参数

参数

是否必选

参数类型

描述

os_type

String

产品镜像的操作系统类型,如Windows。

image_type

String

镜像类型。 -gold 公共镜像 -private 私有镜像

platform

String

镜像系统类型,如Windows。

architecture

String

镜像架构:x86。

package_type

String

套餐系列

image_id

String

镜像Id

limit

Integer

每页数量,范围0-100,默认100。

offset

Integer

偏移量,默认0。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

Content-Type

String

发送的实体的MIME类型,如:application/json。

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

images

Array of ImageInfo objects

云桌面支持的产品镜像列表。

total_count

Integer

对象总数。

表5 ImageInfo

参数

参数类型

描述

id

String

镜像ID。

image_type

String

镜像类型,目前支持以下类型: 公共镜像:gold 私有镜像:private。

os_type

String

操作系统类型,目前取值Linux, Windows,Other。

architecture

String

操作系统架构,目前取值arm,x86

os_version

String

操作系统具体版本。

disk_format

String

镜像格式,目前支持vhd,raw,qcow2,zvhd2格式。

name

String

镜像名称。

min_ram

Integer

镜像运行需要的最小内存,单位为MB。参数取值依据弹性云服务器的规格限制,一般设置为0。

min_disk

Integer

镜像运行需要的最小磁盘,单位为GB 。取值为40~1024GB。

product_code

String

镜像的产品编码。

状态码: 400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 401

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 403

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 404

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 405

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 503

表12 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

  • GET /v2/29dfe82ada564ac2b927e1ff036d9a9b/images?image_type=gold&os_type=Linux
  • /v2/0e69423d4400f4a82f67c0059a1e4cc8/images?architecture=x86&image_type=private

响应示例

状态码: 200

查询OpenStack环境中的镜像响应。

{
  "total_count" : 1,
  "images" : [ {
    "id" : "d6b368bc-a24d-4fb5-a8fb-727356a53f33",
    "image_type" : "gold",
    "os_type" : "Linux",
    "os_version" : "EulerOS 2.2 64bit",
    "disk_format" : "qcow2",
    "name" : "Euler_Online_Tenant_vAG",
    "min_ram" : 0,
    "min_disk" : 50
  }, {
    "id" : "bef99a44-2b6a-4ef9-b1a2-204a4910e374",
    "image_type" : "gold",
    "os_type" : "Linux",
    "os_version" : "EulerOS 2.5 64bit",
    "disk_format" : "qcow2",
    "name" : "FA-LZ-x86vAG-801temp",
    "min_ram" : 0,
    "min_disk" : 60
  } ]
}

状态码

状态码

描述

200

查询OpenStack环境中的镜像响应。

400

由于包含语法错误,当前请求无法被服务器理解。

401

鉴权失败。

403

没有操作权限。

404

找不到资源。

405

请求中指定的方法不被允许。

500

服务内部错误,具体返回错误码请参见错误码说明。

503

服务不可用。

错误码

请参见错误码

分享:

    相关文档

    相关产品