Statistics
| Branch: | Tag: | Revision:

root / docs / plankton-api-guide.rst @ 3458183d

History | View | Annotate | Download (35.1 kB)

1 301294a9 Constantinos Venetsanopoulos
.. _plankton-api-guide:
2 1837aa54 Giorgos Verigakis
3 1837aa54 Giorgos Verigakis
Plankton API Guide
4 167ac7d0 Stavros Sachtouris
==================
5 1837aa54 Giorgos Verigakis
6 167ac7d0 Stavros Sachtouris
Introduction
7 167ac7d0 Stavros Sachtouris
------------
8 167ac7d0 Stavros Sachtouris
9 1076ce55 Stavros Sachtouris
Plankton is an image service implemented by `GRNET <http://www.grnet.gr>`_ as part of the `Synnefo <http://www.synnefo.org>`_ cloud software, and implements an extension of the `OpenStack Image API <http://docs.openstack.org/api/openstack-image-service/1.1/content/>`_. To take full advantage of the Plankton infrastructure, client software should be aware of the extensions that differentiate Plankton from OOSs `Glance <http://docs.openstack.org/developer/glance/glanceapi.html>`_.
10 1076ce55 Stavros Sachtouris
11 1076ce55 Stavros Sachtouris
This document's goals are:
12 1076ce55 Stavros Sachtouris
13 1076ce55 Stavros Sachtouris
* Define the Plankton ReST API
14 1076ce55 Stavros Sachtouris
* Clarify the differences between Plankton and Glance
15 1076ce55 Stavros Sachtouris
16 1076ce55 Stavros Sachtouris
Image ReST API
17 1076ce55 Stavros Sachtouris
--------------
18 74b27be4 Stavros Sachtouris
========================================= ===================================== ====== ======== ======
19 74b27be4 Stavros Sachtouris
Description                               URI                                   Method Plankton Glance
20 74b27be4 Stavros Sachtouris
========================================= ===================================== ====== ======== ======
21 74b27be4 Stavros Sachtouris
`List Available Images <#id2>`_           ``/images``                           GET    ✔        ✔
22 74b27be4 Stavros Sachtouris
`List Available Images in Detail <#id3>`_ ``/images/detail``                    GET    ✔        ✔
23 74b27be4 Stavros Sachtouris
`Add or update an Image <#id6>`_          ``/images``                           POST   ✔        ✔
24 74b27be4 Stavros Sachtouris
`Update an Image <#id9>`_                 ``/images``                           PUT    **✘**    ✔
25 74b27be4 Stavros Sachtouris
\                                         ``/images/<img-id>``                  PUT    ✔        **✘**
26 74b27be4 Stavros Sachtouris
`Retrieve Image Metadata <#id10>`_        ``/images/<img-id>``                  HEAD   ✔        ✔
27 74b27be4 Stavros Sachtouris
`Retrieve Raw Image Data <#id12>`_        ``/images/<img-id>``                  GET    **✘**    ✔
28 74b27be4 Stavros Sachtouris
`List Image Memberships <#id14>`_         ``/images/<img-id>/members``          GET    ✔        ✔
29 51d97e66 Stavros Sachtouris
`Replace a Membership List <#id15>`_      ``/images/<img-id>/members``          PUT    ✔        ✔
30 4a37ba3a Stavros Sachtouris
`Add a Member to an Image <#id16>`_       ``/images/<img-id>/members/<member>`` PUT    ✔        ✔
31 4872824f Stavros Sachtouris
`Remove a Member from an Image <#id17>`_  ``/images/<img-id>/members/<member>`` DELETE ✔        ✔
32 4872824f Stavros Sachtouris
`List Shared Images <#id19>`_             ``/shared-images/<member>``           GET    ✔        ✔
33 74b27be4 Stavros Sachtouris
========================================= ===================================== ====== ======== ======
34 1076ce55 Stavros Sachtouris
35 1076ce55 Stavros Sachtouris
Authentication
36 1076ce55 Stavros Sachtouris
--------------
37 1076ce55 Stavros Sachtouris
38 1076ce55 Stavros Sachtouris
**Plankton** depends on Astakos to handle authentication of clients. An authentication token must be obtained from the identity manager which should be send along with each API requests through the *X-Auth-Token* header. Plankton handles the communication with Astakos to verify the token validity and obtain identity credentials.
39 1076ce55 Stavros Sachtouris
40 1076ce55 Stavros Sachtouris
**Glance** handles authentication in a `similar manner <http://docs.openstack.org/developer/glance/glanceapi.html#authentication>`_, with the only difference being the suggested identity manager.
41 1076ce55 Stavros Sachtouris
42 bc4cf6c7 Stavros Sachtouris
43 1076ce55 Stavros Sachtouris
List Available Images
44 1076ce55 Stavros Sachtouris
---------------------
45 1076ce55 Stavros Sachtouris
46 bc4cf6c7 Stavros Sachtouris
This request returns a list of all images accessible by the user. In specific, the list contains images falling at one of the following categories:
47 bc4cf6c7 Stavros Sachtouris
48 bc4cf6c7 Stavros Sachtouris
* registered by the user
49 bc4cf6c7 Stavros Sachtouris
* shared to  user by others
50 bc4cf6c7 Stavros Sachtouris
* public
51 bc4cf6c7 Stavros Sachtouris
52 4e61d281 Stavros Sachtouris
=========== ====== ======== ======
53 4e61d281 Stavros Sachtouris
URI         Method Plankton Glance
54 4e61d281 Stavros Sachtouris
=========== ====== ======== ======
55 4e61d281 Stavros Sachtouris
``/images`` GET    ✔        ✔
56 4e61d281 Stavros Sachtouris
=========== ====== ======== ======
57 1076ce55 Stavros Sachtouris
58 1076ce55 Stavros Sachtouris
|
59 1076ce55 Stavros Sachtouris
60 1076ce55 Stavros Sachtouris
====================== ======================================= ======== ======
61 1076ce55 Stavros Sachtouris
Request Parameter Name Value                                   Plankton Glance
62 1076ce55 Stavros Sachtouris
====================== ======================================= ======== ======
63 1076ce55 Stavros Sachtouris
name                   Return images of given name             ✔        ✔
64 1076ce55 Stavros Sachtouris
container_format       Return images of given container format ✔        ✔
65 1076ce55 Stavros Sachtouris
disk_format            Return images of given disk format      ✔        ✔
66 1076ce55 Stavros Sachtouris
status                 Return images of given status           ✔        ✔
67 1076ce55 Stavros Sachtouris
size_min               Return images of size >= to given value ✔        ✔
68 1076ce55 Stavros Sachtouris
size_max               Return images of size >= to given value ✔        ✔
69 1076ce55 Stavros Sachtouris
sort_key               Sort images against given key           ✔        ✔
70 1076ce55 Stavros Sachtouris
sort_dir               Sort images in given direction          ✔        ✔
71 1076ce55 Stavros Sachtouris
====================== ======================================= ======== ======
72 1076ce55 Stavros Sachtouris
73 bc4cf6c7 Stavros Sachtouris
**container_format** values are listed at :ref:`container-format-ref`
74 1076ce55 Stavros Sachtouris
75 bc4cf6c7 Stavros Sachtouris
**disk_format** values are listed at :ref:`disk-format-ref`
76 1076ce55 Stavros Sachtouris
77 bc4cf6c7 Stavros Sachtouris
**sort_key** values: id, name, status, size, disk_format, container_format, created_at, updated_at
78 1076ce55 Stavros Sachtouris
79 bc4cf6c7 Stavros Sachtouris
======== ================ ======== =======
80 bc4cf6c7 Stavros Sachtouris
sort_dir Description      Plankton Glance
81 bc4cf6c7 Stavros Sachtouris
======== ================ ======== =======
82 bc4cf6c7 Stavros Sachtouris
asc      Ascending order  default  default
83 bc4cf6c7 Stavros Sachtouris
desc     Descending order ✔        ✔
84 bc4cf6c7 Stavros Sachtouris
======== ================ ======== =======
85 1076ce55 Stavros Sachtouris
86 1076ce55 Stavros Sachtouris
|
87 1076ce55 Stavros Sachtouris
88 bc4cf6c7 Stavros Sachtouris
====================  ========================= ======== =========
89 1076ce55 Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
90 bc4cf6c7 Stavros Sachtouris
====================  ========================= ======== =========
91 3b1963eb Stavros Sachtouris
X-Auth-Token          User authentication token required required
92 bc4cf6c7 Stavros Sachtouris
====================  ========================= ======== =========
93 1076ce55 Stavros Sachtouris
94 1076ce55 Stavros Sachtouris
|
95 1076ce55 Stavros Sachtouris
96 1076ce55 Stavros Sachtouris
=========================== =====================
97 1076ce55 Stavros Sachtouris
Return Code                 Description
98 1076ce55 Stavros Sachtouris
=========================== =====================
99 1076ce55 Stavros Sachtouris
200 (OK)                    The request succeeded
100 1076ce55 Stavros Sachtouris
400 (Bad Request)           Raised in case of invalid values for
101 1076ce55 Stavros Sachtouris
\                           *sort_key*, *sort_dir*, *size_max* or *size_min*
102 1076ce55 Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
103 1076ce55 Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
104 1076ce55 Stavros Sachtouris
=========================== =====================
105 1076ce55 Stavros Sachtouris
106 1076ce55 Stavros Sachtouris
The response data is a list of images in a json format containing the fields presented bellow
107 1076ce55 Stavros Sachtouris
108 1076ce55 Stavros Sachtouris
================ ===================== ======== ======
109 1076ce55 Stavros Sachtouris
Name             Description           Plankton Glance
110 1076ce55 Stavros Sachtouris
================ ===================== ======== ======
111 1076ce55 Stavros Sachtouris
id               A unique image id      ✔        **✘**
112 1076ce55 Stavros Sachtouris
uri              Unique id in URI form **✘**    ✔
113 1076ce55 Stavros Sachtouris
name             The name of the image ✔        ✔
114 1076ce55 Stavros Sachtouris
status           ???The VM status???   ✔        **✘**
115 1076ce55 Stavros Sachtouris
disk_format      The disc format       ✔        ✔
116 1076ce55 Stavros Sachtouris
container_format The container format  ✔        ✔
117 1076ce55 Stavros Sachtouris
size             Image size in bytes   ✔        ✔
118 1076ce55 Stavros Sachtouris
================ ===================== ======== ======
119 1076ce55 Stavros Sachtouris
120 1076ce55 Stavros Sachtouris
Example Plankton response:
121 1076ce55 Stavros Sachtouris
122 1076ce55 Stavros Sachtouris
::
123 1076ce55 Stavros Sachtouris
124 1076ce55 Stavros Sachtouris
    [{
125 1076ce55 Stavros Sachtouris
        "status": "available", 
126 1076ce55 Stavros Sachtouris
        "name": "ubuntu", 
127 1076ce55 Stavros Sachtouris
        "disk_format": "diskdump", 
128 1076ce55 Stavros Sachtouris
        "container_format": "bare", 
129 1076ce55 Stavros Sachtouris
        "id": "5583ffe1-5273-4c84-9e32-2fbe476bd7b7", 
130 1076ce55 Stavros Sachtouris
        "size": 2622562304
131 1076ce55 Stavros Sachtouris
    }, {
132 1076ce55 Stavros Sachtouris
        "status": "available", 
133 1076ce55 Stavros Sachtouris
        "name": "Ubuntu-10.04", 
134 1076ce55 Stavros Sachtouris
        "disk_format": "diskdump", 
135 1076ce55 Stavros Sachtouris
        "container_format": "bare", 
136 1076ce55 Stavros Sachtouris
        "id": "907ef618-c03a-4473-9914-9348e12890c1", 
137 1076ce55 Stavros Sachtouris
        "size": 761368576
138 1076ce55 Stavros Sachtouris
    }]
139 167ac7d0 Stavros Sachtouris
140 74b27be4 Stavros Sachtouris
List Available Images in Detail
141 74b27be4 Stavros Sachtouris
-------------------------------
142 74b27be4 Stavros Sachtouris
143 74b27be4 Stavros Sachtouris
This request returns the same list of images as in `List Available Images <#id2>`_, but the results are reacher in metadata.
144 74b27be4 Stavros Sachtouris
145 74b27be4 Stavros Sachtouris
================== ====== ======== ======
146 74b27be4 Stavros Sachtouris
URI                Method Plankton Glance
147 74b27be4 Stavros Sachtouris
================== ====== ======== ======
148 74b27be4 Stavros Sachtouris
``/images/detail`` GET    ✔        ✔
149 74b27be4 Stavros Sachtouris
================== ====== ======== ======
150 74b27be4 Stavros Sachtouris
151 74b27be4 Stavros Sachtouris
**Request parameters** and **headers** as well as **response headers** and **error codes** are exactly the same as in `List Available Images <#id2>`_, both syntactically and semantically.
152 74b27be4 Stavros Sachtouris
153 74b27be4 Stavros Sachtouris
154 74b27be4 Stavros Sachtouris
The response data is a list of images in json format containing the fields presented bellow
155 74b27be4 Stavros Sachtouris
156 74b27be4 Stavros Sachtouris
================ ===================== ======== ======
157 74b27be4 Stavros Sachtouris
Name             Description           Plankton Glance
158 74b27be4 Stavros Sachtouris
================ ===================== ======== ======
159 74b27be4 Stavros Sachtouris
id               A unique image id     ✔        **✘**
160 74b27be4 Stavros Sachtouris
uri              Unique id in URI form **✘**    ✔
161 74b27be4 Stavros Sachtouris
location         Pithos+ file location ✔        **✘**
162 74b27be4 Stavros Sachtouris
name             The name of the image ✔        ✔
163 74b27be4 Stavros Sachtouris
status           ???The VM status???   ✔        **✘**
164 74b27be4 Stavros Sachtouris
disk_format      The disc format       ✔        ✔
165 74b27be4 Stavros Sachtouris
container_format The container format  ✔        ✔
166 74b27be4 Stavros Sachtouris
size             Image size in bytes   ✔        ✔
167 74b27be4 Stavros Sachtouris
checksum         file MD5 checksum     ✔        ✔
168 74b27be4 Stavros Sachtouris
created_at       Timestamp of creation ✔        ✔
169 74b27be4 Stavros Sachtouris
updated_at       Timestamp of update   ✔        ✔
170 74b27be4 Stavros Sachtouris
deleted_at       Timestamp of deletion ✔        ✔
171 74b27be4 Stavros Sachtouris
is_public        True if img is public ✔        ✔
172 74b27be4 Stavros Sachtouris
min_ram          Minimum ram required  **✘**    ✔
173 74b27be4 Stavros Sachtouris
min_disk         Maximum ram required  **✘**    ✔
174 74b27be4 Stavros Sachtouris
owner            Image owner           ✔        ✔
175 74b27be4 Stavros Sachtouris
properties       Custom properties     ✔        ✔
176 74b27be4 Stavros Sachtouris
================ ===================== ======== ======
177 74b27be4 Stavros Sachtouris
178 74b27be4 Stavros Sachtouris
|
179 74b27be4 Stavros Sachtouris
180 74b27be4 Stavros Sachtouris
Example Plankton response::
181 74b27be4 Stavros Sachtouris
182 74b27be4 Stavros Sachtouris
    [{
183 74b27be4 Stavros Sachtouris
        "status": "available", 
184 74b27be4 Stavros Sachtouris
        "location": "pithos://u53r-1d/images/my/path/example_image_build.diskdump"
185 74b27be4 Stavros Sachtouris
        "name": "ubuntu", 
186 74b27be4 Stavros Sachtouris
        "disk_format": "diskdump", 
187 74b27be4 Stavros Sachtouris
        "container_format": "bare", 
188 74b27be4 Stavros Sachtouris
        "created_at": "2013-03-29 14:14:34",
189 74b27be4 Stavros Sachtouris
        "deleted_at": "",
190 74b27be4 Stavros Sachtouris
        "id": "5583ffe1-5273-4c84-9e32-2fbe476bd7b7",
191 74b27be4 Stavros Sachtouris
        "size": 2622562304,
192 74b27be4 Stavros Sachtouris
        "is_public": "True",
193 74b27be4 Stavros Sachtouris
        "checksum": "a387aaaae583bc65daacf12d6be502bd7cfbbb254dcd452f92ca31f4c06a9208",
194 74b27be4 Stavros Sachtouris
        "properties": {
195 74b27be4 Stavros Sachtouris
            "partition_table": "msdos", 
196 74b27be4 Stavros Sachtouris
            "kernel": "3.8.3", 
197 74b27be4 Stavros Sachtouris
            "osfamily": "linux", 
198 74b27be4 Stavros Sachtouris
            "users": "root user", 
199 74b27be4 Stavros Sachtouris
            "gui": "GNOME 3.4.2", 
200 74b27be4 Stavros Sachtouris
            "sortorder": "5", 
201 74b27be4 Stavros Sachtouris
            "os": "fedora", 
202 74b27be4 Stavros Sachtouris
            "root_partition": "1", 
203 74b27be4 Stavros Sachtouris
            "description": "Fedora release 17 (Beefy Miracle)"}
204 74b27be4 Stavros Sachtouris
    }, {
205 74b27be4 Stavros Sachtouris
        "location": "pithos://0th3r-u53r-1d/images/ubuntu_10_04.diskdump"
206 74b27be4 Stavros Sachtouris
        "status": "available", 
207 74b27be4 Stavros Sachtouris
        "name": "Ubuntu-10.04", 
208 74b27be4 Stavros Sachtouris
        "disk_format": "diskdump", 
209 74b27be4 Stavros Sachtouris
        "container_format": "bare", 
210 74b27be4 Stavros Sachtouris
        "id": "907ef618-c03a-4473-9914-9348e12890c1", 
211 74b27be4 Stavros Sachtouris
        "size": 761368576
212 74b27be4 Stavros Sachtouris
        "created_at": "2013-03-29 14:14:34",
213 74b27be4 Stavros Sachtouris
        "deleted_at": ""
214 74b27be4 Stavros Sachtouris
    }]
215 74b27be4 Stavros Sachtouris
216 bc4cf6c7 Stavros Sachtouris
Add or update an image
217 bc4cf6c7 Stavros Sachtouris
----------------------
218 bc4cf6c7 Stavros Sachtouris
219 bc4cf6c7 Stavros Sachtouris
According to the Synnefo approach, this request performs two functionalities:
220 bc4cf6c7 Stavros Sachtouris
221 bc4cf6c7 Stavros Sachtouris
* registers a new image to Plankton
222 bc4cf6c7 Stavros Sachtouris
* commits metadata for the new image
223 bc4cf6c7 Stavros Sachtouris
* update the metadata of an existing image
224 bc4cf6c7 Stavros Sachtouris
225 bc4cf6c7 Stavros Sachtouris
The physical image file must be uploaded on a `Pithos+ <pithos.html>`_ server, at a space accessible by the user. The Pithos+ location of the physical file acts as a key for the image (image ids and image locations are uniquely coupled).
226 bc4cf6c7 Stavros Sachtouris
227 bc4cf6c7 Stavros Sachtouris
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.
228 bc4cf6c7 Stavros Sachtouris
229 4e61d281 Stavros Sachtouris
=========== ====== ======== ======
230 4e61d281 Stavros Sachtouris
URI         Method Plankton Glance
231 4e61d281 Stavros Sachtouris
=========== ====== ======== ======
232 4e61d281 Stavros Sachtouris
``/images`` POST   ✔        ✔
233 4e61d281 Stavros Sachtouris
=========== ====== ======== ======
234 bc4cf6c7 Stavros Sachtouris
235 bc4cf6c7 Stavros Sachtouris
|
236 bc4cf6c7 Stavros Sachtouris
237 bc4cf6c7 Stavros Sachtouris
============================= ========================= ========  ========
238 bc4cf6c7 Stavros Sachtouris
Request Header Name           Value                     Plankton  Glance
239 bc4cf6c7 Stavros Sachtouris
============================= ========================= ========  ========
240 bc4cf6c7 Stavros Sachtouris
X-Auth-Token                  User authentication token required  required
241 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Name             Img name                  required  required
242 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Id               Unique image id           **✘**     ✔
243 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Location         img file location @Pithos required  **✘**
244 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Store            Storage system            ✔         ✔
245 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Disk-Format      Img disk format           ✔         **✘**
246 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Disk_format      Img disk format           **✘**     ✔
247 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Container-Format Container format          ✔         **✘**
248 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Container_format Container format          **✘**     ✔
249 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Size             Size of img file          ✔         ✔
250 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Checksum         MD5 checksum of img file  ✔         ✔
251 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Is-Public        Make image public         ✔         **✘**
252 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Is_public        Make image public         **✘**     ✔
253 bc4cf6c7 Stavros Sachtouris
x-image-meta-Min-Ram          Minimum ram required (MB) **✘**     ✔
254 bc4cf6c7 Stavros Sachtouris
x-image-meta-Min-Disk         Maximum ram required (MB) **✘**     ✔
255 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Owner            Image owner               ✔         ✔
256 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Property-*       Property prefix           ✔         ✔         
257 bc4cf6c7 Stavros Sachtouris
============================= ========================= ========  ========
258 bc4cf6c7 Stavros Sachtouris
259 ae7e1e1f Stavros Sachtouris
**X-Meta-Location** format is described at :ref:`location-ref`
260 bc4cf6c7 Stavros Sachtouris
261 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Id** is explained at :ref:`id-ref`
262 bc4cf6c7 Stavros Sachtouris
263 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Store** values are listed at :ref:`store-ref`
264 bc4cf6c7 Stavros Sachtouris
265 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Disk-Format** values are listed at :ref:`disk-format-ref`
266 9c16855e Stavros Sachtouris
267 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Container-Format** values are listed at :ref:`container-format-ref`
268 bc4cf6c7 Stavros Sachtouris
269 bc4cf6c7 Stavros Sachtouris
**X-Image-Meta-Size** is optional, but should much the actual image file size.
270 bc4cf6c7 Stavros Sachtouris
271 bc4cf6c7 Stavros Sachtouris
**X-Image-Meta-Is-Public** values are true or false (case insensitive)
272 bc4cf6c7 Stavros Sachtouris
273 bc4cf6c7 Stavros Sachtouris
**X-Image-Meta-Property-*** is used as a prefix to set custom, free-form key:value properties on an image, e.g.::
274 bc4cf6c7 Stavros Sachtouris
275 bc4cf6c7 Stavros Sachtouris
    X-Image-Meta-Property-OS: Debian Linux
276 bc4cf6c7 Stavros Sachtouris
    X-Image-Meta-Property-Users: Root
277 bc4cf6c7 Stavros Sachtouris
278 9c16855e Stavros Sachtouris
|
279 9c16855e Stavros Sachtouris
280 bc4cf6c7 Stavros Sachtouris
=========================== =====================
281 bc4cf6c7 Stavros Sachtouris
Return Code                 Description
282 bc4cf6c7 Stavros Sachtouris
=========================== =====================
283 bc4cf6c7 Stavros Sachtouris
200 (OK)                    The request succeeded
284 bc4cf6c7 Stavros Sachtouris
400 (Bad Request)           
285 bc4cf6c7 Stavros Sachtouris
\                           No name header
286 bc4cf6c7 Stavros Sachtouris
\                           Illegal header value
287 bc4cf6c7 Stavros Sachtouris
\                           File not found on given location
288 bc4cf6c7 Stavros Sachtouris
\                           Invalid size or checksum
289 bc4cf6c7 Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
290 bc4cf6c7 Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
291 bc4cf6c7 Stavros Sachtouris
501 (Not Implemented)       Location header is empty or omitted
292 bc4cf6c7 Stavros Sachtouris
=========================== =====================
293 167ac7d0 Stavros Sachtouris
294 9c16855e Stavros Sachtouris
|
295 9c16855e Stavros Sachtouris
296 bc4cf6c7 Stavros Sachtouris
The following is used when the response code is 200:
297 bc4cf6c7 Stavros Sachtouris
298 bc4cf6c7 Stavros Sachtouris
============================= ===================== ======== ======
299 bc4cf6c7 Stavros Sachtouris
Response Header               Description           Plankton Glance
300 bc4cf6c7 Stavros Sachtouris
============================= ===================== ======== ======
301 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Id               Unique img id         ✔        **✘**
302 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Name             Img name              ✔        **✘**
303 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Disk-Format      Disk format           ✔        **✘**
304 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Container-Format Container format      ✔        **✘**
305 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Size             Img file size         ✔        **✘**
306 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Checksum         Img file MD5 checksum ✔        **✘**
307 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Location         Pithos+ file location ✔        **✘**
308 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Created-At       Date of img creation  ✔        **✘**
309 52f2c69b Stavros Sachtouris
X-Image-Meta-Deleted-At       Date of img deletion  ✔        **✘**
310 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Status           Img status            ✔        **✘**
311 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Is-Public        True if img is public ✔        **✘**
312 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Owner            Img owner or tentant  ✔        **✘**
313 bc4cf6c7 Stavros Sachtouris
X-Image-Meta-Property-*       Custom img properties ✔        **✘**
314 bc4cf6c7 Stavros Sachtouris
============================= ===================== ======== ======
315 167ac7d0 Stavros Sachtouris
316 167ac7d0 Stavros Sachtouris
Update an Image
317 167ac7d0 Stavros Sachtouris
---------------
318 167ac7d0 Stavros Sachtouris
319 74b27be4 Stavros Sachtouris
In Plankton, an image can be updated either by re-registering with different metadata, or by using the request described in the present subsection.
320 9c16855e Stavros Sachtouris
321 74b27be4 Stavros Sachtouris
In Glance, an update is implemented as a *PUT* request on ``/images`` URI. The method described bellow is not part of the Glance API.
322 167ac7d0 Stavros Sachtouris
323 74b27be4 Stavros Sachtouris
====================== ====== ======== ======
324 74b27be4 Stavros Sachtouris
URI                    Method Plankton Glance
325 74b27be4 Stavros Sachtouris
====================== ====== ======== ======
326 74b27be4 Stavros Sachtouris
``/images``            PUT    **✘**    ✔
327 74b27be4 Stavros Sachtouris
``/images/<image-id>`` PUT    ✔        **✘**
328 74b27be4 Stavros Sachtouris
====================== ====== ======== ======
329 167ac7d0 Stavros Sachtouris
330 74b27be4 Stavros Sachtouris
The following refers only to the Plankton implementation.
331 85a32d94 Stavros Sachtouris
332 74b27be4 Stavros Sachtouris
**image-id** is explained at :ref:`id-ref`
333 85a32d94 Stavros Sachtouris
334 74b27be4 Stavros Sachtouris
|
335 85a32d94 Stavros Sachtouris
336 74b27be4 Stavros Sachtouris
============================= =========================
337 74b27be4 Stavros Sachtouris
Request Header Name           Value                    
338 74b27be4 Stavros Sachtouris
============================= =========================
339 74b27be4 Stavros Sachtouris
X-Auth-Token                  User authentication token
340 74b27be4 Stavros Sachtouris
X-Image-Meta-Name             New image name           
341 74b27be4 Stavros Sachtouris
X-Image-Meta-Disk-Format      New disk format          
342 74b27be4 Stavros Sachtouris
X-Image-Meta-Container-Format New container format     
343 74b27be4 Stavros Sachtouris
X-Image-Meta-Status           New image status         
344 74b27be4 Stavros Sachtouris
X-Image-Meta-Is-Public        (un)publish the image    
345 74b27be4 Stavros Sachtouris
X-Image-Meta-Owner            Set an owner             
346 74b27be4 Stavros Sachtouris
X-Image-Meta-Property-*       Add / modify properties  
347 74b27be4 Stavros Sachtouris
============================= =========================
348 85a32d94 Stavros Sachtouris
349 74b27be4 Stavros Sachtouris
**X-Image-Meta-Disk-Format** values are listed at :ref:`disk-format-ref`
350 85a32d94 Stavros Sachtouris
351 74b27be4 Stavros Sachtouris
**X-Image-Meta-Container-Format** values are listed at :ref:`container-format-ref`
352 74b27be4 Stavros Sachtouris
353 74b27be4 Stavros Sachtouris
**X-Image-Meta-Size** is optional, but should much the actual image file size.
354 74b27be4 Stavros Sachtouris
355 74b27be4 Stavros Sachtouris
**X-Image-Meta-Is-Public** values are true or false (case insensitive)
356 74b27be4 Stavros Sachtouris
357 74b27be4 Stavros Sachtouris
**X-Image-Meta-Property-*** is used as a prefix to update image property values, or set some extra proeperties. If a registered image already contains some custom properties that are not addressed in the update request, these properties will remain untouched. For example::
358 74b27be4 Stavros Sachtouris
359 74b27be4 Stavros Sachtouris
    X-Image-Meta-Property-OS: Debian Linux
360 74b27be4 Stavros Sachtouris
    X-Image-Meta-Property-Users: Root
361 85a32d94 Stavros Sachtouris
362 85a32d94 Stavros Sachtouris
|
363 85a32d94 Stavros Sachtouris
364 74b27be4 Stavros Sachtouris
=========================== =====================
365 74b27be4 Stavros Sachtouris
Return Code                 Description
366 74b27be4 Stavros Sachtouris
=========================== =====================
367 74b27be4 Stavros Sachtouris
200 (OK)                    The request succeeded
368 74b27be4 Stavros Sachtouris
400 (Bad Request)           
369 74b27be4 Stavros Sachtouris
\                           Illegal header value
370 74b27be4 Stavros Sachtouris
\                           Invalid size or checksum
371 74b27be4 Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
372 74b27be4 Stavros Sachtouris
404 (Not found)             Image not found
373 74b27be4 Stavros Sachtouris
405 (Not allowed)           Current user does not have permission to change the image
374 74b27be4 Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
375 74b27be4 Stavros Sachtouris
=========================== =====================
376 85a32d94 Stavros Sachtouris
377 74b27be4 Stavros Sachtouris
|
378 74b27be4 Stavros Sachtouris
379 74b27be4 Stavros Sachtouris
The following is received when the response code is 200:
380 74b27be4 Stavros Sachtouris
381 74b27be4 Stavros Sachtouris
============================= =====================
382 74b27be4 Stavros Sachtouris
Response Header               Description          
383 74b27be4 Stavros Sachtouris
============================= =====================
384 74b27be4 Stavros Sachtouris
X-Image-Meta-Id               Unique img id        
385 74b27be4 Stavros Sachtouris
X-Image-Meta-Name             Img name             
386 74b27be4 Stavros Sachtouris
X-Image-Meta-Disk-Format      Disk format          
387 74b27be4 Stavros Sachtouris
X-Image-Meta-Container-Format Container format     
388 74b27be4 Stavros Sachtouris
X-Image-Meta-Size             Img file size        
389 74b27be4 Stavros Sachtouris
X-Image-Meta-Checksum         Img file MD5 checksum
390 74b27be4 Stavros Sachtouris
X-Image-Meta-Location         Pithos+ file location
391 74b27be4 Stavros Sachtouris
X-Image-Meta-Created-At       Date of img creation 
392 74b27be4 Stavros Sachtouris
X-Image-Meta-Deleted-At       Date of img deletion 
393 74b27be4 Stavros Sachtouris
X-Image-Meta-Status           Img status           
394 74b27be4 Stavros Sachtouris
X-Image-Meta-Is-Public        True if img is public
395 74b27be4 Stavros Sachtouris
X-Image-Meta-Owner            Img owner or tentant 
396 74b27be4 Stavros Sachtouris
X-Image-Meta-Property-*       Custom img properties
397 74b27be4 Stavros Sachtouris
============================= =====================
398 74b27be4 Stavros Sachtouris
399 74b27be4 Stavros Sachtouris
.. hint:: In Plankton, use POST to completely reset all image properties and metadata, but use PUT to update a few values without affecting the rest.
400 167ac7d0 Stavros Sachtouris
401 167ac7d0 Stavros Sachtouris
Retrieve Image Metadata
402 167ac7d0 Stavros Sachtouris
-----------------------
403 167ac7d0 Stavros Sachtouris
404 ae7e1e1f Stavros Sachtouris
This request returns the metadata of an image. Images are identified by their unique image id.
405 ae7e1e1f Stavros Sachtouris
406 ae7e1e1f Stavros Sachtouris
In a typical scenario, client applications would query the server to `List Available Images <#id2>`_ for them and then choose one of the image ids returned.
407 ae7e1e1f Stavros Sachtouris
408 4e61d281 Stavros Sachtouris
====================== ====== ======== ======
409 4e61d281 Stavros Sachtouris
URI                    Method Plankton Glance
410 4e61d281 Stavros Sachtouris
====================== ====== ======== ======
411 4e61d281 Stavros Sachtouris
``/images/<image-id>`` HEAD   ✔        ✔
412 4e61d281 Stavros Sachtouris
====================== ====== ======== ======
413 ae7e1e1f Stavros Sachtouris
414 51d97e66 Stavros Sachtouris
**image-id** is explained at :ref:`id-ref`
415 51d97e66 Stavros Sachtouris
416 ae7e1e1f Stavros Sachtouris
|
417 ae7e1e1f Stavros Sachtouris
418 ae7e1e1f Stavros Sachtouris
====================  ========================= ======== =========
419 ae7e1e1f Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
420 ae7e1e1f Stavros Sachtouris
====================  ========================= ======== =========
421 ae7e1e1f Stavros Sachtouris
X-Auth-Token          User authentication token required  required
422 ae7e1e1f Stavros Sachtouris
====================  ========================= ======== =========
423 ae7e1e1f Stavros Sachtouris
424 ae7e1e1f Stavros Sachtouris
|
425 ae7e1e1f Stavros Sachtouris
426 ae7e1e1f Stavros Sachtouris
=========================== =====================
427 ae7e1e1f Stavros Sachtouris
Return Code                 Description
428 ae7e1e1f Stavros Sachtouris
=========================== =====================
429 ae7e1e1f Stavros Sachtouris
200 (OK)                    The request succeeded
430 ae7e1e1f Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
431 ae7e1e1f Stavros Sachtouris
404 (Not Found)             Image not found
432 ae7e1e1f Stavros Sachtouris
405 (Not Allowed)           Access to that image is not allowed
433 ae7e1e1f Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
434 ae7e1e1f Stavros Sachtouris
=========================== =====================
435 ae7e1e1f Stavros Sachtouris
436 ae7e1e1f Stavros Sachtouris
|
437 ae7e1e1f Stavros Sachtouris
438 ae7e1e1f Stavros Sachtouris
============================= ===================== ======== ======
439 ae7e1e1f Stavros Sachtouris
Response Header               Description           Plankton Glance
440 ae7e1e1f Stavros Sachtouris
============================= ===================== ======== ======
441 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Id               Unique img id         ✔        ✔
442 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Location         Pithos+ file location ✔        **✘**
443 ae7e1e1f Stavros Sachtouris
X-Image-Meta-URI              URI of image file     **✘**    ✔
444 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Name             Img name              ✔        ✔
445 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Disk-Format      Disk format           ✔        **✘**
446 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Disk_format      Disk format           **✘**    ✔
447 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Container-Format Container format      ✔        **✘**
448 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Container_format Container format      **✘**    ✔
449 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Size             Img file size         ✔        ✔
450 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Checksum         Img file MD5 checksum ✔        ✔
451 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Created-At       Date of img creation  ✔        **✘**
452 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Created_At       Date of img creation  **✘**    ✔
453 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Updated-At       Last modification     ✔        **✘**
454 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Updated_At       Last modification     **✘**    ✔
455 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Deleted-At       Date of img deletion  ✔        **✘**
456 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Deleted_At       Date of img deletion  **✘**    ✔
457 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Status           Img status            ✔        ✔
458 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Is-Public        True if img is public ✔        ✔
459 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Min-Ram          Minimum image RAM     **✘**    ✔
460 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Min-Disk         Minimum disk size     **✘**    ✔
461 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Owner            Img owner or tentant  ✔        ✔
462 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Property-*       Custom img properties ✔        ✔
463 ae7e1e1f Stavros Sachtouris
============================= ===================== ======== ======
464 ae7e1e1f Stavros Sachtouris
465 ae7e1e1f Stavros Sachtouris
**X-Image-Created-At** is the (immutable) date of initial registration, while **X-Image-Meta-Updated-At** indicates the date of last modification of the image (if any).
466 ae7e1e1f Stavros Sachtouris
467 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Store** values are listed at :ref:`store-ref`
468 ae7e1e1f Stavros Sachtouris
469 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Disk-Format** values are listed at :ref:`disk-format-ref`
470 ae7e1e1f Stavros Sachtouris
471 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Container-Format** values are listed at :ref:`container-format-ref`
472 ae7e1e1f Stavros Sachtouris
473 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Is-Public** values are true or false (case insensitive)
474 ae7e1e1f Stavros Sachtouris
475 ae7e1e1f Stavros Sachtouris
**X-Image-Meta-Property-*** is used as a prefix to set custom, free-form key:value properties on an image, e.g.::
476 ae7e1e1f Stavros Sachtouris
477 ae7e1e1f Stavros Sachtouris
    X-Image-Meta-Property-OS: Debian Linux
478 ae7e1e1f Stavros Sachtouris
    X-Image-Meta-Property-Users: Root
479 ae7e1e1f Stavros Sachtouris
480 ae7e1e1f Stavros Sachtouris
Example Plankton Headers response::
481 ae7e1e1f Stavros Sachtouris
482 ae7e1e1f Stavros Sachtouris
    x-image-meta-id: 940509eb-eb4f-496c-8443-22ffd24912e9
483 ae7e1e1f Stavros Sachtouris
    x-image-meta-location: pithos://25cced7-bd53-4145-91ee-cf4737e9fb2/images/some-image.diskdump
484 ae7e1e1f Stavros Sachtouris
    x-image-meta-name: Debian Desktop
485 ae7e1e1f Stavros Sachtouris
    x-image-meta-disk-format: diskdump
486 ae7e1e1f Stavros Sachtouris
    x-image-meta-container-format: bare
487 ae7e1e1f Stavros Sachtouris
    x-image-meta-size: 3399127040
488 ae7e1e1f Stavros Sachtouris
    x-image-meta-checksum: d0f28e4d72927c90eadf30917d94d0156781fe1351ed16402b538316d404
489 ae7e1e1f Stavros Sachtouris
    x-image-meta-created-at: 2013-02-26 12:04:31
490 ae7e1e1f Stavros Sachtouris
    x-image-meta-updated-at: 2013-02-26 12:05:28
491 ae7e1e1f Stavros Sachtouris
    x-image-meta-deleted-at: 
492 ae7e1e1f Stavros Sachtouris
    x-image-meta-status: available
493 ae7e1e1f Stavros Sachtouris
    x-image-meta-is-public: True
494 ae7e1e1f Stavros Sachtouris
    x-image-meta-owner: 25cced7-bd53-4145-91ee-cf4737e9fb2
495 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-partition-table: msdos
496 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-osfamily: linux
497 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-sortorder: 2
498 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-description: Debian 6.0.7 (Squeeze) Desktop
499 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-os: debian
500 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-users: root user
501 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-kernel: 2.6.32
502 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-root-partition: 1
503 ae7e1e1f Stavros Sachtouris
    x-image-meta-property-gui: GNOME 2.30.2
504 ae7e1e1f Stavros Sachtouris
505 167ac7d0 Stavros Sachtouris
Retrieve Raw Image Data
506 167ac7d0 Stavros Sachtouris
-----------------------
507 167ac7d0 Stavros Sachtouris
508 c982ddf9 Stavros Sachtouris
In **Plankton**, the raw image data is stored at a `Pithos <pithos.html>`_ server and it can be downloaded from the Pithos web UI, with a `client <https://okeanos.grnet.gr/services/pithos/>`_ or with `kamaki <http://www.synnefo.org/docs/kamaki/latest/index.html>`_. The location of an image file can be retrieved from the *X-Image-Meta-Location* header field (see `Retrieve Image Meta <#id10>`_)
509 c982ddf9 Stavros Sachtouris
510 c982ddf9 Stavros Sachtouris
In **Glance**, the raw image can be downloaded with a GET request on ``/images/<image-id>``.
511 c982ddf9 Stavros Sachtouris
512 167ac7d0 Stavros Sachtouris
List Image Memberships
513 167ac7d0 Stavros Sachtouris
----------------------
514 167ac7d0 Stavros Sachtouris
515 4e61d281 Stavros Sachtouris
This request returns the list of users who can access an image. Plankton returns an empty list if the image is publicly accessible.
516 4e61d281 Stavros Sachtouris
517 4e61d281 Stavros Sachtouris
============================== ====== ======== ======
518 4e61d281 Stavros Sachtouris
URI                            Method Plankton Glance
519 4e61d281 Stavros Sachtouris
============================== ====== ======== ======
520 4e61d281 Stavros Sachtouris
``/images/<image-id>/members`` GET    ✔        ✔
521 4e61d281 Stavros Sachtouris
============================== ====== ======== ======
522 4e61d281 Stavros Sachtouris
523 51d97e66 Stavros Sachtouris
**image-id** is explained at :ref:`id-ref`
524 51d97e66 Stavros Sachtouris
525 4e61d281 Stavros Sachtouris
|
526 4e61d281 Stavros Sachtouris
527 4e61d281 Stavros Sachtouris
====================  ========================= ======== =========
528 4e61d281 Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
529 4e61d281 Stavros Sachtouris
====================  ========================= ======== =========
530 4e61d281 Stavros Sachtouris
X-Auth-Token          User authentication token required  required
531 4e61d281 Stavros Sachtouris
====================  ========================= ======== =========
532 4e61d281 Stavros Sachtouris
533 4e61d281 Stavros Sachtouris
|
534 4e61d281 Stavros Sachtouris
535 4e61d281 Stavros Sachtouris
=========================== =====================
536 4e61d281 Stavros Sachtouris
Return Code                 Description
537 4e61d281 Stavros Sachtouris
=========================== =====================
538 4e61d281 Stavros Sachtouris
200 (OK)                    The request succeeded
539 4e61d281 Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
540 4e61d281 Stavros Sachtouris
404 (Not Found)             Image not found
541 4e61d281 Stavros Sachtouris
405 (Not Allowed)           Access to that image is not allowed
542 4e61d281 Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
543 4e61d281 Stavros Sachtouris
=========================== =====================
544 4e61d281 Stavros Sachtouris
545 4e61d281 Stavros Sachtouris
|
546 4e61d281 Stavros Sachtouris
547 4e61d281 Stavros Sachtouris
The response data is a list of users (members) who can access this image
548 4e61d281 Stavros Sachtouris
549 4e61d281 Stavros Sachtouris
================ ===================== ======== ======
550 4e61d281 Stavros Sachtouris
Name             Description           Plankton Glance
551 4e61d281 Stavros Sachtouris
================ ===================== ======== ======
552 74b27be4 Stavros Sachtouris
member_id        uuid (user id)        ✔        ✔
553 4e61d281 Stavros Sachtouris
can_share        Member can share img  false    ✔
554 4e61d281 Stavros Sachtouris
================ ===================== ======== ======
555 4e61d281 Stavros Sachtouris
556 4e61d281 Stavros Sachtouris
**can_share** in Plankton is always false and is returned for compatibility reasons.
557 4e61d281 Stavros Sachtouris
558 4e61d281 Stavros Sachtouris
Example Plankton response::
559 4e61d281 Stavros Sachtouris
560 4e61d281 Stavros Sachtouris
    {'members': [
561 74b27be4 Stavros Sachtouris
        {'member_id': 'th15-4-u53r-1d-fr0m-p1th05',
562 4e61d281 Stavros Sachtouris
        'can_share': false},
563 4e61d281 Stavros Sachtouris
        ...
564 4e61d281 Stavros Sachtouris
    ]}
565 4e61d281 Stavros Sachtouris
566 74b27be4 Stavros Sachtouris
Replace a Membership List
567 74b27be4 Stavros Sachtouris
-------------------------
568 167ac7d0 Stavros Sachtouris
569 51d97e66 Stavros Sachtouris
This request replaces the list of users who can access a registered image. The term "replace" means that the old permission list of the image is abandoned (old permission settings are lost).
570 51d97e66 Stavros Sachtouris
571 51d97e66 Stavros Sachtouris
============================== ====== ======== ======
572 51d97e66 Stavros Sachtouris
URI                            Method Plankton Glance
573 51d97e66 Stavros Sachtouris
============================== ====== ======== ======
574 51d97e66 Stavros Sachtouris
``/images/<image-id>/members`` PUT    ✔        ✔
575 51d97e66 Stavros Sachtouris
============================== ====== ======== ======
576 51d97e66 Stavros Sachtouris
577 51d97e66 Stavros Sachtouris
**image-id** is explained at :ref:`id-ref`
578 51d97e66 Stavros Sachtouris
579 51d97e66 Stavros Sachtouris
|
580 51d97e66 Stavros Sachtouris
581 51d97e66 Stavros Sachtouris
====================  ========================= ======== =========
582 51d97e66 Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
583 51d97e66 Stavros Sachtouris
====================  ========================= ======== =========
584 51d97e66 Stavros Sachtouris
X-Auth-Token          User authentication token required  required
585 51d97e66 Stavros Sachtouris
====================  ========================= ======== =========
586 52f2c69b Stavros Sachtouris
587 51d97e66 Stavros Sachtouris
|
588 51d97e66 Stavros Sachtouris
589 51d97e66 Stavros Sachtouris
Request data should be json-formated. It must consist of a *memberships* field which is a list of members with the following fields:
590 51d97e66 Stavros Sachtouris
591 51d97e66 Stavros Sachtouris
================ ===================== ======== ======
592 51d97e66 Stavros Sachtouris
Name             Description           Plankton Glance
593 51d97e66 Stavros Sachtouris
================ ===================== ======== ======
594 51d97e66 Stavros Sachtouris
member_id        uuid (user id)        ✔        ✔
595 51d97e66 Stavros Sachtouris
can_share        Member can share img  ignored  ✔
596 51d97e66 Stavros Sachtouris
================ ===================== ======== ======
597 51d97e66 Stavros Sachtouris
598 51d97e66 Stavros Sachtouris
**can_share** is optional and ignored in Plankton.
599 51d97e66 Stavros Sachtouris
600 51d97e66 Stavros Sachtouris
A request data example::
601 51d97e66 Stavros Sachtouris
602 51d97e66 Stavros Sachtouris
    {'memberships': [
603 51d97e66 Stavros Sachtouris
        {'member_id': 'uuid-1',
604 51d97e66 Stavros Sachtouris
        'can_share': false},
605 51d97e66 Stavros Sachtouris
        {'member_id': 'uuid-2'},
606 51d97e66 Stavros Sachtouris
        ...
607 51d97e66 Stavros Sachtouris
    ]}
608 51d97e66 Stavros Sachtouris
609 51d97e66 Stavros Sachtouris
|
610 51d97e66 Stavros Sachtouris
611 51d97e66 Stavros Sachtouris
=========================== =====================
612 51d97e66 Stavros Sachtouris
Return Code                 Description
613 51d97e66 Stavros Sachtouris
=========================== =====================
614 4a37ba3a Stavros Sachtouris
204 (No Content)            The request succeeded
615 51d97e66 Stavros Sachtouris
400 (Bad Request)           Invalid format for request data
616 51d97e66 Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
617 51d97e66 Stavros Sachtouris
404 (Not Found)             Image not found
618 51d97e66 Stavros Sachtouris
405 (Not Allowed)           Access to that image is not allowed
619 51d97e66 Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
620 51d97e66 Stavros Sachtouris
=========================== =====================
621 51d97e66 Stavros Sachtouris
622 167ac7d0 Stavros Sachtouris
Add a Member to an Image
623 167ac7d0 Stavros Sachtouris
------------------------
624 167ac7d0 Stavros Sachtouris
625 4a37ba3a Stavros Sachtouris
This request appends a user id to the list of users who can access a registered image.
626 4a37ba3a Stavros Sachtouris
627 4a37ba3a Stavros Sachtouris
===================================== ====== ======== ======
628 4a37ba3a Stavros Sachtouris
URI                                   Method Plankton Glance
629 4a37ba3a Stavros Sachtouris
===================================== ====== ======== ======
630 4a37ba3a Stavros Sachtouris
``/images/<image-id>/members/<uuid>`` PUT    ✔        ✔
631 4a37ba3a Stavros Sachtouris
===================================== ====== ======== ======
632 4a37ba3a Stavros Sachtouris
633 4a37ba3a Stavros Sachtouris
**image-id** is explained at :ref:`id-ref`
634 4a37ba3a Stavros Sachtouris
635 4a37ba3a Stavros Sachtouris
**uuid** is the unique user id of the user (see `Astakos API <astakos-api-guide.html>`_ on how to handle it)
636 4a37ba3a Stavros Sachtouris
637 4a37ba3a Stavros Sachtouris
|
638 4a37ba3a Stavros Sachtouris
639 4a37ba3a Stavros Sachtouris
====================  ========================= ======== =========
640 4a37ba3a Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
641 4a37ba3a Stavros Sachtouris
====================  ========================= ======== =========
642 4a37ba3a Stavros Sachtouris
X-Auth-Token          User authentication token required  required
643 4a37ba3a Stavros Sachtouris
====================  ========================= ======== =========
644 52f2c69b Stavros Sachtouris
645 4a37ba3a Stavros Sachtouris
|
646 4a37ba3a Stavros Sachtouris
647 4a37ba3a Stavros Sachtouris
=========================== =====================
648 4a37ba3a Stavros Sachtouris
Return Code                 Description
649 4a37ba3a Stavros Sachtouris
=========================== =====================
650 4a37ba3a Stavros Sachtouris
204 (No Content)            The request succeeded
651 4a37ba3a Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
652 4a37ba3a Stavros Sachtouris
404 (Not Found)             Image not found
653 4a37ba3a Stavros Sachtouris
405 (Not Allowed)           Access to that image is not allowed
654 4a37ba3a Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
655 4a37ba3a Stavros Sachtouris
=========================== =====================
656 4a37ba3a Stavros Sachtouris
657 167ac7d0 Stavros Sachtouris
Remove a Member from an Image
658 167ac7d0 Stavros Sachtouris
-----------------------------
659 167ac7d0 Stavros Sachtouris
660 4872824f Stavros Sachtouris
This request ensures that, after a successful call, the user with the given uuid will not have access to that image.
661 4872824f Stavros Sachtouris
662 4872824f Stavros Sachtouris
===================================== ====== ======== ======
663 4872824f Stavros Sachtouris
URI                                   Method Plankton Glance
664 4872824f Stavros Sachtouris
===================================== ====== ======== ======
665 4872824f Stavros Sachtouris
``/images/<image-id>/members/<uuid>`` DELETE ✔        ✔
666 4872824f Stavros Sachtouris
===================================== ====== ======== ======
667 4872824f Stavros Sachtouris
668 4872824f Stavros Sachtouris
**image-id** is explained at :ref:`id-ref`
669 4872824f Stavros Sachtouris
670 4872824f Stavros Sachtouris
**uuid** is the unique user id of the user (see `Astakos API <astakos-api-guide.html>`_ on how to handle it)
671 4872824f Stavros Sachtouris
672 4872824f Stavros Sachtouris
|
673 4872824f Stavros Sachtouris
674 4872824f Stavros Sachtouris
====================  ========================= ======== =========
675 4872824f Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
676 4872824f Stavros Sachtouris
====================  ========================= ======== =========
677 4872824f Stavros Sachtouris
X-Auth-Token          User authentication token required  required
678 4872824f Stavros Sachtouris
====================  ========================= ======== =========
679 52f2c69b Stavros Sachtouris
680 4872824f Stavros Sachtouris
|
681 4872824f Stavros Sachtouris
682 4872824f Stavros Sachtouris
=========================== =====================
683 4872824f Stavros Sachtouris
Return Code                 Description
684 4872824f Stavros Sachtouris
=========================== =====================
685 4872824f Stavros Sachtouris
204 (No Content)            The request succeeded
686 4872824f Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
687 4872824f Stavros Sachtouris
404 (Not Found)             Image not found
688 4872824f Stavros Sachtouris
405 (Not Allowed)           Access to that image is not allowed
689 4872824f Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
690 4872824f Stavros Sachtouris
=========================== =====================
691 4872824f Stavros Sachtouris
692 167ac7d0 Stavros Sachtouris
List Shared Images
693 167ac7d0 Stavros Sachtouris
------------------
694 ae7e1e1f Stavros Sachtouris
695 4872824f Stavros Sachtouris
This request returns a list of the images that are shared with a given user.
696 4872824f Stavros Sachtouris
697 4872824f Stavros Sachtouris
========================= ====== ======== ======
698 4872824f Stavros Sachtouris
URI                       Method Plankton Glance
699 4872824f Stavros Sachtouris
========================= ====== ======== ======
700 4872824f Stavros Sachtouris
``/shared-images/<uuid>`` DELETE ✔        ✔
701 4872824f Stavros Sachtouris
========================= ====== ======== ======
702 4872824f Stavros Sachtouris
703 4872824f Stavros Sachtouris
**uuid** is the unique user id of the user (see `Astakos API <astakos-api-guide.html>`_ on how to handle it)
704 4872824f Stavros Sachtouris
705 4872824f Stavros Sachtouris
|
706 4872824f Stavros Sachtouris
707 4872824f Stavros Sachtouris
====================  ========================= ======== =========
708 4872824f Stavros Sachtouris
Request Header Name   Value                     Plankton Glance
709 4872824f Stavros Sachtouris
====================  ========================= ======== =========
710 4872824f Stavros Sachtouris
X-Auth-Token          User authentication token required  required
711 4872824f Stavros Sachtouris
====================  ========================= ======== =========
712 52f2c69b Stavros Sachtouris
713 4872824f Stavros Sachtouris
|
714 4872824f Stavros Sachtouris
715 4872824f Stavros Sachtouris
=========================== =====================
716 4872824f Stavros Sachtouris
Return Code                 Description
717 4872824f Stavros Sachtouris
=========================== =====================
718 4872824f Stavros Sachtouris
200 (OK)                    The request succeeded
719 4872824f Stavros Sachtouris
401 (Unauthorized)          Missing or expired user token
720 4872824f Stavros Sachtouris
404 (Not Found)             Image not found
721 4872824f Stavros Sachtouris
405 (Not Allowed)           Access to that image is not allowed
722 4872824f Stavros Sachtouris
500 (Internal Server Error) The request cannot be completed because of an internal error
723 4872824f Stavros Sachtouris
=========================== =====================
724 4872824f Stavros Sachtouris
725 4872824f Stavros Sachtouris
In case of a 200 response, the response data is json-formated list of images that are shared with given user
726 4872824f Stavros Sachtouris
727 4872824f Stavros Sachtouris
================ ===================== ======== ======
728 4872824f Stavros Sachtouris
Name             Description           Plankton Glance
729 4872824f Stavros Sachtouris
================ ===================== ======== ======
730 4872824f Stavros Sachtouris
image_id         The Image ID          ✔        ✔
731 4872824f Stavros Sachtouris
can_share        Member can share img  false    ✔
732 4872824f Stavros Sachtouris
================ ===================== ======== ======
733 4872824f Stavros Sachtouris
734 4872824f Stavros Sachtouris
**can_share** in Plankton is always false and is returned for compatibility reasons.
735 4872824f Stavros Sachtouris
736 4872824f Stavros Sachtouris
Example Plankton response::
737 4872824f Stavros Sachtouris
738 4872824f Stavros Sachtouris
    {'shared_images': [
739 4872824f Stavros Sachtouris
        {'image_id': 'th3-r3qu3573d-1m4g3-1d',
740 4872824f Stavros Sachtouris
        'can_share': false},
741 4872824f Stavros Sachtouris
        ...
742 4872824f Stavros Sachtouris
    ]}
743 4872824f Stavros Sachtouris
744 c982ddf9 Stavros Sachtouris
Index of variables
745 c982ddf9 Stavros Sachtouris
------------------
746 ae7e1e1f Stavros Sachtouris
747 ae7e1e1f Stavros Sachtouris
The following variables affect the behavior of many requests.
748 ae7e1e1f Stavros Sachtouris
749 ae7e1e1f Stavros Sachtouris
.. _id-ref:
750 ae7e1e1f Stavros Sachtouris
751 ae7e1e1f Stavros Sachtouris
Image ID
752 ae7e1e1f Stavros Sachtouris
^^^^^^^^
753 ae7e1e1f Stavros Sachtouris
754 ae7e1e1f Stavros Sachtouris
The image id is a unique identifier for an image stored in Plankton or Glance.
755 ae7e1e1f Stavros Sachtouris
756 ae7e1e1f Stavros Sachtouris
======================= ========  ======
757 ae7e1e1f Stavros Sachtouris
Image-Id                Plankton  Glance
758 ae7e1e1f Stavros Sachtouris
======================= ========  ======
759 ae7e1e1f Stavros Sachtouris
Automatically generated ✔         **✘**
760 ae7e1e1f Stavros Sachtouris
Can be provided by user **✘**     ✔
761 ae7e1e1f Stavros Sachtouris
======================= ========  ======
762 ae7e1e1f Stavros Sachtouris
763 ae7e1e1f Stavros Sachtouris
.. _location-ref:
764 ae7e1e1f Stavros Sachtouris
765 ae7e1e1f Stavros Sachtouris
Image File Location at a Pithos+ Server
766 ae7e1e1f Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
767 ae7e1e1f Stavros Sachtouris
768 ae7e1e1f Stavros Sachtouris
To refer to a pithos location file, use the following format::
769 ae7e1e1f Stavros Sachtouris
770 ae7e1e1f Stavros Sachtouris
    pithos://<unique-user-id>/<container>/<object-path>
771 ae7e1e1f Stavros Sachtouris
772 ae7e1e1f Stavros Sachtouris
The terms unique-user-id (uuid), container and object-path are used as defined in `Pithos <pithos.html>`_ context.
773 ae7e1e1f Stavros Sachtouris
774 ae7e1e1f Stavros Sachtouris
.. _container-format-ref:
775 ae7e1e1f Stavros Sachtouris
776 ae7e1e1f Stavros Sachtouris
Container format
777 ae7e1e1f Stavros Sachtouris
^^^^^^^^^^^^^^^^
778 ae7e1e1f Stavros Sachtouris
779 ae7e1e1f Stavros Sachtouris
===== ================================= ======== ======
780 ae7e1e1f Stavros Sachtouris
Value Description                       Plankton Glance
781 ae7e1e1f Stavros Sachtouris
===== ================================= ======== ======
782 ae7e1e1f Stavros Sachtouris
aki   Amazon kernel image               ✔        ✔
783 ae7e1e1f Stavros Sachtouris
ari   Amazon ramdisk image              ✔        ✔
784 ae7e1e1f Stavros Sachtouris
ami   Amazon machine image              ✔        ✔
785 ae7e1e1f Stavros Sachtouris
bare  no container or metadata envelope default  default
786 ae7e1e1f Stavros Sachtouris
ovf   Open Virtualization Format        ✔        ✔
787 ae7e1e1f Stavros Sachtouris
===== ================================= ======== ======
788 ae7e1e1f Stavros Sachtouris
789 ae7e1e1f Stavros Sachtouris
.. _disk-format-ref:
790 ae7e1e1f Stavros Sachtouris
791 ae7e1e1f Stavros Sachtouris
Disk format
792 ae7e1e1f Stavros Sachtouris
^^^^^^^^^^^
793 ae7e1e1f Stavros Sachtouris
794 ae7e1e1f Stavros Sachtouris
======== ================================= ======== ======
795 ae7e1e1f Stavros Sachtouris
Value    Description                       Plankton Glance
796 ae7e1e1f Stavros Sachtouris
======== ================================= ======== ======
797 ae7e1e1f Stavros Sachtouris
diskdump Any disk image dump               default  **✘**
798 ae7e1e1f Stavros Sachtouris
extdump  EXT3 image                        ✔        **✘**
799 ae7e1e1f Stavros Sachtouris
ntfsdump NTFS image                        ✔        **✘**
800 ae7e1e1f Stavros Sachtouris
raw      Unstructured disk image           **✘**    ✔
801 ae7e1e1f Stavros Sachtouris
vhd      (VMWare,Xen,MS,VirtualBox, a.o.)  **✘**    ✔
802 ae7e1e1f Stavros Sachtouris
vmdk     Another common disk format        **✘**    ✔
803 ae7e1e1f Stavros Sachtouris
vdi      (VirtualBox, QEMU)                **✘**    ✔
804 ae7e1e1f Stavros Sachtouris
iso      optical disc (e.g. CDROM)         **✘**    ✔
805 ae7e1e1f Stavros Sachtouris
qcow2    (QEMU)                            **✘**    ✔
806 ae7e1e1f Stavros Sachtouris
aki      Amazon kernel image               **✘**    ✔
807 ae7e1e1f Stavros Sachtouris
ari      Amazon ramdisk image              **✘**    ✔
808 ae7e1e1f Stavros Sachtouris
ami      Amazon machine image              **✘**    ✔
809 ae7e1e1f Stavros Sachtouris
======== ================================= ======== ======
810 ae7e1e1f Stavros Sachtouris
811 ae7e1e1f Stavros Sachtouris
.. _store-ref:
812 ae7e1e1f Stavros Sachtouris
813 ae7e1e1f Stavros Sachtouris
Store types
814 ae7e1e1f Stavros Sachtouris
^^^^^^^^^^^
815 ae7e1e1f Stavros Sachtouris
816 ae7e1e1f Stavros Sachtouris
======================= ========  ======
817 ae7e1e1f Stavros Sachtouris
X-Image-Meta-Store      Plankton  Glance
818 ae7e1e1f Stavros Sachtouris
======================= ========  ======
819 ae7e1e1f Stavros Sachtouris
pithos                  ✔         **✘**
820 ae7e1e1f Stavros Sachtouris
file                    **✘**     ✔
821 ae7e1e1f Stavros Sachtouris
s3                      **✘**     ✔
822 ae7e1e1f Stavros Sachtouris
swift                   **✘**     ✔
823 ae7e1e1f Stavros Sachtouris
======================= ========  ======