
To better facilitate the building and publishing of sphinx documentation by Jenkins we are moving all openstack projects with sphinx documentation to a common doc tree structure. Documentation goes in project/doc and build results go in project/doc/build. Change-Id: I3ae14ac735d9b4c0b534eac9a9c142f8ccaac1b9
1.5 KiB
1.5 KiB
The cinderclient
Python API
cinderclient
cinderclient
Usage
First create an instance of OpenStack
with your credentials:
>>> from cinderclient import OpenStack
>>> cinder = OpenStack(USERNAME, PASSWORD, AUTH_URL)
Then call methods on the OpenStack
object:
backup_schedules
A BackupScheduleManager
-- manage automatic backup
images.
flavors
A FlavorManager
--
query available "flavors" (hardware configurations).
images
An ImageManager
--
query and create server disk images.
ipgroups
A IPGroupManager
-- manage shared public IP addresses.
servers
A ServerManager
--
start, stop, and manage virtual machines.
authenticate
For example:
>>> cinder.servers.list()
[<Server: buildslave-ubuntu-9.10>]
>>> cinder.flavors.list()
[<Flavor: 256 server>,
<Flavor: 512 server>,
<Flavor: 1GB server>,
<Flavor: 2GB server>,
<Flavor: 4GB server>,
<Flavor: 8GB server>,
<Flavor: 15.5GB server>]
>>> fl = cinder.flavors.find(ram=512)
>>> cinder.servers.create("my-server", flavor=fl)
<Server: my-server>
For more information, see the reference:
ref/index