Revision 404eb288
b/docs/collection_of_examples/imageregister.rst | ||
---|---|---|
240 | 240 |
Metadata file uploaded as pithos:debian_base3.diskdump.meta (version 1359) |
241 | 241 |
[kamaki]: |
242 | 242 |
|
243 |
Metadata and Property modification |
|
244 |
---------------------------------- |
|
245 |
|
|
246 |
Image metadata and custom properties can be modified even after the image is |
|
247 |
registered. Metadata are fixed image attributes, like name, disk format etc. |
|
248 |
while custom properties are set by the image owner and, usually, refer to |
|
249 |
attributes of the images OS. |
|
250 |
|
|
251 |
Let's rename the image: |
|
252 |
|
|
253 |
.. code-block:: console |
|
254 |
|
|
255 |
[kamaki]: image meta set 7h1rd-1m4g3-1d --name='Changed Name' |
|
256 |
[kamaki]: |
|
257 |
|
|
258 |
If we, now, list the image metadata, we will see that the name is changed: |
|
259 |
|
|
260 |
.. code-block:: console |
|
261 |
|
|
262 |
[kamaki]: image meta list 7h1rd-1m4g3-1d |
|
263 |
checksum: 3cb03556ec971f...e8dd6190443b560cb7 |
|
264 |
container-format: bare |
|
265 |
created-at: 2013-06-19 08:00:22 |
|
266 |
deleted-at: |
|
267 |
disk-format: diskdump |
|
268 |
id: 7h1rd-1m4g3-1d |
|
269 |
is-public: False |
|
270 |
location: pithos://s0m3-u53r-1d/pithos/debian_base3.diskdump |
|
271 |
name: Changed Name |
|
272 |
owner: s0m3-u53r-1d |
|
273 |
properties: |
|
274 |
OS: Linux |
|
275 |
USER: root |
|
276 |
size: 903471104 |
|
277 |
status: available |
|
278 |
updated-at: 2013-06-19 08:01:00 |
|
279 |
[kamaki]: |
|
280 |
|
|
281 |
We can use the same idea to change the values of other metadata like disk |
|
282 |
format, container format or status. On the other hand, we cannot modify the |
|
283 |
id, owner, location, checksum and dates. E.g., to publish and unpublish: |
|
284 |
|
|
285 |
.. code-block:: console |
|
286 |
|
|
287 |
[kamaki]: image meta set 7h1rd-1m4g3-1d --publish --name='Debian Base Gama' |
|
288 |
[kamaki]: image meta set 7h1rd-1m4g3-1d --unpublish |
|
289 |
[kamaki]: |
|
290 |
|
|
291 |
The first call published the image (set is-public to True) and also restored |
|
292 |
the name to "Debian Base Gama". The second one unpublished the image (set |
|
293 |
is-public to False). |
|
294 |
|
|
295 |
To delete metadata, use the image meta delete method: |
|
296 |
|
|
297 |
.. code-block:: console |
|
298 |
|
|
299 |
[kamaki]: image meta delete 7h1rd-1m4g3-1d status |
|
300 |
[kamaki]: |
|
301 |
|
|
302 |
will empty the value of "status". |
|
303 |
|
|
304 |
These operations can be used for properties with the same semantics: |
|
305 |
|
|
306 |
.. code-block:: console |
|
307 |
|
|
308 |
[kamaki]: image meta set 7h1rd-1m4g3-1d -p user=user |
|
309 |
[kamaki]: image meta list 7h1rd-1m4g3-1d |
|
310 |
... |
|
311 |
properties: |
|
312 |
OS: Linux |
|
313 |
USER: user |
|
314 |
... |
|
315 |
[kamaki]: |
|
316 |
|
|
317 |
Just to test the feature, let's create a property "greet" with value |
|
318 |
"hi there", and then remove it. Also, let's restore the value of USER: |
|
319 |
|
|
320 |
.. code-block:: console |
|
321 |
|
|
322 |
[kamaki]: image meta set 7h1rd-1m4g3-1d -p greet='Hi there' -p user=root |
|
323 |
[kamaki]: image meta list 7h1rd-1m4g3-1d |
|
324 |
... |
|
325 |
properties: |
|
326 |
OS: Linux |
|
327 |
USER: root |
|
328 |
GREET: Hi there |
|
329 |
... |
|
330 |
[kamaki]: image meta delete 7h1rd-1m4g3-1d -p greet |
|
331 |
[kamaki]: image meta list 7h1rd-1m4g3-1d |
|
332 |
... |
|
333 |
properties: |
|
334 |
OS: Linux |
|
335 |
USER: root |
|
336 |
... |
|
337 |
[kamaki]: |
|
338 |
|
|
339 |
|
|
243 | 340 |
Reregistration: priorities and overrides |
244 | 341 |
---------------------------------------- |
245 | 342 |
|
b/docs/commands.rst | ||
---|---|---|
69 | 69 |
.. code-block:: text |
70 | 70 |
|
71 | 71 |
list : List images accessible by user |
72 |
meta : Get image metadata |
|
72 |
meta : Manage image metadata |
|
73 |
list : Get image metadata |
|
74 |
set : Add / update metadata and properties for an image |
|
75 |
delete : Remove/empty image metadata and/or custom properties |
|
73 | 76 |
register : (Re)Register an image |
74 | 77 |
unregister: Unregister an image (does not delete the image file) |
75 | 78 |
shared : List shared images |
... | ... | |
78 | 81 |
delete : Delete image |
79 | 82 |
info : Get image details |
80 | 83 |
properties: Manage properties related to OS installation in an image |
81 |
add : Add a property to an image |
|
82 | 84 |
delete: Delete a property from an image |
83 | 85 |
get : Get an image property |
84 | 86 |
list : List all image properties |
... | ... | |
162 | 164 |
list : List server metadata |
163 | 165 |
set : Add / update server metadata |
164 | 166 |
delete: Delete a piece of server metadata |
165 |
meta : Get a server's metadata |
|
166 | 167 |
reboot : Reboot a server |
167 | 168 |
rename : Update a server's name |
168 | 169 |
shutdown: Shutdown a server |
b/docs/man/kamaki.rst | ||
---|---|---|
153 | 153 |
************** |
154 | 154 |
|
155 | 155 |
* list List images accessible by user |
156 |
* meta Get image metadata |
|
156 |
* meta Manage image metadata |
|
157 |
* list Get image metadata |
|
158 |
* set Add / update metadata and properties for an image |
|
159 |
* delete Remove/empty image metadata and/or custom properties |
|
157 | 160 |
* register (Re)Register an image |
158 | 161 |
* unregister Unregister an image (does not delete the image file) |
159 | 162 |
* shared List shared images |
... | ... | |
162 | 165 |
* delete Delete image |
163 | 166 |
* info Get image details |
164 | 167 |
* properties Manage properties related to OS installation in an image |
165 |
* add Add a property to an image |
|
166 | 168 |
* delete Delete a property from an image |
167 | 169 |
* get Get an image property |
168 | 170 |
* list List all image properties |
b/docs/setup.rst | ||
---|---|---|
492 | 492 |
|
493 | 493 |
.. code-block:: console |
494 | 494 |
|
495 |
$ kamaki image meta <img id> -j > img.details |
|
495 |
$ kamaki image meta list <img id> -j > img.details
|
|
496 | 496 |
|
497 | 497 |
* livetest.image_id = <A valid image id used for testing> |
498 | 498 |
* livetest.image_local_path = <The local path of the testing image> |
Also available in: Unified diff