Revision bc4cf6c7
b/docs/plankton-api-guide.rst | ||
---|---|---|
14 | 14 |
* Clarify the differences between Plankton and Glance |
15 | 15 |
* Specify metadata semantics and user interface guidelines for a common experience across client software implementations |
16 | 16 |
|
17 |
Cross-method variables |
|
18 |
---------------------- |
|
19 |
|
|
20 |
The following variables affect the behavior of many requests. |
|
21 |
|
|
22 |
.. _container-format-ref: |
|
23 |
|
|
24 |
Container format |
|
25 |
^^^^^^^^^^^^^^^^ |
|
26 |
|
|
27 |
===== ================================= ======== ====== |
|
28 |
Value Description Plankton Glance |
|
29 |
===== ================================= ======== ====== |
|
30 |
aki Amazon kernel image ✔ ✔ |
|
31 |
ari Amazon ramdisk image ✔ ✔ |
|
32 |
ami Amazon machine image ✔ ✔ |
|
33 |
bare no container or metadata envelope default default |
|
34 |
ovf Open Virtualization Format ✔ ✔ |
|
35 |
===== ================================= ======== ====== |
|
36 |
|
|
37 |
.. _disk-format-ref: |
|
38 |
|
|
39 |
Disk format |
|
40 |
^^^^^^^^^^^ |
|
41 |
|
|
42 |
======== ================================= ======== ====== |
|
43 |
Value Description Plankton Glance |
|
44 |
======== ================================= ======== ====== |
|
45 |
diskdump Any disk image dump default **✘** |
|
46 |
extdump EXT3 image ✔ **✘** |
|
47 |
ntfsdump NTFS image ✔ **✘** |
|
48 |
raw Unstructured disk image **✘** ✔ |
|
49 |
vhd (VMWare,Xen,MS,VirtualBox, a.o.) **✘** ✔ |
|
50 |
vmdk Another common disk format **✘** ✔ |
|
51 |
vdi (VirtualBox, QEMU) **✘** ✔ |
|
52 |
iso optical disc (e.g. CDROM) **✘** ✔ |
|
53 |
qcow2 (QEMU) **✘** ✔ |
|
54 |
aki Amazon kernel image **✘** ✔ |
|
55 |
ari Amazon ramdisk image **✘** ✔ |
|
56 |
ami Amazon machine image **✘** ✔ |
|
57 |
======== ================================= ======== ====== |
|
58 |
|
|
17 | 59 |
Image ReST API |
18 | 60 |
-------------- |
19 | 61 |
|
... | ... | |
21 | 63 |
URI Method Description Plankton Glance |
22 | 64 |
===================================== ====== ================================================ ======== ====== |
23 | 65 |
``/images`` GET `List Available Images <#id2>`_ ✔ ✔ |
24 |
``/images`` POST `Add a New Image <#id3>`_ ✔ ✔
|
|
66 |
``/images`` POST `Add or update an Image <#id3>`_ ✔ ✔
|
|
25 | 67 |
``/images`` PUT `Update an Image <#id4>`_ ✔ ✔ |
26 | 68 |
``/images/detail`` GET `List Available Images in Detail <#id5>`_ ✔ ✔ |
27 | 69 |
``/images/<img-id>`` HEAD `Retrieve Image Metadata <#id6>`_ ✔ ✔ |
... | ... | |
40 | 82 |
|
41 | 83 |
**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. |
42 | 84 |
|
85 |
|
|
43 | 86 |
List Available Images |
44 | 87 |
--------------------- |
45 | 88 |
|
89 |
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: |
|
90 |
|
|
91 |
* registered by the user |
|
92 |
* shared to user by others |
|
93 |
* public |
|
94 |
|
|
46 | 95 |
===================================== ====== ===================== ======== ====== |
47 | 96 |
URI Method Description Plankton Glance |
48 | 97 |
===================================== ====== ===================== ======== ====== |
... | ... | |
64 | 113 |
sort_dir Sort images in given direction ✔ ✔ |
65 | 114 |
====================== ======================================= ======== ====== |
66 | 115 |
|
67 |
**container_format** |
|
116 |
**container_format** values are listed at :ref:`container-format-ref`
|
|
68 | 117 |
|
69 |
===== ================================= ======== ====== |
|
70 |
Value Description Plankton Glance |
|
71 |
===== ================================= ======== ====== |
|
72 |
aki Amazon kernel image ✔ ✔ |
|
73 |
ari Amazon ramdisk image ✔ ✔ |
|
74 |
ami Amazon machine image ✔ ✔ |
|
75 |
bare no container or metadata envelope default default |
|
76 |
ovf Open Virtualization Format ✔ ✔ |
|
77 |
===== ================================= ======== ====== |
|
118 |
**disk_format** values are listed at :ref:`disk-format-ref` |
|
78 | 119 |
|
79 |
**disk_format**
|
|
120 |
**sort_key** values: id, name, status, size, disk_format, container_format, created_at, updated_at
|
|
80 | 121 |
|
81 |
======== ================================= ======== ====== |
|
82 |
Value Description Plankton Glance |
|
83 |
======== ================================= ======== ====== |
|
84 |
diskdump Any disk image dump default **✘** |
|
85 |
extdump EXT3 image ✔ **✘** |
|
86 |
ntfsdump NTFS image ✔ **✘** |
|
87 |
raw Unstructured disk image **✘** ✔ |
|
88 |
vhd (VMWare,Xen,MS,VirtualBox, a.o.) **✘** ✔ |
|
89 |
vmdk Another common disk format **✘** ✔ |
|
90 |
vdi (VirtualBox, QEMU) **✘** ✔ |
|
91 |
iso optical disc (e.g. CDROM) **✘** ✔ |
|
92 |
qcow2 (QEMU) **✘** ✔ |
|
93 |
aki Amazon kernel image **✘** ✔ |
|
94 |
ari Amazon ramdisk image **✘** ✔ |
|
95 |
ami Amazon machine image **✘** ✔ |
|
96 |
======== ================================= ======== ====== |
|
97 |
|
|
98 |
**sort_key** values: id,name,status,size,disk_format, container_format,created_at,updated_at |
|
99 |
|
|
100 |
**sort_dir** |
|
101 |
|
|
102 |
===== ================================= ======== ======= |
|
103 |
Value Description Plankton Glance |
|
104 |
===== ================================= ======== ======= |
|
105 |
asc Ascending order default default |
|
106 |
desc Descending order ✔ ✔ |
|
107 |
===== ================================= ======== ======= |
|
122 |
======== ================ ======== ======= |
|
123 |
sort_dir Description Plankton Glance |
|
124 |
======== ================ ======== ======= |
|
125 |
asc Ascending order default default |
|
126 |
desc Descending order ✔ ✔ |
|
127 |
======== ================ ======== ======= |
|
108 | 128 |
|
109 | 129 |
| |
110 | 130 |
|
111 |
==================== ========================= ======== ====== |
|
131 |
==================== ========================= ======== =========
|
|
112 | 132 |
Request Header Name Value Plankton Glance |
113 |
==================== ========================= ======== ====== |
|
114 |
X-Auth-Token User authentication token ✔ ✔
|
|
115 |
==================== ========================= ======== ====== |
|
133 |
==================== ========================= ======== =========
|
|
134 |
X-Auth-Token User authentication token required required
|
|
135 |
==================== ========================= ======== =========
|
|
116 | 136 |
|
117 | 137 |
| |
118 | 138 |
|
... | ... | |
160 | 180 |
"size": 761368576 |
161 | 181 |
}] |
162 | 182 |
|
163 |
Add a New image |
|
164 |
--------------- |
|
183 |
Add or update an image |
|
184 |
---------------------- |
|
185 |
|
|
186 |
According to the Synnefo approach, this request performs two functionalities: |
|
187 |
|
|
188 |
* registers a new image to Plankton |
|
189 |
* commits metadata for the new image |
|
190 |
* update the metadata of an existing image |
|
191 |
|
|
192 |
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). |
|
193 |
|
|
194 |
According to the OpenStack approach, this request performs the first two functionalities by uploading the the image data and metadata to Glance. In Glance, the update mechanism is not implemented with this specific request. |
|
195 |
|
|
196 |
===================================== ====== ===================== ======== ====== |
|
197 |
URI Method Description Plankton Glance |
|
198 |
===================================== ====== ===================== ======== ====== |
|
199 |
``/images`` POST Add / Update an image ✔ ✔ |
|
200 |
===================================== ====== ===================== ======== ====== |
|
201 |
|
|
202 |
| |
|
203 |
|
|
204 |
============================= ========================= ======== ======== |
|
205 |
Request Header Name Value Plankton Glance |
|
206 |
============================= ========================= ======== ======== |
|
207 |
X-Auth-Token User authentication token required required |
|
208 |
X-Image-Meta-Name Img name required required |
|
209 |
X-Image-Meta-Id Unique image id **✘** ✔ |
|
210 |
X-Image-Meta-Location img file location @Pithos required **✘** |
|
211 |
X-Image-Meta-Store Storage system ✔ ✔ |
|
212 |
X-Image-Meta-Disk-Format Img disk format ✔ **✘** |
|
213 |
X-Image-Meta-Disk_format Img disk format **✘** ✔ |
|
214 |
X-Image-Meta-Container-Format Container format ✔ **✘** |
|
215 |
X-Image-Meta-Container_format Container format **✘** ✔ |
|
216 |
X-Image-Meta-Size Size of img file ✔ ✔ |
|
217 |
X-Image-Meta-Checksum MD5 checksum of img file ✔ ✔ |
|
218 |
X-Image-Meta-Is-Public Make image public ✔ **✘** |
|
219 |
X-Image-Meta-Is_public Make image public **✘** ✔ |
|
220 |
x-image-meta-Min-Ram Minimum ram required (MB) **✘** ✔ |
|
221 |
x-image-meta-Min-Disk Maximum ram required (MB) **✘** ✔ |
|
222 |
X-Image-Meta-Owner Image owner ✔ ✔ |
|
223 |
X-Image-Meta-Property-* Property prefix ✔ ✔ |
|
224 |
============================= ========================= ======== ======== |
|
225 |
|
|
226 |
**X-Meta-Location** format:: |
|
227 |
|
|
228 |
pithos://<unique-user-id>/<container>/<object-path> |
|
229 |
|
|
230 |
The terms unique-user-id (uuid), container and object-path are used as defined in `Pithos <pithos.html>`_ context. |
|
231 |
|
|
232 |
======================= ======== ====== |
|
233 |
X-Image-Meta-Id Plankton Glance |
|
234 |
======================= ======== ====== |
|
235 |
Automatically generated ✔ **✘** |
|
236 |
Can be provided by used **✘** ✔ |
|
237 |
======================= ======== ====== |
|
238 |
|
|
239 |
| |
|
240 |
|
|
241 |
======================= ======== ====== |
|
242 |
X-Image-Meta-Store Plankton Glance |
|
243 |
======================= ======== ====== |
|
244 |
pithos ✔ **✘** |
|
245 |
file **✘** ✔ |
|
246 |
s3 **✘** ✔ |
|
247 |
swift **✘** ✔ |
|
248 |
======================= ======== ====== |
|
249 |
|
|
250 |
**X-Meta-Disk-Format** values are listed at :ref:`disk-format-ref` |
|
251 |
|
|
252 |
**X-Meta-Container-Format** values are listed at :ref:`container-format-ref` |
|
253 |
|
|
254 |
**X-Image-Meta-Size** is optional, but should much the actual image file size. |
|
255 |
|
|
256 |
**X-Image-Meta-Is-Public** values are true or false (case insensitive) |
|
257 |
|
|
258 |
**X-Image-Meta-Property-*** is used as a prefix to set custom, free-form key:value properties on an image, e.g.:: |
|
259 |
|
|
260 |
X-Image-Meta-Property-OS: Debian Linux |
|
261 |
X-Image-Meta-Property-Users: Root |
|
262 |
|
|
263 |
=========================== ===================== |
|
264 |
Return Code Description |
|
265 |
=========================== ===================== |
|
266 |
200 (OK) The request succeeded |
|
267 |
400 (Bad Request) |
|
268 |
\ No name header |
|
269 |
\ Illegal header value |
|
270 |
\ File not found on given location |
|
271 |
\ Invalid size or checksum |
|
272 |
401 (Unauthorized) Missing or expired user token |
|
273 |
500 (Internal Server Error) The request cannot be completed because of an internal error |
|
274 |
501 (Not Implemented) Location header is empty or omitted |
|
275 |
=========================== ===================== |
|
165 | 276 |
|
166 |
Lele |
|
277 |
The following is used when the response code is 200: |
|
278 |
|
|
279 |
============================= ===================== ======== ====== |
|
280 |
Response Header Description Plankton Glance |
|
281 |
============================= ===================== ======== ====== |
|
282 |
X-Image-Meta-Id Auto-generated img id ✔ **✘** |
|
283 |
X-Meta-Image-Name Img name ✔ **✘** |
|
284 |
X-Meta-image-Disk-Format Disk format ✔ **✘** |
|
285 |
X-Meta-Image-Container-Format Container format ✔ **✘** |
|
286 |
X-Image-Meta-Size Img file size ✔ **✘** |
|
287 |
X-Image-Meta-Checksum Img file MD5 checksum ✔ **✘** |
|
288 |
X-Image-Meta-Location Pithos+ file location ✔ **✘** |
|
289 |
X-Image-Meta-Created_at Date of img creation ✔ **✘** |
|
290 |
X-Image-Meta-Deleted_at Date of img deletion ✔ **✘** |
|
291 |
X-Image-Meta-Status Img status ✔ **✘** |
|
292 |
X-Image-Meta-Is-Public True if img is public ✔ **✘** |
|
293 |
X-Image-Meta-Owner Img owner or tentant ✔ **✘** |
|
294 |
X-Image-Meta-Property-* Custom img properties ✔ **✘** |
|
295 |
============================= ===================== ======== ====== |
|
167 | 296 |
|
168 | 297 |
Update an Image |
169 | 298 |
--------------- |
Also available in: Unified diff