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
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"
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}}