The Novaclient Python API

Source: Internet
Author: User

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>&LT;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
    • 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.