Revision 394f5d2a docs/image-api-guide.rst

b/docs/image-api-guide.rst
132 132
::
133 133

  
134 134
    [{
135
        "status": "available", 
136
        "name": "ubuntu", 
137
        "disk_format": "diskdump", 
138
        "container_format": "bare", 
139
        "id": "5583ffe1-5273-4c84-9e32-2fbe476bd7b7", 
135
        "status": "available",
136
        "name": "ubuntu",
137
        "disk_format": "diskdump",
138
        "container_format": "bare",
139
        "id": "5583ffe1-5273-4c84-9e32-2fbe476bd7b7",
140 140
        "size": 2622562304
141 141
    }, {
142
        "status": "available", 
143
        "name": "Ubuntu-10.04", 
144
        "disk_format": "diskdump", 
145
        "container_format": "bare", 
146
        "id": "907ef618-c03a-4473-9914-9348e12890c1", 
142
        "status": "available",
143
        "name": "Ubuntu-10.04",
144
        "disk_format": "diskdump",
145
        "container_format": "bare",
146
        "id": "907ef618-c03a-4473-9914-9348e12890c1",
147 147
        "size": 761368576
148 148
    }]
149 149

  
......
194 194
Example Image response::
195 195

  
196 196
    [{
197
        "status": "available", 
197
        "status": "available",
198 198
        "location": "pithos://u53r-1d/images/my/path/example_image_build.diskdump"
199
        "name": "ubuntu", 
200
        "disk_format": "diskdump", 
201
        "container_format": "bare", 
199
        "name": "ubuntu",
200
        "disk_format": "diskdump",
201
        "container_format": "bare",
202 202
        "created_at": "2013-03-29 14:14:34",
203 203
        "deleted_at": "",
204 204
        "id": "5583ffe1-5273-4c84-9e32-2fbe476bd7b7",
......
206 206
        "is_public": "True",
207 207
        "checksum": "a387aaaae583bc65daacf12d6be502bd7cfbbb254dcd452f92ca31f4c06a9208",
208 208
        "properties": {
209
            "partition_table": "msdos", 
210
            "kernel": "3.8.3", 
211
            "osfamily": "linux", 
212
            "users": "root user", 
213
            "gui": "GNOME 3.4.2", 
214
            "sortorder": "5", 
215
            "os": "fedora", 
216
            "root_partition": "1", 
209
            "partition_table": "msdos",
210
            "kernel": "3.8.3",
211
            "osfamily": "linux",
212
            "users": "root user",
213
            "gui": "GNOME 3.4.2",
214
            "sortorder": "5",
215
            "os": "fedora",
216
            "root_partition": "1",
217 217
            "description": "Fedora release 17 (Beefy Miracle)"}
218 218
    }, {
219 219
        "location": "pithos://0th3r-u53r-1d/images/ubuntu_10_04.diskdump"
220
        "status": "available", 
221
        "name": "Ubuntu-10.04", 
222
        "disk_format": "diskdump", 
223
        "container_format": "bare", 
224
        "id": "907ef618-c03a-4473-9914-9348e12890c1", 
220
        "status": "available",
221
        "name": "Ubuntu-10.04",
222
        "disk_format": "diskdump",
223
        "container_format": "bare",
224
        "id": "907ef618-c03a-4473-9914-9348e12890c1",
225 225
        "size": 761368576
226 226
        "created_at": "2013-03-29 14:14:34",
227 227
        "deleted_at": ""
......
232 232

  
233 233
According to the Synnefo approach, this request performs two operations:
234 234

  
235
* registers a new image to Cyclades/Image 
235
* registers a new image to Cyclades/Image
236 236
* commits metadata for the new image
237 237
* update the metadata of an existing image
238 238

  
......
272 272
x-image-meta-Min-Ram          Minimum ram required (MB) **✘**     ✔
273 273
x-image-meta-Min-Disk         Maximum ram required (MB) **✘**     ✔
274 274
X-Image-Meta-Owner            Image owner               ✔         ✔
275
X-Image-Meta-Property-*       Property prefix           ✔         ✔         
275
X-Image-Meta-Property-*       Property prefix           ✔         ✔
276 276
============================= ========================= ========  ========
277 277

  
278 278
**X-Meta-Location** format is described at :ref:`location-ref`
......
300 300
Return Code                 Description
301 301
=========================== =====================
302 302
200 (OK)                    The request succeeded
303
400 (Bad Request)           
303
400 (Bad Request)
304 304
\                           No name header
305 305
\                           Illegal header value
306
\                           File not found on given location
307 306
\                           Invalid size or checksum
308 307
401 (Unauthorized)          Missing or expired user token
308
404 (Not Found)             File not found on given location
309 309
500 (Internal Server Error) The request cannot be completed because of an internal error
310 310
501 (Not Implemented)       Location header is empty or omitted
311 311
=========================== =====================
......
356 356
|
357 357

  
358 358
============================= =========================
359
Request Header Name           Value                    
359
Request Header Name           Value
360 360
============================= =========================
361 361
X-Auth-Token                  User authentication token
362
X-Image-Meta-Name             New image name           
363
X-Image-Meta-Disk-Format      New disk format          
364
X-Image-Meta-Container-Format New container format     
365
X-Image-Meta-Status           New image status         
366
X-Image-Meta-Is-Public        (un)publish the image    
367
X-Image-Meta-Owner            Set an owner             
368
X-Image-Meta-Property-*       Add / modify properties  
362
X-Image-Meta-Name             New image name
363
X-Image-Meta-Disk-Format      New disk format
364
X-Image-Meta-Container-Format New container format
365
X-Image-Meta-Status           New image status
366
X-Image-Meta-Is-Public        (un)publish the image
367
X-Image-Meta-Owner            Set an owner
368
X-Image-Meta-Property-*       Add / modify properties
369 369
============================= =========================
370 370

  
371 371
**X-Image-Meta-Disk-Format** values are listed at :ref:`disk-format-ref`
......
390 390
Return Code                 Description
391 391
=========================== =====================
392 392
200 (OK)                    The request succeeded
393
400 (Bad Request)           
393
400 (Bad Request)
394 394
\                           Illegal header value
395 395
\                           Invalid size or checksum
396 396
401 (Unauthorized)          Missing or expired user token
......
404 404
The following is received when the response code is 200:
405 405

  
406 406
============================= =====================
407
Response Header               Description          
407
Response Header               Description
408 408
============================= =====================
409
X-Image-Meta-Id               Unique img id        
410
X-Image-Meta-Name             Img name             
411
X-Image-Meta-Disk-Format      Disk format          
412
X-Image-Meta-Container-Format Container format     
413
X-Image-Meta-Size             Img file size        
409
X-Image-Meta-Id               Unique img id
410
X-Image-Meta-Name             Img name
411
X-Image-Meta-Disk-Format      Disk format
412
X-Image-Meta-Container-Format Container format
413
X-Image-Meta-Size             Img file size
414 414
X-Image-Meta-Checksum         Img file MD5 checksum
415 415
X-Image-Meta-Location         Pithos file location
416
X-Image-Meta-Created-At       Date of img creation 
417
X-Image-Meta-Deleted-At       Date of img deletion 
418
X-Image-Meta-Status           Img status           
416
X-Image-Meta-Created-At       Date of img creation
417
X-Image-Meta-Deleted-At       Date of img deletion
418
X-Image-Meta-Status           Img status
419 419
X-Image-Meta-Is-Public        True if img is public
420
X-Image-Meta-Owner            Img owner or tentant 
420
X-Image-Meta-Owner            Img owner or tentant
421 421
X-Image-Meta-Property-*       Custom img properties
422 422
============================= =====================
423 423

  
......
522 522
    x-image-meta-checksum: d0f28e4d72927c90eadf30917d94d0156781fe1351ed16402b538316d404
523 523
    x-image-meta-created-at: 2013-02-26 12:04:31
524 524
    x-image-meta-updated-at: 2013-02-26 12:05:28
525
    x-image-meta-deleted-at: 
525
    x-image-meta-deleted-at:
526 526
    x-image-meta-status: available
527 527
    x-image-meta-is-public: True
528 528
    x-image-meta-owner: 25cced7-bd53-4145-91ee-cf4737e9fb2

Also available in: Unified diff