2016-04-12 09:03:46 -04:00
|
|
|
.. -*- rst -*-
|
2016-04-20 16:10:51 -04:00
|
|
|
.. needs:parameter_verification
|
|
|
|
.. needs:example_verification
|
|
|
|
.. needs:body_verification
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
=========================================
|
|
|
|
Port interfaces (servers, os-interface)
|
|
|
|
=========================================
|
|
|
|
|
|
|
|
Creates a port interface and uses it to attach a port to a server and
|
|
|
|
detaches a port interface from a server. Also, lists all port interfaces
|
|
|
|
and shows details for a port interface.
|
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
List Port Interfaces
|
|
|
|
====================
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
.. rest_method:: GET /v2.1/{tenant_id}/servers/{server_id}/os-interface
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Lists port interfaces that are attached to a server.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-18 16:41:58 -07:00
|
|
|
Normal response codes: 200
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
|
|
|
|
NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- tenant_id: tenant_id
|
|
|
|
- server_id: server_id
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- interfaceAttachment: interfaceAttachment
|
2016-04-23 22:54:22 +08:00
|
|
|
- port_state: port_state
|
2016-04-12 09:03:46 -04:00
|
|
|
- fixed_ips: fixed_ips
|
|
|
|
- mac_addr: mac_addr
|
|
|
|
- net_id: net_id
|
|
|
|
- port_id: port_id
|
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
**Example List Port Interfaces: JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-attach-interfaces/attach-interfaces-list-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Create Interface
|
|
|
|
================
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
.. rest_method:: POST /v2.1/{tenant_id}/servers/{server_id}/os-interface
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Creates a port interface and uses it to attach a port to a server instance.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-18 16:41:58 -07:00
|
|
|
Normal response codes: 200
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
|
|
|
|
itemNotFound(404), conflict(409), computeFault(500), NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- tenant_id: tenant_id
|
|
|
|
- server_id: server_id
|
2016-04-23 22:54:22 +08:00
|
|
|
- interfaceAttachment: interfaceAttachment
|
|
|
|
- port_id: port_id
|
|
|
|
- net_id: net_id
|
|
|
|
- fixed_ips: fixed_ips
|
|
|
|
|
|
|
|
**Example Create Interface: JSON request**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-attach-interfaces/attach-interfaces-create-req.json
|
|
|
|
:language: javascript
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- interfaceAttachment: interfaceAttachment
|
|
|
|
- fixed_ips: fixed_ips
|
|
|
|
- mac_addr: mac_addr
|
|
|
|
- net_id: net_id
|
|
|
|
- port_id: port_id
|
2016-04-23 22:54:22 +08:00
|
|
|
- port_state: port_state
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
**Example Create Interface: JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-attach-interfaces/attach-interfaces-create-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Show Port Interface Details
|
|
|
|
===========================
|
|
|
|
|
|
|
|
.. rest_method:: GET /v2.1/{tenant_id}/servers/{server_id}/os-interface/{port_id}
|
|
|
|
|
|
|
|
Shows details for a port interface that is attached to a server.
|
|
|
|
|
2016-04-18 16:41:58 -07:00
|
|
|
Normal response codes: 200
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- tenant_id: tenant_id
|
|
|
|
- server_id: server_id
|
|
|
|
- port_id: port_id
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-19 17:52:18 +09:00
|
|
|
**Example Show Port Interface Details: JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-20 11:38:31 +09:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-attach-interfaces/attach-interfaces-show-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Detach Interface
|
|
|
|
================
|
|
|
|
|
|
|
|
.. rest_method:: DELETE /v2.1/{tenant_id}/servers/{server_id}/os-interface/{port_id}
|
|
|
|
|
|
|
|
Detaches a port interface.
|
|
|
|
|
2016-04-18 16:41:58 -07:00
|
|
|
Normal response codes: 202
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-23 22:54:22 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
|
|
|
|
conflict(409), NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- tenant_id: tenant_id
|
|
|
|
- server_id: server_id
|
|
|
|
- port_id: port_id
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|