Listing network interfaces of virtual machines

GET /servers/{server_id}/os-interface

List network interfaces that are attached to the given virtual machine.

Source: https://docs.openstack.org/api-ref/compute/?expanded=list-port-interfaces-detail#list-port-interfaces

Request

Parameters

Name In Type Description
server_id path string The UUID of the server.

Example

List all network interfaces that are attached to a VM with the specified ID.

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8774/v2.1/b906404c55bb44729da99987536ac5bc/servers/0785ee80-1eca-426b-b8c4-5b499fc7f614/os-interface

Response

Parameters

Name In Type Description
interfaceAttachments body array List of the interface attachments.
port_state body string The port state.
fixed_ips body array Fixed IP addresses with subnet IDs.
subnet_id body string The UUID of the subnet.
ip_address body string The IP address.
port_id body string The port ID.
net_id body string The network ID.
mac_addr body string The MAC address.
tag body string

The device tag applied to the virtual network interface or null.

New in version 2.70

Status codes

Success

Code Reason
200 - OK Request was successful.

Error

Code Reason
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 requested resource could not be found.

501 - Not Implemented

The server either does not recognize the request method, or it lacks the ability to fulfill the request.

Example

{
  "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"
    },
    {
      "port_state": "ACTIVE",
      "fixed_ips": [
        {
          "subnet_id": "470526d3-ea5a-48fb-81ac-20273f005f61", 
          "ip_address": "192.168.128.10"
        }
      ],
      "port_id": "ff9edb95-611f-4969-b98a-498f77c0326a",
      "net_id": "0bb6b7a7-da8d-432c-b8d5-12139f7924d1",
      "mac_addr": "fa:16:3e:8d:73:9f"
    }
  ]
}