Statistics
| Branch: | Tag: | Revision:

root / docs / compute-api-guide.rst @ a3d2b515

History | View | Annotate | Download (94.2 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 Addresses <#list-server-addresses>`_         ``/servers/<server id>/ips``              GET    ✔        ✔
92
`Get NICs by Net <#get-server-nics-by-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
    "servers": [
212
      {
213
        "links": [
214
          {
215
            "href": "https://example.org/compute/v2.0/servers/42", 
216
            "rel": "self"
217
          }, {
218
            "href": "https://example.org/compute/v2.0/servers/42", 
219
            "rel": "bookmark"
220
          }
221
        ],
222
        "id": "42",
223
        "name": "My Server",
224
      }, {
225
        "links": [
226
          {
227
            "href": "https://example.org/compute/v2.0/servers/43", 
228
            "rel": "self"
229
          }, {
230
            "href": "https://example.org/compute/v2.0/servers/43", 
231
            "rel": "bookmark"
232
          }
233
        ],
234
        "id": "84",
235
        "name": "My Server",
236
      }
237
    ]
238
  }
239

    
240
*Example List Servers: JSON (detail)*
241

    
242
.. code-block:: javascript
243

    
244
  {
245
    "servers": [
246
      {
247
        "addresses": [
248
          "2718": [
249
            {
250
              "version": 6,
251
              "addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21ab",
252
              "OS-EXT-IPS:type": "fixed"
253
            }
254
          ],
255
          "2719": [
256
            {
257
              "version": 4,
258
              "addr": "192.168.1.2",
259
              "OS-EXT-IPS:type": "floating"
260
            }
261
          ]
262
        ],
263
        "attachments": [
264
            {
265
              "id": "18",
266
              "network_id": "2718",
267
              "mac_address": "aa:01:02:6c:34:ab",
268
              "firewallProfile": "DISABLED",
269
              "ipv4": "",
270
              "ipv6": "2001:443:2dfc:1232:a810:3cf:fe9b:21ab"
271
              "OS-EXT-IPS:type": "fixed"
272
            }, {
273
              "id": "19",
274
              "network_id": "2719",
275
              "mac_address": "aa:00:0c:6d:34:bb",
276
              "firewallProfile": "PROTECTED",
277
              "ipv4": "192.168.1.2",
278
              "ipv6": ""
279
              "OS-EXT-IPS:type": "floating"
280
            }
281
        ],
282
        "links": [
283
          {
284
            "href": "https://example.org/compute/v2.0/servers/42", 
285
            "rel": "self"
286
          }, {
287
            "href": "https://example.org/compute/v2.0/servers/42", 
288
            "rel": "bookmark"
289
          }
290
        ],
291
        "image": {
292
          "id": "im4g3-1d",
293
          "links": [
294
            {
295
              "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
296
              "rel": "self"
297
            }, {
298
              "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
299
              "rel": "bookmark"
300
            }, {
301
              "href": "https://example.org/image/v1.0/images/im4g3-1d", 
302
              "rel": "alternate"
303
            }
304
          ]
305
        },
306
        "suspended": false,
307
        "created': '2011-04-19T10:18:52.085737+00:00',
308
        "flavor": {
309
          "id": 1",
310
          "links": [
311
            {
312
              "href": "https://example.org/compute/v2.0/flavors/1", 
313
              "rel": "self"
314
            }, {
315
              "href": "https://example.org/compute/v2.0/flavors/1", 
316
              "rel": "bookmark"
317
            }
318
          ]
319
        },
320
        "id": "42",
321
        "security_groups": [{"name": "default"}],
322
        "user_id": "s0m5-u5e7-1d",
323
        "accessIPv4": "",
324
        "accessIPv6": "",
325
        "progress": 100,
326
        "config_drive": "",
327
        "status": "ACTIVE",
328
        "updated": "2011-05-29T14:07:07.037602+00:00",
329
        "hostId": "",
330
        "SNF:fqdn": "snf-42.vm.example.org",
331
        "key_name": null,
332
        "name": "My Server",
333
        "created": "2014-02-12T08:31:37.834542+00:00",
334
        "tenant_id": "s0m5-u5e7-1d",
335
        "SNF:port_forwarding": {},
336
        "SNF:task_state": "",
337
        "diagnostics": [
338
            {
339
                "level": "DEBUG",
340
                "created": "2014-02-12T08:31:37.834542+00:00",
341
                "source": "image-info",
342
                "source_date": "2014-02-12T08:32:35.929507+00:00",
343
                "message": "Image customization finished successfully.",
344
                "details": null
345
            }
346
        ],
347
        "metadata": {
348
            "os": "debian",
349
            "users": "root"
350
        }
351
      }, {
352
      {
353
        "addresses": [
354
          "2718": [
355
            {
356
              "version": 6,
357
              "addr": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd",
358
              "OS-EXT-IPS:type": "fixed"
359
            }
360
          ],
361
          "4178": [
362
            {
363
              "version": 4,
364
              "addr": "192.168.1.3",
365
              "OS-EXT-IPS:type": "floating"
366
            }
367
          ]
368
        ],
369
        "attachments": [
370
            {
371
              "id": "36",
372
              "network_id": "2718",
373
              "mac_address": "aa:01:02:6c:34:cd",
374
              "firewallProfile": "DISABLED",
375
              "ipv4": "",
376
              "ipv6": "2001:443:2dfc:1232:a810:3cf:fe9b:21cd"
377
              "OS-EXT-IPS:type": "fixed"
378
            }, {
379
              "id": "38",
380
              "network_id": "4178",
381
              "mac_address": "aa:00:0c:6d:34:cc",
382
              "firewallProfile": "PROTECTED",
383
              "ipv4": "192.168.1.3",
384
              "ipv6": ""
385
              "OS-EXT-IPS:type": "floating"
386
            }
387
        ],
388
        "links": [
389
          {
390
            "href": "https://example.org/compute/v2.0/servers/84", 
391
            "rel": "self"
392
          }, {
393
            "href": "https://example.org/compute/v2.0/servers/84", 
394
            "rel": "bookmark"
395
          }
396
        ],
397
        "image": {
398
          "id": "im4g3-1d",
399
          "links": [
400
            {
401
              "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
402
              "rel": "self"
403
            }, {
404
              "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
405
              "rel": "bookmark"
406
            }, {
407
              "href": "https://example.org/image/v1.0/images/im4g3-1d", 
408
              "rel": "alternate"
409
            }
410
          ]
411
        },
412
        "suspended": false,
413
        "created': '2011-04-21T10:18:52.085737+00:00',
414
        "flavor": {
415
          "id": 3",
416
          "links": [
417
            {
418
              "href": "https://example.org/compute/v2.0/flavors/3", 
419
              "rel": "self"
420
            }, {
421
              "href": "https://example.org/compute/v2.0/flavors/3", 
422
              "rel": "bookmark"
423
            }
424
          ]
425
        },
426
        "id": "84",
427
        "security_groups": [{"name": "default"}],
428
        "user_id": "s0m5-u5e7-1d",
429
        "accessIPv4": "",
430
        "accessIPv6": "",
431
        "progress": 100,
432
        "config_drive": "",
433
        "status": "ACTIVE",
434
        "updated": "2011-05-30T14:07:07.037602+00:00",
435
        "hostId": "",
436
        "SNF:fqdn": "snf-84.vm.example.org",
437
        "key_name": null,
438
        "name": "My Other Server",
439
        "created": "2014-02-21T08:31:37.834542+00:00",
440
        "tenant_id": "s0m5-u5e7-1d",
441
        "SNF:port_forwarding": {},
442
        "SNF:task_state": "",
443
        "diagnostics": [
444
          {
445
            "level": "DEBUG",
446
            "created": "2014-02-21T08:31:37.834542+00:00",
447
            "source": "image-info",
448
            "source_date": "2014-02-21T08:32:35.929507+00:00",
449
            "message": "Image customization finished successfully.",
450
            "details": null
451
          }
452
        ],
453
        "metadata": {
454
          "os": "debian",
455
          "users": "root"
456
        }
457
      }
458
    ]
459
  }
460

    
461

    
462
Create Server
463
-------------
464

    
465
Create a new virtual server
466

    
467
.. rubric:: Request
468

    
469
============ ====== ======== ==========
470
URI          Method Cyclades OS/Compute
471
============ ====== ======== ==========
472
``/servers`` POST   ✔        ✔
473
============ ====== ======== ==========
474

    
475
|
476

    
477
==============  ========================= ======== ==========
478
Request Header  Value                     Cyclades OS/Compute
479
==============  ========================= ======== ==========
480
X-Auth-Token    User authentication token required required
481
Content-Type    Type or request body      required required
482
Content-Length  Length of request body    required required
483
==============  ========================= ======== ==========
484

    
485
*Example Request Headers*::
486

    
487
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
488
  Content-Type:   application/json
489
  Content-Length: 735
490

    
491
|
492

    
493
================= ===============
494
Request Parameter Value
495
================= ===============
496
json              Respond in json
497
xml               Respond in xml
498
================= ===============
499

    
500
Request body contents::
501

    
502
  server: {
503
      <server attribute>: <value>,
504
      ...
505
      personality: [
506
        {
507
          <personality attribute>: <value>,
508
          ...
509
        },
510
        ...
511
      ],
512
      ...
513
  }
514

    
515
=========== ==================== ======== ==========
516
Attributes  Description          Cyclades OS/Compute
517
=========== ==================== ======== ==========
518
name        The server name      ✔        ✔
519
imageRef    Image id             ✔        ✔
520
flavorRef   Resources flavor     ✔        ✔
521
personality Personality contents ✔        ✔
522
metadata    Custom metadata      ✔        ✔
523
=========== ==================== ======== ==========
524

    
525
* **name** can be any string
526

    
527
* **imageRed** and **flavorRed** should refer to existing images and hardware
528
  flavors accessible by the user
529

    
530
* **metadata** are ``key``:``value`` pairs of custom server-specific metadata.
531
  There are no semantic limitations.
532

    
533
* **personality** (optional) is a list of personality injections. A personality
534
  injection is a way to add a file into a virtual server while creating it.
535
  Each change modifies/creates a file on the virtual server. The injected data
536
  (``contents``) should not exceed 10240 *bytes* in size and must be base64
537
  encoded. The file mode should be a number, not a string. A personality
538
  injection contains the following attributes:
539

    
540
====================== =================== ======== ==========
541
Personality Attributes Description         Cyclades OS/Compute
542
====================== =================== ======== ==========
543
path                   File path on server ✔        ✔
544
contents               Data to inject      ✔        ✔
545
group                  User group          ✔        **✘**
546
mode                   File access mode    ✔        **✘**
547
owner                  File owner          ✔        **✘**
548
====================== =================== ======== ==========
549

    
550
*Example Create Server Request: JSON*
551

    
552
.. code-block:: javascript
553

    
554
  {
555
    "server": {
556
      "name": "My Server Name: Example Name",
557
      "imageRef": "da7a211f-...-f901ce81a3e6",
558
      "flavorRef": 289,
559
      "personality": [
560
        {
561
          "path": "/Users/myusername/personlities/example1.file",
562
          "contents": "some data to inject",
563
          "group": "remotely-set user group",
564
          "mode": 0600,
565
          "owner": "ausername"
566
        }, {
567
          "path": "/Users/myusername/personlities/example2.file",
568
          "contents": "some more data to inject",
569
          "group": "",
570
          "mode": 0777,
571
          "owner": "anotherusername"
572
        }
573
      ],
574
      "metadata": {
575
        "EloquentDescription": "Example server with personality",
576
        "ShortDescription": "Trying VMs"
577
      }
578
    }
579
  }
580

    
581
.. rubric:: Response
582

    
583
=========================== =====================
584
Return Code                 Description
585
=========================== =====================
586
200 (OK)                    Request succeeded
587
400 (Bad Request)           Malformed request data
588
401 (Unauthorized)          Missing or expired user token
589
403 (Forbidden)             User is not allowed to perform this operation
590
404 (Not Found)             Image or Flavor not found
591
413 (Over Limit)            Exceeded some resource limit (#VMs, personality
592
size, etc.)
593
415 (Bad Media Type)        
594
500 (Internal Server Error) The request cannot be completed because of an
595
\                           internal error
596
503 (Service Unavailable)   No available backends or service currently
597
\                           unavailable
598
=========================== =====================
599

    
600
|
601

    
602
Response body contents::
603

    
604
  server: {
605
    <server attribute>: <value>,
606
    ...
607
  }
608

    
609
Server attributes are `listed here <#server-ref>`_.
610

    
611
*Example Create Server Response: JSON*
612

    
613
.. code-block:: javascript
614

    
615
  {
616
    "server": {
617
      "addresses": 
618
      "id": 28130,
619
        "links": [
620
            {
621
                "href": "https://example.org/compute/v2.0/servers/42", 
622
                "rel": "self"
623
            }, 
624
            {
625
                "href": "https://example.org/compute/v2.0/servers/42", 
626
                "rel": "bookmark"
627
            }
628
        ],
629

    
630
      "image": {
631
        "id": im4g3-1d
632
        "links": [
633
            {
634
                "href": "https://example.org/compute/v2.0/images/im4g3-1d"
635
                "rel": "self"
636
            }, {
637
                "href": "https://example.org/compute/v2.0/images/im4g3-1d"
638
                "rel": "bookmark"
639
            }, {
640
                "href": "https://example.org/image/v1.0/images/im4g3-1d"
641
                "rel": "alternate"
642
            }
643
        ]
644
      },
645
      "flavor": {
646
        "id": 289
647
        "links": [
648
            {
649
                "href": "https://example.org/compute/v2.0/flavors/289"
650
                "rel": "self"
651
            }, {
652
                "href": "https://example.org/compute/v2.0/flavors/289"
653
                "rel": "bookmark"
654
            }
655
        ]
656
      },
657
      "status": "BUILD",
658
      "updated": "2013-04-10T13:52:18.140686+00:00",
659
      "hostId": "",
660
      "name": "My Server Name: Example Name",
661
      "created": "2013-04-10T13:52:17.085402+00:00",
662
      "adminPass": "fKCqlZe2at",
663
      "suspended": false,
664
      "progress": 0
665
      "metadata": {
666
        "EloquentDescription": "Example server with personality",
667
        "ShortDescription": "Trying VMs"
668
      }
669
    }
670
  }
671

    
672
*Example Create Server Response: XML*
673

    
674
.. code-block:: xml
675

    
676
  <?xml version="1.0" encoding="UTF-8"?>
677
  <server xmlns="http://docs.openstack.org/compute/api/v1.1"\
678
    xmlns:atom="http://www.w3.org/2005/Atom"
679
    id="1"
680
    status="BUILD"
681
    hostId="",
682
    name="My Server Name: Example Name"
683
    created="2013-04-10T13:52:17.085402+00:00"
684
    adminPass="fKCqlZe2at"
685
    suspended="false"
686
    progress="0"
687
    ...
688
  />
689

    
690
Get Server Stats
691
----------------
692

    
693
.. note:: This operation is not part of OS/Compute v2.
694

    
695
This operation returns URLs of graphs showing CPU and Network statistics.
696

    
697
.. rubric:: Request
698

    
699
============================== ====== ======== ==========
700
URI                            Method Cyclades OS/Compute
701
============================== ====== ======== ==========
702
``/servers/<server-id>/stats`` GET    ✔        **✘**
703
============================== ====== ======== ==========
704

    
705
* **server-id** is the identifier of the virtual server
706

    
707
|
708

    
709
==============  ========================= ======== ==========
710
Request Header  Value                     Cyclades OS/Compute
711
==============  ========================= ======== ==========
712
X-Auth-Token    User authentication token required required
713
==============  ========================= ======== ==========
714

    
715
|
716

    
717
================= ===============
718
Request Parameter Value          
719
================= ===============
720
json              Respond in json
721
xml               Respond in xml 
722
================= ===============
723

    
724
* **json** and **xml** parameters are mutually exclusive. If none supported,
725
the response will be formated in json.
726

    
727
.. note:: Request body should be empty
728

    
729
.. rubric:: Response
730

    
731
=========================== =====================
732
Return Code                 Description
733
=========================== =====================
734
200 (OK)                    Request succeeded
735
400 (Bad Request)           Invalid server ID or Server deleted
736
401 (Unauthorized)          Missing or expired user token
737
403 (Forbidden)             Administratively suspended server
738
404 (Not Found)             Server not found
739
500 (Internal Server Error) The request cannot be completed because of an
740
\                           internal error
741
503 (Service Unavailable)   The server is not currently available
742
=========================== =====================
743

    
744
|
745

    
746
Response body contents::
747

    
748
  stats: {<parameter>: <value> }
749

    
750
============= ======================
751
Parameter     Description
752
============= ======================
753
serverRef     Server ID
754
refresh       Refresh frequency
755
cpuBar        Latest CPU load graph URL
756
cpuTimeSeries CPU load / time graph URL
757
netBar        Latest Network load graph URL
758
netTimeSeries Network load / time graph URL
759
============= ======================
760

    
761
* **refresh** is the recommended sampling rate
762

    
763
*Example Get Server Stats Response: JSON*
764

    
765
.. code-block:: javascript
766

    
767
  {
768
    "stats": {
769
      "serverRef": 1,
770
      "refresh": 60,
771
      "cpuBar": "http://stats.okeanos.grnet.gr/b9a...048c/cpu-bar.png",
772
      "cpuTimeSeries": "http://stats.okeanos.grnet.gr/b9a...048c/cpu-ts.png",
773
      "netBar": "http://stats.okeanos.grnet.gr/b9a...048c/net-bar.png",
774
      "netTimeSeries": "http://stats.okeanos.grnet.gr/b9a...048c/net-ts.png"
775
    }
776
  }
777

    
778
*Example Get Network Details Response: XML*
779

    
780
.. code-block:: xml
781

    
782
  <?xml version="1.0" encoding="UTF-8"?>
783
  <stats xmlns="http://docs.openstack.org/compute/api/v1.1"\
784
    xmlns:atom="http://www.w3.org/2005/Atom"
785
    serverRef="1"
786
    refresh="60"
787
    cpuBar="https://www.example.org/stats/snf-42/cpu-bar/",
788
    netTimeSeries="https://example.org/stats/snf-42/net-ts/",
789
    netBar="https://example.org/stats/snf-42/net-bar/",
790
    cpuTimeSeries="https://www.example.org/stats/snf-42/cpu-ts/"
791
  </stats>
792

    
793
Get Server Diagnostics
794
----------------------
795

    
796
.. note:: This operation is not part of OS/Compute v2.
797

    
798
This operation returns diagnostic information (logs) for a server.
799

    
800
.. rubric:: Request
801

    
802
==================================== ====== ======== ==========
803
URI                                  Method Cyclades OS/Compute
804
==================================== ====== ======== ==========
805
``/servers/<server-id>/diagnostics`` GET    ✔        **✘**
806
==================================== ====== ======== ==========
807

    
808
* **server-id** is the identifier of the virtual server
809

    
810
|
811

    
812
==============  ========================= ======== ==========
813
Request Header  Value                     Cyclades OS/Compute
814
==============  ========================= ======== ==========
815
X-Auth-Token    User authentication token required required
816
==============  ========================= ======== ==========
817

    
818
.. note:: Request parameters should be empty
819

    
820
.. note:: Request body should be empty
821

    
822
.. rubric:: Response
823

    
824
=========================== =====================
825
Return Code                 Description
826
=========================== =====================
827
200 (OK)                    Request succeeded
828
400 (Bad Request)           Invalid server ID or Server deleted
829
401 (Unauthorized)          Missing or expired user token
830
403 (Forbidden)             Administratively suspended server
831
404 (Not Found)             Server not found
832
500 (Internal Server Error) The request cannot be completed because of an
833
\                           internal error
834
503 (Service Unavailable)   The server is not currently available
835
=========================== =====================
836

    
837
|
838

    
839
Response body contents::
840

    
841
  [
842
    {
843
      <diagnostic attribute}: <value>,
844
      ...
845
    }, {
846
      <diagnostic attribute}: <value>,
847
      ...
848
    },
849
    ...
850
  ]
851

    
852
==================== ===========
853
Diagnostic attribute Description
854
==================== ===========
855
level                Debug level
856
created              Log entry timestamp
857
source               Log source proccess
858
source_date          Log source date
859
message              Log description
860
details              Detailed log description
861
==================== ===========
862

    
863
*Example Get Server Diagnostics Response: JSON*
864

    
865
.. code-block:: javascript
866

    
867
  [
868
    {
869
      "level": "DEBUG",
870
      "created": "2013-04-09T15:25:53.965144+00:00",
871
      "source": "image-helper-task-start",
872
      "source_date": "2013-04-09T15:25:53.954695+00:00",
873
      "message": "FixPartitionTable",
874
      "details": null
875
    }, {
876
      "level": "DEBUG",
877
      "created": "2013-04-09T15:25:46.413718+00:00",
878
      "source": "image-info",
879
      "source_date": "2013-04-09T15:25:46.404477+00:00",
880
      "message": "Starting customization VM...",
881
      "details": null
882
    }, {
883
      "level": "DEBUG",
884
      "created": "2013-04-09T15:25:46.207038+00:00",
885
      "source": "image-info",
886
      "source_date": "2013-04-09T15:25:46.197183+00:00",
887
      "message": "Image copy finished.",
888
      "details": "All operations finished as they should. No errors reported."
889
    }
890
  ]
891

    
892
Get Server Details
893
------------------
894

    
895
This operation returns detailed information for a virtual server
896

    
897
.. rubric:: Request
898

    
899
======================== ====== ======== ==========
900
URI                      Method Cyclades OS/Compute
901
======================== ====== ======== ==========
902
``/servers/<server id>`` GET    ✔        ✔
903
======================== ====== ======== ==========
904

    
905
* **server-id** is the identifier of the virtual server
906

    
907
|
908

    
909
==============  ========================= ======== ==========
910
Request Header  Value                     Cyclades OS/Compute
911
==============  ========================= ======== ==========
912
X-Auth-Token    User authentication token required required
913
==============  ========================= ======== ==========
914

    
915
.. note:: Request parameters should be empty
916

    
917
.. note:: Request body should be empty
918

    
919
.. rubric:: Response
920

    
921
=========================== =====================
922
Return Code                 Description
923
=========================== =====================
924
200 (OK)                    Request succeeded
925
400 (Bad Request)           Malformed server id
926
401 (Unauthorized)          Missing or expired user token
927
403 (Forbidden)             Administratively suspended server
928
404 (Not Found)             Server not found
929
500 (Internal Server Error) The request cannot be completed because of an
930
\                           internal error
931
503 (Service Unavailable)   No available backends or service currently
932
\                           unavailable
933
=========================== =====================
934

    
935
|
936

    
937
Response body contents::
938

    
939
  server: {
940
    <server attribute>: <value>,
941
    ...
942
  }
943

    
944
================= ====================== ======== ==========
945
Server Attributes Description            Cyclades OS/Compute
946
================= ====================== ======== ==========
947
id                The server id          ✔        ✔
948
name              The server name        ✔        ✔
949
hostId            Server playground      empty    ✔
950
created           Creation date          ✔        ✔
951
updated           Creation date          ✔        ✔
952
flavor            The flavor id          ✔        ✔
953
image             The image id           ✔        ✔
954
progress          Build progress         ✔        ✔
955
status            Server status          ✔        ✔
956
suspended         If server is suspended ✔        **✘**
957
attachments       Network interfaces     ✔        **✘**
958
addresses         Network interfaces     **✘**    ✔
959
metadata          Server custom metadata ✔        ✔
960
diagnostics       Diagnostic information ✔        **✘**
961
================= ====================== ======== ==========
962

    
963
* **hostId** is not used in Cyclades, but is returned as an empty string for
964
  compatibility
965

    
966
* **progress** is changing while the server is building up and has values
967
  between 0 and 100. When it reaches 100 the server is built.
968

    
969
* **status** refers to `the status <#status-ref>`_ of the server
970

    
971
* **metadata** are custom key:value pairs used to specify various attributes of
972
  the VM (e.g. OS, super user, etc.)
973

    
974
* **attachments** in Cyclades are lists of network interfaces (NICs).
975
  **Attachments** are different to OS/Compute's **addresses**. The former is a
976
  list of the server's `network interface connections <#attachments-ref>`_ while the
977
  later is just a list of networks. Thus, a Cyclades virtual server may be
978
  connected to the same network through more than one distinct network
979
  interfaces.
980

    
981
* **diagnostics** is a list of items that contain key:value information useful
982
  for diagnosing the server behavior and may be used by the administrators of
983
  deployed Synnefo setups.
984

    
985
*Example Details for server with id 42042: JSON*
986

    
987
.. code-block:: javascript
988

    
989
  {
990
    "server": {
991
        "attachments": [
992
            {
993
              "network_id": "1888",
994
              "mac_address": "aa:0c:f5:ad:16:41",
995
              "firewallProfile": "DISABLED",
996
              "ipv4": "83.212.112.56",
997
              "ipv6": "2001:648:2ffc:1119:a80c:f5ff:fead:1641",
998
              "id": "nic-42042-0"
999
            }
1000
        ],
1001
        "links": [
1002
            {
1003
                "href": "https://example.org/compute/v2.0/servers/42031", 
1004
                "rel": "self"
1005
            }, 
1006
            {
1007
                "href": "https://example.org/compute/v2.0/servers/42042",
1008
                "rel": "bookmark"
1009
            }
1010
        ],
1011
        "created": "2011-05-02T20:51:08.527759+00:00",
1012
        "flavor": {
1013
            "id": 1,
1014
            "links": [
1015
                {
1016
                    "href": "https://example.org/compute/v2.0/flavors/1", 
1017
                    "rel": "self"
1018
                }, 
1019
                {
1020
                    "href": "https://example.org/compute/v2.0/flavors/1", 
1021
                    "rel": "bookmark"
1022
                }
1023
            ]
1024

    
1025
        },
1026
        "hostId": "",
1027
        "id": "42042",
1028
        "image": {
1029
            "id": "im4g3-1d",
1030
            "links": [
1031
                {
1032
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
1033
                    "rel": "self"
1034
                }, 
1035
                {
1036
                    "href": "https://example.org/compute/v2.0/images/im4g3-1d", 
1037
                    "rel": "bookmark"
1038
                }, 
1039
                {
1040
                    "href": "https://example.org/image/v1.0/images/im4g3-1d", 
1041
                    "rel": "alternate"
1042
                }
1043
            ]
1044
        },
1045
        "name": "My Example Server",
1046
        "description": "A sample server to showcase server requests",
1047
        "progress": "0",
1048
        "status": "ACTIVE",
1049
        "updated": "2011-05-29T14:59:11.267087+00:00",
1050
        "suspended": false,
1051
        "diagnostics": [
1052
            {
1053
                "level": "DEBUG",
1054
                "created": "2013-04-18T10:09:52.776920+00:00",
1055
                "source": "image-info",
1056
                "source_date": "2013-04-18T10:09:52.709791+00:00",
1057
                "message": "Image customization finished successfully.",
1058
                "details": null
1059
            }
1060
        ],
1061
      }
1062
    }
1063
  }
1064

    
1065
Rename Server
1066
-------------
1067

    
1068
Modify the ``name`` attribute of a virtual server. OS/Compute API also features
1069
the modification of IP addresses
1070

    
1071
.. rubric:: Response
1072

    
1073
======================== ====== ======== ==========
1074
URI                      Method Cyclades OS/Compute
1075
======================== ====== ======== ==========
1076
``/servers/<server id>`` PUT    ✔        ✔
1077
======================== ====== ======== ==========
1078

    
1079
* **server-id** is the identifier of the virtual server
1080

    
1081
|
1082

    
1083
==============  ========================= ======== ==========
1084
Request Header  Value                     Cyclades OS/Compute
1085
==============  ========================= ======== ==========
1086
X-Auth-Token    User authentication token required required
1087
Content-Type    Type or request body      required required
1088
Content-Length  Length of request body    required required
1089
==============  ========================= ======== ==========
1090

    
1091
**Example Request Headers**::
1092

    
1093
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
1094
  Content-Type:   application/json
1095
  Content-Length: 54
1096

    
1097
.. note:: Request parameters should be empty
1098

    
1099
Request body contents::
1100

    
1101
  server: {
1102
    <server attribute>: <value>,
1103
    ...
1104
  }
1105

    
1106
=========== ==================== ======== ==========
1107
Attribute   Description          Cyclades OS/Compute
1108
=========== ==================== ======== ==========
1109
name        The server name      ✔        ✔
1110
accessIPv4  IP v4 address        **✘**    ✔
1111
accessIPv6  IP v6 address        **✘**    ✔
1112
=========== ==================== ======== ==========
1113

    
1114
* Cyclades support multiple network connections per virtual server, which
1115
  explains the above differences in request body attributes.
1116

    
1117
*Example Rename Server Request: JSON*
1118

    
1119
.. code-block:: javascript
1120

    
1121
  {"server": {"name": "A new name for my virtual server"}}
1122

    
1123
.. rubric:: Response
1124

    
1125
=========================== =====================
1126
Return Code                 Description
1127
=========================== =====================
1128
204 (OK)                    Request succeeded
1129
400 (Bad Request)           Malformed request or malformed server id
1130
401 (Unauthorized)          Missing or expired user token
1131
403 (Forbidden)             User is not allowed to perform this operation
1132
404 (Not Found)             Server not found
1133
415 (Bad Media Type)
1134
409 (Build In Progress)     Server is not ready yet
1135
500 (Internal Server Error) The request cannot be completed because of an
1136
\                           internal error
1137
503 (Service Unavailable)   No available backends or service currently
1138
\                           unavailable
1139
=========================== =====================
1140

    
1141
.. note:: In case of a 204 return code, there will be no request results
1142
  according to the Cyclades API. Compute OS API suggests that response should
1143
  include the new server details.
1144

    
1145
Delete Server
1146
-------------
1147

    
1148
Delete a virtual server. When a server is deleted, all its connections are
1149
deleted as well.
1150

    
1151
.. rubric:: Request
1152

    
1153
======================== ====== ======== ==========
1154
URI                      Method Cyclades OS/Compute
1155
======================== ====== ======== ==========
1156
``/servers/<server id>`` DELETE ✔        ✔
1157
======================== ====== ======== ==========
1158

    
1159
* **server-id** is the identifier of the virtual server.
1160

    
1161
|
1162

    
1163
==============  ========================= ======== ==========
1164
Request Header  Value                     Cyclades OS/Compute
1165
==============  ========================= ======== ==========
1166
X-Auth-Token    User authentication token required required
1167
==============  ========================= ======== ==========
1168

    
1169
.. note:: Request parameters should be empty
1170

    
1171
.. note:: Request body should be empty
1172

    
1173
.. rubric:: Response
1174

    
1175
=========================== =====================
1176
Return Code                 Description
1177
=========================== =====================
1178
204 (OK)                    Request succeeded
1179
400 (Bad Request)           Malformed server id or machine already deleted
1180
401 (Unauthorized)          Missing or expired user token
1181
404 (Not Found)             Server not found
1182
409 (Build In Progress)     Server is not ready yet
1183
500 (Internal Server Error) The request cannot be completed because of an
1184
\                           internal error
1185
503 (Service Unavailable)   Action not supported or service currently
1186
\                           unavailable
1187
=========================== =====================
1188

    
1189
.. note:: In case of a 204 code, response body should be empty
1190

    
1191
List Server Addresses
1192
---------------------
1193

    
1194
List all network connections of a server. In Cyclades API, connections are
1195
represented as Network Connection Interfaces (NICs), which describe a server -
1196
network relation through their respective identifiers. This mechanism ensures
1197
flexibility and multiple networks connecting the same virtual servers.
1198

    
1199
The Synnefo/Cyclades approach in this matter differs substantially to the
1200
`one suggested by the OS/Compute API <http://docs.openstack.org/api/openstack-compute/2/content/List_Addresses-d1e3014.html>`_.
1201

    
1202
.. rubric:: Request
1203

    
1204
============================ ====== ======== ==========
1205
URI                          Method Cyclades OS/Compute
1206
============================ ====== ======== ==========
1207
``/servers/<server id>/ips`` GET    ✔        ✔
1208
============================ ====== ======== ==========
1209

    
1210
* **server-id** is the identifier of the virtual server
1211

    
1212
|
1213

    
1214
==============  ========================= ======== ==========
1215
Request Header  Value                     Cyclades OS/Compute
1216
==============  ========================= ======== ==========
1217
X-Auth-Token    User authentication token required required
1218
==============  ========================= ======== ==========
1219

    
1220
.. note:: Request parameters should be empty
1221

    
1222
.. note:: Request body should be empty
1223

    
1224
.. rubric:: Response
1225

    
1226
=========================== =====================
1227
Return Code                 Description
1228
=========================== =====================
1229
200 (OK)                    Request succeeded
1230
400 (Bad Request)           Malformed server id or machine already deleted
1231
401 (Unauthorized)          Missing or expired user token
1232
404 (Not Found)             Server not found
1233
409 (Build In Progress)     Server is not ready yet
1234
500 (Internal Server Error) The request cannot be completed because of an
1235
\                           internal error
1236
503 (Service Unavailable)   Service currently unavailable
1237
=========================== =====================
1238

    
1239
Response body contents::
1240

    
1241
  addresses: [
1242
    {
1243
      <NIC attribute>: <value>,
1244
      ...
1245
    },
1246
    ...
1247
  ]
1248

    
1249
A Network Interface Connection (or NIC) connects the current server to a
1250
network, through their respective identifiers. More information in NIC
1251
attributes are `enlisted here <#attachments-ref>`_.
1252

    
1253
*Example List Addresses: JSON*
1254

    
1255
.. code-block:: javascript
1256

    
1257
  {
1258
    "addresses": [
1259
      {
1260
        "id": "nic-25455-0"
1261
        "network_id": "1",
1262
        "mac_address": "aa:00:03:7a:84:bb",
1263
        "firewallProfile": "DISABLED",
1264
        "ipv4": "192.168.0.27",
1265
        "ipv6": "2001:646:2ffc:1222:a820:3fd:fe7a:84bb",
1266
      }, {
1267
        "id": "nic-25455-1"
1268
        "network_id": "7",
1269
        "mac_address": "aa:00:03:7a:84:cc",
1270
        "firewallProfile": "DISABLED",
1271
        "ipv4": "192.168.0.28",
1272
        "ipv6": "2002:646:2fec:1222:a820:3fd:fe7a:84bc",
1273
      },
1274
    ]
1275
  }
1276

    
1277
Get Server NICs by Network
1278
--------------------------
1279

    
1280
Return the NIC that connects a server to a network.
1281

    
1282
The semantics of this operation are substantially different to the respective
1283
OS/Compute
1284
`List Addresses by Network semantics <http://docs.openstack.org/api/openstack-compute/2/content/List_Addresses_by_Network-d1e3118.html>`_.
1285

    
1286
.. rubric:: Request
1287

    
1288
========================================= ====== ======== ==========
1289
URI                                       Method Cyclades OS/Compute
1290
========================================= ====== ======== ==========
1291
``/servers/<server id>/ips/<network id>`` GET    ✔        ✔
1292
========================================= ====== ======== ==========
1293

    
1294
* **server id** is the identifier of the virtual server
1295

    
1296
* **network id** is the identifier of the network
1297

    
1298
|
1299

    
1300
==============  ========================= ======== ==========
1301
Request Header  Value                     Cyclades OS/Compute
1302
==============  ========================= ======== ==========
1303
X-Auth-Token    User authentication token required required
1304
==============  ========================= ======== ==========
1305

    
1306
.. note:: Request parameters should be empty
1307

    
1308
.. note:: Request body should be empty
1309

    
1310
.. rubric:: Response
1311

    
1312
=========================== =====================
1313
Return Code                 Description
1314
=========================== =====================
1315
200 (OK)                    Request succeeded
1316
400 (Bad Request)           Malformed server id or machine already deleted
1317
401 (Unauthorized)          Missing or expired user token
1318
404 (Not Found)             Server not found
1319
409 (Build In Progress)     Server is not ready yet
1320
500 (Internal Server Error) The request cannot be completed because of an
1321
\                           internal error
1322
503 (Service Unavailable)   Service currently unavailable
1323
=========================== =====================
1324

    
1325
|
1326

    
1327
Response body contents::
1328

    
1329
  network: {
1330
    <NIC attributes>: <value>,
1331
    ...
1332
  }
1333

    
1334
Network Interface Connection (NIC) attributes are listed `here <#attachments-ref>`_.
1335

    
1336
**List Server NICs Example with server id 25455, network id 7: JSON**
1337

    
1338
.. code-block:: javascript
1339

    
1340
  {
1341
    "network": {
1342
      "id": "nic-25455-0"
1343
      "network_id": "7",
1344
      "mac_address": "aa:00:03:7a:84:bb",
1345
      "firewallProfile": "DISABLED",
1346
      "ipv4": "192.168.0.27",
1347
      "ipv6": "2001:646:2ffc:1222:a820:3fd:fe7a:84bb",
1348
    }
1349
  }
1350

    
1351

    
1352
List Server Metadata
1353
--------------------
1354

    
1355
List the metadata of a server
1356

    
1357
.. note:: This operation is semantically equivalent in Cyclades and OS/Compute
1358
  besides the different URI.
1359

    
1360
.. rubric:: Request
1361

    
1362
================================= ====== ======== ==========
1363
URI                               Method Cyclades OS/Compute
1364
================================= ====== ======== ==========
1365
``/servers/<server-id>/metadata`` GET    ✔        ✔
1366
================================= ====== ======== ==========
1367

    
1368
* **server-id** is the identifier of the virtual server
1369

    
1370
|
1371

    
1372
==============  ========================= ======== ==========
1373
Request Header  Value                     Cyclades OS/Compute
1374
==============  ========================= ======== ==========
1375
X-Auth-Token    User authentication token required required
1376
==============  ========================= ======== ==========
1377

    
1378
.. note:: Request parameters should be empty
1379

    
1380
.. note:: Request body should be empty
1381

    
1382
.. rubric:: Response
1383

    
1384
=========================== =====================
1385
Return Code                 Description
1386
=========================== =====================
1387
200 (OK)                    Request succeeded
1388
400 (Bad Request)           Invalid server ID or Malformed request
1389
401 (Unauthorized)          Missing or expired user token
1390
403 (Forbidden)             Administratively suspended server
1391
404 (Not Found)             Server not found
1392
500 (Internal Server Error) The request cannot be completed because of an
1393
\                           internal error
1394
503 (Service Unavailable)   The server is not currently available
1395
=========================== =====================
1396

    
1397
Response body contents::
1398

    
1399
  metadata: {
1400
    <key>: <value>,
1401
      ...
1402
  }
1403

    
1404
*Example List Server Metadata: JSON*
1405

    
1406
.. code-block:: javascript
1407

    
1408
  {
1409
    ""metadata": {
1410
      "OS": "Linux",
1411
      "users": "root"
1412
    }
1413
  }
1414

    
1415
Set / Update Server Metadata
1416
----------------------------
1417

    
1418
In Cyclades API, setting new metadata and updating the values of existing ones
1419
is achieved with the same type of request (``POST``), while in OS/Compute API
1420
there are two separate request types (``PUT`` and ``POST`` for
1421
`setting new <http://docs.openstack.org/api/openstack-compute/2/content/Create_or_Replace_Metadata-d1e5358.html>`_
1422
and
1423
`updating existing <http://docs.openstack.org/api/openstack-compute/2/content/Update_Metadata-d1e5208.html>`_
1424
metadata, respectively).
1425

    
1426
In Cyclades API, metadata keys which are not referred by the operation will
1427
remain intact, while metadata referred by the operation will be overwritten.
1428

    
1429
.. rubric:: Request
1430

    
1431
================================= ====== ======== ==========
1432
URI                               Method Cyclades OS/Compute
1433
================================= ====== ======== ==========
1434
``/servers/<server-id>/metadata`` PUT    **✘**    ✔
1435
``/servers/<server-id>/metadata`` POST   ✔       ✔
1436
================================= ====== ======== ==========
1437

    
1438
* **server-id** is the identifier of the virtual server
1439

    
1440
|
1441

    
1442
==============  ========================= ======== ==========
1443
Request Header  Value                     Cyclades OS/Compute
1444
==============  ========================= ======== ==========
1445
X-Auth-Token    User authentication token required required
1446
Content-Type    Type or request body      required required
1447
Content-Length  Length of request body    required required
1448
==============  ========================= ======== ==========
1449

    
1450
**Example Request Headers**::
1451

    
1452
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
1453
  Content-Type:   application/json
1454
  Content-Length: 56
1455

    
1456
.. note:: Request parameters should be empty
1457

    
1458
Request body contents::
1459

    
1460
  metadata: {
1461
    <key>: <value>,
1462
    ...
1463
  }
1464

    
1465
*Example Request Set / Update Server Metadata: JSON*
1466

    
1467
.. code-block:: javascript
1468

    
1469
  {"metadata": {"role": "webmail", "users": "root,maild"}}
1470

    
1471
.. rubric:: Response
1472

    
1473
=========================== =====================
1474
Return Code                 Description
1475
=========================== =====================
1476
201 (OK)                    Request succeeded
1477
400 (Bad Request)           Invalid server ID or Malformed request
1478
401 (Unauthorized)          Missing or expired user token
1479
403 (Forbidden)             Administratively suspended server
1480
404 (Not Found)             Server not found
1481
413 (OverLimit)             Maximum number of metadata exceeded
1482
500 (Internal Server Error) The request cannot be completed because of an
1483
\                           internal error
1484
503 (Service Unavailable)   The server is not currently available
1485
=========================== =====================
1486

    
1487
Response body contents::
1488

    
1489
  metadata: {
1490
    <key>: <value>,
1491
    ...
1492
  }
1493

    
1494
*Example Response Set / Update Server Metadata: JSON*
1495

    
1496
.. code-block:: javascript
1497

    
1498
  {"metadata": {"OS": "Linux", "role": "webmail", "users": "root,maild"}}
1499

    
1500
Get Server Metadata Item
1501
------------------------
1502

    
1503
Get the value of a specific piece of metadata of a virtual server
1504

    
1505
.. rubric:: Request
1506

    
1507
======================================= ====== ======== ==========
1508
URI                                     Method Cyclades OS/Compute
1509
======================================= ====== ======== ==========
1510
``/servers/<server-id>/metadata/<key>`` GET    ✔        ✔
1511
======================================= ====== ======== ==========
1512

    
1513
* **server-id** is the identifier of the virtual server
1514

    
1515
* **key** is the key of a mata ``key``:``value`` pair
1516

    
1517
|
1518

    
1519
==============  ========================= ======== ==========
1520
Request Header  Value                     Cyclades OS/Compute
1521
==============  ========================= ======== ==========
1522
X-Auth-Token    User authentication token required required
1523
==============  ========================= ======== ==========
1524

    
1525
.. note:: Request parameters should be empty
1526

    
1527
.. note:: Request body should be empty
1528

    
1529
.. rubric:: Response
1530

    
1531
=========================== =====================
1532
Return Code                 Description
1533
=========================== =====================
1534
200 (OK)                    Request succeeded
1535
400 (Bad Request)           Invalid server ID or Malformed request
1536
401 (Unauthorized)          Missing or expired user token
1537
403 (Forbidden)             Administratively suspended server
1538
404 (Not Found)             Meta key not found
1539
500 (Internal Server Error) The request cannot be completed because of an
1540
\                           internal error
1541
503 (Service Unavailable)   The server is not currently available
1542
=========================== =====================
1543

    
1544
Response body content::
1545

    
1546
  metadata: {<key>: <value>}
1547

    
1548
*Example Get Server Metadata for Item 'role', JSON*
1549

    
1550
.. code-block:: javascript
1551

    
1552
  {"metadata": {"role": "webmail"}}
1553

    
1554
Update Server Metadata Item
1555
---------------------------
1556

    
1557
Set a new or update an existing a metadum value for a virtual server.
1558

    
1559
.. rubric:: Request
1560

    
1561
======================================= ====== ======== ==========
1562
URI                                     Method Cyclades OS/Compute
1563
======================================= ====== ======== ==========
1564
``/servers/<server-id>/metadata/<key>`` PUT    ✔        ✔
1565
======================================= ====== ======== ==========
1566

    
1567
* **server-id** is the identifier of the virtual server
1568

    
1569
* **key** is the key of a ``key``:``value`` pair piece of metadata
1570

    
1571
|
1572

    
1573
==============  ========================= ======== ==========
1574
Request Header  Value                     Cyclades OS/Compute
1575
==============  ========================= ======== ==========
1576
X-Auth-Token    User authentication token required required
1577
Content-Type    Type or request body      required required
1578
Content-Length  Length of request body    required required
1579
==============  ========================= ======== ==========
1580

    
1581
**Example Request Headers**::
1582

    
1583
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
1584
  Content-Type:   application/json
1585
  Content-Length: 29
1586

    
1587
.. note:: Request parameters should be empty
1588

    
1589
Request body content::
1590

    
1591
  metadata: {<key>: <value>}
1592

    
1593
*Example Request to Set or Update Server Metadata "role": JSON*
1594

    
1595
.. code-block:: javascript
1596

    
1597
  {"metadata": {"role": "gateway"}}
1598

    
1599
.. rubric:: Response
1600

    
1601
=========================== =====================
1602
Return Code                 Description
1603
=========================== =====================
1604
201 (OK)                    Request succeeded
1605
400 (Bad Request)           Invalid server ID or Malformed request
1606
401 (Unauthorized)          Missing or expired user token
1607
403 (Forbidden)             Administratively suspended server
1608
404 (Not Found)             Meta key not found
1609
413 (OverLimit)             Maximum number of metadata exceeded
1610
500 (Internal Server Error) The request cannot be completed because of an
1611
\                           internal error
1612
503 (Service Unavailable)   The server is not currently available
1613
=========================== ====================
1614

    
1615
Response body content::
1616

    
1617
  metadata: {<key>: <value>}
1618

    
1619
*Example Set or Update Server Metadata "role":"gateway": JSON*
1620

    
1621
.. code-block:: javascript
1622

    
1623
  {"metadata": {"role": "gateway"}}
1624

    
1625
Delete Server Metadata
1626
----------------------
1627

    
1628
Delete a metadata of a virtual server
1629

    
1630
.. rubric:: Request
1631

    
1632
======================================= ====== ======== ==========
1633
URI                                     Method Cyclades OS/Compute
1634
======================================= ====== ======== ==========
1635
``/servers/<server-id>/metadata/<key>`` DELETE ✔        ✔
1636
======================================= ====== ======== ==========
1637

    
1638
* **server-id** is the identifier of the virtual server
1639

    
1640
* **key** is the key of a mata ``key``:``value`` pair
1641

    
1642
|
1643

    
1644
==============  ========================= ======== ==========
1645
Request Header  Value                     Cyclades OS/Compute
1646
==============  ========================= ======== ==========
1647
X-Auth-Token    User authentication token required required
1648
==============  ========================= ======== ==========
1649

    
1650
.. note:: Request parameters should be empty
1651

    
1652
.. note:: Request body should be empty
1653

    
1654
.. rubric:: Response
1655

    
1656
=========================== =====================
1657
Return Code                 Description
1658
=========================== =====================
1659
204 (OK)                    Request succeeded
1660
400 (Bad Request)           Invalid server ID
1661
401 (Unauthorized)          Missing or expired user token
1662
403 (Forbidden)             Administratively suspended server
1663
404 (Not Found)             Metadata key not found
1664
500 (Internal Server Error) The request cannot be completed because of an
1665
\                           internal error
1666
503 (Service Unavailable)   The server is not currently available
1667
=========================== =====================
1668

    
1669
.. note:: In case of a 204 code, response body should be empty
1670

    
1671
Server Actions
1672
--------------
1673

    
1674
Actions are operations that are achieved through the same type of request
1675
(``POST``). There are differences in the implementations of some operations
1676
between Synnefo/Cyclades and OS/Compute. Although this document focuses on
1677
Synnefo/Cyclades, differences and similarities between the APIs are also
1678
briefed.
1679

    
1680
=============================================== ======== ==========
1681
Operations                                      Cyclades OS/Compute
1682
=============================================== ======== ==========
1683
`Start <#start-server>`_                        ✔        **✘**
1684
`Shutdown <#shutdown-server>`_                  ✔        **✘**
1685
`Reboot <#reboot-server>`_                      ✔        ✔
1686
`Get Console <#get-server-console>`_            ✔        **✘**
1687
`Set Firewall <#set-server-firewall-profile>`_  ✔        **✘**
1688
`Change Admin Password <#os-compute-specific>`_ **✘**    ✔
1689
`Rebuild <#os-compute-specific>`_               **✘**    ✔
1690
`Resize <#os-compute-specific>`_                **✘**    ✔
1691
`Confirm Resized <#os-compute-specific>`_       **✘**    ✔
1692
`Revert Resized <#os-compute-specific>`_        **✘**    ✔
1693
`Create Image <#os-compute-specific>`_          **✘**    ✔
1694
=============================================== ======== ==========
1695

    
1696
.. rubric:: Request
1697

    
1698
=============================== ====== ======== ==========
1699
URI                             Method Cyclades OS/Compute
1700
=============================== ====== ======== ==========
1701
``/servers/<server id>/action`` POST   ✔        ✔
1702
=============================== ====== ======== ==========
1703

    
1704
|
1705

    
1706
==============  ========================= ======== ==========
1707
Request Header  Value                     Cyclades OS/Compute
1708
==============  ========================= ======== ==========
1709
X-Auth-Token    User authentication token required required
1710
Content-Type    Type or request body      required required
1711
Content-Length  Length of request body    required required
1712
==============  ========================= ======== ==========
1713

    
1714
**Example Request Headers**::
1715

    
1716
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
1717
  Content-Type:   application/json
1718
  Content-Length: 32
1719

    
1720
.. note:: Request parameters should be empty
1721

    
1722
.. note:: Request body varies between operations (see bellow)
1723

    
1724
.. rubric:: Response
1725

    
1726
=========================== =====================
1727
Return Code                 Description
1728
=========================== =====================
1729
200 (OK)                    Request succeeded (for console operation)
1730
202 (OK)                    Request succeeded
1731
400 (Bad Request)           Invalid request or unknown action
1732
401 (Unauthorized)          Missing or expired user token
1733
403 (Forbidden)             User is not allowed to perform this operation
1734
500 (Internal Server Error) The request cannot be completed because of an
1735
\                           internal error
1736
503 (Service Unavailable)   The server is not currently available
1737
=========================== =====================
1738

    
1739
.. note:: Response body varies between operations (see bellow)
1740

    
1741
Start server
1742
................
1743

    
1744
This operation transitions a server from a STOPPED to an ACTIVE state.
1745

    
1746
Request body contents::
1747

    
1748
  start: {}
1749

    
1750
*Example Start Server: JSON*
1751

    
1752
.. code-block:: javascript
1753

    
1754
  {"start": {}}
1755

    
1756
.. note:: Response body should be empty
1757

    
1758
Reboot Server
1759
.............
1760

    
1761
This operation transitions a server from ``ACTIVE`` to ``REBOOT`` and then
1762
``ACTIVE`` again.
1763

    
1764
Synnefo and OS/Compute APIs offer two reboot modes: ``soft``
1765
and ``hard``. OS/Compute distinguishes between the two intermediate states
1766
(``REBOOT`` and ``HARD_REBOOT``) while rebooting, while Synnefo/Cyclades use
1767
only the ``REBOOT`` term. The expected behavior is the same, though.
1768

    
1769
Request body contents::
1770

    
1771
  reboot: {type: <reboot type>}
1772

    
1773
* **reboot type** can be either ``SOFT`` or ``HARD``.
1774

    
1775
*Example (soft) Reboot Server: JSON*
1776

    
1777
.. code-block:: javascript
1778

    
1779
  {"reboot" : { "type": "soft"}}
1780

    
1781
.. note:: Response body should be empty
1782

    
1783
Shutdown server
1784
...............
1785

    
1786
This operation transitions a server from an ACTIVE to a STOPPED state.
1787

    
1788
Request body contents::
1789

    
1790
  shutdown: {}
1791

    
1792
*Example Shutdown Server: JSON*
1793

    
1794
.. code-block:: javascript
1795

    
1796
  {"shutdown": {}}
1797

    
1798
.. note:: Response body should be empty
1799

    
1800
Get Server Console
1801
..................
1802

    
1803
.. note:: This operation is not part of OS/Compute API
1804

    
1805
The console operation arranges for an OOB console of the specified type. Only
1806
consoles of type ``vnc`` are supported for now. Cyclades server uses a running
1807
instance of vncauthproxy to setup proper VNC forwarding with a random password,
1808
then returns the necessary VNC connection info to the caller.
1809

    
1810
Request body contents::
1811

    
1812
  console: {type: vnc}
1813

    
1814
*Example Get Server Console: JSON*
1815

    
1816
.. code-block:: javascript
1817

    
1818
  {"console": {"type": "vnc" }
1819

    
1820
Response body contents::
1821

    
1822
  console: {
1823
    <vnc attribute>: <value>,
1824
    ...
1825
  }
1826

    
1827
============== ======================
1828
VNC Attributes Description
1829
============== ======================
1830
host           The vncprocy host
1831
port           vncprocy port
1832
password       Temporary password
1833
type           Connection type (only VNC)
1834
============== ======================
1835

    
1836
*Example Action Console Response: JSON*
1837

    
1838
.. code-block:: javascript
1839

    
1840
  {
1841
    "console": {
1842
      "type": "vnc",
1843
      "host": "vm42.example.org",
1844
      "port": 1234,
1845
      "password": "513NR14PN0T"
1846
    }
1847
  }
1848

    
1849
Set Server Firewall Profile
1850
...........................
1851

    
1852
The firewallProfile function sets a firewall profile for the public interface
1853
of a server.
1854

    
1855
Request body contents::
1856

    
1857
  firewallProfile: {profile: <firewall profile>, nic: <nic id>}
1858

    
1859
* **firewall profile** can be ``ENABLED``, ``DISABLED`` or ``PROTECTED``
1860

    
1861
*Example Action firewallProfile: JSON**
1862

    
1863
.. code-block:: javascript
1864

    
1865
  {"firewallProfile": {"profile": "ENABLED", "nic": 123}}
1866

    
1867
.. note:: Response body should be empty
1868

    
1869
OS/Compute Specific
1870
...................
1871

    
1872
The following operations are meaningless or not supported in the context of
1873
Synnefo/Cyclades, but are parts of the OS/Compute API:
1874

    
1875
* `Change Administrator Password <http://docs.openstack.org/api/openstack-compute/2/content/Change_Password-d1e3234.html>`_
1876
* `Rebuild Server <http://docs.openstack.org/api/openstack-compute/2/content/Rebuild_Server-d1e3538.html>`_
1877
* `Resize Server <http://docs.openstack.org/api/openstack-compute/2/content/Resize_Server-d1e3707.html>`_
1878
* `Confirm Resized Server <http://docs.openstack.org/api/openstack-compute/2/content/Confirm_Resized_Server-d1e3868.html>`_
1879
* `Revert Resized Server <http://docs.openstack.org/api/openstack-compute/2/content/Revert_Resized_Server-d1e4024.html>`_
1880
* `Create Image <http://docs.openstack.org/api/openstack-compute/2/content/Create_Image-d1e4655.html>`_
1881

    
1882
List Flavors
1883
------------
1884

    
1885
List the flavors that are accessible by the user
1886

    
1887
.. rubric:: Request
1888

    
1889
=================== ====== ======== ==========
1890
URI                 Method Cyclades OS/Compute
1891
=================== ====== ======== ==========
1892
``/flavors``        GET    ✔        ✔
1893
``/flavors/detail`` GET    ✔        ✔
1894
=================== ====== ======== ==========
1895

    
1896
|
1897
==============  ========================= ======== ==========
1898
Request Header  Value                     Cyclades OS/Compute
1899
==============  ========================= ======== ==========
1900
X-Auth-Token    User authentication token required required
1901
==============  ========================= ======== ==========
1902

    
1903
|
1904
================= ===============
1905
Request Parameter Value
1906
================= ===============
1907
json              Respond in json
1908
xml               Respond in xml
1909
================= ===============
1910

    
1911
.. note:: Request body should be empty
1912

    
1913
.. rubric:: Response
1914

    
1915
=========================== =====================
1916
Return Code                 Description
1917
=========================== =====================
1918
200 (OK)                    Request succeeded
1919
400 (Bad Request)           Malformed request
1920
401 (Unauthorized)          Missing or expired user token
1921
403 (Forbidden)             Forbidden to use this flavor
1922
500 (Internal Server Error) The request cannot be completed because of an
1923
\                           internal error
1924
503 (Service Unavailable)   The server is not currently available
1925
=========================== =====================
1926

    
1927
Response code contents::
1928

    
1929
  flavors: [
1930
    {
1931
      <flavor attribute>: <value>,
1932
      ...
1933
    },
1934
    ...
1935
  ]
1936

    
1937
Flavor attributes are `listed here <#flavor-ref>`_. Regular listing contains
1938
only ``id`` and ``name`` attributes.
1939

    
1940
*Example List Flavors (regular): JSON*
1941

    
1942
.. code-block:: javascript
1943

    
1944
  {
1945
    "flavors": [
1946
      {
1947
        "id": 1,
1948
        "name": "One code",
1949
        "links": [
1950
            {
1951
                "href": "https://example.org/compute/v2.0/flavors/1", 
1952
                "rel": "self"
1953
            }, 
1954
            {
1955
                "href": "https://example.org/compute/v2.0/flavors/1", 
1956
                "rel": "bookmark"
1957
            }
1958
        ]
1959
      }, {
1960
        "id": 3,
1961
        "name": "Four core",
1962
        "links": [
1963
            {
1964
                "href": "https://example.org/compute/v2.0/flavors/3", 
1965
                "rel": "self"
1966
            }, 
1967
            {
1968
                "href": "https://example.org/compute/v2.0/flavors/3", 
1969
                "rel": "bookmark"
1970
            }
1971
        ]
1972
      }
1973
    ]
1974
  }
1975

    
1976

    
1977
*Example List Flavors (regular): XML*
1978

    
1979
.. code-block:: xml
1980

    
1981
  <?xml version="1.0" encoding="UTF-8"?>
1982
  <flavors xmlns="http://docs.openstack.org/compute/api/v1"
1983
    xmlns:atom="http://www.w3.org/2005/Atom">
1984
    <flavor id="1" name="One core"/>
1985
    <flavor id="3" name="Four core"/>
1986
  </flavors>
1987

    
1988
*Example List Flavors (detail): JSON*
1989

    
1990
.. code-block:: javascript
1991

    
1992
  {
1993
    "flavors": [
1994
      {
1995
        "id": 1,
1996
        "name": "One core",
1997
        "ram": 1024,
1998
        "SNF:disk_template": "drbd",
1999
        "disk": 20,
2000
        "cpu": 1,
2001
        "links": [
2002
            {
2003
                "href": "https://example.org/compute/v2.0/flavors/1", 
2004
                "rel": "self"
2005
            }, 
2006
            {
2007
                "href": "https://example.org/compute/v2.0/flavors/1", 
2008
                "rel": "bookmark"
2009
            }
2010
        ]
2011
      }, {
2012
        "id": 3,
2013
        "name": "Four core",
2014
        "ram": 1024,
2015
        "SNF:disk_template": "drbd",
2016
        "disk": 40,
2017
        "cpu": 4,
2018
        "links": [
2019
            {
2020
                "href": "https://example.org/compute/v2.0/flavors/3", 
2021
                "rel": "self"
2022
            }, 
2023
            {
2024
                "href": "https://example.org/compute/v2.0/flavors/3", 
2025
                "rel": "bookmark"
2026
            }
2027
        ]
2028
      }
2029
    ]
2030
  }
2031

    
2032
Get Flavor Details
2033
------------------
2034

    
2035
Get the configuration of a specific flavor
2036

    
2037
.. rubric:: Request
2038

    
2039
======================= ====== ======== ==========
2040
URI                     Method Cyclades OS/Compute
2041
======================= ====== ======== ==========
2042
``/flavors/<flavor-id`` GET    ✔        ✔
2043
======================= ====== ======== ==========
2044

    
2045
* **flavor-id** is the identifier of the flavor
2046

    
2047
|
2048

    
2049
==============  ========================= ======== ==========
2050
Request Header  Value                     Cyclades OS/Compute
2051
==============  ========================= ======== ==========
2052
X-Auth-Token    User authentication token required required
2053
==============  ========================= ======== ==========
2054

    
2055
|
2056

    
2057
================= ===============
2058
Request Parameter Value
2059
================= ===============
2060
json              Respond in json
2061
xml               Respond in xml
2062
================= ===============
2063

    
2064
.. note:: Request body should be empty
2065

    
2066
.. rubric:: Response
2067

    
2068
=========================== =====================
2069
Return Code                 Description
2070
=========================== =====================
2071
200 (OK)                    Request succeeded
2072
400 (Bad Request)           Malformed flavor ID
2073
401 (Unauthorized)          Missing or expired user token
2074
403 (Forbidden)             Forbidden to use this flavor
2075
404 (Not Found)             Flavor id not founmd
2076
500 (Internal Server Error) The request cannot be completed because of an
2077
\                           internal error
2078
503 (Service Unavailable)   The server is not currently available
2079
=========================== =====================
2080

    
2081
Response code contents::
2082

    
2083
  flavor: {
2084
    <flavor attribute>: <value>,
2085
    ...
2086
  }
2087

    
2088
All flavor attributes are `listed here <#flavor-ref>`_.
2089

    
2090
*Example Flavor Details: JSON*
2091

    
2092
.. code-block:: javascript
2093

    
2094
  {
2095
    "flavor": {
2096
      {
2097
        "id": 1,
2098
        "name": "One core",
2099
        "ram": 1024,
2100
        "SNF:disk_template": "drbd",
2101
        "disk": 20,
2102
        "cpu": 1,
2103
        "links": [
2104
            {
2105
                "href": "https://example.org/compute/v2.0/flavors/1", 
2106
                "rel": "self"
2107
            }, 
2108
            {
2109
                "href": "https://example.org/compute/v2.0/flavors/1", 
2110
                "rel": "bookmark"
2111
            }
2112
        ]
2113
      }
2114
    }
2115
  }
2116

    
2117
*Example Flavor Details: XML*
2118

    
2119
.. code-block:: xml
2120

    
2121
  <?xml version="1.0" encoding="UTF-8"?>
2122
  <flavor xmlns="http://docs.openstack.org/compute/api/v1"
2123
    xmlns:atom="http://www.w3.org/2005/Atom"
2124
    id="1" name="One core" ram="1024" disk="20" cpu="1" />
2125

    
2126
List Images
2127
-----------
2128

    
2129
List all images accessible by the user
2130

    
2131
.. rubric:: Request
2132

    
2133
=================== ====== ======== ==========
2134
URI                 Method Cyclades OS/Compute
2135
=================== ====== ======== ==========
2136
``/images``        GET    ✔        ✔
2137
``/images/detail`` GET    ✔        ✔
2138
=================== ====== ======== ==========
2139

    
2140
|
2141

    
2142
==============  ========================= ======== ==========
2143
Request Header  Value                     Cyclades OS/Compute
2144
==============  ========================= ======== ==========
2145
X-Auth-Token    User authentication token required required
2146
==============  ========================= ======== ==========
2147

    
2148
|
2149

    
2150
================= ======================== ======== ==========
2151
Request Parameter Value                    Cyclades OS/Compute
2152
================= ======================== ======== ==========
2153
server            Server filter            **✘**    ✔
2154
name              Image name filter        **✘**    ✔
2155
status            Server status filter     **✘**    ✔
2156
changes-since     Change timestamp filter  ✔        ✔
2157
marker            Last list last ID filter **✘**    ✔
2158
limit             Page size filter         **✘**    ✔
2159
type              Request filter type      **✘**    ✔
2160
================= ======================== ======== ==========
2161

    
2162
* **changes-since** must be an ISO8601 date string. In Cyclades it refers to
2163
  the image ``updated_at`` attribute and it should be a date in the window
2164
  [- POLL_LIMIT ... now]. POLL_LIMIT default value is 3600 seconds except if it
2165
  is set otherwise at server side.
2166

    
2167
.. note:: Request body should be empty
2168

    
2169
.. rubric:: Response
2170

    
2171
=========================== =====================
2172
Return Code                 Description
2173
=========================== =====================
2174
200 (OK)                    Request succeeded
2175
304 (No images since date)  Can be returned if ``changes-since`` is given
2176
400 (Bad Request)           Invalid or malformed ``changes-since`` parameter
2177
401 (Unauthorized)          Missing or expired user token
2178
403 (Forbidden)             User is not allowed to perform this operation
2179
500 (Internal Server Error) The request cannot be completed because of an
2180
\                           internal error
2181
503 (Service Unavailable)   The server is not currently available
2182
=========================== =====================
2183

    
2184
Response body contents::
2185

    
2186
  images: [
2187
    {
2188
      <image attribute>: <value>,
2189
      ...
2190
      metadata: {
2191
        <image meta key>: <value>,
2192
        ...
2193
      },
2194
      ...
2195
    },
2196
    ...
2197
  ]
2198

    
2199
The regular response returns just ``id`` and ``name``, while the detail returns
2200
a collections of the `image attributes listed here <#image-ref>`_.
2201

    
2202
*Example List Image (detail): JSON*
2203

    
2204
.. code-block:: javascript
2205

    
2206
  {
2207
    "images: [
2208
      {
2209
        "status": "ACTIVE",
2210
        "updated": "2013-03-02T15:57:03+00:00",
2211
        "name": "edx_saas",
2212
        "created": "2013-03-02T12:21:00+00:00",
2213
        "progress": 100,
2214
        "id": "175716...526236",
2215
        "links": [
2216
          {
2217
            "href": "https://example.org/compute/v2.0/images/175716...526236", 
2218
            "rel": "self"
2219
          }, 
2220
          {
2221
            "href": "https://example.org/compute/v2.0/images/175716...526236", 
2222
            "rel": "bookmark"
2223
          }, 
2224
          {
2225
            "href": "https://example.org/image/v1.0/images/175716...526236", 
2226
            "rel": "alternate"
2227
          }
2228
        ],
2229
        "metadata": {
2230
          "partition_table": "msdos",
2231
          "osfamily": "linux",
2232
          "users": "root saasbook",
2233
          "exclude_task_changepassword": "yes",
2234
          "os": "ubuntu",
2235
          "root_partition": "1",
2236
          "description": "Ubuntu 12.04 LTS"
2237
        }
2238
      }, {
2239
        "status": "ACTIVE",
2240
        "updated": "2013-03-02T15:57:03+00:00",
2241
        "name": "edx_saas",
2242
        "created": "2013-03-02T12:21:00+00:00",
2243
        "progress": 100,
2244
        "id": "1357163d...c526206",
2245
        "links": [
2246
          {
2247
            "href": "https://example.org/compute/v2.0/images/1357163d...c526206", 
2248
            "rel": "self"
2249
          }, 
2250
          {
2251
            "href": "https://example.org/compute/v2.0/images/1357163d...c526206", 
2252
            "rel": "bookmark"
2253
          }, 
2254
          {
2255
            "href": "https://example.org/image/v1.0/images/1357163d...c526206", 
2256
            "rel": "alternate"
2257
          }
2258
        ],
2259
        "metadata": {
2260
          "partition_table": "msdos",
2261
          "osfamily": "windows",
2262
          "users": "Administratior",
2263
          "exclude_task_changepassword": "yes",
2264
          "os": "WinME",
2265
          "root_partition": "1",
2266
          "description": "Rerto Windows"
2267
        }
2268
      }
2269
    ]
2270
  }
2271

    
2272
Get Image Details
2273
-----------------
2274

    
2275
Get the details of a specific image
2276

    
2277
.. rubric:: Request
2278

    
2279
====================== ====== ======== ==========
2280
URI                    Method Cyclades OS/Compute
2281
====================== ====== ======== ==========
2282
``/images/<image-id>`` GET    ✔        ✔
2283
====================== ====== ======== ==========
2284

    
2285
* **image-id** is the identifier of the virtual image
2286

    
2287
|
2288

    
2289
==============  ========================= ======== ==========
2290
Request Header  Value                     Cyclades OS/Compute
2291
==============  ========================= ======== ==========
2292
X-Auth-Token    User authentication token required required
2293
==============  ========================= ======== ==========
2294

    
2295
.. note:: Request parameters should be empty
2296

    
2297
.. note:: Request body should be empty
2298

    
2299
.. rubric:: Response
2300

    
2301
=========================== =====================
2302
Return Code                 Description
2303
=========================== =====================
2304
200 (OK)                    Request succeeded
2305
400 (Bad Request)           Malformed image id
2306
401 (Unauthorized)          Missing or expired user token
2307
403 (Forbidden)             Not allowed to use this image
2308
404 (Not Found)             Image not found
2309
500 (Internal Server Error) The request cannot be completed because of an
2310
\                           internal error
2311
503 (Service Unavailable)   No available backends or service currently
2312
\                           unavailable
2313
=========================== =====================
2314

    
2315
Response body contents::
2316

    
2317
  image: {
2318
    <image attribute>: <value>,
2319
    ...
2320
    metadata: {
2321
      <image meta key>: <value>
2322
    }
2323
  }
2324

    
2325
Image attributes are `listed here <#image-ref>`_.
2326

    
2327
*Example Details for an image with id 6404619d-...-aef57eaff4af, in JSON*
2328

    
2329
.. code-block:: javascript
2330

    
2331
  {
2332
  "image": {
2333
    "id": "6404619d-...-aef57eaff4af",
2334
    "name": "FreeBSD",
2335
    "status": "ACTIVE",
2336
    "updated": "2013-04-24T12:06:02+00:00",
2337
    "created": "2013-04-24T11:52:16+00:00",
2338
    "progress": 100,
2339
    "links": [
2340
      {
2341
        "href": "https://example.org/compute/v2.0/images/6404619d-...-aef57eaff4af", 
2342
        "rel": "self"
2343
      }, 
2344
      {
2345
        "href": "https://example.org/compute/v2.0/images/6404619d-...-aef57eaff4af", 
2346
        "rel": "bookmark"
2347
      }, 
2348
      {
2349
        "href": "https://example.org/image/v1.0/images/6404619d-...-aef57eaff4af", 
2350
        "rel": "alternate"
2351
      }
2352
    ],
2353
    "metadata": {
2354
      "kernel": "9.1 RELEASE",
2355
      "osfamily": "freebsd",
2356
      "users": "root",
2357
      "gui": "No GUI",
2358
      "sortorder": "9",
2359
      "os": "freebsd",
2360
      "root_partition": "2",
2361
      "description": "FreeBSD 9"
2362
      }
2363
    }
2364
  }
2365

    
2366

    
2367
Delete Image
2368
------------
2369

    
2370
Delete an image, by changing its status from ``ACTIVE`` to ``DELETED``.
2371

    
2372
.. rubric:: Request
2373

    
2374
====================== ====== ======== ==========
2375
URI                    Method Cyclades OS/Compute
2376
====================== ====== ======== ==========
2377
``/images/<image id>`` DELETE ✔        ✔
2378
====================== ====== ======== ==========
2379

    
2380
* **image id** is the identifier of the image
2381

    
2382
|
2383

    
2384
==============  ========================= ======== ==========
2385
Request Header  Value                     Cyclades OS/Compute
2386
==============  ========================= ======== ==========
2387
X-Auth-Token    User authentication token required required
2388
==============  ========================= ======== ==========
2389

    
2390
.. note:: Request parameters should be empty
2391

    
2392
.. note:: Request body should be empty
2393

    
2394
.. rubric:: Response
2395

    
2396
=========================== =====================
2397
Return Code                 Description
2398
=========================== =====================
2399
204 (OK)                    Request succeeded
2400
400 (Bad Request)           Invalid request or image id
2401
401 (Unauthorized)          Missing or expired user token
2402
404 (Not Found)             Image not found
2403
500 (Internal Server Error) The request cannot be completed because of an
2404
\                           internal error
2405
503 (Service Unavailable)   Action not supported or service currently
2406
\                           unavailable
2407
=========================== =====================
2408

    
2409
.. note:: In case of a 204 code, request body should be empty
2410

    
2411
List Image Metadata
2412
-------------------
2413

    
2414
.. rubric:: Request
2415

    
2416
=============================== ====== ======== ==========
2417
URI                             Method Cyclades OS/Compute
2418
=============================== ====== ======== ==========
2419
``/images/<image-id>/metadata`` GET    ✔        ✔
2420
=============================== ====== ======== ==========
2421

    
2422
* **image-id** is the identifier of the virtual image
2423

    
2424
|
2425
==============  ========================= ======== ==========
2426
Request Header  Value                     Cyclades OS/Compute
2427
==============  ========================= ======== ==========
2428
X-Auth-Token    User authentication token required required
2429
==============  ========================= ======== ==========
2430

    
2431
.. note:: Request parameters should be empty
2432

    
2433
.. note:: Request body should be empty
2434

    
2435
.. rubric:: Response
2436

    
2437
=========================== =====================
2438
Return Code                 Description
2439
=========================== =====================
2440
201 (OK)                    Request succeeded
2441
400 (Bad Request)           Invalid image ID or Malformed request
2442
401 (Unauthorized)          Missing or expired user token
2443
403 (Forbidden)             Administratively suspended server
2444
404 (Not Found)             Server not found
2445
409 (Build In Progress)     The image is not ready yet
2446
500 (Internal Server Error) The request cannot be completed because of an
2447
\                           internal error
2448
503 (Service Unavailable)   The server is not currently available
2449
=========================== =====================
2450

    
2451
Response body content::
2452

    
2453
  metadata: {
2454
    <meta key>: <value>,
2455
  ...
2456
  }
2457

    
2458
*Example List Image Metadata: JSON*
2459

    
2460
.. code-block:: javascript
2461

    
2462
  {
2463
    "metadata": {
2464
      "partition_table": "msdos",
2465
      "kernel": "3.2.0",
2466
      "osfamily": "linux",
2467
      "users": "user",
2468
      "gui": "Unity 5",
2469
      "sortorder": "3",
2470
      "os": "ubuntu",
2471
      "root_partition": "1",
2472
      "description": "Ubuntu 12 LTS"
2473
    }
2474
  }
2475

    
2476
.. note:: In OS/Compute API  the ``values`` level is missing from the response.
2477

    
2478
Update Image Metadata
2479
---------------------
2480

    
2481
In Cyclades API, setting new metadata and updating the values of existing ones
2482
is achieved using one type of request (POST), while in OS/Compute API two
2483
different types are used (PUT and POST for
2484
`setting new <http://docs.openstack.org/api/openstack-compute/2/content/Create_or_Replace_Metadata-d1e5358.html>`_
2485
and
2486
`updating existing <http://docs.openstack.org/api/openstack-compute/2/content/Update_Metadata-d1e5208.html>`_
2487
metadata, respectively).
2488

    
2489
In Cyclades API, unmentioned metadata keys will remain intact, while metadata
2490
referred by the operation will be overwritten.
2491

    
2492
.. rubric:: Request
2493

    
2494
=============================== ====== ======== ==========
2495
URI                             Method Cyclades OS/Compute
2496
=============================== ====== ======== ==========
2497
``/images/<image-id>/metadata`` PUT    **✘**    ✔
2498
``/images/<image-id>/metadata`` POST   ✔        ✔
2499
=============================== ====== ======== ==========
2500

    
2501
* **image-id** is the identifier of the virtual image
2502

    
2503
|
2504
==============  ========================= ======== ==========
2505
Request Header  Value                     Cyclades OS/Compute
2506
==============  ========================= ======== ==========
2507
X-Auth-Token    User authentication token required required
2508
Content-Type    Type or request body      required required
2509
Content-Length  Length of request body    required required
2510
==============  ========================= ======== ==========
2511

    
2512
**Example Request Headers**::
2513

    
2514
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
2515
  Content-Type:   application/json
2516
  Content-Length: 52
2517

    
2518
.. note:: Request parameters should be empty
2519

    
2520
Request body content::
2521

    
2522
  metadata: {
2523
    <meta key>: <value>,
2524
    ...
2525
  }
2526

    
2527
*Example Update Image Metadata Request: JSON*
2528

    
2529
.. code-block:: javascript
2530

    
2531
  {"metadata": {"NewAttr": "NewVal", "os": "Xubuntu'}}
2532

    
2533
.. rubric:: Response
2534

    
2535
=========================== =====================
2536
Return Code                 Description
2537
=========================== =====================
2538
201 (OK)                    Request succeeded
2539
400 (Bad Request)           Malformed request or image id
2540
401 (Unauthorized)          Missing or expired user token
2541
403 (Forbidden)             Not allowed to modify this image
2542
404 (Not Found)             Image or meta key not found
2543
413 (OverLimit)             Maximum number of metadata exceeded
2544
500 (Internal Server Error) The request cannot be completed because of an
2545
\                           internal error
2546
503 (Service Unavailable)   The server is not currently available
2547
=========================== =====================
2548

    
2549
Response body content::
2550

    
2551
  metadata: {
2552
    <key>: <value>,
2553
    ...
2554
  }
2555

    
2556
*Example Update Image Response: JSON*
2557

    
2558
.. code-block:: javascript
2559

    
2560
  {
2561
    "metadata": {
2562
      "partition_table": "msdos",
2563
      "kernel": "3.2.0",
2564
      "osfamily": "linux",
2565
      "users": "user",
2566
      "gui": "Unity 5",
2567
      "sortorder": "3",
2568
      "os": "Xubuntu",
2569
      "root_partition": "1",
2570
      "description": "Ubuntu 12 LTS",
2571
      "NewAttr": "NewVal"
2572
    }
2573
  }
2574

    
2575
Get Image Metadata
2576
------------------
2577

    
2578
.. rubric:: Request
2579

    
2580
===================================== ====== ======== ==========
2581
URI                                   Method Cyclades OS/Compute
2582
===================================== ====== ======== ==========
2583
``/images/<image-id>/metadata/<key>`` GET    ✔        ✔
2584
===================================== ====== ======== ==========
2585

    
2586
* **image-id** is the identifier of the image
2587

    
2588
* **key** is the key of a mata ``key``:``value`` pair
2589

    
2590
|
2591

    
2592
==============  ========================= ======== ==========
2593
Request Header  Value                     Cyclades OS/Compute
2594
==============  ========================= ======== ==========
2595
X-Auth-Token    User authentication token required required
2596
==============  ========================= ======== ==========
2597

    
2598
.. note:: Request parameters should be empty
2599

    
2600
.. note:: Request body should be empty
2601

    
2602
.. rubric:: Response
2603

    
2604
=========================== =====================
2605
Return Code                 Description
2606
=========================== =====================
2607
200 (OK)                    Request succeeded
2608
400 (Bad Request)           Malformed request or image id
2609
401 (Unauthorized)          Missing or expired user token
2610
403 (Forbidden)             Not allowed to access this information
2611
404 (Not Found)             Meta key not found
2612
500 (Internal Server Error) The request cannot be completed because of an
2613
\                           internal error
2614
503 (Service Unavailable)   The server is not currently available
2615
=========================== =====================
2616

    
2617
Response body content::
2618

    
2619
  metadata: {<key>: <value>}
2620

    
2621
*Example Get Image Metadata Item: JSON*
2622

    
2623
.. code-block:: javascript
2624

    
2625
  {"metadata": {"os": "Xubuntu"}}
2626

    
2627
.. note:: In OS/Compute, ``metadata`` is ``meta``
2628

    
2629
Update Image Metadata
2630
---------------------
2631

    
2632
.. rubric:: Request
2633

    
2634
===================================== ====== ======== ==========
2635
URI                                   Method Cyclades OS/Compute
2636
===================================== ====== ======== ==========
2637
``/images/<image-id>/metadata/<key>`` PUT    ✔        ✔
2638
===================================== ====== ======== ==========
2639

    
2640
* **image-id** is the identifier of the image
2641

    
2642
* **key** is the key of a matadata ``key``:``value`` pair
2643

    
2644
|
2645

    
2646
==============  ========================= ======== ==========
2647
Request Header  Value                     Cyclades OS/Compute
2648
==============  ========================= ======== ==========
2649
X-Auth-Token    User authentication token required required
2650
Content-Type    Type or request body      required required
2651
Content-Length  Length of request body    required required
2652
==============  ========================= ======== ==========
2653

    
2654
**Example Request Headers**::
2655

    
2656
  X-Auth-Token:   z31uRXUn1LZy45p1r7V==
2657
  Content-Type:   application/json
2658
  Content-Length: 27
2659

    
2660
|
2661

    
2662
.. note:: Request parameters should be empty
2663

    
2664
Request body content::
2665

    
2666
  metadata: {<key>: <value>}
2667

    
2668
*Example Update Image Metadata Item Request: JSON*
2669

    
2670
.. code-block:: javascript
2671

    
2672
  {"metadata": {"os": "Kubuntu"}}
2673

    
2674
.. rubric:: Response
2675

    
2676
=========================== =====================
2677
Return Code                 Description
2678
=========================== =====================
2679
201 (OK)                    Request succeeded
2680
400 (Bad Request)           Malformed request or image id
2681
401 (Unauthorized)          Missing or expired user token
2682
403 (Forbidden)             Not allowed to modify this image
2683
404 (Not Found)             Metadata key not found
2684
413 (OverLimit)             Maximum number of metadata exceeded
2685
500 (Internal Server Error) The request cannot be completed because of an
2686
\                           internal error
2687
503 (Service Unavailable)   The server is not currently available
2688
=========================== =====================
2689

    
2690
Request body content::
2691

    
2692
  metadata: {<key>: <value>}
2693

    
2694
*Example Update Image Metadata Item Response: JSON*
2695

    
2696
.. code-block:: javascript
2697

    
2698
  {"metadata": {"os": "Kubuntu"}}
2699

    
2700
Delete Image Metadata
2701
---------------------
2702

    
2703
Delete an image metadata by its key.
2704

    
2705
.. rubric:: Request
2706

    
2707
===================================== ====== ======== ==========
2708
URI                                   Method Cyclades OS/Compute
2709
===================================== ====== ======== ==========
2710
``/images/<image-id>/metadata/<key>`` DELETE ✔        ✔
2711
===================================== ====== ======== ==========
2712

    
2713
* **image-id** is the identifier of the image
2714

    
2715
* **key** is the key of a mata ``key``:``value`` pair
2716

    
2717
|
2718
==============  ========================= ======== ==========
2719
Request Header  Value                     Cyclades OS/Compute
2720
==============  ========================= ======== ==========
2721
X-Auth-Token    User authentication token required required
2722
==============  ========================= ======== ==========
2723

    
2724
.. note:: Request parameters should be empty
2725

    
2726
.. note:: Request body should be empty
2727

    
2728
.. rubric:: Response
2729

    
2730
=========================== =====================
2731
Return Code                 Description
2732
=========================== =====================
2733
204 (OK)                    Request succeeded
2734
400 (Bad Request)           Malformed image ID
2735
401 (Unauthorized)          Missing or expired user token
2736
403 (Forbidden)             Not allowed to modify this image
2737
404 (Not Found)             Metadata key not found
2738
500 (Internal Server Error) The request cannot be completed because of an
2739
\                           internal error
2740
503 (Service Unavailable)   The server is not currently available
2741
=========================== =====================
2742

    
2743
.. note:: In case of a 204 code, the response body should be empty.
2744

    
2745
Index of Attributes
2746
-------------------
2747

    
2748
.. _server-ref:
2749

    
2750
Server Attributes
2751
.................
2752

    
2753
=================== ======== ==========
2754
Server attribute    Cyclades OS/Compute
2755
=================== ======== ==========
2756
id                  ✔        ✔
2757
name                ✔        ✔
2758
addresses           ✔        ✔
2759
links               ✔        ✔
2760
image               ✔        ✔
2761
flavor              ✔        ✔
2762
user_id             ✔        ✔
2763
tenant_id           ✔        ✔
2764
accessIPv4          ✔        ✔
2765
accessIPv6          ✔        ✔
2766
progress            ✔        ✔
2767
status              ✔        ✔
2768
updated             ✔        ✔
2769
hostId              ✔        ✔
2770
created             ✔        ✔
2771
adminPass           ✔        ✔
2772
metadata            ✔        ✔
2773
suspended           ✔        **✘**
2774
security_groups     ✔        **✘**
2775
attachments         ✔        **✘**
2776
config_drive        ✔        **✘**
2777
SNF:fqdn            ✔        **✘**
2778
key_name            ✔        **✘**
2779
SNF:port_forwarding ✔        **✘**
2780
SNF:task_state      ✔        **✘**
2781
diagnostics         ✔        **✘**
2782
deleted             ✔        **✘**
2783
=================== ======== ==========
2784

    
2785
* **addresses** Networks related to this server. All information in this field
2786
  is redundant, since it can be infered from the ``attachments`` field, but
2787
  it is used for compatibility with OS/Computet
2788

    
2789
* **user_id** The UUID of the owner of the virtual server
2790

    
2791
* **tenant_id** The UUID of the main project for this user
2792

    
2793
* *hostId*, **accessIPv4** and **accessIPv6** are always empty and are used for
2794
  compatibility with OS/Compute
2795

    
2796
* **progress** Shows the building progress of a virtual server. After the server
2797
  is built, it is always ``100``
2798

    
2799
* **status** values are described `here <#status-ref>`_
2800

    
2801
* **updated** and **created** are date-formated
2802

    
2803
* **adminPass** is shown only once (in ``create server`` response). This
2804
  information is not preserved in a clear text form, so it is not recoverable
2805

    
2806
* **suspended** is True only if the server is suspended by the cloud
2807
  administrations or policy
2808

    
2809
* **progress** is a number between 0 and 100 and reflects the server building
2810
  status
2811

    
2812
* **metadata** are custom key:value pairs. In Cyclades, the ``OS`` and
2813
  ``USERS`` metadata are automatically retrieved from the servers image during
2814
  creation
2815

    
2816
* **attachments** List of connection ports. Details `here <#attachments-ref>`_.
2817

    
2818
.. _status-ref:
2819

    
2820
Server Status
2821
.............
2822

    
2823
============= ==================== ======== ==========
2824
Status        Description          Cyclades OS/Compute
2825
============= ==================== ======== ==========
2826
BUILD         Building             ✔        ✔
2827
ACTIVE        Up and running       ✔        ✔
2828
STOPPED       Shut down            ✔        **✘**
2829
REBOOT        Rebooting            ✔        ✔
2830
DELETED       Removed              ✔        ✔
2831
UNKNOWN       Unexpected error     ✔        ✔
2832
ERROR         In error             ✔        ✔
2833
HARD_REBOOT   Hard rebooting       **✘**    ✔
2834
PASSWORD      Resetting password   **✘**    ✔
2835
REBUILD       Rebuilding server    **✘**    ✔
2836
RESCUE        In rescue mode       **✘**    ✔
2837
RESIZE        Resizing             **✘**    ✔
2838
REVERT_RESIZE Failed to resize     **✘**    ✔
2839
SHUTOFF       Shut down by user    **✘**    ✔
2840
SUSPENDED     Suspended            **✘**    ✔
2841
VERIFY_RESIZE Waiting confirmation **✘**    ✔
2842
============= ==================== ======== ==========
2843

    
2844
.. _attachments-ref:
2845

    
2846
Attachments (ports)
2847
...................
2848

    
2849
In Cyclades, a port connects a virtual server to a public or private network.
2850

    
2851
Ports can be handled separately through the Cyclades/Network API.
2852

    
2853
In a virtual server context, a port may contain the following information:
2854

    
2855
================= ======================
2856
Port Attributes    Description          
2857
================= ======================
2858
id                Port id            
2859
mac_address       NIC's mac address     
2860
network_id        Network ID
2861
OS-EXT-IPS:type   ``fixed`` or ``floating``
2862
firewallProfile   ``ENABLED``, ``DISABLED``, ``PROTECTED``
2863
ipv4              IP v4 address
2864
ipv6              IP v6 address
2865
================= ======================
2866

    
2867
* **ipv4** and **ipv6** are mutually exclusive in practice, since a port
2868
    either handles an IPv4, an IPv6, or none, but not both.
2869

    
2870
.. _flavor-ref:
2871

    
2872
Flavor
2873
......
2874

    
2875
A flavor is a hardware configuration for a server. It contains the following
2876
information:
2877

    
2878
================= ==================== ======== ==========
2879
Flavor Attributes Description          Cyclades OS/Compute
2880
================= ==================== ======== ==========
2881
id                The flavor id        ✔        ✔
2882
name              The flavor name      ✔        ✔
2883
ram               Server RAM size      ✔        ✔
2884
SNF:disk_template Storage mechanism    ✔        **✘**
2885
disk              Server disk size     ✔        ✔
2886
vcpus             # of Virtual CPUs    ✔        ✔
2887
links rel         Atom link rel field  **✘**    ✔
2888
links href        Atom link href field **✘**    ✔
2889
================= ==================== ======== ==========
2890

    
2891
* **id** is the flavor unique id (a possitive integer)
2892

    
2893
* **name** is the flavor name (a string)
2894

    
2895
* **ram** is the server RAM size in MB
2896

    
2897
* **SNF:disk_template** is a reference to the underlying storage mechanism
2898
  used by the Cyclades server. It is Cyclades specific.
2899

    
2900
* **disk** the servers disk size in GB
2901

    
2902
* **vcpus** refer to the number of virtual CPUs assigned to a server
2903

    
2904
* **link ref** and **link href** refer to the Atom link attributes that are
2905
  `used in OS/Compute API <http://docs.openstack.org/api/openstack-compute/2/content/List_Flavors-d1e4188.html>`_.
2906

    
2907
.. _image-ref:
2908

    
2909
Image
2910
.....
2911

    
2912
An image is a collection of files you use to create or rebuild a server.
2913

    
2914
An image item may have the fields presented bellow:
2915

    
2916
================ ====================== ======== ==========
2917
Image Attributes Description            Cyclades OS/Compute
2918
================ ====================== ======== ==========
2919
id               Image ID               ✔        ✔
2920
name             Image name             ✔        ✔
2921
updated          Last update date       ✔        ✔
2922
created          Image creation date    ✔        ✔
2923
progress         Ready status progress  ✔        **✘**
2924
status           Image status           **✘**    ✔
2925
tenant_id        Image creator          **✘**    ✔
2926
user_id          Image users            **✘**    ✔
2927
metadata         Custom metadata        ✔        ✔
2928
links            Atom links             **✘**    ✔
2929
minDisk          Minimum required disk  **✘**    ✔
2930
minRam           Minimum required RAM   **✘**    ✔
2931
================ ====================== ======== ==========
2932

    
2933
* **id** is the image id and **name** is the image name. They are both strings.
2934

    
2935
* **updated** and **created** are both ISO8601 date strings
2936

    
2937
* **progress** varies between 0 and 100 and denotes the status of the image
2938

    
2939
* **metadata** is a collection of ``key``:``values`` pairs of custom metadata,
2940
  under the tag ``values`` which lies under the tag ``metadata``.
2941

    
2942
.. note:: in OS/Compute, the ``values`` layer is missing