diff options
| author | Doug Hellmann <doug@doughellmann.com> | 2017-06-15 16:54:52 -0400 |
|---|---|---|
| committer | Doug Hellmann <doug@doughellmann.com> | 2017-06-28 12:24:48 -0400 |
| commit | e8acf5e7367821625ee8e94866b117990d207c9f (patch) | |
| tree | dd93ed509133564ed05738380efab9914ee338c7 /doc/source/reference/index.rst | |
| parent | d6e936cd14f0954751dfc1b754f08deb166a53bf (diff) | |
| download | python-glanceclient-e8acf5e7367821625ee8e94866b117990d207c9f.tar.gz | |
move existing content into the new standard structure
This patch rearranges and reformats existing content.
It replaces the home-grown autodoc feature with the one built into pbr,
for consistency with other OpenStack projects.
It depends on the doc-migration spec and a pbr feature to allow us to
specify where the autodoc content should go in the source tree during
the build.
Change-Id: I8d2bb11b5ef3e46fcd22c8bed8f84060d8ab6f03
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
Depends-On: I2bd5652bb59cbd9c939931ba2e7db1b37d2b30bb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Diffstat (limited to 'doc/source/reference/index.rst')
| -rw-r--r-- | doc/source/reference/index.rst | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst new file mode 100644 index 0000000..33ce8b2 --- /dev/null +++ b/doc/source/reference/index.rst @@ -0,0 +1,27 @@ +========================== + Python Library Reference +========================== + +In order to use the python api directly, you must first obtain an auth +token and identify which endpoint you wish to speak to. Once you have +done so, you can use the API like so:: + + >>> from glanceclient import Client + >>> glance = Client('1', endpoint=OS_IMAGE_ENDPOINT, token=OS_AUTH_TOKEN) + >>> image = glance.images.create(name="My Test Image") + >>> print image.status + 'queued' + >>> 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) + >>> image.delete() + +.. toctree:: + :maxdepth: 2 + + api/index + apiv2 |
