Revision 0e214bbe docs/cyclades-api-guide.rst

b/docs/cyclades-api-guide.rst
171 171
=========================== =====================
172 172

  
173 173

  
174
The response data format is a list of servers, under the ``servers`` label. A server may have the fields presented bellow (only *id* and *name* if not a detail request)
175

  
176
================== ====================== ======== ==========
177
Response Parameter Description            Cyclades OS Compute
178
================== ====================== ======== ==========
179
id                 The server id          ✔        ✔
180
name               The server name        ✔        ✔
181
hostId             Server playground      empty    ✔
182
created            Creation date          ✔        ✔
183
updated            Creation date          ✔        ✔
184
flavorRef          The flavor id          ✔        **✘**
185
flavor             The flavor id          **✘**    ✔
186
imageRef           The image id           ✔        **✘**
187
image              The image id           **✘**    ✔
188
progress           Build progress         ✔        ✔
189
status             Server status          ✔        ✔
190
attachments        Network interfaces     ✔        **✘**
191
addresses          Network interfaces     **✘**    ✔
192
metadata           Server custom metadata ✔        ✔
193
================== ====================== ======== ==========
174
The response data format is a list of servers under the ``servers`` label. A server may have the fields presented bellow:
175

  
176
================= ====================== ======== ==========
177
Server Attributes Description            Cyclades OS Compute
178
================= ====================== ======== ==========
179
id                The server id          ✔        ✔
180
name              The server name        ✔        ✔
181
hostId            Server playground      empty    ✔
182
created           Creation date          ✔        ✔
183
updated           Creation date          ✔        ✔
184
flavorRef         The flavor id          ✔        **✘**
185
flavor            The flavor id          **✘**    ✔
186
imageRef          The image id           ✔        **✘**
187
image             The image id           **✘**    ✔
188
progress          Build progress         ✔        ✔
189
status            Server status          ✔        ✔
190
attachments       Network interfaces     ✔        **✘**
191
addresses         Network interfaces     **✘**    ✔
192
metadata          Server custom metadata ✔        ✔
193
================= ====================== ======== ==========
194 194

  
195 195
* **hostId** is not used in Cyclades, but is returned as an empty string for compatibility
196 196

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

  
200 200

  
201
* **status** referes to the status of the server
202

  
203
============= ==================== ======== ==========
204
Status        Description          Cyclades OS Compute
205
============= ==================== ======== ==========
206
BUILD         Building             ✔        ✔
207
ACTIVE        Up and running       ✔        ✔
208
STOPPED       Shut down            ✔        **✘**
209
REBOOT        Rebooting            ✔        ✔
210
DELETED       Removed              ✔        ✔
211
UNKNOWN       Unexpected error     ✔        ✔
212
ERROR         In error             ✔        ✔
213
HARD_REBOOT   Hard rebooting       **✘**    ✔
214
PASSWORD      Resetting password   **✘**    ✔
215
REBUILD       Rebuilding server    **✘**    ✔
216
RESCUE        In rescue mode       **✘**    ✔
217
RESIZE        Resizing             **✘**    ✔
218
REVERT_RESIZE Failed to resize     **✘**    ✔
219
SHUTOFF       Shut down by user    **✘**    ✔
220
SUSPENDED     Suspended            **✘**    ✔
221
VERIFY_RESIZE Waiting confirmation **✘**    ✔
222
============= ==================== ======== ==========
223

  
224
|
201
* **status** refers to `the status <#status_ref>`_ of the server
225 202

  
226 203
* **metadata** are custom key:value pairs used to specify various attributes of the VM (e.g. OS, super user, etc.)
227 204

  
......
299 276
  }
300 277

  
301 278

  
279
Create Server
280
.............
281

  
282
=================== ====== ======== ==========
283
URI                 Method Cyclades OS Compute
284
=================== ====== ======== ==========
285
``/servers``        POST   ✔        ✔
286
=================== ====== ======== ==========
287

  
288
|
289

  
290
================= ===============
291
Request Parameter Value          
292
================= ===============
293
json              Respond in json
294
xml               Respond in xml 
295
================= ===============
296

  
297
|
298

  
299
==============  ========================= ======== ==========
300
Request Header  Value                     Cyclades OS Compute
301
==============  ========================= ======== ==========
302
X-Auth-Token    User authentication token required required
303
==============  ========================= ======== ==========
304

  
305
The request body is json formated. It consists of a ``server`` tag over the following attributes:
306

  
307
=========== ==================== ======== ==========
308
Name        Description          Cyclades OS Compute
309
=========== ==================== ======== ==========
310
name        The server name      ✔        ✔
311
imageRef    Image id             ✔        ✔
312
flavorRef   Resources flavor     ✔        ✔
313
personality Personality contents ✔        ✔
314
metadata    Custom metadata      ✔        ✔
315
=========== ==================== ======== ==========
316

  
317
* **name** can be any string
318

  
319
* **imageRed** and **flavorRed** should refer to existing images and hardware flavors accessible by the user
320

  
321
* **metadata** are key:value pairs of custom server-specific metadata. There are no semantic limitations.
322

  
323
* **personality** (optional) is a list of personality injections. A personality injection is a small set of changes to a virtual server. Each change modifies a file on the virtual server, by injecting some data in it. The injected data (``content``) should exceed 10240 *bytes* in size and must be base64 encoded. A personality injection contains the following attributes:
324

  
325
======== =================== ======== ==========
326
Name     Description         Cyclades OS Compute
327
======== =================== ======== ==========
328
path     File path on server ✔        ✔
329
contents Data to inject      ✔        ✔
330
group    User group          ✔        **✘**
331
mode     File access mode    ✔        **✘**
332
owner    File owner          ✔        **✘**
333
======== =================== ======== ==========
334

  
335
|
336

  
337
=========================== =====================
338
Return Code                 Description
339
=========================== =====================
340
200 (OK)                    Request succeeded
341
400 (Bad Request)           Malformed request data
342
401 (Unauthorized)          Missing or expired user token
343
403 (Forbidden)             User is not allowed to perform this operation
344
404 (Not Found)             Image or Flavor not found
345
413 (Over Limit)            Exceeded some resource limit (#VMs, personality size, etc.) 
346
415 (Bad Media Type)        
347
500 (Internal Server Error) The request cannot be completed because of an internal error
348
503 (Service Unavailable)   No available backends or service currently unavailable
349
=========================== =====================
350

  
351
|
352

  
353
In case of a 200 return code, the Response Data are json-formated and consist of a `list of attributes <#server-ref>`_ under the ``server`` tag:
354

  
355
For example::
356

  
357
  {"server": {
358
    "id": 28130
359
    "status": "BUILD",
360
    "updated": "2013-04-10T13:52:18.140686+00:00",
361
    "hostId": "",
362
    "name": "My Server Name: Example Name",
363
    "imageRef": "da7a211f-1db5-444a-938b-f901ce81a3e6",
364
    "created": "2013-04-10T13:52:17.085402+00:00",
365
    "flavorRef": 289,
366
    "adminPass": "fKCqlZe2at",
367
    "suspended": false,
368
    "progress": 0,
369
  }}
370

  
302 371
Get Server Stats
303 372
................
304 373

  
......
807 876
  }
808 877

  
809 878
This operation does not contain a response body.
879

  
880
Index of details
881
----------------
882

  
883
.. _server-ref:
884

  
885
Server Attributes
886
.................
887

  
888
================ ========================== ======== ==========
889
Server attribute Description                Cyclades OS Compute
890
================ ========================== ======== ==========
891
id               Server ID                  ✔        ✔
892
name             Server Name                ✔        ✔
893
status           Server Status              ✔        ✔
894
updated          Date of last modification  ✔        ✔
895
created          Date of creation           ✔        ✔
896
hostId           Physical host              empty    ✔
897
imageRef         Image ID                   ✔        **✘**
898
image            A full image descreption   **✘**    ✔
899
flavorRef        Flavor ID                  ✔        **✘**
900
flavor           A full flavor description  **✘**    ✔
901
adminPass        Superuser Password         ✔        ✔
902
suspended        If server is suspended     ✔        ✔
903
progress         Build progress             ✔        ✔
904
metadata         Custom server metadata     ✔        ✔
905
user_id          Server owner               **✘**    ✔
906
tenant_id        Server tenant              **✘**    ✔
907
accessIPv4       Server IPV4 net address    **✘**    ✔
908
accessIPv6       Server IPV4 net address    **✘**    ✔
909
addresses        Nets connected on server   **✘**    ✔
910
links            Server links               **✘**    ✔
911
================ ========================== ======== ==========
912

  
913
* **status** values are described `here <status-ref>`_
914

  
915
* **updated** and **created** are date-formated
916

  
917
* **hostId** is always empty in Cyclades and is returned for compatibility reasons
918

  
919
* **imageRef** and **flavorRef** always refer to existing Image and Flavor specifications. Cyclades improved the OpenStack approach by using references to Image and Flavor attributes, instead of listing their full properties
920

  
921
* **adminPass** in Cyclades it is generated automatically during creation. For safety, it is not stored anywhere in the system and it cannot be recovered with a query request
922

  
923
* **suspended** is True only of the server is suspended by the cloud administrations or policy
924

  
925
* **progress** is a number between 0 and 100 and reflects the server building status
926

  
927
* **metadata** are custom key:value pairs refering to the VM. In Cyclades, the ``OS`` and ``users`` metadata are automatically retrieved from the servers image during creation
928

  
929
.. _status-ref:
930

  
931
Server Status
932
.............
933

  
934
============= ==================== ======== ==========
935
Status        Description          Cyclades OS Compute
936
============= ==================== ======== ==========
937
BUILD         Building             ✔        ✔
938
ACTIVE        Up and running       ✔        ✔
939
STOPPED       Shut down            ✔        **✘**
940
REBOOT        Rebooting            ✔        ✔
941
DELETED       Removed              ✔        ✔
942
UNKNOWN       Unexpected error     ✔        ✔
943
ERROR         In error             ✔        ✔
944
HARD_REBOOT   Hard rebooting       **✘**    ✔
945
PASSWORD      Resetting password   **✘**    ✔
946
REBUILD       Rebuilding server    **✘**    ✔
947
RESCUE        In rescue mode       **✘**    ✔
948
RESIZE        Resizing             **✘**    ✔
949
REVERT_RESIZE Failed to resize     **✘**    ✔
950
SHUTOFF       Shut down by user    **✘**    ✔
951
SUSPENDED     Suspended            **✘**    ✔
952
VERIFY_RESIZE Waiting confirmation **✘**    ✔
953
============= ==================== ======== ==========

Also available in: Unified diff