add examples for properties and doc build script

* add image property examples for v1 and v2
* add standard sphinx doc build helper

Change-Id: I2f8dff884d9f22cc582aabcbbbbaea6d6fe725c0
This commit is contained in:
Alan Meadows
2015-03-12 20:21:20 -07:00
parent cc4c402f09
commit f00f769da5
3 changed files with 103 additions and 0 deletions
+12
View File
@@ -38,6 +38,18 @@ Update a specific image::
# update with a list of image attribute names and their new values
glance.images.update(image.id, name="myNewImageName")
Custom Properties
-----------------
Set a custom property on an image::
# set an arbitrary property on an image
glance.images.update(image.id, my_custom_property='value')
Remove a custom property from an image::
# remove the custom property 'my_custom_property'
glance.images.update(image.id, remove_props=['my_custom_property'])
Delete
------
Delete specified image(s)::
+1
View File
@@ -10,6 +10,7 @@ In order to use the python api directly, you must first obtain an auth token and
>>> image.update(data=open('/tmp/myimage.iso', 'rb'))
>>> print image.status
'active'
>>> image.update(properties=dict(my_custom_property='value'))
>>> with open('/tmp/copyimage.iso', 'wb') as f:
for chunk in image.data:
f.write(chunk)