DetailInstance【获取云主机详细信息】¶
获取云主机详细信息:可根据云主机ID来获取云主机信息列表。 如果不指定任何过滤条件,则会返回错误信息。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
obj_id | String | 云主机 ID | Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
data | Array | JSON 格式的云主机信息列表,每项参数可见下面 Data Item |
Data Item
Name | Type | Description |
---|---|---|
status | String | 状态 |
macaddress | Array | MAC 地址 |
key_name | String | 关键字名称 |
qos_settings | Array | QOS 配置 |
image_name | String | 镜像名称 |
full_flavor | Dict | 全部配额信息 disk:磁盘大小
vcpus:内核个数
ram:内存大小(MB)
name:配额方案名称
|
default_swap_device | Array | 默认交换设备 |
id | String | 云主机 ID |
task | String | 任务名称 |
name | String | 云主机名称 |
created | String | 创建时间 |
availability_zone | String | 可使用区域 |
root_device_name | Array | 根设备名称 |
volumes | Array | 云硬盘信息 |
default_ephemeral_device | Array | 默认临时设备 |
security_groups | Array | 安全组 |
addresses | Dict | IP 地址信息 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/json
JSON Data:
{
"action": "DetailInstance",
"obj_id": "159a6b9c-fa37-46e8-a3cf-5f7dde879cc4"
}
Example Response:
{
"message": "成功",
"code": 200,
"data": [
{
"status": "ACTIVE",
"macaddress": [
"fa:16:3e:9f:9f:f8"
],
"task": null,
"name": "sphinx-01",
"created": "2015-01-19 16:52:35",
"key_name": null,
"qos_settings": [],
"availability_zone": "nova",
"image_name": "CentOS-6.5-x86_64",
"full_flavor": {
"disk": 0,
"vcpus": 1,
"ram": 1024,
"name": "1C1G0G"
},
"default_swap_device": "",
"root_device_name": "vda",
"volumes": [],
"default_ephemeral_device": "",
"id": "4979cb77-679b-4192-8908-716f3ee2fc04",
"security_groups": [
"default"
],
"addresses": {
"default-network": [
{
"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:9f:9f:f8",
"version": 4,
"addr": "192.168.100.2",
"OS-EXT-IPS:type": "fixed"
}
]
}
}
]
}