Skip to main content

List VM Network Interfaces

GET/v2.1/{project_id}/servers/{server_id}/os-interface

Lists 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.

Request​

Parameters​

project_idstringrequired

The UUID of the project.

server_idstringrequired

The 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​

interfaceAttachmentsarrayrequired

List of interface attachments.

port_idstringrequired

The port ID.

net_idstringrequired

The network ID.

fixed_ipsarrayrequired

Fixed IP addresses with their subnet IDs.

2 fields
subnet_idstringrequiredbody

The UUID of the subnet.

ip_addressstringrequiredbody

The IP address.

mac_addrstringrequired

The MAC address.

port_statestringrequired

The port state, for example ACTIVE.

tagstringrequired

Device 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 CodeDescription
200 - OKRequest was successful.

Error​

Status CodeDescription
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.
404 - Not FoundThe VM does not exist, or is not visible to your project.
501 - Not ImplementedNetwork 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.