First create an instance of OpenStack with your credentials:
>>> from novaclient import OpenStack
>>> nova = OpenStack(USERNAME, PASSWORD, AUTH_URL)
Then call methods on the OpenStack object:
A BackupScheduleManager – manage automatic backup images.
A FlavorManager – query available “flavors” (hardware configurations).
An ImageManager – query and create server disk images.
A IPGroupManager – manage shared public IP addresses.
A ServerManager – start, stop, and manage virtual machines.
For example:
>>> 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>
For more information, see the reference: