Statistics
| Branch: | Tag: | Revision:

root / docs / plankton-api-guide.rst @ 9f41ab1e

History | View | Annotate | Download (35 kB)

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