68 lines
1.5 KiB
ReStructuredText
Raw Normal View History

The :mod:`novaclient` Python API
2011-01-25 14:01:22 -06:00
==================================
.. module:: novaclient
:synopsis: A client for the OpenStack Nova API.
2011-01-25 14:01:22 -06:00
.. currentmodule:: novaclient
2011-01-25 14:01:22 -06:00
Usage
-----
First create an instance of :class:`OpenStack` with your credentials::
2011-01-25 14:01:22 -06:00
>>> from novaclient import OpenStack
>>> nova = OpenStack(USERNAME, API_KEY, AUTH_URL)
2011-01-25 14:01:22 -06:00
Then call methods on the :class:`OpenStack` object:
2011-01-25 14:01:22 -06:00
.. class:: OpenStack
2011-01-25 14:01:22 -06:00
.. attribute:: backup_schedules
A :class:`BackupScheduleManager` -- manage automatic backup images.
.. attribute:: flavors
A :class:`FlavorManager` -- query available "flavors" (hardware
configurations).
.. attribute:: images
An :class:`ImageManager` -- query and create server disk images.
.. attribute:: ipgroups
A :class:`IPGroupManager` -- manage shared public IP addresses.
.. attribute:: servers
A :class:`ServerManager` -- start, stop, and manage virtual machines.
.. automethod:: authenticate
For example::
>>> nova.servers.list()
2011-01-25 14:01:22 -06:00
[<Server: buildslave-ubuntu-9.10>]
>>> nova.flavors.list()
2011-01-25 14:01:22 -06:00
[<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)
2011-01-25 14:01:22 -06:00
<Server: my-server>
For more information, see the reference:
.. toctree::
:maxdepth: 2
ref/index