Revision 9c16855e docs/plankton-api-guide.rst

b/docs/plankton-api-guide.rst
58 58

  
59 59
Image ReST API
60 60
--------------
61

  
62
===================================== ====== ================================================ ======== ======
63
URI                                   Method Description                                      Plankton Glance
64
===================================== ====== ================================================ ======== ======
65
``/images``                           GET    `List Available Images <#id2>`_                  ✔        ✔
66
``/images``                           POST   `Add or update an Image <#id3>`_                 ✔        ✔
67
``/images``                           PUT    `Update an Image <#id4>`_                        ✔        ✔
68
``/images/detail``                    GET    `List Available Images in Detail <#id5>`_        ✔        ✔
69
``/images/<img-id>``                  HEAD   `Retrieve Image Metadata <#id6>`_                ✔        ✔
70
``/images/<img-id>``                  GET    `Retrieve Raw Image Data <#id7>`_                **✘**    ✔
71
``/images/<img-id>/members``          GET    `List Image Memberships <#id8>`_                 ✔        ✔
72
``/images/<img-id>/members``          PUT    `Replace a Membership List for an Image <#id9>`_ ✔        ✔
73
``/images/<img-id>/members/<member>`` PUT    `Add a Member to an Image <#id10>`_              ✔        ✔
74
``/images/<img-id>/members/<member>`` DELETE `Remove a Member from an Image <#id11>`_         ✔        ✔
75
``/shared-images/<member>``           GET    `List Shared Images <#id12>`_                    ✔        ✔
76
===================================== ====== ================================================ ======== ======
61
================================================ ===================================== ====== ======== ======
62
Description                                      URI                                   Method Plankton Glance
63
================================================ ===================================== ====== ======== ======
64
`List Available Images <#id2>`_                  ``/images``                           GET    ✔        ✔
65
`Add or update an Image <#id3>`_                 ``/images``                           POST   ✔        ✔
66
`Update an Image <#id5>`_                        ``/images``                           PUT    ✔        **✘**
67
`List Available Images in Detail <#id6>`_        ``/images/detail``                    GET    ✔        ✔
68
`Retrieve Image Metadata <#id7>`_                ``/images/<img-id>``                  HEAD   ✔        ✔
69
`Retrieve Raw Image Data <#id8>`_                ``/images/<img-id>``                  GET    **✘**    ✔
70
`List Image Memberships <#id9>`_                 ``/images/<img-id>/members``          GET    ✔        ✔
71
`Replace a Membership List of an Image <#id10>`_ ``/images/<img-id>/members``          PUT    ✔        ✔
72
`Add a Member to an Image <#id11>`_              ``/images/<img-id>/members/<member>`` PUT    ✔        ✔
73
`Remove a Member from an Image <#id12>`_         ``/images/<img-id>/members/<member>`` DELETE ✔        ✔
74
`List Shared Images <#id13>`_                    ``/shared-images/<member>``           GET    ✔        ✔
75
================================================ ===================================== ====== ======== ======
77 76

  
78 77
Authentication
79 78
--------------
......
92 91
* shared to  user by others
93 92
* public
94 93

  
95
===================================== ====== ===================== ======== ======
96
URI                                   Method Description           Plankton Glance
97
===================================== ====== ===================== ======== ======
98
``/images``                           GET    List Available Images ✔        ✔
99
===================================== ====== ===================== ======== ======
94
===================== =========== ====== ======== ======
95
Description           URI         Method Plankton Glance
96
===================== =========== ====== ======== ======
97
List Available Images ``/images`` GET    ✔        ✔
98
===================== =========== ====== ======== ======
100 99

  
101 100
|
102 101

  
......
193 192

  
194 193
According to the OpenStack approach, this request performs the first two functionalities by uploading the the image data and metadata to Glance. In Glance, the update mechanism is not implemented with this specific request.
195 194

  
196
===================================== ====== ===================== ======== ======
197
URI                                   Method Description           Plankton Glance
198
===================================== ====== ===================== ======== ======
199
``/images``                           POST   Add / Update an image ✔        ✔
200
===================================== ====== ===================== ======== ======
195
===================== =========== ====== ======== ======
196
Description           URI         Method Plankton Glance
197
===================== =========== ====== ======== ======
198
Add / update an image ``/images`` POST   ✔        ✔
199
===================== =========== ====== ======== ======
201 200

  
202 201
|
203 202

  
......
229 228

  
230 229
The terms unique-user-id (uuid), container and object-path are used as defined in `Pithos <pithos.html>`_ context.
231 230

  
231
|
232

  
232 233
======================= ========  ======
233 234
X-Image-Meta-Id         Plankton  Glance
234 235
======================= ========  ======
......
260 261
    X-Image-Meta-Property-OS: Debian Linux
261 262
    X-Image-Meta-Property-Users: Root
262 263

  
264
|
265

  
263 266
=========================== =====================
264 267
Return Code                 Description
265 268
=========================== =====================
......
274 277
501 (Not Implemented)       Location header is empty or omitted
275 278
=========================== =====================
276 279

  
280
|
281

  
277 282
The following is used when the response code is 200:
278 283

  
279 284
============================= ===================== ======== ======
......
297 302
Update an Image
298 303
---------------
299 304

  
300
Lili
305
In Plankton, the ReST API desctiption details above not only cover addition of new images, but also updating an existing one. An image is identified by its location at the Pithos server (X-Image-Meta-Location). For example, to alter the name of an image, add an image with the same X-Image-Meta-Location header but a different X-Image-Meta-Name header. An update overwrites the old values. An omission of a header option is equivalent to the removal of the corresponding property or metadata from the image, provided it is allowed for an image to exist without this specific metadatum.
306

  
307
Glance manages image updates by compining *PUT* with semantics similar to *POST* for the same URI. Check the `Glance documentation <http://docs.openstack.org/developer/glance/glanceapi.html#update-an-image>`_ for more details on Glance implementation.
301 308

  
302 309
List Available Images in Detail
303 310
-------------------------------

Also available in: Unified diff