有奖捉虫:办公协同&微信生态&物联网文档专题 HOT
说明:

当前页面接口为旧版 API,未来可能停止维护,目前不展示在左侧导航。云服务器 API 3.0 版本接口定义更加规范,访问时延下降显著,建议使用 云服务器 API 3.0

1. 接口描述

本接口 (DescribeImages) 用于获取用户能够使用的镜像,可以使用这些镜像来创建 CVM 实例。

接口请求域名:image.api.qcloud.com

  • 可以通过镜像 ID 进行查询(最多指定10个镜像 ID);同时,也可以根据镜像的状态或者类型来进行过滤。
  • 镜像拥有5个状态,用户可以根据需要来进行过滤:
    • 1: 创建中
    • 2: 正常
    • 3: 使用中
    • 4: 同步中
    • 5: 复制中
  • 镜像拥有4个类型,用户可以根据需要来进行过滤:
    • 1: 私有镜像 (本账户创建的镜像)
    • 2: 公共镜像 (腾讯云官方镜像)
    • 3: 服务市场 (服务市场提供的镜像)
    • 4: 共享镜像(其他账户共享给本账户的镜像)
  • 北美地区不支持服务市场。
  • 常用公共镜像 ID 一览:
    镜像名称unImgId/unImageId
    CentOS 5.8 32位 img-7br3ouzr
    CentOS 5.8 64位 img-4cq5l3u1
    CentOS 5.11 32位 img-ko6c8e6f
    CentOS 5.11 64位 img-ailu7ftt
    CentOS 6.2 64位 img-50mr2ow7
    CentOS 6.3 32位 img-1afi29f3
    CentOS 6.3 64位 img-4w43a15z
    CentOS 6.4 32位 img-k09t26i1
    CentOS 6.4 64位 img-jlo93805
    CentOS 6.5 32位 img-7uq6rrhr
    CentOS 6.5 64位 img-7fwdvfur
    CentOS 6.6 32位 img-5jbd8jxn
    CentOS 6.6 64位 img-h5le2uy5
    CentOS 6.7 32位img-ljriodz5
    CentOS 6.7 64位 img-9iwld2rx
    CentOS 7.0 64位 img-b1ve77s9
    CentOS 7.1 64位 img-9q2lxkar
    CentOS 7.2 64位 img-31tjrtph
    Debian 7.4 64位 img-c1l6bgb1
    Debian 7.8 32位 img-2p1g2wjv
    Debian 7.8 64位 img-feqctcrx
    Debian 8.2 32位 img-ez7jwngr
    Debian 8.2 64位 img-hi93l4ht
    Ubuntu Server 12.04 LTS 64位 (Docker) img-aa9z7opt
    Ubuntu Server 14.04.1 LTS 32位 img-qpxvpujt
    Ubuntu Server 14.04.1 LTS 64位 img-3wnd9xpl
    openSUSE 12.3 32位 img-8bf2kz5x
    openSUSE 12.3 64位 img-1p6m0vz5
    openSUSE 13.2 64位 img-pmhtrjdx
    SUSE Linux Enterprise Server 11 SP3 64位 img-mg89zx1h
    SUSE Linux Enterprise Server 12 64位 img-d5304izr
    FreeBSD 10.1 64位 img-871lthrb
    CoreOS 717.3.0 64位 img-6mre94jv
    Windows Server 2012 R2 标准版 64位英文版 img-lkxqa4kj
    Windows Server 2012 R2 标准版 64位中文版 img-egif9bvl
    Windows Server 2012 R2 数据中心版 64位英文版 img-2tddq003
    Ubuntu 16.04.1 LTS 64位中文版img-pyqx34y1
    Windows Server 2016 R2 数据中心版 64位中文版 img-9id7emv7

2. 输入参数

以下请求参数列表仅列出了接口请求参数,其它参数见 公共请求参数 页面。

参数名称 是否必选 类型 描述
imageType Int 按照镜像的类型过滤;具体值见上。
imageIds.n String 按照镜像 ID 过滤;如果指定了镜像 ID,imageType 则为必选(此接口支持同时传入多个 ID。此参数的具体格式可参考 API 简介id.n一节)。
status Int 按照镜像的状态过滤。默认值为0,查询全部镜像。具体值见上。
offset Int 偏移量,默认为0。关于offset的更进一步介绍参考 API 简介 中的相关小节。
limit Int 返回数量,默认 20,最大值 100。关于limit的更进一步介绍参考 API 简介 中的相关小节。

3. 输出参数

参数名称 类型 描述
code Int 公共错误码。0表示成功,其他值表示失败。
message String 模块错误信息描述,与接口相关。
totalCount Int 符合条件的镜像数量。
imageSet Array 符合条件的镜像信息。

其中 imageSet 存储了镜像具体的信息,构成如下:

参数名称 类型 描述
unImgId String 硬盘镜像 ID,命名格式为“img-xxxxxxxx”,使用此 ID 标识镜像。
imageName String 硬盘镜像名称。
imageDescription String 描述信息。
imageType Int 镜像类型。具体值见上。
osName String 操作系统名称。
createTime String 创建时间。
creator String 创建者的账号。
status Int 镜像的状态。具体值见上。

4. 示例

输入

  https://image.api.qcloud.com/v2/index.php?Action=DescribeImages
  &imageType=1
  &<公共请求参数>

输出


{
    "code" : 0,
    "message" : "",
    "totalCount" : 1,
    "imageSet" : [
        {
            "unImgId" : "img-1234test",
            "imageName" : "test",
            "imageDescription" : "test",
            "osName" : "Ubuntu 12.04 64bit",
            "imageType" : 1,
            "createTime" : "2014-09-27 10:11:00",
            "createor" : "1000",
            "status" : 2
        }
    ]
}