~zulcss/python-cinderclient/python-cinderclient-cloud-g2

« back to all changes in this revision

Viewing changes to cinderclient/v1/client.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2012-10-01 12:05:26 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20121001120526-2yuh9biiloo13zu0
Tags: 1:1.0.0-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/fix-pep8-errors.patch: Dropped dont run 
  pep8 tests. 

[ Adam Gandelman ]
* debian/control: Drop 'Provides: ${python:Provides}'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from cinderclient import client
 
2
from cinderclient.v1 import limits
 
3
from cinderclient.v1 import quota_classes
 
4
from cinderclient.v1 import quotas
2
5
from cinderclient.v1 import volumes
3
6
from cinderclient.v1 import volume_snapshots
4
7
from cinderclient.v1 import volume_types
6
9
 
7
10
class Client(object):
8
11
    """
9
 
    Top-level object to access the OpenStack Compute API.
 
12
    Top-level object to access the OpenStack Volume API.
10
13
 
11
14
    Create an instance with your creds::
12
15
 
21
24
 
22
25
    """
23
26
 
24
 
    # FIXME(jesse): project_id isn't required to authenticate
25
 
    def __init__(self, username, api_key, project_id, auth_url,
26
 
                 insecure=False, timeout=None, proxy_tenant_id=None,
27
 
                 proxy_token=None, region_name=None,
 
27
    def __init__(self, username, api_key, project_id=None, auth_url='',
 
28
                 insecure=False, timeout=None, tenant_id=None,
 
29
                 proxy_tenant_id=None, proxy_token=None, region_name=None,
28
30
                 endpoint_type='publicURL', extensions=None,
29
 
                 service_type='compute', service_name=None,
 
31
                 service_type='volume', service_name=None,
30
32
                 volume_service_name=None):
31
33
        # FIXME(comstud): Rename the api_key argument above when we
32
34
        # know it's not being used as keyword argument
33
35
        password = api_key
 
36
        self.limits = limits.LimitsManager(self)
34
37
 
35
38
        # extensions
36
39
        self.volumes = volumes.VolumeManager(self)
37
40
        self.volume_snapshots = volume_snapshots.SnapshotManager(self)
38
41
        self.volume_types = volume_types.VolumeTypeManager(self)
 
42
        self.quota_classes = quota_classes.QuotaClassSetManager(self)
 
43
        self.quotas = quotas.QuotaSetManager(self)
39
44
 
40
45
        # Add in any extensions...
41
46
        if extensions:
51
56
            auth_url,
52
57
            insecure=insecure,
53
58
            timeout=timeout,
 
59
            tenant_id=tenant_id,
54
60
            proxy_token=proxy_token,
55
61
            proxy_tenant_id=proxy_tenant_id,
56
62
            region_name=region_name,