List interfaces

Overview

Lists port interfaces.

Classification

  • List

API Operation Object

  • os-interface

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/servers/{server_id}/os-interface

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional
tenant_id URI String The ID for the tenant or account in a multi-tenancy cloud. required
server_id URI UUID The UUID for the server of interest to you. required

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Code

Response Codes
response code condition
200 normal end
400 badRequest
401 unauthorized
403 forbidden
404 itemNotFound
405 badMethod
413 overLimit
503 serviceUnavailable

HTTP Response Body

Format

{
    "interfaceAttachments": [
        {
            "port_state": "<port_state>",
            "fixed_ips": [
                {
                    "subnet_id": "<subnet_id>",
                    "ip_address": "<ip_address>"
                }
            ],
            "net_id": "<net_id>",
            "port_id": "<port_id>",
            "mac_addr": "<mac_addr>"
        }
    ]
}

Response Parameter

Response Parameters
item format description
port_state String The port state.
fixed_ips String Fixed IP addresses with subnet IDs.
mac_addr String The MAC address.
net_id UUID The network ID.
port_id UUID The port ID.

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{tenant_id}/servers/{server_id}/os-interface

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Body

{
    "interfaceAttachments": [
        {
            "port_state": "ACTIVE",
            "fixed_ips": [
                {
                    "subnet_id": "f8a6e8f8-c2ec-497c-9f23-da9616de54ef",
                    "ip_address": "192.168.1.3"
                }
            ],
            "net_id": "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
            "port_id": "ce531f90-199f-48c0-816c-13e38010b442",
            "mac_addr": "fa:16:3e:4c:2c:30"
        }
    ]
}

Execution Example

HTTP Request

GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc291/servers/aef82e69-0b3e-4056-b1b6-c37d5a278183/os-interface HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: c75def63cc764c50a96129a7069a3879
Accept: application/json

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 284
X-Compute-Request-Id: req-34b70202-57ab-41ad-a810-bd69c5bfb1cf
Date: Thu, 15 Oct 2015 05:57:14 GMT

{"interfaceAttachments": [{"port_state": "ACTIVE", "fixed_ips": [{"subnet_id": "b77f4e56-968d-45ae-b66c-9b9046f3d78f", "ip_address": "172.24.4.2"}], "port_id": "091d5b74-8d3f-47d3-9220-6a78da0779dc", "net_id": "d23c3220-f519-4f32-aef5-5d804b3803f9", "mac_addr": "fa:16:3e:e5:6b:2b"}]}

Error Execution Example

HTTP Request

GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc290/servers/aef82e69-0b3e-4056-b1b6-c37d5a278183/os-interface HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: c75def63cc764c50a96129a7069a3879
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-0c4d84a4-5c5b-4f1c-b4c5-cf79a7996dac
Date: Thu, 15 Oct 2015 05:58:29 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id 'ad355aa6ed3e4cf5ae0fa0df652bc290' doesn't match Context's project_id 'ad355aa6ed3e4cf5ae0fa0df652bc291'", "code": 400}}