ListInterface【获取云主机的网卡信息】¶
获取云主机的网卡信息:可根据云主机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 |
---|---|---|
port_state | String | 状态 |
port_id | String | 网卡 ID |
fixed_ips | Array | 内网 IP列表 subnet_id:子网 ID
ip_address:IP 地址
|
net_id | String | 网络 ID |
mac_addr | String | MAC 地址 |
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: ListInterface
obj_id: 8074edee-a3de-48b2-be0d-3ead131ac399
Example Response:
{
"message": "成功",
"code": 200,
"data": [
{
"port_state": "ACTIVE",
"port_id": "00f0f9ed-def9-4197-9807-77de71e50eaa",
"fixed_ips": [
{
"subnet_id": "47c04364-1a0b-4ad6-ab21-2d898ab6b696",
"ip_address": "192.168.100.5"
}
],
"net_id": "3974fd50-5d7f-4ac8-8d95-80a35bb9121a",
"mac_addr": "fa:16:3e:b3:d5:32"
}
]
}