
The right module name should be `novaclient.v1_1.servers' instead of `novaclient'. Similar fix on `images', `flavors' and `exceptions'. Removed `ipgroups' and `backup_schedules' since they do not exist any more. Closes-Bug: #1056478 Change-Id: Id35f9c275fb36f3651a0bb2b0eb03c43f0aaeec1
964 B
964 B
The novaclient
Python API
novaclient
novaclient
Usage
First create a client instance with your credentials:
>>> from novaclient.client import Client
>>> nova = Client(VERSION, USERNAME, PASSWORD, PROJECT_ID, AUTH_URL)
Here VERSION
can be: 1.1
, 2
and 3
.
Then call methods on its managers:
>>> nova.servers.list()
[<Server: buildslave-ubuntu-9.10>]
>>> nova.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 = nova.flavors.find(ram=512)
>>> nova.servers.create("my-server", flavor=fl)
<Server: my-server>
Reference
For more information, see the reference:
ref/index