GetInstances【获取云主机列表】¶
获取租户的云主机列表
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
data | Array | JSON 格式的云主机信息列表,每项参数可见下面 Data Item |
Data Item
Name | Type | Description |
---|---|---|
status | String | 状态 |
boot_from_ebs | String | 从EBS引导 |
image_name | String | 镜像名称 |
network_adapter | Integer | 网卡数量 |
flavor | String | 资源配额 |
fixed_ips | Array | 内网 IP |
id | String | 云主机 ID |
task | String | 任务名称 |
name | String | 云主机名称 |
created | String | 运行时间 |
availability_zone | String | 可用区域 |
floating_ips | Array | 公网 IP |
billing_type | 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: GetInstances
Example Response:
{
"message": "成功",
"code": 200,
"data": [
{
"status": "ACTIVE",
"boot_from_ebs": "False",
"image_name": "CentOS-6.5-x86_64",
"network_adapter": 1,
"flavor": "10",
"fixed_ips": [
"192.168.100.2"
],
"id": "4979cb77-679b-4192-8908-716f3ee2fc04",
"task": null,
"name": "sphinx-01",
"created": "1 天, 23 小时",
"availability_zone": "nova",
"floating_ips": [
""
],
"billing_type": "hour"
}
]
}