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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
.. -*- rst -*-
=====================================
Server metadata (servers, metadata)
=====================================
Lists metadata, creates or replaces one or more metadata items, and
updates one or more metadata items for a server.
Shows details for, creates or replaces, and updates a metadata item, by
key, for a server.
List All Metadata
=================
.. rest_method:: GET /servers/{server_id}/metadata
Lists all metadata for a server.
Policy defaults enable only users with the administrative role or the owner of the server to perform this operation. Cloud providers can change these permissions through the ``policy.json`` file.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
Response
--------
.. rest_parameters:: parameters.yaml
- metadata: metadata_object
**Example List All Metadata**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-all-resp.json
:language: javascript
Create or Update Metadata Items
===============================
.. rest_method:: POST /servers/{server_id}/metadata
Create or update one or more metadata items for a server.
Creates any metadata items that do not already exist in the server, replaces
exists metadata items that match keys. Does not modify items that are not in
the request.
Policy defaults enable only users with the administrative role or the owner of the server to perform this operation. Cloud providers can change these permissions through the ``policy.json`` file.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- metadata: metadata_object
**Example Update Metadata Items**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-all-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- metadata: metadata_object
**Example Update Metadata Items**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-all-resp.json
:language: javascript
Replace Metadata Items
======================
.. rest_method:: PUT /servers/{server_id}/metadata
Replaces one or more metadata items for a server.
Creates any metadata items that do not already exist in the server. Removes and completely replaces any metadata items that already exist in the server with the metadata items in the request.
Policy defaults enable only users with the administrative role or the owner of the server to perform this operation. Cloud providers can change these permissions through the ``policy.json`` file.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- metadata: metadata_object
**Example Create Or Replace Metadata Items**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-all-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- metadata: metadata_object
**Example Create Or Replace Metadata Items**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-all-resp.json
:language: javascript
Show Metadata Item Details
==========================
.. rest_method:: GET /servers/{server_id}/metadata/{key}
Shows details for a metadata item, by key, for a server.
Policy defaults enable only users with the administrative role or the owner of the server to perform this operation. Cloud providers can change these permissions through the ``policy.json`` file.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- key: key
Response
--------
.. rest_parameters:: parameters.yaml
- meta: metadata_object
**Example Show Metadata Item Details**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-resp.json
:language: javascript
Create Or Update Metadata Item
==============================
.. rest_method:: PUT /servers/{server_id}/metadata/{key}
Creates or replaces a metadata item, by key, for a server.
Creates a metadata item that does not already exist in the server. Replaces
existing metadata items that match keys with the metadata item in the request.
Policy defaults enable only users with the administrative role or the owner of the server to perform this operation. Cloud providers can change these permissions through the ``policy.json`` file.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- key: key
**Example Create Or Update Metadata Item**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- meta: metadata_object
**Example Create Or Update Metadata Item**
.. literalinclude:: ../../doc/api_samples/server-metadata/server-metadata-resp.json
:language: javascript
Delete Metadata Item
====================
.. rest_method:: DELETE /servers/{server_id}/metadata/{key}
Deletes a metadata item, by key, from a server.
Policy defaults enable only users with the administrative role or the owner of the server to perform this operation. Cloud providers can change these permissions through the ``policy.json`` file.
Normal response codes: 204
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- server_id: server_id_path
- key: key
Response
--------
If successful, this method does not return content in the response body.
|