基本信息

Action

DescribeInstances

Path

/iaas

Method

GET

请求参数

此接口除公共参数外,还包含以下参数。关于公共参数的更多信息,请参见前文内容

参数名 类型 描述 是否必须

instances.n

String

云服务器 ID

image_id.n

String

一个或多个镜像ID

instance_type.n

String

云服务器配置类型

instance_class

Integer

云服务器性能类型: 性能型:0, 超高性能型:1, 基础型:101, 企业型:201

vcpus_current

Integer

云服务器CPU的核心数

memory_current

Integer

云服务器内存大小

os_disk_size

Integer

云服务器系统盘大小

exclude_reserved

Integer

是否过滤预留云服务器, 若为1, 则不返回预留云服务器信息

status.n

String

云服务器状态: pending, running, stopped, suspended, terminated, ceased

search_word

String

搜索关键词, 支持云服务器 ID , 云服务器名称

tags.n

String

按照标签ID过滤, 只返回已绑定某标签的资源

dedicated_host_group_id

String

按照专属宿云服务器组过滤

dedicated_host_id

String

按照专属宿云服务器组中某个宿云服务器过滤

owner

String

按照用户账户过滤, 只返回指定账户的资源

verbose

Integer

是否返回冗长的信息, 若为1, 则返回云服务器相关其他资源的详细数据。

instance_set 参数说明如下。

参数名 类型 描述

instance_id

String

云服务器 ID

instance_name

String

云服务器名称

description

String

云服务器描述

instance_type

String

云服务器类型

vcpus_current

Integer

云服务器CPU核心数目。

memory_current

Integer

云服务器内存大小, 单位为MB。

status

String

云服务器状态, 有效值为pending, running, stopped, suspended, terminated, ceased。

  • pending: 等待被创建

  • running: 运行中

  • stopped: 已关机

  • suspended: 由于欠费, 已被暂停使用

  • terminated: 已被删除, 但处于此状态的云服务器在2小时之内仍可以被恢复为 running 状态

  • ceased: 已被彻底删除, 处于此状态的云服务器无法恢复

transition_status

String

云服务器过渡状态, 有效值为creating, starting, stopping, restarting, suspending, resuming, terminating, recovering, resetting。

  • creating: 创建中, 由 pending 状态变成 running 状态

  • starting: 启动中, 由 stopped 状态变成 running 状态

  • stopping: 关闭中, 由 running 状态变成 stopped 状态

  • restarting: 重启中

  • suspending: 欠费暂停中, 由 running/stopped 状态变成 suspended 状态

  • resuming: 恢复中, 由 suspended 状态变成 running 状态

  • terminating: 删除中, 由 running/stopped/suspended 状态变成 terminated 状态

  • recovering: 恢复中, 由 terminated 状态变成 running 状态

  • resetting: 操作系统重置中

create_time

TimeStamp

云服务器创建时间, 为UTC时间, 格式可参见 ISO8601.

status_time

TimeStamp

云服务器最近一次状态变更时间, 为UTC时间, 格式可参见 ISO8601.

image

Dict

云服务器的模板信息。

  • processor_type: 支持的处理器类型, 有效值为 64bit 和 32bit

  • platform: 模板平台, 有效值为 linux 和 windows

  • os_family: 模板操作系统平台, 有效值为 windows, centos, ubuntu, debian, fedora等

  • image_size: 模板大小

  • image_name: 模板名称

  • provider: 模板提供方, 有效值为 系统模板( system ), 自有模板 ( self )

vxnets

Array

云服务器加入的私有网络信息。

  • vxnet_id: 私有网络ID

  • vxnet_name: 私有网络名称

  • vxnet_type: 私有网络类型, 1 为受管私有网络, 0 为自管私有网络。

  • nic_id: 云服务器加入私有网络的网卡ID

  • private_ip: 云服务器位于私有网络中的私有地址

eip

Dict

云服务器绑定的公网 IP 信息。

  • eip_id: 公网 IP 的 ID

  • eip_addr: IP 地址

  • bandwidth: 带宽(Mbps)

security_group

Dict

云服务器的防火墙信息。

  • security_group_id: 防火墙ID

  • is_default: 是否为默认防火墙, 1 为是, 0 为不是。

  • 只有在请求参数 verbose=1 时才会返回此信息。

volume_ids

Array

云服务器上挂载的硬盘ID
只有在请求参数 verbose=1 时才会返回此信息。

keypair_ids

Array

云服务器上加载的SSH密钥 ID
只有在请求参数 verbose=1 时才会返回此信息。

graphics_protocol

String

图形化访问支持协议

graphics_passwd

String

图形化访问密码

返回数据

此接口除了返回公共响应参数外,还返回以下参数。关于公共响应参数的更多信息,请参见前文内容

参数名 类型 描述

instance_set

Array

JSON 格式的云服务器数据列表,每项参数可见后文

total_count

Integer

根据过滤条件得到的云服务器总数

请求示例

https://api.<your_domain>/iaas/?action=DescribeInstances
&instances.1=i-ogbndull
&status.1=running
&verbose=1
&COMMON_PARAMS

返回示例

{
  "action":"DescribeInstancesResponse",
  "instance_set":[
    {
      "vcpus_current":1,
      "instance_id":"i-ogbndull",
      "volume_ids":[
        "vol-g7xy7d6g",
        "vol-jg7326gy"
      ],
      "vxnets":[
        {
          "vxnet_name":"primary vxnet",
          "vxnet_type":1,
          "vxnet_id":"vxnet-0",
          "nic_id":"52:54:ef:0c:ed:66",
          "private_ip":"10.50.13.54"
        }
      ],
      "eip":{
        "eip_id":"eip-1234abcd",
        "eip_addr":"121.201.5.5",
        "bandwidth":"50"
      },
      "memory_current":1024,
      "sub_code":0,
      "transition_status":"",
      "instance_name":"",
      "instance_type":"small_b",
      "create_time":"2013-08-28T14:26:03Z",
      "status":"running",
      "description":null,
      "security_group":{
        "is_default":1,
        "security_group_id":"sg-z13kokni"
      },
      "status_time":"2013-08-28T14:26:03Z",
      "image":{
        "processor_type":"64bit",
        "platform":"linux",
        "image_size":20,
        "image_name":"CentOS 6.4 64bit",
        "image_id":"centos64x64",
        "os_family":"centos",
        "provider":"system"
      },
      "keypair_ids":[
        "kp-bn2n77ow",
        "kp-05vfs7zs"
      ]
    }
  ],
  "ret_code":0,
  "total_count":1
}