ThenovaclientPython API
Usage
First create a client instance with your credentials:
Clientclient(VERSIONUSERNAMEPASSWORDproject_idauth_url)
Here VERSION can is: 1.1, 2 and 3.
Alternatively, you can create a client instance using the Keystoneclient session API:
>>>FromKeystoneclient.auth.identityImportV2>>>FromKeystoneclientImportSession>>>FromNovaclient.clientImportClient>>>Auth=V2password (auth_url=AUTH_URL< Span class= "p" >, Username=username, Password=password, Tenant_ name=project_id) >>> sess = sessionsession (auth=auth ) >>> nova = clientclient (versionsession =sess)
For more information on the keystoneclient API, see Using Sessions.
Then call methods on the 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=MB)>>> Nova. Servers. Create("My-server", flavor=fl)<Server:my-server>
Reference¶
For more information, see the reference:
- Exceptions
- Version 1.1, version 2 API Reference
- flavors
- images
- servers
Li class= "toctree-l2" >hosts
- agents
- aggregates
- availability_zones
- certs
- Fixed_ips
- floating_ip_pools
- floating_ips
- hypervisors
- keypairs
- limits
- networks
- quota_classes
- quotas
- security_group_rules
- security_groups
- services
- virtual_interfaces
- volume_snapshots
- volumes
- volume_types
- version 3 API Reference
- flavors
- hosts
- agents
- aggregates
- Availability_zones
- certs
- hypervisors
- images
- keypairs
- quotas
- quotas_classes
- servers
- services
< Span class= "p" >< span class= "n" > < span class= "n" >
The novaclient Python API