diff options
| author | Alan Meadows <alan.meadows@gmail.com> | 2015-03-12 20:21:20 -0700 |
|---|---|---|
| committer | Alan Meadows <alan.meadows@gmail.com> | 2015-03-13 07:01:55 -0700 |
| commit | f00f769da53d7b257a68e57d9f8fcc22648cb601 (patch) | |
| tree | dcddd4f58606c661f2487d7ca1a01b0e246e0167 /doc/source | |
| parent | cc4c402f099304e2657347a5e33745de884157c3 (diff) | |
| download | python-glanceclient-f00f769da53d7b257a68e57d9f8fcc22648cb601.tar.gz | |
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
Diffstat (limited to 'doc/source')
| -rw-r--r-- | doc/source/apiv2.rst | 12 | ||||
| -rw-r--r-- | doc/source/index.rst | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/source/apiv2.rst b/doc/source/apiv2.rst index ef6fb71..436db8f 100644 --- a/doc/source/apiv2.rst +++ b/doc/source/apiv2.rst @@ -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):: diff --git a/doc/source/index.rst b/doc/source/index.rst index 7d0d95f..fc88cbd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -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) |
