root / docs / compute-api-guide.rst @ a1d0bacb
History | View | Annotate | Download (89.1 kB)
1 |
.. _compute-api-guide: |
---|---|
2 |
|
3 |
API Guide |
4 |
********* |
5 |
|
6 |
`Cyclades <cyclades.html>`_ is the Compute Service of `Synnefo |
7 |
<http://www.synnefo.org>`_. The Cyclades/Compute API complies with |
8 |
`OpenStack Compute <http://docs.openstack.org/api/openstack-compute/2/content>`_ |
9 |
with custom extensions when needed. |
10 |
|
11 |
This document's goals are: |
12 |
|
13 |
* Define the Cyclades/Compute REST API |
14 |
* Clarify the differences between Cyclades and OpenStack/Compute |
15 |
|
16 |
Users and developers who wish to access Cyclades through its REST API are |
17 |
advised to use the |
18 |
`kamaki <http://www.synnefo.org/docs/kamaki/latest/index.html>`_ command-line |
19 |
client and associated python library, instead of making direct calls. |
20 |
|
21 |
Overview |
22 |
======== |
23 |
|
24 |
* OpenStack does not define if requests for invalid URLs should return 404 or a |
25 |
* Fault. We return a BadRequest Fault. |
26 |
* OpenStack does not define if requests with a wrong HTTP method should return |
27 |
* 405 or a Fault. We return a BadRequest Fault. |
28 |
|
29 |
General API Information |
30 |
======================= |
31 |
|
32 |
Authentication |
33 |
-------------- |
34 |
|
35 |
All requests use the same authentication method: an ``X-Auth-Token`` header is |
36 |
passed to the servive, which is used to authenticate the user and retrieve user |
37 |
related information. No other user details are passed through HTTP. |
38 |
|
39 |
Efficient Polling with the Changes-Since Parameter |
40 |
-------------------------------------------------- |
41 |
|
42 |
* Effectively limit support of the changes-since parameter in **List Servers** |
43 |
and **List Images**. |
44 |
|
45 |
* Assume that garbage collection of deleted servers will only affect servers |
46 |
deleted ``POLL_TIME`` seconds (default: 3600) in the past or earlier. Else |
47 |
loose the information of a server getting deleted. |
48 |
|
49 |
* Images do not support a deleted state, so deletions cannot be tracked. |
50 |
|
51 |
Limitations |
52 |
----------- |
53 |
|
54 |
* Version MIME type and vesionless requests are not currently supported. |
55 |
|
56 |
* Cyclades only supports JSON Requests and JSON/XML Responses. XML Requests are |
57 |
currently not supported. |
58 |
|
59 |
* Optional content compression support is currently not supported. |
60 |
|
61 |
* To prevent abuse, HTTP sessions have a timeout of 20 seconds before being |
62 |
closed. |
63 |
|
64 |
* Full URI references and ``self`` and ``bookmark`` links are not supported. |
65 |
|
66 |
* Pagination is currently not supported. |
67 |
|
68 |
* Cached responses are currently not supported. |
69 |
|
70 |
* Limits are currently not supported. |
71 |
|
72 |
* Extensions are currently not supported. |
73 |
|
74 |
|
75 |
API Operations |
76 |
============== |
77 |
|
78 |
.. rubric:: Servers |
79 |
|
80 |
================================================== ========================================= ====== ======== ========== |
81 |
Description URI Method Cyclades OS/Compute |
82 |
================================================== ========================================= ====== ======== ========== |
83 |
`List <#list-servers>`_ ``/servers`` GET ✔ ✔ |
84 |
\ ``/servers/detail`` GET ✔ ✔ |
85 |
`Create <#create-server>`_ ``/servers`` POST ✔ ✔ |
86 |
`Get Stats <#get-server-stats>`_ ``/servers/<server-id>/stats`` GET ✔ **✘** |
87 |
`Get Diagnostics <#get-server-diagnostics>`_ ``/servers/<server-id>/diagnostics`` GET ✔ **✘** |
88 |
`Get Details <#get-server-details>`_ ``/servers/<server id>`` GET ✔ ✔ |
89 |
`Rename <#rename-server>`_ ``/servers/<server id>`` PUT ✔ ✔ |
90 |
`Delete <#delete-server>`_ ``/servers/<server id>`` DELETE ✔ ✔ |
91 |
`List Connections <#list-server-connections>`_ ``/servers/<server id>/ips`` GET ✔ ✔ |
92 |
`Get Connection <#connection-with-network>`_ ``/servers/<server id>/ips/<network id>`` GET ✔ ✔ |
93 |
`List Metadata <#list-server-metadata>`_ ``/servers/<server-id>/metadata`` GET ✔ ✔ |
94 |
`Update Metadata <#set-update-server-metadata>`_ ``/servers/<server-id>/metadata`` PUT **✘** ✔ |
95 |
\ ``/servers/<server-id>/metadata`` POST ✔ ✔ |
96 |
`Get Meta Item <#get-server-metadata-item>`_ ``/servers/<server-id>/metadata/<key>`` GET ✔ ✔ |
97 |
`Update Meta Item <#update-server-metadata-item>`_ ``/servers/<server-id>/metadata/<key>`` PUT ✔ ✔ |
98 |
`Delete Meta Item <#delete-server-metadata>`_ ``/servers/<server-id>/metadata/<key>`` DELETE ✔ ✔ |
99 |
`Actions <#server-actions>`_ ``servers/<server id>/action`` POST ✔ ✔ |
100 |
================================================== ========================================= ====== ======== ========== |
101 |
|
102 |
.. rubric:: Flavors |
103 |
|
104 |
==================================== ======================== ====== ======== ========== |
105 |
Description URI Method Cyclades OS/Compute |
106 |
==================================== ======================== ====== ======== ========== |
107 |
`List <#list-flavors>`_ ``/flavors`` GET ✔ ✔ |
108 |
\ ``/flavors/detail`` GET ✔ **✘** |
109 |
`Get details <#get-flavor-details>`_ ``/flavors/<flavor-id>`` GET ✔ ✔ |
110 |
==================================== ======================== ====== ======== ========== |
111 |
|
112 |
.. rubric:: Images |
113 |
|
114 |
=========================================== ===================================== ====== ======== ========== |
115 |
Description URI Method Cyclades OS/Compute |
116 |
=========================================== ===================================== ====== ======== ========== |
117 |
`List <#list-images>`_ ``/images`` GET ✔ ✔ |
118 |
\ ``/images/detail`` GET ✔ ✔ |
119 |
`Get details <#get-image-details>`_ ``/images/<image-id>`` GET ✔ ✔ |
120 |
`Delete <#delete-image>`_ ``/images/<image id>`` DELETE ✔ ✔ |
121 |
`List Metadata <#list-image-metadata>`_ ``/images/<image-id>/metadata`` GET ✔ ✔ |
122 |
`Update Metadata <#update-image-metadata>`_ ``/images/<image-id>/metadata`` POST ✔ ✔ |
123 |
\ ``/images/<image-id>/metadata`` PUT **✘** ✔ |
124 |
`Get Meta Item <#get-image-metadata>`_ ``/image/<image-id>/metadata/<key>`` GET ✔ ✔ |
125 |
`Update Metadata <#update-image-metadata>`_ ``/images/<image-id>/metadata/<key>`` PUT ✔ ✔ |
126 |
`Delete Metadata <#delete-image-metadata>`_ ``/images/<image-id>/metadata/<key>`` DELETE ✔ ✔ |
127 |
=========================================== ===================================== ====== ======== ========== |
128 |
|
129 |
List Servers |
130 |
------------ |
131 |
|
132 |
List all virtual servers owned by the user. |
133 |
|
134 |
.. rubric:: Request |
135 |
|
136 |
=================== ====== ======== ========== |
137 |
URI Method Cyclades OS/Compute |
138 |
=================== ====== ======== ========== |
139 |
``/servers`` GET ✔ ✔ |
140 |
``/servers/detail`` GET ✔ ✔ |
141 |
=================== ====== ======== ========== |
142 |
|
143 |
* Both requests return a list of servers. The first returns just ``id``, |
144 |
``name`` and ``links``, while the second returns the full collections of |
145 |
server attributes. |
146 |
|
147 |
| |
148 |
============== ========================= ======== ========== |
149 |
Request Header Value Cyclades OS/Compute |
150 |
============== ========================= ======== ========== |
151 |
X-Auth-Token User authentication token required required |
152 |
============== ========================= ======== ========== |
153 |
|
154 |
| |
155 |
================= =================================== ======== ========== |
156 |
Request Parameter Value Cyclades OS/Compute |
157 |
================= =================================== ======== ========== |
158 |
json Respond in json default **✘** |
159 |
xml Respond in xml ✔ **✘** |
160 |
changes-since Servers delete since that timestamp ✔ ✔ |
161 |
image Image reference **✘** ✔ |
162 |
flavor VM flavor reference **✘** ✔ |
163 |
server Server flavor reference **✘** ✔ |
164 |
status Server status **✘** ✔ |
165 |
marker Last list last ID **✘** ✔ |
166 |
limit Page size **✘** ✔ |
167 |
================= =================================== ======== ========== |
168 |
|
169 |
* **json** and **xml** parameters are mutually exclusive. If none supported, |
170 |
the response will be formated in json. |
171 |
|
172 |
* **status** refers to the `server status <#status-ref>`_ |
173 |
|
174 |
* **changes-since** must be an ISO8601 date string |
175 |
|
176 |
.. rubric:: Response |
177 |
|
178 |
=========================== ===================== |
179 |
Return Code Description |
180 |
=========================== ===================== |
181 |
200 (OK) Request succeeded |
182 |
304 (No servers since date) Can be returned if ``changes-since`` is given |
183 |
400 (Bad Request) Invalid or malformed ``changes-since`` parameter |
184 |
401 (Unauthorized) Missing or expired user token |
185 |
403 (Forbidden) User is not allowed to perform this operation |
186 |
500 (Internal Server Error) The request cannot be completed because of an |
187 |
\ internal error |
188 |
503 (Service Unavailable) The server is not currently available |
189 |
=========================== ===================== |
190 |
|
191 |
| |
192 |
|
193 |
Response body contents:: |
194 |
|
195 |
servers: [ |
196 |
{ |
197 |
<server attribute>: <value>, |
198 |
... |
199 |
}, ... |
200 |
] |
201 |
|
202 |
The server attributes are listed `here <#server-ref>`_ |
203 |
|
204 |
*Example List Servers: JSON (regular)* |
205 |
|
206 |
.. code-block:: javascript |
207 |
|
208 |
GET https://example.org/compute/v2.0/servers |
209 |
|
210 |
|
211 |
{ |
212 |
"servers": [ |
213 |
{ |
214 |
"links": [ |
215 |
{ |
216 |
"href": "https://example.org/compute/v2.0/servers/42", |
217 |
"rel": "self" |
218 |
}, { |
219 |
"href": "https://example.org/compute/v2.0/servers/42", |
220 |
"rel": "bookmark" |
221 |
} |
222 |
], |
223 |
"id": "42", |
224 |
"name": "My Server", |
225 |
}, { |
226 |
"links": [ |
227 |
{ |
228 |
"href": "https://example.org/compute/v2.0/servers/43", |
229 |
"rel": "self" |
230 |
}, { |
231 |
"href": "https://example.org/compute/v2.0/servers/43", |
232 |
"rel": "bookmark" |
233 |
} |
234 |
], |
235 |
"id": "84", |
236 |
"name": "My Server", |
237 |
} |
238 |
] |
239 |
} |
240 |
|
241 |
*Example List Servers: JSON (detail)* |
242 |
|
243 |
GET https://example.org/compute/v2.0/servers/detail |
244 |
|
245 |
|
246 |
.. code-block:: javascript |
247 |
|
248 |
{ |
249 |
"servers": [ |
250 |
{ |
251 |
"addresses": [ |
252 |
"2718": [ |
253 |
{ |
254 |
"version": 6, |
255 |
"addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21ab", |
256 |
"OS-EXT-IPS:type": "fixed" |
257 |
} |
258 |
], |
259 |
"2719": [ |
260 |
{ |
261 |
"version": 4, |
262 |
"addr": "192.168.1.2", |
263 |
"OS-EXT-IPS:type": "floating" |
264 |
} |
265 |
] |
266 |
], |
267 |
"attachments": [ |
268 |
{ |
269 |
"id": "18", |
270 |
"network_id": "2718", |
271 |
"mac_address": "aa:01:02:6c:34:ab", |
272 |
"firewallProfile": "DISABLED", |
273 |
"ipv4": "", |
274 |
"ipv6": "2001:443:2dfc:1232:a810:3cf:fe9b:21ab" |
275 |
"OS-EXT-IPS:type": "fixed" |
276 |
}, { |
277 |
"id": "19", |
278 |
"network_id": "2719", |
279 |
"mac_address": "aa:00:0c:6d:34:bb", |
280 |
"firewallProfile": "PROTECTED", |
281 |
"ipv4": "192.168.1.2", |
282 |
"ipv6": "" |
283 |
"OS-EXT-IPS:type": "floating" |
284 |
} |
285 |
], |
286 |
"links": [ |
287 |
{ |
288 |
"href": "https://example.org/compute/v2.0/servers/42", |
289 |
"rel": "self" |
290 |
}, { |
291 |
"href": "https://example.org/compute/v2.0/servers/42", |
292 |
"rel": "bookmark" |
293 |
} |
294 |
], |
295 |
"image": { |
296 |
"id": "im4g3-1d", |
297 |
"links": [ |
298 |
{ |
299 |
"href": "https://example.org/compute/v2.0/images/im4g3-1d", |
300 |
"rel": "self" |
301 |
}, { |
302 |
"href": "https://example.org/compute/v2.0/images/im4g3-1d", |
303 |
"rel": "bookmark" |
304 |
}, { |
305 |
"href": "https://example.org/image/v1.0/images/im4g3-1d", |
306 |
"rel": "alternate" |
307 |
} |
308 |
] |
309 |
}, |
310 |
"suspended": false, |
311 |
"created': '2011-04-19T10:18:52.085737+00:00', |
312 |
"flavor": { |
313 |
"id": 1", |
314 |
"links": [ |
315 |
{ |
316 |
"href": "https://example.org/compute/v2.0/flavors/1", |
317 |
"rel": "self" |
318 |
}, { |
319 |
"href": "https://example.org/compute/v2.0/flavors/1", |
320 |
"rel": "bookmark" |
321 |
} |
322 |
] |
323 |
}, |
324 |
"id": "42", |
325 |
"security_groups": [{"name": "default"}], |
326 |
"user_id": "s0m5-u5e7-1d", |
327 |
"accessIPv4": "", |
328 |
"accessIPv6": "", |
329 |
"progress": 100, |
330 |
"config_drive": "", |
331 |
"status": "ACTIVE", |
332 |
"updated": "2011-05-29T14:07:07.037602+00:00", |
333 |
"hostId": "", |
334 |
"SNF:fqdn": "snf-42.vm.example.org", |
335 |
"key_name": null, |
336 |
"name": "My Server", |
337 |
"created": "2014-02-12T08:31:37.834542+00:00", |
338 |
"tenant_id": "s0m5-u5e7-1d", |
339 |
"SNF:port_forwarding": {}, |
340 |
"SNF:task_state": "", |
341 |
"diagnostics": [ |
342 |
{ |
343 |
"level": "DEBUG", |
344 |
"created": "2014-02-12T08:31:37.834542+00:00", |
345 |
"source": "image-info", |
346 |
"source_date": "2014-02-12T08:32:35.929507+00:00", |
347 |
"message": "Image customization finished successfully.", |
348 |
"details": null |
349 |
} |
350 |
], |
351 |
"metadata": { |
352 |
"os": "debian", |
353 |
"users": "root" |
354 |
} |
355 |
}, { |
356 |
{ |
357 |
"addresses": [ |
358 |
"2718": [ |
359 |
{ |
360 |
"version": 6, |
361 |
"addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd", |
362 |
"OS-EXT-IPS:type": "fixed" |
363 |
} |
364 |
], |
365 |
"4178": [ |
366 |
{ |
367 |
"version": 4, |
368 |
"addr": "192.168.1.3", |
369 |
"OS-EXT-IPS:type": "floating" |
370 |
} |
371 |
] |
372 |
], |
373 |
"attachments": [ |
374 |
{ |
375 |
"id": "36", |
376 |
"network_id": "2718", |
377 |
"mac_address": "aa:01:02:6c:34:cd", |
378 |
"firewallProfile": "DISABLED", |
379 |
"ipv4": "", |
380 |
"ipv6": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd" |
381 |
"OS-EXT-IPS:type": "fixed" |
382 |
}, { |
383 |
"id": "38", |
384 |
"network_id": "4178", |
385 |
"mac_address": "aa:00:0c:6d:34:cc", |
386 |
"firewallProfile": "PROTECTED", |
387 |
"ipv4": "192.168.1.3", |
388 |
"ipv6": "" |
389 |
"OS-EXT-IPS:type": "floating" |
390 |
} |
391 |
], |
392 |
"links": [ |
393 |
{ |
394 |
"href": "https://example.org/compute/v2.0/servers/84", |
395 |
"rel": "self" |
396 |
}, { |
397 |
"href": "https://example.org/compute/v2.0/servers/84", |
398 |
"rel": "bookmark" |
399 |
} |
400 |
], |
401 |
"image": { |
402 |
"id": "im4g3-1d", |
403 |
"links": [ |
404 |
{ |
405 |
"href": "https://example.org/compute/v2.0/images/im4g3-1d", |
406 |
"rel": "self" |
407 |
}, { |
408 |
"href": "https://example.org/compute/v2.0/images/im4g3-1d", |
409 |
"rel": "bookmark" |
410 |
}, { |
411 |
"href": "https://example.org/image/v1.0/images/im4g3-1d", |
412 |
"rel": "alternate" |
413 |
} |
414 |
] |
415 |
}, |
416 |
"suspended": false, |
417 |
"created': '2011-04-21T10:18:52.085737+00:00', |
418 |
"flavor": { |
419 |
"id": 3", |
420 |
"links": [ |
421 |
{ |
422 |
"href": "https://example.org/compute/v2.0/flavors/3", |
423 |
"rel": "self" |
424 |
}, { |
425 |
"href": "https://example.org/compute/v2.0/flavors/3", |
426 |
"rel": "bookmark" |
427 |
} |
428 |
] |
429 |
}, |
430 |
"id": "84", |
431 |
"security_groups": [{"name": "default"}], |
432 |
"user_id": "s0m5-u5e7-1d", |
433 |
"accessIPv4": "", |
434 |
"accessIPv6": "", |
435 |
"progress": 100, |
436 |
"config_drive": "", |
437 |
"status": "ACTIVE", |
438 |
"updated": "2011-05-30T14:07:07.037602+00:00", |
439 |
"hostId": "", |
440 |
"SNF:fqdn": "snf-84.vm.example.org", |
441 |
"key_name": null, |
442 |
"name": "My Other Server", |
443 |
"created": "2014-02-21T08:31:37.834542+00:00", |
444 |
"tenant_id": "s0m5-u5e7-1d", |
445 |
"SNF:port_forwarding": {}, |
446 |
"SNF:task_state": "", |
447 |
"diagnostics": [ |
448 |
{ |
449 |
"level": "DEBUG", |
450 |
"created": "2014-02-21T08:31:37.834542+00:00", |
451 |
"source": "image-info", |
452 |
"source_date": "2014-02-21T08:32:35.929507+00:00", |
453 |
"message": "Image customization finished successfully.", |
454 |
"details": null |
455 |
} |
456 |
], |
457 |
"metadata": { |
458 |
"os": "debian", |
459 |
"users": "root" |
460 |
} |
461 |
} |
462 |
] |
463 |
} |
464 |
|
465 |
|
466 |
Create Server |
467 |
------------- |
468 |
|
469 |
Create a new virtual server |
470 |
|
471 |
.. rubric:: Request |
472 |
|
473 |
============ ====== ======== ========== |
474 |
URI Method Cyclades OS/Compute |
475 |
============ ====== ======== ========== |
476 |
``/servers`` POST ✔ ✔ |
477 |
============ ====== ======== ========== |
478 |
|
479 |
| |
480 |
============== ========================= ======== ========== |
481 |
Request Header Value Cyclades OS/Compute |
482 |
============== ========================= ======== ========== |
483 |
X-Auth-Token User authentication token required required |
484 |
Content-Type Type or request body required required |
485 |
Content-Length Length of request body required required |
486 |
============== ========================= ======== ========== |
487 |
|
488 |
| |
489 |
================= =============== |
490 |
Request Parameter Value |
491 |
================= =============== |
492 |
json Respond in json |
493 |
xml Respond in xml |
494 |
================= =============== |
495 |
|
496 |
Request body contents:: |
497 |
|
498 |
server: { |
499 |
<server attribute>: <value>, |
500 |
... |
501 |
personality: [ |
502 |
... |
503 |
], |
504 |
networks: [ |
505 |
... |
506 |
] |
507 |
... |
508 |
} |
509 |
|
510 |
=========== ====================== ======== ========== |
511 |
Attributes Description Cyclades OS/Compute |
512 |
=========== ====================== ======== ========== |
513 |
name The server name ✔ ✔ |
514 |
imageRef Image id ✔ ✔ |
515 |
flavorRef Resources flavor ✔ ✔ |
516 |
personality Personality contents ✔ ✔ |
517 |
metadata Custom metadata ✔ ✔ |
518 |
networks Connection information ✔ ✔ |
519 |
.. project .. Project UUID .. ✔ .. **✘** |
520 |
=========== ====================== ======== ========== |
521 |
|
522 |
* **name** can be any string |
523 |
|
524 |
* **imageRed** and **flavorRed** should refer to existing images and hardware |
525 |
flavors accessible by the user |
526 |
|
527 |
* **metadata** are ``key``:``value`` pairs of custom server-specific metadata. |
528 |
There are no semantic limitations, although the ``OS`` and ``USERS`` values |
529 |
should rather be defined |
530 |
|
531 |
* **personality** (optional) is a list of |
532 |
`personality injections <#personality-ref>`_ |
533 |
|
534 |
* **networks** (optional) is a list of |
535 |
`network connections <#network-on-vm-ref>`_. |
536 |
|
537 |
.. rubric:: Response |
538 |
|
539 |
=========================== ===================== |
540 |
Return Code Description |
541 |
=========================== ===================== |
542 |
200 (OK) Request succeeded |
543 |
400 (Bad Request) Malformed request data |
544 |
401 (Unauthorized) Missing or expired user token |
545 |
403 (Forbidden) User is not allowed to perform this operation |
546 |
404 (Not Found) Image or Flavor not found |
547 |
413 (Over Limit) Exceeded some resource limit |
548 |
415 (Bad Media Type) |
549 |
500 (Internal Server Error) The request cannot be completed because of an |
550 |
\ internal error |
551 |
503 (Service Unavailable) No available backends or service currently |
552 |
\ unavailable |
553 |
=========================== ===================== |
554 |
|
555 |
| |
556 |
|
557 |
Response body contents:: |
558 |
|
559 |
server: { |
560 |
<server attribute>: <value>, |
561 |
... |
562 |
} |
563 |
|
564 |
Server attributes are `listed here <#server-ref>`_. |
565 |
|
566 |
.. note:: The ``adminPass`` attribute is generated in the response. This is the |
567 |
only case where this attribute appears in a response. |
568 |
|
569 |
*Example Create Server Response: JSON* |
570 |
|
571 |
.. code-block:: javascript |
572 |
|
573 |
POST https://example.org/compute/v2.0/servers |
574 |
|
575 |
|
576 |
{ |
577 |
"server": { |
578 |
"name": "My Example Server", |
579 |
"id": 5678, |
580 |
"status": "BUILD", |
581 |
"created": "2013-04-10T13:52:17.085402+00:00", |
582 |
"updated": "2013-04-10T13:52:17.085402+00:00", |
583 |
"adminPass": "fKCqlZe2at", |
584 |
"progress": 0 |
585 |
"metadata": { |
586 |
"OS": "debian", |
587 |
"USERS": "root" |
588 |
}, |
589 |
... |
590 |
} |
591 |
} |
592 |
|
593 |
.. _personality-ref: |
594 |
|
595 |
Personality: injecting files while creating a virtual server |
596 |
............................................................ |
597 |
|
598 |
The term "personality" refers to a mechanism for injecting data as files into |
599 |
the file system of a virtual server while the server is being created. This |
600 |
mechanism has many application e.g., the injection of ``ssh keys`` for secure |
601 |
password-less access, automation in user profile configuration, etc. |
602 |
|
603 |
A personality injection contains the following attributes: |
604 |
|
605 |
====================== =================== ======== ========== |
606 |
Personality Attributes Description Cyclades OS/Compute |
607 |
====================== =================== ======== ========== |
608 |
path File path on server ✔ ✔ |
609 |
contents Data to inject ✔ ✔ |
610 |
group User group ✔ **✘** |
611 |
mode File access mode ✔ **✘** |
612 |
owner File owner ✔ **✘** |
613 |
====================== =================== ======== ========== |
614 |
|
615 |
* **path** is the path (including name) for the file on the remote server. If |
616 |
the file does not exist, it will be created |
617 |
* **contents** is the data to be injected, must not exceed 10240 *bytes* and |
618 |
must be base64-encoded |
619 |
* **mode** is the access mode of the created remote file and must be a number |
620 |
(usually octal or decimal) |
621 |
|
622 |
*Example Create Server Request: JSON* |
623 |
|
624 |
.. code-block:: javascript |
625 |
|
626 |
POST https://example.org/compute/v2.0/servers |
627 |
{ |
628 |
"server": { |
629 |
"name": "My Password-less Server", |
630 |
"personality": [ |
631 |
{ |
632 |
"path": "/home/someuser/.ssh/authorized_keys", |
633 |
"contents": "Some users public key", |
634 |
"group": "users", |
635 |
"mode": 0600, |
636 |
"owner": "someuser" |
637 |
}, { |
638 |
"path": "/home/someuser/.bashrc", |
639 |
"contents": "bash configuration", |
640 |
"group": "users", |
641 |
"mode": 0777, |
642 |
"owner": "someuser" |
643 |
} |
644 |
], |
645 |
... |
646 |
} |
647 |
} |
648 |
|
649 |
.. _network-on-vm-ref: |
650 |
|
651 |
Network connections on virtual server creation |
652 |
.............................................. |
653 |
|
654 |
A network connection is established by creating a port that connects a virtual |
655 |
device with a network. There are five cases: |
656 |
|
657 |
* The ``network`` attribute is not provided. In that case, the service will |
658 |
apply its default policy (e.g., automatic public network and IP assignment) |
659 |
* The ``network`` attribute is an empty list. In that case, the virtual server |
660 |
will not have any network connections |
661 |
* Provide an existing network ID. In that case, the virtual server will be |
662 |
connected to that network. |
663 |
* Provide an existing network ID and an IP (which is already associated to that |
664 |
network). In that case, the virtual server will be connected to that network |
665 |
with this specific IP attached. |
666 |
* Provide an existing port ID to establish a connection through it. |
667 |
|
668 |
========================================= ======== ========== |
669 |
Network attributes on server construction Cyclades OS/Compute |
670 |
========================================= ======== ========== |
671 |
uuid ✔ ✔ |
672 |
fixed_ip ✔ ✔ |
673 |
port ✔ ✔ |
674 |
========================================= ======== ========== |
675 |
|
676 |
E.g., the following example connects a public network with an IP (2719) and a |
677 |
private network (9876) on the virtual server under construction: |
678 |
|
679 |
* Example Connect server on various networks* |
680 |
|
681 |
.. code-block:: python |
682 |
|
683 |
POST https://example.org/compute/v2.0/servers |
684 |
{ |
685 |
"server": { |
686 |
"networks": [ |
687 |
{"uuid": 9876}, |
688 |
{"uuid": 2719, "fixed_ip": "192.168.1.2"}, |
689 |
], |
690 |
... |
691 |
} |
692 |
} |
693 |
|
694 |
|
695 |
Get Server Stats |
696 |
---------------- |
697 |
|
698 |
.. note:: This operation is not part of OS/Compute v2. |
699 |
|
700 |
This operation returns URLs of graphs showing CPU and Network statistics. |
701 |
|
702 |
.. rubric:: Request |
703 |
|
704 |
============================== ====== ======== ========== |
705 |
URI Method Cyclades OS/Compute |
706 |
============================== ====== ======== ========== |
707 |
``/servers/<server-id>/stats`` GET ✔ **✘** |
708 |
============================== ====== ======== ========== |
709 |
|
710 |
| |
711 |
============== ========================= ======== ========== |
712 |
Request Header Value Cyclades OS/Compute |
713 |
============== ========================= ======== ========== |
714 |
X-Auth-Token User authentication token required required |
715 |
============== ========================= ======== ========== |
716 |
|
717 |
| |
718 |
================= =============== |
719 |
Request Parameter Value |
720 |
================= =============== |
721 |
json Respond in json |
722 |
xml Respond in xml |
723 |
================= =============== |
724 |
|
725 |
* **json** and **xml** parameters are mutually exclusive. If none supported, |
726 |
the response will be formated in json. |
727 |
|
728 |
.. rubric:: Response |
729 |
|
730 |
=========================== ===================== |
731 |
Return Code Description |
732 |
=========================== ===================== |
733 |
200 (OK) Request succeeded |
734 |
400 (Bad Request) Invalid server ID or Server deleted |
735 |
401 (Unauthorized) Missing or expired user token |
736 |
403 (Forbidden) Administratively suspended server |
737 |
404 (Not Found) Server not found |
738 |
500 (Internal Server Error) The request cannot be completed because of an |
739 |
\ internal error |
740 |
503 (Service Unavailable) The server is not currently available |
741 |
=========================== ===================== |
742 |
|
743 |
| |
744 |
|
745 |
Response body contents:: |
746 |
|
747 |
stats: {<parameter>: <value> } |
748 |
|
749 |
============= ====================== |
750 |
Parameter Description |
751 |
============= ====================== |
752 |
serverRef Server ID |
753 |
refresh Refresh frequency |
754 |
cpuBar Latest CPU load graph URL |
755 |
cpuTimeSeries CPU load / time graph URL |
756 |
netBar Latest Network load graph URL |
757 |
netTimeSeries Network load / time graph URL |
758 |
============= ====================== |
759 |
|
760 |
* **refresh** is the recommended sampling rate |
761 |
|
762 |
*Example Get Server Stats Response: JSON* |
763 |
|
764 |
.. code-block:: javascript |
765 |
GET https://example.org/compute/v2.0/servers/5678/stats |
766 |
{ |
767 |
"stats": { |
768 |
"serverRef": 5678, |
769 |
"refresh": 60, |
770 |
"cpuBar": "http://stats.okeanos.grnet.gr/b9a...048c/cpu-bar.png", |
771 |
"cpuTimeSeries": "http://stats.okeanos.grnet.gr/b9a...048c/cpu-ts.png", |
772 |
"netBar": "http://stats.okeanos.grnet.gr/b9a...048c/net-bar.png", |
773 |
"netTimeSeries": "http://stats.okeanos.grnet.gr/b9a...048c/net-ts.png" |
774 |
} |
775 |
} |
776 |
|
777 |
Get Server Diagnostics |
778 |
---------------------- |
779 |
|
780 |
.. note:: This operation is not part of OS/Compute v2. |
781 |
|
782 |
This operation returns diagnostic information (logs) for a server. |
783 |
|
784 |
.. rubric:: Request |
785 |
|
786 |
==================================== ====== ======== ========== |
787 |
URI Method Cyclades OS/Compute |
788 |
==================================== ====== ======== ========== |
789 |
``/servers/<server-id>/diagnostics`` GET ✔ **✘** |
790 |
==================================== ====== ======== ========== |
791 |
|
792 |
| |
793 |
============== ========================= ======== ========== |
794 |
Request Header Value Cyclades OS/Compute |
795 |
============== ========================= ======== ========== |
796 |
X-Auth-Token User authentication token required required |
797 |
============== ========================= ======== ========== |
798 |
|
799 |
.. rubric:: Response |
800 |
|
801 |
=========================== ===================== |
802 |
Return Code Description |
803 |
=========================== ===================== |
804 |
200 (OK) Request succeeded |
805 |
400 (Bad Request) Invalid server ID or Server deleted |
806 |
401 (Unauthorized) Missing or expired user token |
807 |
403 (Forbidden) Administratively suspended server |
808 |
404 (Not Found) Server not found |
809 |
500 (Internal Server Error) The request cannot be completed because of an |
810 |
\ internal error |
811 |
503 (Service Unavailable) The server is not currently available |
812 |
=========================== ===================== |
813 |
|
814 |
| |
815 |
|
816 |
Response body contents:: |
817 |
|
818 |
[ |
819 |
{ |
820 |
<diagnostic attribute}: <value>, |
821 |
... |
822 |
}, |
823 |
... |
824 |
] |
825 |
|
826 |
==================== =========== |
827 |
Diagnostic attribute Description |
828 |
==================== =========== |
829 |
level Debug level |
830 |
created Log entry timestamp |
831 |
source Log source proccess |
832 |
source_date Log source date |
833 |
message Log description |
834 |
details Detailed log description |
835 |
==================== =========== |
836 |
|
837 |
*Example Get Server Diagnostics Response: JSON* |
838 |
|
839 |
.. code-block:: javascript |
840 |
|
841 |
GET https://example.org/compute/v2.0/servers/5678/diagnostics |
842 |
[ |
843 |
{ |
844 |
"level": "DEBUG", |
845 |
"created": "2013-04-09T15:25:53.965144+00:00", |
846 |
"source": "image-helper-task-start", |
847 |
"source_date": "2013-04-09T15:25:53.954695+00:00", |
848 |
"message": "FixPartitionTable", |
849 |
"details": null |
850 |
}, { |
851 |
"level": "DEBUG", |
852 |
"created": "2013-04-09T15:25:46.413718+00:00", |
853 |
"source": "image-info", |
854 |
"source_date": "2013-04-09T15:25:46.404477+00:00", |
855 |
"message": "Starting customization VM...", |
856 |
"details": null |
857 |
} |
858 |
] |
859 |
|
860 |
Get Server Details |
861 |
------------------ |
862 |
|
863 |
This operation returns detailed information for a virtual server |
864 |
|
865 |
.. rubric:: Request |
866 |
|
867 |
======================== ====== ======== ========== |
868 |
URI Method Cyclades OS/Compute |
869 |
======================== ====== ======== ========== |
870 |
``/servers/<server id>`` GET ✔ ✔ |
871 |
======================== ====== ======== ========== |
872 |
|
873 |
| |
874 |
|
875 |
============== ========================= ======== ========== |
876 |
Request Header Value Cyclades OS/Compute |
877 |
============== ========================= ======== ========== |
878 |
X-Auth-Token User authentication token required required |
879 |
============== ========================= ======== ========== |
880 |
|
881 |
.. rubric:: Response |
882 |
|
883 |
=========================== ===================== |
884 |
Return Code Description |
885 |
=========================== ===================== |
886 |
200 (OK) Request succeeded |
887 |
400 (Bad Request) Malformed server id |
888 |
401 (Unauthorized) Missing or expired user token |
889 |
403 (Forbidden) Administratively suspended server |
890 |
404 (Not Found) Server not found |
891 |
500 (Internal Server Error) The request cannot be completed because of an |
892 |
\ internal error |
893 |
503 (Service Unavailable) No available backends or service currently |
894 |
\ unavailable |
895 |
=========================== ===================== |
896 |
|
897 |
| |
898 |
|
899 |
Response body contents:: |
900 |
|
901 |
server: { |
902 |
<server attribute>: <value>, |
903 |
... |
904 |
} |
905 |
|
906 |
Server attributes are explained `here <#server-ref>`_ |
907 |
|
908 |
*Example get server Details* |
909 |
|
910 |
.. code-block:: javascript |
911 |
|
912 |
GET https://example.org/compute/v2.0/servers/84 |
913 |
|
914 |
|
915 |
{ |
916 |
"server": { |
917 |
"addresses": [ |
918 |
"2718": [ |
919 |
{ |
920 |
"version": 6, |
921 |
"addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd", |
922 |
"OS-EXT-IPS:type": "fixed" |
923 |
} |
924 |
], |
925 |
"4178": [ |
926 |
{ |
927 |
"version": 4, |
928 |
"addr": "192.168.1.3", |
929 |
"OS-EXT-IPS:type": "floating" |
930 |
} |
931 |
] |
932 |
], |
933 |
"attachments": [ |
934 |
{ |
935 |
"id": "36", |
936 |
"network_id": "2718", |
937 |
"mac_address": "aa:01:02:6c:34:cd", |
938 |
"firewallProfile": "DISABLED", |
939 |
"ipv4": "", |
940 |
"ipv6": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd" |
941 |
"OS-EXT-IPS:type": "fixed" |
942 |
}, { |
943 |
"id": "38", |
944 |
"network_id": "4178", |
945 |
"mac_address": "aa:00:0c:6d:34:cc", |
946 |
"firewallProfile": "PROTECTED", |
947 |
"ipv4": "192.168.1.3", |
948 |
"ipv6": "" |
949 |
"OS-EXT-IPS:type": "floating" |
950 |
} |
951 |
], |
952 |
"links": [ |
953 |
{ |
954 |
"href": "https://example.org/compute/v2.0/servers/84", |
955 |
"rel": "self" |
956 |
}, { |
957 |
"href": "https://example.org/compute/v2.0/servers/84", |
958 |
"rel": "bookmark" |
959 |
} |
960 |
], |
961 |
"image": { |
962 |
"id": "im4g3-1d", |
963 |
"links": [ |
964 |
{ |
965 |
"href": "https://example.org/compute/v2.0/images/im4g3-1d", |
966 |
"rel": "self" |
967 |
}, { |
968 |
"href": "https://example.org/compute/v2.0/images/im4g3-1d", |
969 |
"rel": "bookmark" |
970 |
}, { |
971 |
"href": "https://example.org/image/v1.0/images/im4g3-1d", |
972 |
"rel": "alternate" |
973 |
} |
974 |
] |
975 |
}, |
976 |
"suspended": false, |
977 |
"created': '2011-04-21T10:18:52.085737+00:00', |
978 |
"flavor": { |
979 |
"id": 3", |
980 |
"links": [ |
981 |
{ |
982 |
"href": "https://example.org/compute/v2.0/flavors/3", |
983 |
"rel": "self" |
984 |
}, { |
985 |
"href": "https://example.org/compute/v2.0/flavors/3", |
986 |
"rel": "bookmark" |
987 |
} |
988 |
] |
989 |
}, |
990 |
"id": "84", |
991 |
"security_groups": [{"name": "default"}], |
992 |
"user_id": "s0m5-u5e7-1d", |
993 |
"accessIPv4": "", |
994 |
"accessIPv6": "", |
995 |
"progress": 100, |
996 |
"config_drive": "", |
997 |
"status": "ACTIVE", |
998 |
"updated": "2011-05-30T14:07:07.037602+00:00", |
999 |
"hostId": "", |
1000 |
"SNF:fqdn": "snf-84.vm.example.org", |
1001 |
"key_name": null, |
1002 |
"name": "My Other Server", |
1003 |
"created": "2014-02-21T08:31:37.834542+00:00", |
1004 |
"tenant_id": "s0m5-u5e7-1d", |
1005 |
"SNF:port_forwarding": {}, |
1006 |
"SNF:task_state": "", |
1007 |
"diagnostics": [ |
1008 |
{ |
1009 |
"level": "DEBUG", |
1010 |
"created": "2014-02-21T08:31:37.834542+00:00", |
1011 |
"source": "image-info", |
1012 |
"source_date": "2014-02-21T08:32:35.929507+00:00", |
1013 |
"message": "Image customization finished successfully.", |
1014 |
"details": null |
1015 |
} |
1016 |
], |
1017 |
"metadata": { |
1018 |
"os": "debian", |
1019 |
"users": "root" |
1020 |
} |
1021 |
} |
1022 |
} |
1023 |
|
1024 |
Rename Server |
1025 |
------------- |
1026 |
|
1027 |
In Synnefo/Cyclades, only the ``name`` attribute of a virtual server can be |
1028 |
modified with this call. |
1029 |
|
1030 |
.. rubric:: Response |
1031 |
|
1032 |
======================== ====== ======== ========== |
1033 |
URI Method Cyclades OS/Compute |
1034 |
======================== ====== ======== ========== |
1035 |
``/servers/<server id>`` PUT ✔ ✔ |
1036 |
======================== ====== ======== ========== |
1037 |
|
1038 |
| |
1039 |
============== ========================= ======== ========== |
1040 |
Request Header Value Cyclades OS/Compute |
1041 |
============== ========================= ======== ========== |
1042 |
X-Auth-Token User authentication token required required |
1043 |
Content-Type Type or request body required required |
1044 |
Content-Length Length of request body required required |
1045 |
============== ========================= ======== ========== |
1046 |
|
1047 |
Request body contents:: |
1048 |
|
1049 |
server: { |
1050 |
<server attribute>: <value>, |
1051 |
... |
1052 |
} |
1053 |
|
1054 |
=========== ==================== ======== ========== |
1055 |
Attribute Description Cyclades OS/Compute |
1056 |
=========== ==================== ======== ========== |
1057 |
name The server name ✔ ✔ |
1058 |
accessIPv4 IP v4 address **✘** ✔ |
1059 |
accessIPv6 IP v6 address **✘** ✔ |
1060 |
=========== ==================== ======== ========== |
1061 |
|
1062 |
* **accessIPv4** and **accessIPv6** are ignored. Cyclades features a different |
1063 |
`mechanism for managing network connections <network-api-guide.html>`_ on |
1064 |
servers |
1065 |
|
1066 |
*Example Rename Server Request: JSON* |
1067 |
|
1068 |
.. code-block:: javascript |
1069 |
|
1070 |
{"server": {"name": "New name"}} |
1071 |
|
1072 |
.. rubric:: Response |
1073 |
|
1074 |
=========================== ===================== |
1075 |
Return Code Description |
1076 |
=========================== ===================== |
1077 |
204 (OK) Request succeeded |
1078 |
400 (Bad Request) Malformed request or malformed server id |
1079 |
401 (Unauthorized) Missing or expired user token |
1080 |
403 (Forbidden) User is not allowed to perform this operation |
1081 |
404 (Not Found) Server not found |
1082 |
415 (Bad Media Type) |
1083 |
409 (Build In Progress) Server is not ready yet |
1084 |
500 (Internal Server Error) The request cannot be completed because of an |
1085 |
\ internal error |
1086 |
503 (Service Unavailable) No available backends or service currently |
1087 |
\ unavailable |
1088 |
=========================== ===================== |
1089 |
|
1090 |
.. note:: In case of a 204 return code, there will be no request results |
1091 |
according to the Cyclades API. Compute OS API suggests that response should |
1092 |
include the new server details. |
1093 |
|
1094 |
Delete Server |
1095 |
------------- |
1096 |
|
1097 |
Delete a virtual server. When a server is deleted, all its attachments (ports) |
1098 |
are deleted as well. |
1099 |
|
1100 |
.. rubric:: Request |
1101 |
|
1102 |
======================== ====== ======== ========== |
1103 |
URI Method Cyclades OS/Compute |
1104 |
======================== ====== ======== ========== |
1105 |
``/servers/<server id>`` DELETE ✔ ✔ |
1106 |
======================== ====== ======== ========== |
1107 |
|
1108 |
* **server-id** is the identifier of the virtual server. |
1109 |
|
1110 |
| |
1111 |
============== ========================= ======== ========== |
1112 |
Request Header Value Cyclades OS/Compute |
1113 |
============== ========================= ======== ========== |
1114 |
X-Auth-Token User authentication token required required |
1115 |
============== ========================= ======== ========== |
1116 |
|
1117 |
.. rubric:: Response |
1118 |
|
1119 |
=========================== ===================== |
1120 |
Return Code Description |
1121 |
=========================== ===================== |
1122 |
204 (OK) Request succeeded |
1123 |
400 (Bad Request) Malformed server id or machine already deleted |
1124 |
401 (Unauthorized) Missing or expired user token |
1125 |
404 (Not Found) Server not found |
1126 |
409 (Build In Progress) Server is not ready yet |
1127 |
500 (Internal Server Error) The request cannot be completed because of an |
1128 |
\ internal error |
1129 |
503 (Service Unavailable) Action not supported or service currently |
1130 |
\ unavailable |
1131 |
=========================== ===================== |
1132 |
|
1133 |
List Server Connections |
1134 |
----------------------- |
1135 |
|
1136 |
List a server's network connections. In Cyclades, connections are ports between |
1137 |
a network and the server. |
1138 |
|
1139 |
.. rubric:: Request |
1140 |
|
1141 |
============================ ====== ======== ========== |
1142 |
URI Method Cyclades OS/Compute |
1143 |
============================ ====== ======== ========== |
1144 |
``/servers/<server id>/ips`` GET ✔ ✔ |
1145 |
============================ ====== ======== ========== |
1146 |
|
1147 |
| |
1148 |
============== ========================= ======== ========== |
1149 |
Request Header Value Cyclades OS/Compute |
1150 |
============== ========================= ======== ========== |
1151 |
X-Auth-Token User authentication token required required |
1152 |
============== ========================= ======== ========== |
1153 |
|
1154 |
.. rubric:: Response |
1155 |
|
1156 |
=========================== ===================== |
1157 |
Return Code Description |
1158 |
=========================== ===================== |
1159 |
200 (OK) Request succeeded |
1160 |
400 (Bad Request) Malformed server id or machine already deleted |
1161 |
401 (Unauthorized) Missing or expired user token |
1162 |
404 (Not Found) Server not found |
1163 |
409 (Build In Progress) Server is not ready yet |
1164 |
500 (Internal Server Error) The request cannot be completed because of an |
1165 |
\ internal error |
1166 |
503 (Service Unavailable) Service currently unavailable |
1167 |
=========================== ===================== |
1168 |
|
1169 |
Response body contents:: |
1170 |
|
1171 |
addresses: [ |
1172 |
<network id>: [ |
1173 |
{ |
1174 |
version: <4 or 6>, |
1175 |
addr: <IP address, if any> |
1176 |
OS-EXT-TYPE:type: <floating or fixed> |
1177 |
}, |
1178 |
... |
1179 |
], |
1180 |
... |
1181 |
], |
1182 |
attachments: [ |
1183 |
{ |
1184 |
<attachment attribute>: ..., |
1185 |
... |
1186 |
}, |
1187 |
... |
1188 |
] |
1189 |
|
1190 |
Attachment attributes are explained `here <#attachments-ref>`_ |
1191 |
|
1192 |
*Example List Addresses: JSON* |
1193 |
|
1194 |
.. code-block:: javascript |
1195 |
|
1196 |
GET https://example.org/compute/v2.0/servers/84/ips/ |
1197 |
|
1198 |
{ |
1199 |
"addresses": [ |
1200 |
"2718": [ |
1201 |
{ |
1202 |
"version": 6, |
1203 |
"addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd", |
1204 |
"OS-EXT-IPS:type": "fixed" |
1205 |
} |
1206 |
], |
1207 |
"4178": [ |
1208 |
{ |
1209 |
"version": 4, |
1210 |
"addr": "192.168.1.3", |
1211 |
"OS-EXT-IPS:type": "floating" |
1212 |
} |
1213 |
] |
1214 |
], |
1215 |
"attachments": [ |
1216 |
{ |
1217 |
"id": "36", |
1218 |
"network_id": "2718", |
1219 |
"mac_address": "aa:01:02:6c:34:cd", |
1220 |
"firewallProfile": "DISABLED", |
1221 |
"ipv4": "", |
1222 |
"ipv6": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd" |
1223 |
"OS-EXT-IPS:type": "fixed" |
1224 |
}, { |
1225 |
"id": "38", |
1226 |
"network_id": "4178", |
1227 |
"mac_address": "aa:00:0c:6d:34:cc", |
1228 |
"firewallProfile": "PROTECTED", |
1229 |
"ipv4": "192.168.1.3", |
1230 |
"ipv6": "" |
1231 |
"OS-EXT-IPS:type": "floating" |
1232 |
} |
1233 |
] |
1234 |
} |
1235 |
|
1236 |
Connection with network |
1237 |
----------------------- |
1238 |
|
1239 |
Get information on a network connected on a server |
1240 |
|
1241 |
.. rubric:: Request |
1242 |
|
1243 |
========================================= ====== ======== ========== |
1244 |
URI Method Cyclades OS/Compute |
1245 |
========================================= ====== ======== ========== |
1246 |
``/servers/<server id>/ips/<network id>`` GET ✔ ✔ |
1247 |
========================================= ====== ======== ========== |
1248 |
|
1249 |
| |
1250 |
============== ========================= ======== ========== |
1251 |
Request Header Value Cyclades OS/Compute |
1252 |
============== ========================= ======== ========== |
1253 |
X-Auth-Token User authentication token required required |
1254 |
============== ========================= ======== ========== |
1255 |
|
1256 |
.. rubric:: Response |
1257 |
|
1258 |
=========================== ===================== |
1259 |
Return Code Description |
1260 |
=========================== ===================== |
1261 |
200 (OK) Request succeeded |
1262 |
400 (Bad Request) Malformed server id or machine already deleted |
1263 |
401 (Unauthorized) Missing or expired user token |
1264 |
404 (Not Found) Server not found |
1265 |
409 (Build In Progress) Server is not ready yet |
1266 |
500 (Internal Server Error) The request cannot be completed because of an |
1267 |
\ internal error |
1268 |
503 (Service Unavailable) Service currently unavailable |
1269 |
=========================== ===================== |
1270 |
|
1271 |
| |
1272 |
|
1273 |
Response body contents:: |
1274 |
|
1275 |
network: { |
1276 |
<network id>: [ |
1277 |
{ |
1278 |
version: <4 or 6>, |
1279 |
addr: <IP address, if any> |
1280 |
OS-EXT-TYPE:type: <floating or fixed> |
1281 |
}, |
1282 |
} |
1283 |
|
1284 |
**Example** |
1285 |
|
1286 |
.. code-block:: javascript |
1287 |
|
1288 |
GET https://example.org/compute/v2.0/servers/84/ips/2718 |
1289 |
|
1290 |
|
1291 |
"network": { |
1292 |
"2718": [ |
1293 |
{ |
1294 |
"version": 6, |
1295 |
"addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd", |
1296 |
"OS-EXT-IPS:type": "fixed" |
1297 |
} |
1298 |
] |
1299 |
} |
1300 |
|
1301 |
List Server Metadata |
1302 |
-------------------- |
1303 |
|
1304 |
.. note:: This operation is semantically equivalent in Cyclades and OS/Compute |
1305 |
besides the different URI. |
1306 |
|
1307 |
.. rubric:: Request |
1308 |
|
1309 |
================================= ====== ======== ========== |
1310 |
URI Method Cyclades OS/Compute |
1311 |
================================= ====== ======== ========== |
1312 |
``/servers/<server-id>/metadata`` GET ✔ ✔ |
1313 |
================================= ====== ======== ========== |
1314 |
|
1315 |
| |
1316 |
============== ========================= ======== ========== |
1317 |
Request Header Value Cyclades OS/Compute |
1318 |
============== ========================= ======== ========== |
1319 |
X-Auth-Token User authentication token required required |
1320 |
============== ========================= ======== ========== |
1321 |
|
1322 |
.. rubric:: Response |
1323 |
|
1324 |
=========================== ===================== |
1325 |
Return Code Description |
1326 |
=========================== ===================== |
1327 |
200 (OK) Request succeeded |
1328 |
400 (Bad Request) Invalid server ID or Malformed request |
1329 |
401 (Unauthorized) Missing or expired user token |
1330 |
403 (Forbidden) Administratively suspended server |
1331 |
404 (Not Found) Server not found |
1332 |
500 (Internal Server Error) The request cannot be completed because of an |
1333 |
\ internal error |
1334 |
503 (Service Unavailable) The server is not currently available |
1335 |
=========================== ===================== |
1336 |
|
1337 |
Response body contents:: |
1338 |
|
1339 |
metadata: { |
1340 |
<key>: <value>, |
1341 |
... |
1342 |
} |
1343 |
|
1344 |
* Key is in uppercase by convention |
1345 |
|
1346 |
*Example List Server Metadata: JSON* |
1347 |
|
1348 |
.. code-block:: javascript |
1349 |
|
1350 |
{ |
1351 |
""metadata": { |
1352 |
"OS": "Linux", |
1353 |
"USERS": "root" |
1354 |
} |
1355 |
} |
1356 |
|
1357 |
Set / Update Server Metadata |
1358 |
---------------------------- |
1359 |
|
1360 |
In Cyclades API, setting new metadata and updating the values of existing ones |
1361 |
is achieved with the same type of request (``POST``), while in OS/Compute API |
1362 |
there are two separate request types (``PUT`` and ``POST`` for |
1363 |
`setting new <http://docs.openstack.org/api/openstack-compute/2/content/Create_or_Replace_Metadata-d1e5358.html>`_ |
1364 |
and |
1365 |
`updating existing <http://docs.openstack.org/api/openstack-compute/2/content/Update_Metadata-d1e5208.html>`_ |
1366 |
metadata, respectively). |
1367 |
|
1368 |
In Cyclades API, metadata keys which are not referred by the operation will |
1369 |
remain intact, while metadata referred by the operation will be overwritten. |
1370 |
|
1371 |
.. rubric:: Request |
1372 |
|
1373 |
================================= ====== ======== ========== |
1374 |
URI Method Cyclades OS/Compute |
1375 |
================================= ====== ======== ========== |
1376 |
``/servers/<server-id>/metadata`` PUT **✘** ✔ |
1377 |
``/servers/<server-id>/metadata`` POST ✔ ✔ |
1378 |
================================= ====== ======== ========== |
1379 |
|
1380 |
| |
1381 |
============== ========================= ======== ========== |
1382 |
Request Header Value Cyclades OS/Compute |
1383 |
============== ========================= ======== ========== |
1384 |
X-Auth-Token User authentication token required required |
1385 |
Content-Type Type or request body required required |
1386 |
Content-Length Length of request body required required |
1387 |
============== ========================= ======== ========== |
1388 |
|
1389 |
Request body contents:: |
1390 |
|
1391 |
metadata: { |
1392 |
<key>: <value>, |
1393 |
... |
1394 |
} |
1395 |
|
1396 |
*Example Request Set / Update Server Metadata: JSON* |
1397 |
|
1398 |
.. code-block:: javascript |
1399 |
|
1400 |
{"metadata": {"role": "webmail", "users": "root,maild"}} |
1401 |
|
1402 |
.. rubric:: Response |
1403 |
|
1404 |
=========================== ===================== |
1405 |
Return Code Description |
1406 |
=========================== ===================== |
1407 |
201 (OK) Request succeeded |
1408 |
400 (Bad Request) Invalid server ID or Malformed request |
1409 |
401 (Unauthorized) Missing or expired user token |
1410 |
403 (Forbidden) Administratively suspended server |
1411 |
404 (Not Found) Server not found |
1412 |
413 (OverLimit) Maximum number of metadata exceeded |
1413 |
500 (Internal Server Error) The request cannot be completed because of an |
1414 |
\ internal error |
1415 |
503 (Service Unavailable) The server is not currently available |
1416 |
=========================== ===================== |
1417 |
|
1418 |
Response body contents:: |
1419 |
|
1420 |
metadata: { |
1421 |
<key>: <value>, |
1422 |
... |
1423 |
} |
1424 |
|
1425 |
*Example Response Set / Update Server Metadata: JSON* |
1426 |
|
1427 |
.. code-block:: javascript |
1428 |
|
1429 |
{"metadata": {"OS": "Linux", "role": "webmail", "users": "root,maild"}} |
1430 |
|
1431 |
Get Server Metadata Item |
1432 |
------------------------ |
1433 |
|
1434 |
Get the value of a specific piece of metadata of a virtual server |
1435 |
|
1436 |
.. rubric:: Request |
1437 |
|
1438 |
======================================= ====== ======== ========== |
1439 |
URI Method Cyclades OS/Compute |
1440 |
======================================= ====== ======== ========== |
1441 |
``/servers/<server-id>/metadata/<key>`` GET ✔ ✔ |
1442 |
======================================= ====== ======== ========== |
1443 |
|
1444 |
| |
1445 |
============== ========================= ======== ========== |
1446 |
Request Header Value Cyclades OS/Compute |
1447 |
============== ========================= ======== ========== |
1448 |
X-Auth-Token User authentication token required required |
1449 |
============== ========================= ======== ========== |
1450 |
|
1451 |
.. rubric:: Response |
1452 |
|
1453 |
=========================== ===================== |
1454 |
Return Code Description |
1455 |
=========================== ===================== |
1456 |
200 (OK) Request succeeded |
1457 |
400 (Bad Request) Invalid server ID or Malformed request |
1458 |
401 (Unauthorized) Missing or expired user token |
1459 |
403 (Forbidden) Administratively suspended server |
1460 |
404 (Not Found) Meta key not found |
1461 |
500 (Internal Server Error) The request cannot be completed because of an |
1462 |
\ internal error |
1463 |
503 (Service Unavailable) The server is not currently available |
1464 |
=========================== ===================== |
1465 |
|
1466 |
Response body content:: |
1467 |
|
1468 |
metadata: {<key>: <value>} |
1469 |
|
1470 |
*Example Get Server Metadata for Item 'role', JSON* |
1471 |
|
1472 |
.. code-block:: javascript |
1473 |
|
1474 |
{"metadata": {"role": "webmail"}} |
1475 |
|
1476 |
Update Server Metadata Item |
1477 |
--------------------------- |
1478 |
|
1479 |
Set a new or update an existing a metadum value for a virtual server. |
1480 |
|
1481 |
.. rubric:: Request |
1482 |
|
1483 |
======================================= ====== ======== ========== |
1484 |
URI Method Cyclades OS/Compute |
1485 |
======================================= ====== ======== ========== |
1486 |
``/servers/<server-id>/metadata/<key>`` PUT ✔ ✔ |
1487 |
======================================= ====== ======== ========== |
1488 |
|
1489 |
| |
1490 |
|
1491 |
============== ========================= ======== ========== |
1492 |
Request Header Value Cyclades OS/Compute |
1493 |
============== ========================= ======== ========== |
1494 |
X-Auth-Token User authentication token required required |
1495 |
Content-Type Type or request body required required |
1496 |
Content-Length Length of request body required required |
1497 |
============== ========================= ======== ========== |
1498 |
|
1499 |
Request body content:: |
1500 |
|
1501 |
metadata: {<key>: <value>} |
1502 |
|
1503 |
*Example Request to Set or Update Server Metadata "role": JSON* |
1504 |
|
1505 |
.. code-block:: javascript |
1506 |
|
1507 |
{"metadata": {"role": "gateway"}} |
1508 |
|
1509 |
.. rubric:: Response |
1510 |
|
1511 |
=========================== ===================== |
1512 |
Return Code Description |
1513 |
=========================== ===================== |
1514 |
201 (OK) Request succeeded |
1515 |
400 (Bad Request) Invalid server ID or Malformed request |
1516 |
401 (Unauthorized) Missing or expired user token |
1517 |
403 (Forbidden) Administratively suspended server |
1518 |
404 (Not Found) Meta key not found |
1519 |
413 (OverLimit) Maximum number of metadata exceeded |
1520 |
500 (Internal Server Error) The request cannot be completed because of an |
1521 |
\ internal error |
1522 |
503 (Service Unavailable) The server is not currently available |
1523 |
=========================== ==================== |
1524 |
|
1525 |
Response body content:: |
1526 |
|
1527 |
metadata: {<key>: <value>} |
1528 |
|
1529 |
*Example Set or Update Server Metadata "role":"gateway": JSON* |
1530 |
|
1531 |
.. code-block:: javascript |
1532 |
|
1533 |
{"metadata": {"role": "gateway"}} |
1534 |
|
1535 |
Delete Server Metadata |
1536 |
---------------------- |
1537 |
|
1538 |
Delete a metadata of a virtual server |
1539 |
|
1540 |
.. rubric:: Request |
1541 |
|
1542 |
======================================= ====== ======== ========== |
1543 |
URI Method Cyclades OS/Compute |
1544 |
======================================= ====== ======== ========== |
1545 |
``/servers/<server-id>/metadata/<key>`` DELETE ✔ ✔ |
1546 |
======================================= ====== ======== ========== |
1547 |
|
1548 |
| |
1549 |
============== ========================= ======== ========== |
1550 |
Request Header Value Cyclades OS/Compute |
1551 |
============== ========================= ======== ========== |
1552 |
X-Auth-Token User authentication token required required |
1553 |
============== ========================= ======== ========== |
1554 |
|
1555 |
.. rubric:: Response |
1556 |
|
1557 |
=========================== ===================== |
1558 |
Return Code Description |
1559 |
=========================== ===================== |
1560 |
204 (OK) Request succeeded |
1561 |
400 (Bad Request) Invalid server ID |
1562 |
401 (Unauthorized) Missing or expired user token |
1563 |
403 (Forbidden) Administratively suspended server |
1564 |
404 (Not Found) Metadata key not found |
1565 |
500 (Internal Server Error) The request cannot be completed because of an |
1566 |
\ internal error |
1567 |
503 (Service Unavailable) The server is not currently available |
1568 |
=========================== ===================== |
1569 |
|
1570 |
Server Actions |
1571 |
-------------- |
1572 |
|
1573 |
Actions are operations that are achieved through the same type of request |
1574 |
(``POST``). There are differences in the implementations of some operations |
1575 |
between Synnefo/Cyclades and OS/Compute. Although this document focuses on |
1576 |
Synnefo/Cyclades, differences and similarities between the APIs are also |
1577 |
briefed. |
1578 |
|
1579 |
=============================================== ======== ========== |
1580 |
Operations Cyclades OS/Compute |
1581 |
=============================================== ======== ========== |
1582 |
`Start <#start-server>`_ ✔ **✘** |
1583 |
`Shutdown <#shutdown-server>`_ ✔ **✘** |
1584 |
`Reboot <#reboot-server>`_ ✔ ✔ |
1585 |
`Get Console <#get-server-console>`_ ✔ **✘** |
1586 |
`Set Firewall <#set-server-firewall-profile>`_ ✔ **✘** |
1587 |
`Change Admin Password <#os-compute-specific>`_ **✘** ✔ |
1588 |
`Rebuild <#os-compute-specific>`_ **✘** ✔ |
1589 |
`Resize <#resize-server>`_ ✔ ✔ |
1590 |
`Confirm Resized <#os-compute-specific>`_ **✘** ✔ |
1591 |
`Revert Resized <#os-compute-specific>`_ **✘** ✔ |
1592 |
`Create Image <#os-compute-specific>`_ **✘** ✔ |
1593 |
.. `Reassign to project <#server-reassign>`_ .. ✔ .. **✘** |
1594 |
=============================================== ======== ========== |
1595 |
|
1596 |
.. rubric:: Request |
1597 |
|
1598 |
=============================== ====== ======== ========== |
1599 |
URI Method Cyclades OS/Compute |
1600 |
=============================== ====== ======== ========== |
1601 |
``/servers/<server id>/action`` POST ✔ ✔ |
1602 |
=============================== ====== ======== ========== |
1603 |
|
1604 |
| |
1605 |
============== ========================= ======== ========== |
1606 |
Request Header Value Cyclades OS/Compute |
1607 |
============== ========================= ======== ========== |
1608 |
X-Auth-Token User authentication token required required |
1609 |
Content-Type Type or request body required required |
1610 |
Content-Length Length of request body required required |
1611 |
============== ========================= ======== ========== |
1612 |
|
1613 |
.. rubric:: Response |
1614 |
|
1615 |
=========================== ===================== |
1616 |
Return Code Description |
1617 |
=========================== ===================== |
1618 |
200 (OK) Request succeeded (for console operation) |
1619 |
202 (OK) Request succeeded |
1620 |
400 (Bad Request) Invalid request or unknown action |
1621 |
401 (Unauthorized) Missing or expired user token |
1622 |
403 (Forbidden) User is not allowed to perform this operation |
1623 |
500 (Internal Server Error) The request cannot be completed because of an |
1624 |
\ internal error |
1625 |
503 (Service Unavailable) The server is not currently available |
1626 |
=========================== ===================== |
1627 |
|
1628 |
.. note:: Response body varies between operations (see bellow) |
1629 |
|
1630 |
Start server |
1631 |
................ |
1632 |
|
1633 |
This operation transitions a server from a STOPPED to an ACTIVE state. |
1634 |
|
1635 |
Request body contents:: |
1636 |
|
1637 |
start: {} |
1638 |
|
1639 |
*Example Start Server: JSON* |
1640 |
|
1641 |
.. code-block:: javascript |
1642 |
|
1643 |
{"start": {}} |
1644 |
|
1645 |
Reboot Server |
1646 |
............. |
1647 |
|
1648 |
This operation transitions a server from ``ACTIVE`` to ``REBOOT`` and then |
1649 |
``ACTIVE`` again. |
1650 |
|
1651 |
Synnefo and OS/Compute APIs offer two reboot modes: ``soft`` |
1652 |
and ``hard``. OS/Compute distinguishes between the two intermediate states |
1653 |
(``REBOOT`` and ``HARD_REBOOT``) while rebooting, while Synnefo/Cyclades use |
1654 |
only the ``REBOOT`` term. The expected behavior is the same, though. |
1655 |
|
1656 |
Request body contents:: |
1657 |
|
1658 |
reboot: {type: <reboot type>} |
1659 |
|
1660 |
* **reboot type** can be either ``SOFT`` or ``HARD``. |
1661 |
|
1662 |
*Example (soft) Reboot Server: JSON* |
1663 |
|
1664 |
.. code-block:: javascript |
1665 |
|
1666 |
{"reboot" : { "type": "soft"}} |
1667 |
|
1668 |
Resize Server |
1669 |
............. |
1670 |
|
1671 |
This operation changes the flavor of the server, which is the equivalent of |
1672 |
upgrading the hardware of a physical machine. |
1673 |
|
1674 |
Request body contents:: |
1675 |
|
1676 |
resize: {flavorRef: <flavor ID>} |
1677 |
|
1678 |
*Example Resize Server: JSON* |
1679 |
|
1680 |
.. code-block:: javascript |
1681 |
|
1682 |
{"resize" : { "flavorRef": 153}} |
1683 |
|
1684 |
Shutdown server |
1685 |
............... |
1686 |
|
1687 |
This operation transitions a server from an ACTIVE to a STOPPED state. |
1688 |
|
1689 |
Request body contents:: |
1690 |
|
1691 |
shutdown: {} |
1692 |
|
1693 |
*Example Shutdown Server: JSON* |
1694 |
|
1695 |
.. code-block:: javascript |
1696 |
|
1697 |
{"shutdown": {}} |
1698 |
|
1699 |
.. note:: Response body should be empty |
1700 |
|
1701 |
Get Server Console |
1702 |
.................. |
1703 |
|
1704 |
.. note:: This operation is not part of OS/Compute API |
1705 |
|
1706 |
The console operation arranges for an OOB console of the specified type. Only |
1707 |
consoles of type ``vnc`` are supported for now. Cyclades server uses a running |
1708 |
instance of vncauthproxy to setup proper VNC forwarding with a random password, |
1709 |
then returns the necessary VNC connection info to the caller. |
1710 |
|
1711 |
Request body contents:: |
1712 |
|
1713 |
console: {type: vnc} |
1714 |
|
1715 |
*Example Get Server Console: JSON* |
1716 |
|
1717 |
.. code-block:: javascript |
1718 |
|
1719 |
{"console": {"type": "vnc" } |
1720 |
|
1721 |
Response body contents:: |
1722 |
|
1723 |
console: { |
1724 |
<vnc attribute>: <value>, |
1725 |
... |
1726 |
} |
1727 |
|
1728 |
============== ====================== |
1729 |
VNC Attributes Description |
1730 |
============== ====================== |
1731 |
host The vncprocy host |
1732 |
port vncprocy port |
1733 |
password Temporary password |
1734 |
type Connection type (only VNC) |
1735 |
============== ====================== |
1736 |
|
1737 |
*Example Action Console Response: JSON* |
1738 |
|
1739 |
.. code-block:: javascript |
1740 |
|
1741 |
{ |
1742 |
"console": { |
1743 |
"type": "vnc", |
1744 |
"host": "vm42.example.org", |
1745 |
"port": 1234, |
1746 |
"password": "513NR14PN0T" |
1747 |
} |
1748 |
} |
1749 |
|
1750 |
Set Server Firewall Profile |
1751 |
........................... |
1752 |
|
1753 |
The firewallProfile function sets a firewall profile for the public interface |
1754 |
of a server. |
1755 |
|
1756 |
Request body contents:: |
1757 |
|
1758 |
firewallProfile: {profile: <firewall profile>, nic: <nic id>} |
1759 |
|
1760 |
* **firewall profile** can be ``ENABLED``, ``DISABLED`` or ``PROTECTED`` |
1761 |
|
1762 |
*Example Action firewallProfile: JSON** |
1763 |
|
1764 |
.. code-block:: javascript |
1765 |
|
1766 |
{"firewallProfile": {"profile": "ENABLED", "nic": 123}} |
1767 |
|
1768 |
.. note:: Response body should be empty |
1769 |
|
1770 |
.. Server reassign |
1771 |
.. ............. |
1772 |
|
1773 |
.. Each resource is assigned to a project. A Synnefo project is a set of resource |
1774 |
.. limits e.g., maximum number of CPU cores per user, maximum ammount of RAM, etc. |
1775 |
|
1776 |
.. Although its resource is assigned exactly one project, a user may be a member |
1777 |
.. of more, so that different resources are registered to different projects. |
1778 |
|
1779 |
.. Project reassignment is the process of assigning a project to a different |
1780 |
.. project |
1781 |
|
1782 |
.. Request body contents:: |
1783 |
.. reassign: { project: <project ID>} |
1784 |
|
1785 |
.. .. code-block:: javascript |
1786 |
.. "reassign": { "project": "s0m3-pr0j3ct-1d"} |
1787 |
|
1788 |
OS/Compute Specific |
1789 |
................... |
1790 |
|
1791 |
The following operations are meaningless or not supported in the context of |
1792 |
Synnefo/Cyclades, but are parts of the OS/Compute API: |
1793 |
|
1794 |
* `Change Administrator Password <http://docs.openstack.org/api/openstack-compute/2/content/Change_Password-d1e3234.html>`_ |
1795 |
* `Rebuild Server <http://docs.openstack.org/api/openstack-compute/2/content/Rebuild_Server-d1e3538.html>`_ |
1796 |
* `Confirm Resized Server <http://docs.openstack.org/api/openstack-compute/2/content/Confirm_Resized_Server-d1e3868.html>`_ |
1797 |
* `Revert Resized Server <http://docs.openstack.org/api/openstack-compute/2/content/Revert_Resized_Server-d1e4024.html>`_ |
1798 |
* `Create Image <http://docs.openstack.org/api/openstack-compute/2/content/Create_Image-d1e4655.html>`_ |
1799 |
|
1800 |
List Flavors |
1801 |
------------ |
1802 |
|
1803 |
List the flavors that are accessible by the user |
1804 |
|
1805 |
.. rubric:: Request |
1806 |
|
1807 |
=================== ====== ======== ========== |
1808 |
URI Method Cyclades OS/Compute |
1809 |
=================== ====== ======== ========== |
1810 |
``/flavors`` GET ✔ ✔ |
1811 |
``/flavors/detail`` GET ✔ ✔ |
1812 |
=================== ====== ======== ========== |
1813 |
|
1814 |
| |
1815 |
============== ========================= ======== ========== |
1816 |
Request Header Value Cyclades OS/Compute |
1817 |
============== ========================= ======== ========== |
1818 |
X-Auth-Token User authentication token required required |
1819 |
============== ========================= ======== ========== |
1820 |
|
1821 |
| |
1822 |
================= =============== |
1823 |
Request Parameter Value |
1824 |
================= =============== |
1825 |
json Respond in json |
1826 |
xml Respond in xml |
1827 |
================= =============== |
1828 |
|
1829 |
.. note:: Request body should be empty |
1830 |
|
1831 |
.. rubric:: Response |
1832 |
|
1833 |
=========================== ===================== |
1834 |
Return Code Description |
1835 |
=========================== ===================== |
1836 |
200 (OK) Request succeeded |
1837 |
400 (Bad Request) Malformed request |
1838 |
401 (Unauthorized) Missing or expired user token |
1839 |
403 (Forbidden) Forbidden to use this flavor |
1840 |
500 (Internal Server Error) The request cannot be completed because of an |
1841 |
\ internal error |
1842 |
503 (Service Unavailable) The server is not currently available |
1843 |
=========================== ===================== |
1844 |
|
1845 |
Response code contents:: |
1846 |
|
1847 |
flavors: [ |
1848 |
{ |
1849 |
<flavor attribute>: <value>, |
1850 |
... |
1851 |
}, |
1852 |
... |
1853 |
] |
1854 |
|
1855 |
Flavor attributes are `listed here <#flavor-ref>`_. Regular listing contains |
1856 |
only ``id`` and ``name`` attributes. |
1857 |
|
1858 |
*Example List Flavors (regular): JSON* |
1859 |
|
1860 |
.. code-block:: javascript |
1861 |
|
1862 |
GET https://example.org/compute/v2.0/flavors |
1863 |
|
1864 |
{ |
1865 |
"flavors": [ |
1866 |
{ |
1867 |
"id": 1, |
1868 |
"name": "One code", |
1869 |
"links": [ |
1870 |
{ |
1871 |
"href": "https://example.org/compute/v2.0/flavors/1", |
1872 |
"rel": "self" |
1873 |
}, |
1874 |
{ |
1875 |
"href": "https://example.org/compute/v2.0/flavors/1", |
1876 |
"rel": "bookmark" |
1877 |
} |
1878 |
] |
1879 |
}, { |
1880 |
"id": 3, |
1881 |
"name": "Four core", |
1882 |
"links": [ |
1883 |
{ |
1884 |
"href": "https://example.org/compute/v2.0/flavors/3", |
1885 |
"rel": "self" |
1886 |
}, |
1887 |
{ |
1888 |
"href": "https://example.org/compute/v2.0/flavors/3", |
1889 |
"rel": "bookmark" |
1890 |
} |
1891 |
] |
1892 |
} |
1893 |
] |
1894 |
} |
1895 |
|
1896 |
|
1897 |
*Example List Flavors (regular): XML* |
1898 |
|
1899 |
.. code-block:: xml |
1900 |
|
1901 |
<?xml version="1.0" encoding="UTF-8"?> |
1902 |
<flavors xmlns="http://docs.openstack.org/compute/api/v1" |
1903 |
xmlns:atom="http://www.w3.org/2005/Atom"> |
1904 |
<flavor id="1" name="One core"/> |
1905 |
<flavor id="3" name="Four core"/> |
1906 |
</flavors> |
1907 |
|
1908 |
*Example List Flavors (detail): JSON* |
1909 |
|
1910 |
.. code-block:: javascript |
1911 |
|
1912 |
GET https://example.org/compute/v2.0/flavors/detail |
1913 |
|
1914 |
{ |
1915 |
"flavors": [ |
1916 |
{ |
1917 |
"id": 1, |
1918 |
"name": "One core", |
1919 |
"ram": 1024, |
1920 |
"SNF:disk_template": "drbd", |
1921 |
"disk": 20, |
1922 |
"vcpus": 1, |
1923 |
"links": [ |
1924 |
{ |
1925 |
"href": "https://example.org/compute/v2.0/flavors/1", |
1926 |
"rel": "self" |
1927 |
}, |
1928 |
{ |
1929 |
"href": "https://example.org/compute/v2.0/flavors/1", |
1930 |
"rel": "bookmark" |
1931 |
} |
1932 |
] |
1933 |
}, { |
1934 |
"id": 3, |
1935 |
"name": "Four core", |
1936 |
"ram": 1024, |
1937 |
"SNF:disk_template": "drbd", |
1938 |
"disk": 40, |
1939 |
"vcpus": 4, |
1940 |
"links": [ |
1941 |
{ |
1942 |
"href": "https://example.org/compute/v2.0/flavors/3", |
1943 |
"rel": "self" |
1944 |
}, |
1945 |
{ |
1946 |
"href": "https://example.org/compute/v2.0/flavors/3", |
1947 |
"rel": "bookmark" |
1948 |
} |
1949 |
] |
1950 |
} |
1951 |
] |
1952 |
} |
1953 |
|
1954 |
Get Flavor Details |
1955 |
------------------ |
1956 |
|
1957 |
.. rubric:: Request |
1958 |
|
1959 |
======================= ====== ======== ========== |
1960 |
URI Method Cyclades OS/Compute |
1961 |
======================= ====== ======== ========== |
1962 |
``/flavors/<flavor-id`` GET ✔ ✔ |
1963 |
======================= ====== ======== ========== |
1964 |
|
1965 |
| |
1966 |
============== ========================= ======== ========== |
1967 |
Request Header Value Cyclades OS/Compute |
1968 |
============== ========================= ======== ========== |
1969 |
X-Auth-Token User authentication token required required |
1970 |
============== ========================= ======== ========== |
1971 |
|
1972 |
| |
1973 |
================= =============== |
1974 |
Request Parameter Value |
1975 |
================= =============== |
1976 |
json Respond in json |
1977 |
xml Respond in xml |
1978 |
================= =============== |
1979 |
|
1980 |
.. rubric:: Response |
1981 |
|
1982 |
=========================== ===================== |
1983 |
Return Code Description |
1984 |
=========================== ===================== |
1985 |
200 (OK) Request succeeded |
1986 |
400 (Bad Request) Malformed flavor ID |
1987 |
401 (Unauthorized) Missing or expired user token |
1988 |
403 (Forbidden) Forbidden to use this flavor |
1989 |
404 (Not Found) Flavor id not founmd |
1990 |
500 (Internal Server Error) The request cannot be completed because of an |
1991 |
\ internal error |
1992 |
503 (Service Unavailable) The server is not currently available |
1993 |
=========================== ===================== |
1994 |
|
1995 |
Response code contents:: |
1996 |
|
1997 |
flavor: { |
1998 |
<flavor attribute>: <value>, |
1999 |
... |
2000 |
} |
2001 |
|
2002 |
All flavor attributes are `listed here <#flavor-ref>`_. |
2003 |
|
2004 |
*Example Flavor Details: JSON* |
2005 |
|
2006 |
GET https://example.org/compute/v2.0/flavors/1 |
2007 |
|
2008 |
.. code-block:: javascript |
2009 |
|
2010 |
{ |
2011 |
"flavor": { |
2012 |
{ |
2013 |
"id": 1, |
2014 |
"name": "One core", |
2015 |
"ram": 1024, |
2016 |
"SNF:disk_template": "drbd", |
2017 |
"disk": 20, |
2018 |
"vcpus": 1, |
2019 |
"links": [ |
2020 |
{ |
2021 |
"href": "https://example.org/compute/v2.0/flavors/1", |
2022 |
"rel": "self" |
2023 |
}, |
2024 |
{ |
2025 |
"href": "https://example.org/compute/v2.0/flavors/1", |
2026 |
"rel": "bookmark" |
2027 |
} |
2028 |
] |
2029 |
} |
2030 |
} |
2031 |
} |
2032 |
|
2033 |
List Images |
2034 |
----------- |
2035 |
|
2036 |
List all images accessible by the user |
2037 |
|
2038 |
.. rubric:: Request |
2039 |
|
2040 |
=================== ====== ======== ========== |
2041 |
URI Method Cyclades OS/Compute |
2042 |
=================== ====== ======== ========== |
2043 |
``/images`` GET ✔ ✔ |
2044 |
``/images/detail`` GET ✔ ✔ |
2045 |
=================== ====== ======== ========== |
2046 |
|
2047 |
| |
2048 |
============== ========================= ======== ========== |
2049 |
Request Header Value Cyclades OS/Compute |
2050 |
============== ========================= ======== ========== |
2051 |
X-Auth-Token User authentication token required required |
2052 |
============== ========================= ======== ========== |
2053 |
|
2054 |
| |
2055 |
================= ======================== ======== ========== |
2056 |
Request Parameter Value Cyclades OS/Compute |
2057 |
================= ======================== ======== ========== |
2058 |
server Server filter **✘** ✔ |
2059 |
name Image name filter **✘** ✔ |
2060 |
status Server status filter **✘** ✔ |
2061 |
changes-since Change timestamp filter ✔ ✔ |
2062 |
marker Last list last ID filter **✘** ✔ |
2063 |
limit Page size filter **✘** ✔ |
2064 |
type Request filter type **✘** ✔ |
2065 |
================= ======================== ======== ========== |
2066 |
|
2067 |
* **changes-since** must be an ISO8601 date string. In Cyclades it refers to |
2068 |
the image ``updated_at`` attribute and it should be a date in the window |
2069 |
[- POLL_LIMIT ... now]. POLL_LIMIT default value is 3600 seconds except if it |
2070 |
is set otherwise at server side. |
2071 |
|
2072 |
.. rubric:: Response |
2073 |
|
2074 |
=========================== ===================== |
2075 |
Return Code Description |
2076 |
=========================== ===================== |
2077 |
200 (OK) Request succeeded |
2078 |
304 (No images since date) Can be returned if ``changes-since`` is given |
2079 |
400 (Bad Request) Invalid or malformed ``changes-since`` parameter |
2080 |
401 (Unauthorized) Missing or expired user token |
2081 |
403 (Forbidden) User is not allowed to perform this operation |
2082 |
500 (Internal Server Error) The request cannot be completed because of an |
2083 |
\ internal error |
2084 |
503 (Service Unavailable) The server is not currently available |
2085 |
=========================== ===================== |
2086 |
|
2087 |
Response body contents:: |
2088 |
|
2089 |
images: [ |
2090 |
{ |
2091 |
<image attribute>: <value>, |
2092 |
... |
2093 |
metadata: { |
2094 |
<image meta key>: <value>, |
2095 |
... |
2096 |
}, |
2097 |
... |
2098 |
}, |
2099 |
... |
2100 |
] |
2101 |
|
2102 |
The regular response returns just ``id`` and ``name``, while the detail returns |
2103 |
a collections of the `image attributes listed here <#image-ref>`_. |
2104 |
|
2105 |
*Example List Image (detail): JSON* |
2106 |
|
2107 |
.. code-block:: javascript |
2108 |
|
2109 |
GET https://example.org/compute/v2.0/images |
2110 |
|
2111 |
{ |
2112 |
"images: [ |
2113 |
{ |
2114 |
"status": "ACTIVE", |
2115 |
"updated": "2013-03-02T15:57:03+00:00", |
2116 |
"name": "Verbal description", |
2117 |
"created": "2013-03-02T12:21:00+00:00", |
2118 |
"id": "s0m3-1m4g3-1d", |
2119 |
"links": [ |
2120 |
{ |
2121 |
"href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", |
2122 |
"rel": "self" |
2123 |
}, |
2124 |
{ |
2125 |
"href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", |
2126 |
"rel": "bookmark" |
2127 |
} |
2128 |
], |
2129 |
"metadata": { |
2130 |
"PARTITION_TABLE": "msdos", |
2131 |
"OSFAMILY": "linux", |
2132 |
"USERS": "root", |
2133 |
"OS": "ubuntu", |
2134 |
} |
2135 |
}, { |
2136 |
"status": "ACTIVE", |
2137 |
"updated": "2013-03-02T15:57:03+00:00", |
2138 |
"name": "edx_saas", |
2139 |
"created": "2013-03-02T12:21:00+00:00", |
2140 |
"progress": 100, |
2141 |
"id": "07h3r-1m4g3-1d", |
2142 |
"links": [ |
2143 |
{ |
2144 |
"href": "https://example.org/compute/v2.0/images/07h3r-1m4g3-1d", |
2145 |
"rel": "self" |
2146 |
}, |
2147 |
{ |
2148 |
"href": "https://example.org/compute/v2.0/images/07h3r-1m4g3-1d", |
2149 |
"rel": "bookmark" |
2150 |
} |
2151 |
], |
2152 |
"metadata": { |
2153 |
"PARTITION_TABLE": "ext3", |
2154 |
"OSFAMILY": "Linux", |
2155 |
"USERS": "root", |
2156 |
"OS": "Debian" |
2157 |
} |
2158 |
} |
2159 |
] |
2160 |
} |
2161 |
|
2162 |
Get Image Details |
2163 |
----------------- |
2164 |
|
2165 |
Get the details of a specific image |
2166 |
|
2167 |
.. rubric:: Request |
2168 |
|
2169 |
====================== ====== ======== ========== |
2170 |
URI Method Cyclades OS/Compute |
2171 |
====================== ====== ======== ========== |
2172 |
``/images/<image-id>`` GET ✔ ✔ |
2173 |
====================== ====== ======== ========== |
2174 |
|
2175 |
| |
2176 |
============== ========================= ======== ========== |
2177 |
Request Header Value Cyclades OS/Compute |
2178 |
============== ========================= ======== ========== |
2179 |
X-Auth-Token User authentication token required required |
2180 |
============== ========================= ======== ========== |
2181 |
|
2182 |
.. rubric:: Response |
2183 |
|
2184 |
=========================== ===================== |
2185 |
Return Code Description |
2186 |
=========================== ===================== |
2187 |
200 (OK) Request succeeded |
2188 |
400 (Bad Request) Malformed image id |
2189 |
401 (Unauthorized) Missing or expired user token |
2190 |
403 (Forbidden) Not allowed to use this image |
2191 |
404 (Not Found) Image not found |
2192 |
500 (Internal Server Error) The request cannot be completed because of an |
2193 |
\ internal error |
2194 |
503 (Service Unavailable) No available backends or service currently |
2195 |
\ unavailable |
2196 |
=========================== ===================== |
2197 |
|
2198 |
Response body contents:: |
2199 |
|
2200 |
image: { |
2201 |
<image attribute>: <value>, |
2202 |
... |
2203 |
metadata: { |
2204 |
<image meta key>: <value> |
2205 |
} |
2206 |
} |
2207 |
|
2208 |
Image attributes are `listed here <#image-ref>`_. |
2209 |
|
2210 |
*Example Details for an image with id 6404619d-...-aef57eaff4af, in JSON* |
2211 |
|
2212 |
.. code-block:: javascript |
2213 |
|
2214 |
GET https://example.org/compute/v2.0/images/s0m3-1m4g3-1d |
2215 |
|
2216 |
{ |
2217 |
"image": |
2218 |
{ |
2219 |
"status": "ACTIVE", |
2220 |
"updated": "2013-03-02T15:57:03+00:00", |
2221 |
"name": "Verbal description", |
2222 |
"created": "2013-03-02T12:21:00+00:00", |
2223 |
"id": "s0m3-1m4g3-1d", |
2224 |
"links": [ |
2225 |
{ |
2226 |
"href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", |
2227 |
"rel": "self" |
2228 |
}, |
2229 |
{ |
2230 |
"href": "https://example.org/compute/v2.0/images/s0m3-1m4g3-1d", |
2231 |
"rel": "bookmark" |
2232 |
} |
2233 |
], |
2234 |
"metadata": { |
2235 |
"PARTITION_TABLE": "msdos", |
2236 |
"OSFAMILY": "linux", |
2237 |
"USERS": "root", |
2238 |
"OS": "ubuntu", |
2239 |
} |
2240 |
} |
2241 |
} |
2242 |
|
2243 |
Delete Image |
2244 |
------------ |
2245 |
|
2246 |
Delete an image, by changing its status from ``ACTIVE`` to ``DELETED``. |
2247 |
|
2248 |
.. rubric:: Request |
2249 |
|
2250 |
====================== ====== ======== ========== |
2251 |
URI Method Cyclades OS/Compute |
2252 |
====================== ====== ======== ========== |
2253 |
``/images/<image id>`` DELETE ✔ ✔ |
2254 |
====================== ====== ======== ========== |
2255 |
|
2256 |
| |
2257 |
============== ========================= ======== ========== |
2258 |
Request Header Value Cyclades OS/Compute |
2259 |
============== ========================= ======== ========== |
2260 |
X-Auth-Token User authentication token required required |
2261 |
============== ========================= ======== ========== |
2262 |
|
2263 |
.. rubric:: Response |
2264 |
|
2265 |
=========================== ===================== |
2266 |
Return Code Description |
2267 |
=========================== ===================== |
2268 |
204 (OK) Request succeeded |
2269 |
400 (Bad Request) Invalid request or image id |
2270 |
401 (Unauthorized) Missing or expired user token |
2271 |
404 (Not Found) Image not found |
2272 |
500 (Internal Server Error) The request cannot be completed because of an |
2273 |
\ internal error |
2274 |
503 (Service Unavailable) Action not supported or service currently |
2275 |
\ unavailable |
2276 |
=========================== ===================== |
2277 |
|
2278 |
.. note:: In case of a 204 code, request body should be empty |
2279 |
|
2280 |
List Image Metadata |
2281 |
------------------- |
2282 |
|
2283 |
.. rubric:: Request |
2284 |
|
2285 |
=============================== ====== ======== ========== |
2286 |
URI Method Cyclades OS/Compute |
2287 |
=============================== ====== ======== ========== |
2288 |
``/images/<image-id>/metadata`` GET ✔ ✔ |
2289 |
=============================== ====== ======== ========== |
2290 |
|
2291 |
| |
2292 |
============== ========================= ======== ========== |
2293 |
Request Header Value Cyclades OS/Compute |
2294 |
============== ========================= ======== ========== |
2295 |
X-Auth-Token User authentication token required required |
2296 |
============== ========================= ======== ========== |
2297 |
|
2298 |
.. rubric:: Response |
2299 |
|
2300 |
=========================== ===================== |
2301 |
Return Code Description |
2302 |
=========================== ===================== |
2303 |
201 (OK) Request succeeded |
2304 |
400 (Bad Request) Invalid image ID or Malformed request |
2305 |
401 (Unauthorized) Missing or expired user token |
2306 |
403 (Forbidden) Administratively suspended server |
2307 |
404 (Not Found) Server not found |
2308 |
409 (Build In Progress) The image is not ready yet |
2309 |
500 (Internal Server Error) The request cannot be completed because of an |
2310 |
\ internal error |
2311 |
503 (Service Unavailable) The server is not currently available |
2312 |
=========================== ===================== |
2313 |
|
2314 |
Response body content:: |
2315 |
|
2316 |
metadata: { |
2317 |
<meta key>: <value>, |
2318 |
... |
2319 |
} |
2320 |
|
2321 |
*Example List Image Metadata: JSON* |
2322 |
|
2323 |
.. code-block:: javascript |
2324 |
|
2325 |
GET https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata |
2326 |
|
2327 |
{ |
2328 |
"metadata": { |
2329 |
"PARTITION_TABLE": "msdos", |
2330 |
"OSFAMILY": "linux", |
2331 |
"USERS": "root", |
2332 |
"OS": "ubuntu", |
2333 |
} |
2334 |
} |
2335 |
|
2336 |
.. note:: In OS/Compute API the ``values`` level is missing from the response. |
2337 |
|
2338 |
Update Image Metadata |
2339 |
--------------------- |
2340 |
|
2341 |
In Cyclades API, setting new metadata and updating the values of existing ones |
2342 |
is achieved using one type of request (POST), while in OS/Compute API two |
2343 |
different types are used (PUT and POST for |
2344 |
`setting new <http://docs.openstack.org/api/openstack-compute/2/content/Create_or_Replace_Metadata-d1e5358.html>`_ |
2345 |
and |
2346 |
`updating existing <http://docs.openstack.org/api/openstack-compute/2/content/Update_Metadata-d1e5208.html>`_ |
2347 |
metadata, respectively). |
2348 |
|
2349 |
In Cyclades API, unmentioned metadata keys will remain intact, while metadata |
2350 |
referred by the operation will be overwritten. |
2351 |
|
2352 |
.. rubric:: Request |
2353 |
|
2354 |
=============================== ====== ======== ========== |
2355 |
URI Method Cyclades OS/Compute |
2356 |
=============================== ====== ======== ========== |
2357 |
``/images/<image-id>/metadata`` PUT **✘** ✔ |
2358 |
``/images/<image-id>/metadata`` POST ✔ ✔ |
2359 |
=============================== ====== ======== ========== |
2360 |
|
2361 |
| |
2362 |
============== ========================= ======== ========== |
2363 |
Request Header Value Cyclades OS/Compute |
2364 |
============== ========================= ======== ========== |
2365 |
X-Auth-Token User authentication token required required |
2366 |
Content-Type Type or request body required required |
2367 |
Content-Length Length of request body required required |
2368 |
============== ========================= ======== ========== |
2369 |
|
2370 |
.. note:: Request parameters should be empty |
2371 |
|
2372 |
Request body content:: |
2373 |
|
2374 |
metadata: { |
2375 |
<meta key>: <value>, |
2376 |
... |
2377 |
} |
2378 |
|
2379 |
*Example Update Image Metadata Request: JSON* |
2380 |
|
2381 |
.. code-block:: javascript |
2382 |
|
2383 |
POST https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata |
2384 |
|
2385 |
{"metadata": {"NewAttr": "NewVal", "OS": "Xubuntu'}} |
2386 |
|
2387 |
.. rubric:: Response |
2388 |
|
2389 |
=========================== ===================== |
2390 |
Return Code Description |
2391 |
=========================== ===================== |
2392 |
201 (OK) Request succeeded |
2393 |
400 (Bad Request) Malformed request or image id |
2394 |
401 (Unauthorized) Missing or expired user token |
2395 |
403 (Forbidden) Not allowed to modify this image |
2396 |
404 (Not Found) Image or meta key not found |
2397 |
413 (OverLimit) Maximum number of metadata exceeded |
2398 |
500 (Internal Server Error) The request cannot be completed because of an |
2399 |
\ internal error |
2400 |
503 (Service Unavailable) The server is not currently available |
2401 |
=========================== ===================== |
2402 |
|
2403 |
Response body content:: |
2404 |
|
2405 |
metadata: { |
2406 |
<key>: <value>, |
2407 |
... |
2408 |
} |
2409 |
|
2410 |
*Example Update Image Response: JSON* |
2411 |
|
2412 |
.. code-block:: javascript |
2413 |
|
2414 |
{ |
2415 |
"metadata": { |
2416 |
"PARTITION_TABLE": "msdos", |
2417 |
"OSFAMILY": "linux", |
2418 |
"USERS": "root", |
2419 |
"OS": "Xubuntu", |
2420 |
"NEWATTR": "NewVal" |
2421 |
} |
2422 |
} |
2423 |
|
2424 |
Get Image Metadata |
2425 |
------------------ |
2426 |
|
2427 |
.. rubric:: Request |
2428 |
|
2429 |
===================================== ====== ======== ========== |
2430 |
URI Method Cyclades OS/Compute |
2431 |
===================================== ====== ======== ========== |
2432 |
``/images/<image-id>/metadata/<key>`` GET ✔ ✔ |
2433 |
===================================== ====== ======== ========== |
2434 |
|
2435 |
| |
2436 |
============== ========================= ======== ========== |
2437 |
Request Header Value Cyclades OS/Compute |
2438 |
============== ========================= ======== ========== |
2439 |
X-Auth-Token User authentication token required required |
2440 |
============== ========================= ======== ========== |
2441 |
|
2442 |
.. rubric:: Response |
2443 |
|
2444 |
=========================== ===================== |
2445 |
Return Code Description |
2446 |
=========================== ===================== |
2447 |
200 (OK) Request succeeded |
2448 |
400 (Bad Request) Malformed request or image id |
2449 |
401 (Unauthorized) Missing or expired user token |
2450 |
403 (Forbidden) Not allowed to access this information |
2451 |
404 (Not Found) Meta key not found |
2452 |
500 (Internal Server Error) The request cannot be completed because of an |
2453 |
\ internal error |
2454 |
503 (Service Unavailable) The server is not currently available |
2455 |
=========================== ===================== |
2456 |
|
2457 |
Response body content:: |
2458 |
|
2459 |
metadata: {<key>: <value>} |
2460 |
|
2461 |
*Example Get Image Metadata Item: JSON* |
2462 |
|
2463 |
.. code-block:: javascript |
2464 |
|
2465 |
GET https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata/OS |
2466 |
|
2467 |
{"metadata": {"OS": "Xubuntu"}} |
2468 |
|
2469 |
.. note:: In OS/Compute, ``metadata`` is ``meta`` |
2470 |
|
2471 |
Update Image Metadata |
2472 |
--------------------- |
2473 |
|
2474 |
.. rubric:: Request |
2475 |
|
2476 |
===================================== ====== ======== ========== |
2477 |
URI Method Cyclades OS/Compute |
2478 |
===================================== ====== ======== ========== |
2479 |
``/images/<image-id>/metadata/<key>`` PUT ✔ ✔ |
2480 |
===================================== ====== ======== ========== |
2481 |
|
2482 |
| |
2483 |
============== ========================= ======== ========== |
2484 |
Request Header Value Cyclades OS/Compute |
2485 |
============== ========================= ======== ========== |
2486 |
X-Auth-Token User authentication token required required |
2487 |
Content-Type Type or request body required required |
2488 |
Content-Length Length of request body required required |
2489 |
============== ========================= ======== ========== |
2490 |
|
2491 |
.. note:: Request parameters should be empty |
2492 |
|
2493 |
Request body content:: |
2494 |
|
2495 |
metadata: {<key>: <value>} |
2496 |
|
2497 |
*Example Update Image Metadata Item Request: JSON* |
2498 |
|
2499 |
.. code-block:: javascript |
2500 |
|
2501 |
PUT https://example.org/compute/v2.0/images/s0m3-1m4g3-1d/metadata/OS |
2502 |
{ |
2503 |
"metadata": {"OS": "Kubuntu"} |
2504 |
} |
2505 |
|
2506 |
.. rubric:: Response |
2507 |
|
2508 |
=========================== ===================== |
2509 |
Return Code Description |
2510 |
=========================== ===================== |
2511 |
201 (OK) Request succeeded |
2512 |
400 (Bad Request) Malformed request or image id |
2513 |
401 (Unauthorized) Missing or expired user token |
2514 |
403 (Forbidden) Not allowed to modify this image |
2515 |
404 (Not Found) Metadata key not found |
2516 |
413 (OverLimit) Maximum number of metadata exceeded |
2517 |
500 (Internal Server Error) The request cannot be completed because of an |
2518 |
\ internal error |
2519 |
503 (Service Unavailable) The server is not currently available |
2520 |
=========================== ===================== |
2521 |
|
2522 |
Request body content:: |
2523 |
|
2524 |
metadata: {<key>: <value>} |
2525 |
|
2526 |
*Example Update Image Metadata Item Response: JSON* |
2527 |
|
2528 |
.. code-block:: javascript |
2529 |
|
2530 |
{"metadata": {"OS": "Kubuntu"}} |
2531 |
|
2532 |
Delete Image Metadata |
2533 |
--------------------- |
2534 |
|
2535 |
Delete an image metadata by its key. |
2536 |
|
2537 |
.. rubric:: Request |
2538 |
|
2539 |
===================================== ====== ======== ========== |
2540 |
URI Method Cyclades OS/Compute |
2541 |
===================================== ====== ======== ========== |
2542 |
``/images/<image-id>/metadata/<key>`` DELETE ✔ ✔ |
2543 |
===================================== ====== ======== ========== |
2544 |
|
2545 |
| |
2546 |
============== ========================= ======== ========== |
2547 |
Request Header Value Cyclades OS/Compute |
2548 |
============== ========================= ======== ========== |
2549 |
X-Auth-Token User authentication token required required |
2550 |
============== ========================= ======== ========== |
2551 |
|
2552 |
.. rubric:: Response |
2553 |
|
2554 |
=========================== ===================== |
2555 |
Return Code Description |
2556 |
=========================== ===================== |
2557 |
204 (OK) Request succeeded |
2558 |
400 (Bad Request) Malformed image ID |
2559 |
401 (Unauthorized) Missing or expired user token |
2560 |
403 (Forbidden) Not allowed to modify this image |
2561 |
404 (Not Found) Metadata key not found |
2562 |
500 (Internal Server Error) The request cannot be completed because of an |
2563 |
\ internal error |
2564 |
503 (Service Unavailable) The server is not currently available |
2565 |
=========================== ===================== |
2566 |
|
2567 |
Index of Attributes |
2568 |
------------------- |
2569 |
|
2570 |
.. _server-ref: |
2571 |
|
2572 |
Server Attributes |
2573 |
................. |
2574 |
|
2575 |
=================== ======== ========== |
2576 |
Server attribute Cyclades OS/Compute |
2577 |
=================== ======== ========== |
2578 |
id ✔ ✔ |
2579 |
name ✔ ✔ |
2580 |
addresses ✔ ✔ |
2581 |
links ✔ ✔ |
2582 |
image ✔ ✔ |
2583 |
flavor ✔ ✔ |
2584 |
user_id ✔ ✔ |
2585 |
tenant_id ✔ ✔ |
2586 |
accessIPv4 ✔ ✔ |
2587 |
accessIPv6 ✔ ✔ |
2588 |
progress ✔ ✔ |
2589 |
status ✔ ✔ |
2590 |
updated ✔ ✔ |
2591 |
hostId ✔ ✔ |
2592 |
created ✔ ✔ |
2593 |
adminPass ✔ ✔ |
2594 |
metadata ✔ ✔ |
2595 |
suspended ✔ **✘** |
2596 |
security_groups ✔ **✘** |
2597 |
attachments ✔ **✘** |
2598 |
config_drive ✔ **✘** |
2599 |
SNF:fqdn ✔ **✘** |
2600 |
key_name ✔ **✘** |
2601 |
SNF:port_forwarding ✔ **✘** |
2602 |
SNF:task_state ✔ **✘** |
2603 |
diagnostics ✔ **✘** |
2604 |
deleted ✔ **✘** |
2605 |
=================== ======== ========== |
2606 |
|
2607 |
* **addresses** Networks related to this server. All information in this field |
2608 |
is redundant, since it can be infered from the ``attachments`` field, but |
2609 |
it is used for compatibility with OS/Computet |
2610 |
|
2611 |
* **user_id** The UUID of the owner of the virtual server |
2612 |
|
2613 |
* **tenant_id** The UUID of the project that defines this resource |
2614 |
|
2615 |
* *hostId*, **accessIPv4** and **accessIPv6** are always empty and are used for |
2616 |
compatibility with OS/Compute |
2617 |
|
2618 |
* **progress** Shows the building progress of a virtual server. After the server |
2619 |
is built, it is always ``100`` |
2620 |
|
2621 |
* **status** values are described `here <#status-ref>`_ |
2622 |
|
2623 |
* **updated** and **created** are date-formated |
2624 |
|
2625 |
* **adminPass** is shown only once (in ``create server`` response). This |
2626 |
information is not preserved in a clear text form, so it is not recoverable |
2627 |
|
2628 |
* **suspended** is True only if the server is suspended by the cloud |
2629 |
administrations or policy |
2630 |
|
2631 |
* **progress** is a number between 0 and 100 and reflects the server building |
2632 |
status |
2633 |
|
2634 |
* **metadata** are custom key:value pairs. In Cyclades, the ``OS`` and |
2635 |
``USERS`` metadata are automatically retrieved from the servers image during |
2636 |
creation |
2637 |
|
2638 |
* **attachments** List of connection ports. Details `here <#attachments-ref>`_. |
2639 |
|
2640 |
.. _status-ref: |
2641 |
|
2642 |
Server Status |
2643 |
............. |
2644 |
|
2645 |
============= ==================== ======== ========== |
2646 |
Status Description Cyclades OS/Compute |
2647 |
============= ==================== ======== ========== |
2648 |
BUILD Building ✔ ✔ |
2649 |
ACTIVE Up and running ✔ ✔ |
2650 |
STOPPED Shut down ✔ **✘** |
2651 |
REBOOT Rebooting ✔ ✔ |
2652 |
DELETED Removed ✔ ✔ |
2653 |
UNKNOWN Unexpected error ✔ ✔ |
2654 |
ERROR In error ✔ ✔ |
2655 |
HARD_REBOOT Hard rebooting **✘** ✔ |
2656 |
PASSWORD Resetting password **✘** ✔ |
2657 |
REBUILD Rebuilding server **✘** ✔ |
2658 |
RESCUE In rescue mode **✘** ✔ |
2659 |
RESIZE Resizing **✘** ✔ |
2660 |
REVERT_RESIZE Failed to resize **✘** ✔ |
2661 |
SHUTOFF Shut down by user **✘** ✔ |
2662 |
SUSPENDED Suspended **✘** ✔ |
2663 |
VERIFY_RESIZE Waiting confirmation **✘** ✔ |
2664 |
============= ==================== ======== ========== |
2665 |
|
2666 |
.. _attachments-ref: |
2667 |
|
2668 |
Attachments (ports) |
2669 |
................... |
2670 |
|
2671 |
In Cyclades, a port connects a virtual server to a public or private network. |
2672 |
|
2673 |
Ports can be handled separately through the Cyclades/Network API. |
2674 |
|
2675 |
In a virtual server context, a port may contain the following information: |
2676 |
|
2677 |
================= ====================== |
2678 |
Port Attributes Description |
2679 |
================= ====================== |
2680 |
id Port id |
2681 |
mac_address NIC's mac address |
2682 |
network_id Network ID |
2683 |
OS-EXT-IPS:type ``fixed`` or ``floating`` |
2684 |
firewallProfile ``ENABLED``, ``DISABLED``, ``PROTECTED`` |
2685 |
ipv4 IP v4 address |
2686 |
ipv6 IP v6 address |
2687 |
================= ====================== |
2688 |
|
2689 |
* **ipv4** and **ipv6** are mutually exclusive in practice, since a port |
2690 |
either handles an IPv4, an IPv6, or none, but not both. |
2691 |
|
2692 |
.. _flavor-ref: |
2693 |
|
2694 |
Flavor |
2695 |
...... |
2696 |
|
2697 |
A flavor is a hardware configuration for a server. It contains the following |
2698 |
information: |
2699 |
|
2700 |
================= ==================== ======== ========== |
2701 |
Flavor Attributes Description Cyclades OS/Compute |
2702 |
================= ==================== ======== ========== |
2703 |
id The flavor id ✔ ✔ |
2704 |
name The flavor name ✔ ✔ |
2705 |
ram Server RAM size ✔ ✔ |
2706 |
SNF:disk_template Storage mechanism ✔ **✘** |
2707 |
disk Server disk size ✔ ✔ |
2708 |
vcpus # of Virtual CPUs ✔ ✔ |
2709 |
links rel Atom link rel field ✔ ✔ |
2710 |
links href Atom link href field ✔ ✔ |
2711 |
================= ==================== ======== ========== |
2712 |
|
2713 |
* **id** is the flavor unique id (a possitive integer) |
2714 |
* **name** is the flavor name (a string) |
2715 |
* **ram** is the server RAM size in MB |
2716 |
* **SNF:disk_template** is a reference to the underlying storage mechanism |
2717 |
used by the Cyclades server (e.g., drdb, ext_elmc). |
2718 |
* **disk** the servers disk size in GB |
2719 |
* **vcpus** refer to the number of virtual CPUs assigned to a server |
2720 |
* **link ref** and **link href** refer to the Atom link attributes that are |
2721 |
`used in OS/Compute API <http://docs.openstack.org/api/openstack-compute/2/content/List_Flavors-d1e4188.html>`_. |
2722 |
|
2723 |
.. _image-ref: |
2724 |
|
2725 |
Image |
2726 |
..... |
2727 |
|
2728 |
An image is a collection of files you use to create or rebuild a server. |
2729 |
|
2730 |
An image item may have the fields presented bellow: |
2731 |
|
2732 |
================ ====================== ======== ========== |
2733 |
Image Attributes Description Cyclades OS/Compute |
2734 |
================ ====================== ======== ========== |
2735 |
id Image ID ✔ ✔ |
2736 |
name Image name ✔ ✔ |
2737 |
updated Last update date ✔ ✔ |
2738 |
created Image creation date ✔ ✔ |
2739 |
progress Ready status progress ✔ **✘** |
2740 |
status Image status **✘** ✔: |
2741 |
tenant_id Image creator **✘** ✔ |
2742 |
user_id Image users **✘** ✔ |
2743 |
metadata Custom metadata ✔ ✔ |
2744 |
links Atom links **✘** ✔ |
2745 |
minDisk Minimum required disk **✘** ✔ |
2746 |
minRam Minimum required RAM **✘** ✔ |
2747 |
================ ====================== ======== ========== |
2748 |
|
2749 |
* **id** is the image id and **name** is the image name. They are both strings. |
2750 |
|
2751 |
* **updated** and **created** are both ISO8601 date strings |
2752 |
|
2753 |
* **progress** varies between 0 and 100 and denotes the status of the image |
2754 |
|
2755 |
* **metadata** is a collection of ``key``:``values`` pairs of custom metadata, |
2756 |
under the tag ``values`` which lies under the tag ``metadata``. |
2757 |
|
2758 |
* **tenant_id** The UUID of the project that defines this resource |
2759 |
|
2760 |
.. note:: in OS/Compute, the ``values`` layer is missing |