1
Python bindings to the OpenStack Volume API
2
===========================================
4
This is a client for the OpenStack Volume API. There's a Python API (the
5
``cinderclient`` module), and a command-line script (``cinder``). Each
6
implements 100% of the OpenStack Volume API.
8
[PENDING] `Full documentation is available`__.
10
__ http://packages.python.org/python-cinderclient/
12
You'll also probably want to read `OpenStack Compute Developer Guide API`__ --
13
the first bit, at least -- to get an idea of the concepts. Rackspace is doing
14
the cloud hosting thing a bit differently from Amazon, and if you get the
15
concepts this library should make more sense.
17
__ http://docs.openstack.org/api/
19
The project is hosted on `Launchpad`_, where bugs can be filed. The code is
20
hosted on `Github`_. Patches must be submitted using `Gerrit`_, *not* Github
23
.. _Github: https://github.com/openstack/python-cinderclient
24
.. _Launchpad: https://launchpad.net/python-cinderclient
25
.. _Gerrit: http://wiki.openstack.org/GerritWorkflow
27
This code a fork of `Jacobian's python-cloudservers`__ If you need API support
28
for the Rackspace API solely or the BSD license, you should use that repository.
29
python-client is licensed under the Apache License like the rest of OpenStack.
31
__ http://github.com/jacobian/python-cloudservers
33
.. contents:: Contents:
39
Installing this package gets you a shell command, ``cinder``, that you
40
can use to interact with any Rackspace compatible API (including OpenStack).
42
You'll need to provide your OpenStack username and password. You can do this
43
with the ``--os_username``, ``--os_password`` and ``--os_tenant_name``
44
params, but it's easier to just set them as environment variables::
46
export OS_USERNAME=openstack
47
export OS_PASSWORD=yadayada
48
export OS_TENANT_NAME=myproject
50
You will also need to define the authentication url with ``--os_auth_url``
51
and the version of the API with ``--version``. Or set them as an environment
54
export OS_AUTH_URL=http://example.com:8774/v1.1/
55
export OS_COMPUTE_API_VERSION=1.1
57
If you are using Keystone, you need to set the CINDER_URL to the keystone
60
export OS_AUTH_URL=http://example.com:5000/v2.0/
62
Since Keystone can return multiple regions in the Service Catalog, you
63
can specify the one you want with ``--os_region_name`` (or
64
``export OS_REGION_NAME``). It defaults to the first in the list returned.
66
You'll find complete documentation on the shell by running
69
usage: cinder [--debug] [--os_username OS_USERNAME] [--os_password OS_PASSWORD]
70
[--os_tenant_name OS_TENANT_NAME] [--os_auth_url OS_AUTH_URL]
71
[--os_region_name OS_REGION_NAME] [--service_type SERVICE_TYPE]
72
[--service_name SERVICE_NAME] [--endpoint_type ENDPOINT_TYPE]
73
[--version VERSION] [--username USERNAME]
74
[--region_name REGION_NAME] [--apikey APIKEY]
75
[--projectid PROJECTID] [--url URL]
78
Command-line interface to the OpenStack Nova API.
82
create Add a new volume.
83
credentials Show user credentials returned from auth
84
delete Remove a volume.
85
endpoints Discover endpoints that get returned from the
87
list List all the volumes.
88
show Show details about a volume.
89
snapshot-create Add a new snapshot.
90
snapshot-delete Remove a snapshot.
91
snapshot-list List all the snapshots.
92
snapshot-show Show details about a snapshot.
93
type-create Create a new volume type.
94
type-delete Delete a specific flavor
95
type-list Print a list of available 'volume types'.
96
bash-completion Prints all of the commands and options to stdout so
98
help Display help about this program or one of its
102
--debug Print debugging output
103
--os_username OS_USERNAME
104
Defaults to env[OS_USERNAME].
105
--os_password OS_PASSWORD
106
Defaults to env[OS_PASSWORD].
107
--os_tenant_name OS_TENANT_NAME
108
Defaults to env[OS_TENANT_NAME].
109
--os_auth_url OS_AUTH_URL
110
Defaults to env[OS_AUTH_URL].
111
--os_region_name OS_REGION_NAME
112
Defaults to env[OS_REGION_NAME].
113
--service_type SERVICE_TYPE
114
Defaults to compute for most actions
115
--service_name SERVICE_NAME
116
Defaults to env[CINDER_SERVICE_NAME]
117
--endpoint_type ENDPOINT_TYPE
118
Defaults to env[CINDER_ENDPOINT_TYPE] or publicURL.
119
--os_compute_api_version VERSION
120
Accepts 1.1, defaults to env[OS_COMPUTE_API_VERSION].
121
--username USERNAME Deprecated
122
--region_name REGION_NAME
124
--apikey APIKEY, --password APIKEY
126
--projectid PROJECTID, --tenant_name PROJECTID
128
--url URL, --auth_url URL
131
See "cinder help COMMAND" for help on a specific command.
136
[PENDING] There's also a `complete Python API`__.
138
__ http://packages.python.org/python-cinderclient/
140
Quick-start using keystone::
142
# use v2.0 auth with http://example.com:5000/v2.0/")
143
>>> from cinderclient.v1 import client
144
>>> nt = client.Client(USER, PASS, TENANT, AUTH_URL, service_type="compute")
145
>>> nt.flavors.list()
147
>>> nt.servers.list()
149
>>> nt.keypairs.list()
155
[PENDING] See `the release notes <http://packages.python.org/python-cinderclient/releases.html>`_.