GetImages【获取镜像列表】

获取镜像列表:可根据镜像类型获取公有镜像和私有镜像列表,如果不指定镜像类型,则会返回所有镜像。

Request Parameters

Parameter name Type Description Required
action String API 标识符 Yes
type String

镜像的类型,有效值 public,private

public:公有镜像
private:私有镜像
No

Response Elements

Name Type Description
message String 执行结果信息
code Integer HTTP Resonpe响应状态码
data Array JSON 格式的镜像信息列表,每项参数可见下面 Data Item

Data Item

Name Type Description
arch String 镜像系统架构
disk_format String 系统盘格式
id String 镜像ID
image_type String 镜像类型
is_public Boolean 是否为公有镜像
name String 镜像名称
os String 操作系统
properties Array JSON 格式的系统配置信息列表,每项参数可见下面 Properties Item
protected Boolean 是否受保护
release String 发行版本
size String 系统盘大小
status String 镜像状态

Properties Item

Name Type Description
architecture String 镜像系统架构
os_distro String 操作系统发行版
os_type String 镜像系统类型
os_version String 系统版本
vol_size String 系统盘大小

Example

Example Request:

Request Headers:

POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/x-www-form-urlencoded

Form Data:

action: GetImages
type: public

Example Response:

{
  "message": "成功",
  "code": 200,
  "data": [
    {
      "status": "active",
      "is_public": true,
      "arch": "x86_64",
      "properties": {
        "vol_size": "40",
        "os_type": "windows",
        "architecture": "x86_64",
        "os_distro": "windows",
        "os_version": "2008R2-Enterprise-SP1"
      },
      "size": "40",
      "name": "Windows-Server-2008R2-Enterprise-SP1-x64",
      "image_type": "image",
      "disk_format": "qcow2",
      "id": "4d584da2-45ce-4bf3-ba3e-d9252a7f8ca7",
      "protected": false,
      "release": "2008R2-Enterprise-SP1",
      "os": "windows"
    }
  ]
}