2016-04-12 09:03:46 -04:00
|
|
|
.. -*- rst -*-
|
|
|
|
|
|
|
|
===================================================================
|
|
|
|
Servers with volume attachments (servers, os-volume\_attachments)
|
|
|
|
===================================================================
|
|
|
|
|
|
|
|
Attaches volumes that are created through the volume API to server
|
2017-03-27 09:22:10 +00:00
|
|
|
instances. Also, lists volume attachments for a server, shows
|
2016-04-12 09:03:46 -04:00
|
|
|
details for a volume attachment, and detaches a volume.
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
List volume attachments for an instance
|
|
|
|
=======================================
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /servers/{server_id}/os-volume_attachments
|
2016-05-12 08:19:24 +09:00
|
|
|
|
|
|
|
List volume attachments for an instance.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- server_id: server_id_path
|
2016-12-15 13:20:32 -05:00
|
|
|
- limit: limit_simple
|
|
|
|
- offset: offset_simple
|
2016-05-13 12:51:09 +09:00
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- volumeAttachments: volumeAttachments
|
|
|
|
- device: device_resp
|
2016-08-02 17:19:15 +09:00
|
|
|
- id: attachment_id_required
|
2016-05-13 12:51:09 +09:00
|
|
|
- serverId: server_id
|
|
|
|
- volumeId: volumeId_resp
|
|
|
|
|
2016-05-13 14:40:24 +09:00
|
|
|
**Example List volume attachments for an instance: JSON response**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-volumes/list-volume-attachments-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Attach a volume to an instance
|
|
|
|
==============================
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: POST /servers/{server_id}/os-volume_attachments
|
2016-05-12 08:19:24 +09:00
|
|
|
|
|
|
|
Attach a volume to an instance.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
|
|
|
|
|
2016-09-09 22:01:00 +08:00
|
|
|
.. note:: From v2.20 attach a volume to an instance in SHELVED or SHELVED_OFFLOADED
|
|
|
|
state is allowed.
|
|
|
|
|
2016-01-21 22:10:27 +01:00
|
|
|
.. note:: From v2.60, attaching a multiattach volume to multiple instances is
|
|
|
|
supported for instances that are not SHELVED_OFFLOADED. The ability
|
|
|
|
to actually support a multiattach volume depends on the volume type
|
|
|
|
and compute hosting the instance.
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- server_id: server_id_path
|
2017-03-23 16:00:46 -04:00
|
|
|
- volumeAttachment: volumeAttachment_post
|
2016-05-13 12:51:09 +09:00
|
|
|
- volumeId: volumeId
|
|
|
|
- device: device
|
2016-09-25 10:00:43 -04:00
|
|
|
- tag: device_tag_bdm_attachment
|
2016-05-13 12:51:09 +09:00
|
|
|
|
2016-05-13 14:40:24 +09:00
|
|
|
**Example Attach a volume to an instance: JSON request**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-volumes/attach-volume-to-server-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-09-25 10:00:43 -04:00
|
|
|
**Example Attach a volume to an instance and tag it (v2.49): JSON request**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-volumes/v2.49/attach-volume-to-server-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- volumeAttachment: volumeAttachment
|
|
|
|
- device: device_resp
|
2016-08-02 17:19:15 +09:00
|
|
|
- id: attachment_id_required
|
2016-05-13 12:51:09 +09:00
|
|
|
- serverId: server_id
|
|
|
|
- volumeId: volumeId_resp
|
|
|
|
|
2016-05-13 14:40:24 +09:00
|
|
|
**Example Attach a volume to an instance: JSON response**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-volumes/attach-volume-to-server-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Show a detail of a volume attachment
|
|
|
|
====================================
|
|
|
|
|
2017-07-06 13:26:39 +08:00
|
|
|
.. rest_method:: GET /servers/{server_id}/os-volume_attachments/{volume_id}
|
2016-05-12 08:19:24 +09:00
|
|
|
|
|
|
|
Show a detail of a volume attachment.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- server_id: server_id_path
|
2017-07-06 13:26:39 +08:00
|
|
|
- volume_id: volume_id
|
2016-05-13 12:51:09 +09:00
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- volumeAttachment: volumeAttachment
|
|
|
|
- device: device_resp
|
2016-08-02 17:19:15 +09:00
|
|
|
- id: attachment_id_required
|
2016-05-13 12:51:09 +09:00
|
|
|
- serverId: server_id
|
|
|
|
- volumeId: volumeId_resp
|
|
|
|
|
2016-05-13 14:40:24 +09:00
|
|
|
**Example Show a detail of a volume attachment: JSON response**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-volumes/volume-attachment-detail-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Update a volume attachment
|
|
|
|
==========================
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: PUT /servers/{server_id}/os-volume_attachments/{attachment_id}
|
2016-05-12 08:19:24 +09:00
|
|
|
|
|
|
|
Update a volume attachment.
|
|
|
|
|
2017-07-24 12:46:21 -04:00
|
|
|
.. note:: This action only valid when the server is in ACTIVE, PAUSED and RESIZED state,
|
|
|
|
or a conflict(409) error will be returned.
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Normal response codes: 202
|
|
|
|
|
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
|
|
|
|
|
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- server_id: server_id_path
|
|
|
|
- attachment_id: attachment_id
|
2017-03-23 16:00:46 -04:00
|
|
|
- volumeAttachment: volumeAttachment_put
|
2016-05-13 12:51:09 +09:00
|
|
|
- volumeId: volumeId_swap
|
|
|
|
|
2016-05-13 14:40:24 +09:00
|
|
|
**Example Update a volume attachment: JSON request**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-volumes/update-volume-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Response
|
|
|
|
--------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
No body is returned on successful request.
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Detach a volume from an instance
|
|
|
|
================================
|
|
|
|
|
2017-07-06 13:26:39 +08:00
|
|
|
.. rest_method:: DELETE /servers/{server_id}/os-volume_attachments/{volume_id}
|
2016-05-12 08:19:24 +09:00
|
|
|
|
|
|
|
Detach a volume from an instance.
|
|
|
|
|
|
|
|
Normal response codes: 202
|
|
|
|
|
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
|
|
|
|
|
2016-09-09 22:01:00 +08:00
|
|
|
.. note:: From v2.20 detach a volume from an instance in SHELVED or SHELVED_OFFLOADED
|
|
|
|
state is allowed.
|
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Request
|
|
|
|
-------
|
|
|
|
|
2016-05-13 12:51:09 +09:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- server_id: server_id_path
|
2017-07-06 13:26:39 +08:00
|
|
|
- volume_id: volume_id
|
2016-05-13 12:51:09 +09:00
|
|
|
|
2016-05-12 08:19:24 +09:00
|
|
|
Response
|
|
|
|
--------
|
2016-05-13 12:51:09 +09:00
|
|
|
|
|
|
|
No body is returned on successful request.
|