List VM Network Interfaces
GET
/v2.1/{project_id}/servers/{server_id}/os-interfaceLists the ports attached to a VM: the port ID, the network and subnet, the fixed IP, the MAC address, and the port state. Use the port ID when you need to detach an interface or to find the port behind a floating IP.
info
Source: list-port-interfaces
Request
Parameters
project_idstringrequiredThe UUID of the project.
server_idstringrequiredThe UUID of the VM.
Sample Request
curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://api.vietnix.cloud:8774/v2.1/{project_id}/servers/{server_id}/os-interface
Response
interfaceAttachmentsarrayrequiredList of interface attachments.
port_idstringrequiredThe port ID.
net_idstringrequiredThe network ID.
fixed_ipsarrayrequiredFixed IP addresses with their subnet IDs.
2 fields
subnet_idstringrequiredbodyThe UUID of the subnet.
ip_addressstringrequiredbodyThe IP address.
mac_addrstringrequiredThe MAC address.
port_statestringrequiredThe port state, for example ACTIVE.
tagstringrequiredDevice tag applied to the interface, or null.
Sample Response
Response body
{
"interfaceAttachments": [
{
"port_state": "ACTIVE",
"fixed_ips": [
{
"subnet_id": "d52aa9f4-6a4b-4268-a71d-1a50f9b60aa9",
"ip_address": "10.136.18.138"
}
],
"port_id": "bfc3228d-384e-4864-a583-54157225a4ef",
"net_id": "a1d8d6ae-c89d-4307-8a0c-3cc2ee55d7e3",
"mac_addr": "fa:16:3e:3b:0b:c3"
}
]
}
Status Code
Success
| Status Code | Description |
|---|---|
| 200 - OK | Request was successful. |
Error
| Status Code | Description |
|---|---|
| 401 - Unauthorized | User must authenticate before making a request. |
| 403 - Forbidden | Policy does not allow current user to do this operation. |
| 404 - Not Found | The VM does not exist, or is not visible to your project. |
| 501 - Not Implemented | Network interfaces are not implemented for this deployment. |
note
A VM can have several interfaces on the same network. Do not identify an interface by its IP alone; use port_id.