Esempio n. 1
0
 def __init__(self,
              username,
              apikey,
              auth_url='https://auth.api.rackspacecloud.com/v1.0'):
     self.backup_schedules = BackupScheduleManager(self)
     self.client = OpenStackClient(username, apikey, auth_url)
     self.flavors = FlavorManager(self)
     self.images = ImageManager(self)
     self.ipgroups = IPGroupManager(self)
     self.keys = KeyManager(self)
     self.servers = ServerManager(self)
     self.volumes = VolumeManager(self)
     self.zones = ZoneManager(self)
Esempio n. 2
0
class OpenStack(object):
    """
    Top-level object to access the OpenStack Nova API.

    Create an instance with your creds::

        >>> os = OpenStack(USERNAME, API_KEY, AUTH_URL)

    Then call methods on its managers::

        >>> os.servers.list()
        ...
        >>> os.flavors.list()
        ...

    &c.
    """
    def __init__(self,
                 username,
                 apikey,
                 auth_url='https://auth.api.rackspacecloud.com/v1.0'):
        self.backup_schedules = BackupScheduleManager(self)
        self.client = OpenStackClient(username, apikey, auth_url)
        self.flavors = FlavorManager(self)
        self.images = ImageManager(self)
        self.ipgroups = IPGroupManager(self)
        self.keys = KeyManager(self)
        self.servers = ServerManager(self)
        self.volumes = VolumeManager(self)
        self.zones = ZoneManager(self)

    def authenticate(self):
        """
        Authenticate against the server.

        Normally this is called automatically when you first access the API,
        but you can call this method to force authentication right now.

        Returns on success; raises :exc:`novatools.Unauthorized` if the
        credentials are wrong.
        """
        self.client.authenticate()
Esempio n. 3
0
 def __init__(self, username, apikey,
              auth_url='https://auth.api.rackspacecloud.com/v1.0'):
     self.backup_schedules = BackupScheduleManager(self)
     self.client = OpenStackClient(username, apikey, auth_url)
     self.flavors = FlavorManager(self)
     self.images = ImageManager(self)
     self.ipgroups = IPGroupManager(self)
     self.keys = KeyManager(self)
     self.servers = ServerManager(self)
     self.volumes = VolumeManager(self)
     self.zones = ZoneManager(self)
Esempio n. 4
0
class OpenStack(object):
    """
    Top-level object to access the OpenStack Nova API.

    Create an instance with your creds::

        >>> os = OpenStack(USERNAME, API_KEY, AUTH_URL)

    Then call methods on its managers::

        >>> os.servers.list()
        ...
        >>> os.flavors.list()
        ...

    &c.
    """

    def __init__(self, username, apikey,
                 auth_url='https://auth.api.rackspacecloud.com/v1.0'):
        self.backup_schedules = BackupScheduleManager(self)
        self.client = OpenStackClient(username, apikey, auth_url)
        self.flavors = FlavorManager(self)
        self.images = ImageManager(self)
        self.ipgroups = IPGroupManager(self)
        self.keys = KeyManager(self)
        self.servers = ServerManager(self)
        self.volumes = VolumeManager(self)
        self.zones = ZoneManager(self)

    def authenticate(self):
        """
        Authenticate against the server.

        Normally this is called automatically when you first access the API,
        but you can call this method to force authentication right now.

        Returns on success; raises :exc:`novatools.Unauthorized` if the
        credentials are wrong.
        """
        self.client.authenticate()
Esempio n. 5
0
def client():
    cl = OpenStackClient("username", "apikey", "auth_test")
    cl.management_url = "http://example.com"
    cl.auth_token = "token"
    return cl
Esempio n. 6
0
def client():
    cl = OpenStackClient("username", "apikey", "auth_test")
    cl.management_url = "http://example.com"
    cl.auth_token = "token"
    return cl