File: os-server-shares.inc

package info (click to toggle)
nova 2%3A31.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 50,892 kB
  • sloc: python: 412,488; pascal: 1,845; sh: 992; makefile: 166; xml: 83
file content (163 lines) | stat: -rw-r--r-- 3,913 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.. -*- 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)

Request
-------

.. rest_parameters:: parameters.yaml

  - server_id: server_id_path

Response
--------

.. rest_parameters:: parameters.yaml

  - shares: shares_body
  - share_id: share_id_body
  - status: share_status_body
  - tag: share_tag_body


**Example List share attachments for an instance: JSON response**

.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-list-resp.json
   :language: javascript


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.

Request
-------

.. rest_parameters:: parameters.yaml

  - server_id: server_id_path
  - share_id: share_id_body
  - tag: share_tag_body

**Example Attach a share to an instance: JSON request**

.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-create-req.json
   :language: javascript


Response
--------

.. rest_parameters:: parameters.yaml

  - shares: shares_body
  - share_id: share_id_body
  - status: share_status_body
  - tag: share_tag_body

**Example Attach a share to an instance: JSON response**

.. literalinclude:: ../../doc/api_samples/os-server-shares/v2.97/server-shares-create-resp.json
   :language: javascript


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)


Request
-------

.. rest_parameters:: parameters.yaml

  - server_id: server_id_path
  - share_id: share_id_path

Response
--------

.. rest_parameters:: parameters.yaml

  - share: share_body
  - uuid: share_uuid_body
  - share_id: share_id_body
  - status: share_status_body
  - tag: share_tag_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
   :language: javascript

**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
   :language: javascript


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.


Request
-------

.. rest_parameters:: parameters.yaml

  - server_id: server_id_path
  - share_id: share_id_path

Response
--------

No body is returned on successful request.