~corey.bryant/python-novaclient/2.26.0

« back to all changes in this revision

Viewing changes to novaclient/v3/client.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-09-18 08:52:31 UTC
  • mfrom: (1.1.35)
  • Revision ID: package-import@ubuntu.com-20140918085231-56hs515gp9zpb9sd
Tags: 1:2.19.0-0ubuntu1
* New upstream release.
* debian/control: Drop python-d2to1, python-httpretty as build dependency.
* debian/control: Add python-requests-mock as build dependency.
* debian/control: Add python-oslo.utils.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
        >>> client = Client(USERNAME, PASSWORD, PROJECT_ID, AUTH_URL)
42
42
 
 
43
    Or, alternatively, you can create a client instance using the
 
44
    keystoneclient.session API::
 
45
 
 
46
        >>> from keystoneclient.auth.identity import v2
 
47
        >>> from keystoneclient import session
 
48
        >>> from novaclient.client import Client
 
49
        >>> auth = v2.Password(auth_url=AUTH_URL,
 
50
                               username=USERNAME,
 
51
                               password=PASSWORD,
 
52
                               tenant_name=PROJECT_ID)
 
53
        >>> sess = session.Session(auth=auth)
 
54
        >>> nova = client.Client(VERSION, session=sess)
 
55
 
43
56
    Then call methods on its managers::
44
57
 
45
58
        >>> client.servers.list()
84
97
        self.tenant_id = tenant_id
85
98
        self.user_id = user_id
86
99
        self.os_cache = os_cache or not no_cache
87
 
        #TODO(bnemec): Add back in v3 extensions
 
100
        # TODO(bnemec): Add back in v3 extensions
88
101
        self.agents = agents.AgentsManager(self)
89
102
        self.aggregates = aggregates.AggregateManager(self)
90
103
        self.availability_zones = \