This website requires JavaScript.
2022年03月22日 15:15:21 +01:00
.. -*- rst -*-
===================================================================
Servers with shares attachments (servers, shares)
===================================================================
Attaches shares that are created through the Manila share API to server
instances. Also, lists share attachments for a server, shows
details for a share attachment, and detaches a share (New in version 2.97).
List share attachments for an instance
=======================================
.. rest_method:: GET /servers/{server_id}/shares
List share attachments for an instance.
Normal response codes: 200
Error response codes: badrequest(400), forbidden(403), itemNotFound(404)
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
.. rest_parameters:: parameters.yaml
- share_id: share_id_body
- status: share_status_body
**Example List share attachments for an instance: JSON response**
.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-list-resp.json
Attach a share to an instance
==============================
.. rest_method:: POST /servers/{server_id}/shares
Attach a share to an instance.
Normal response codes: 201
Error response codes: badRequest(400), forbidden(403), itemNotFound(404), conflict(409)
.. note:: This action is only valid when the server is in ``STOPPED`` state.
.. note:: This action also needs specific configurations, check the documentation requirements to configure
your environment and support this feature.
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- share_id: share_id_body
**Example Attach a share to an instance: JSON request**
.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-create-req.json
.. rest_parameters:: parameters.yaml
- share_id: share_id_body
- status: share_status_body
**Example Attach a share to an instance: JSON response**
.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-create-resp.json
Show a detail of a share attachment
====================================
.. rest_method:: GET /servers/{server_id}/shares/{share_id}
Show a detail of a share attachment.
Normal response codes: 200
Error response codes: badRequest(400), forbidden(403), itemNotFound(404)
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- share_id: share_id_path
.. rest_parameters:: parameters.yaml
- share_id: share_id_body
- status: share_status_body
- export_location: share_export_location_body
.. note:: Optional fields can only be seen by admins.
**Example Show a detail of a share attachment: JSON response**
.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-show-resp.json
**Example Show a detail of a share attachment with admin rights: JSON response**
.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-admin-show-resp.json
Detach a share from an instance
================================
.. rest_method:: DELETE /servers/{server_id}/shares/{share_id}
Detach a share from an instance.
Normal response codes: 200
Error response codes: badRequest(400), forbidden(403), itemNotFound(404), conflict(409)
.. note:: This action is only valid when the server is in ``STOPPED`` or ``ERROR`` state.
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- share_id: share_id_path
No body is returned on successful request.