获取云服务器信息
基本信息
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。
|
transition_status |
String |
云服务器过渡状态, 有效值为creating, starting, stopping, restarting, suspending, resuming, terminating, recovering, resetting。
|
create_time |
TimeStamp |
云服务器创建时间, 为UTC时间, 格式可参见 ISO8601. |
status_time |
TimeStamp |
云服务器最近一次状态变更时间, 为UTC时间, 格式可参见 ISO8601. |
image |
Dict |
云服务器的模板信息。
|
vxnets |
Array |
云服务器加入的私有网络信息。
|
eip |
Dict |
云服务器绑定的公网 IP 信息。
|
security_group |
Dict |
云服务器的防火墙信息。
|
volume_ids |
Array |
云服务器上挂载的硬盘ID |
keypair_ids |
Array |
云服务器上加载的SSH密钥 ID |
graphics_protocol |
String |
图形化访问支持协议 |
graphics_passwd |
String |
图形化访问密码 |
返回数据
请求示例
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
}