Exemple #1
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.connection = ApiConnection(self.config)
     self.tenants = TenantManager(self)
     self.users = UserManager(self)
     self.role_refs = RoleRefManager(self)
     self.roles = RoleManager(self)
     self.endpoint_templates = EndpointTemplateManager(self)
     self.endpoints = EndpointManager(self)
Exemple #2
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.connection = ApiConnection(self.config)
     self.projects = ProjectManager(self)
     self.services = ServiceManager(self)
     self.flavors = FlavorManager(self)
     self.quota_sets = QuotaSetManager(self)
     self.servers = ServerManager(self)
     self.networks = NetworkManager(self)
Exemple #3
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.connection = ApiConnection(self.config)
     self.consoles = ConsoleManager(self)
     self.usage = UsageManager(self)
     self.flavors = FlavorManager(self)
     self.servers = ServerManager(self)
     self.keypairs = KeypairManager(self)
     self.snapshots = SnapshotManager(self)
     self.security_groups = SecurityGroupManager(self)
     self.security_group_rules = SecurityGroupRuleManager(self)
     self.virtual_interfaces = VirtualInterfacesManager(self)
Exemple #4
0
class Extras(object):
    """
    Top-level object to access the X7 Admin API.

    Create an instance with your creds::

    >>> compute = Admin(username=USERNAME, apikey=API_KEY)

    Then call methods on its managers::

        >>> compute.servers.list()
        ...
        >>> compute.flavors.list()
        ...

    &c.
    """

    def __init__(self, **kwargs):
        self.config = self._get_config(kwargs)
        self.connection = ApiConnection(self.config)
        self.consoles = ConsoleManager(self)
        self.usage = UsageManager(self)
        self.flavors = FlavorManager(self)
        self.servers = ServerManager(self)
        self.keypairs = KeypairManager(self)
        self.snapshots = SnapshotManager(self)
        self.security_groups = SecurityGroupManager(self)
        self.security_group_rules = SecurityGroupRuleManager(self)
        self.virtual_interfaces = VirtualInterfacesManager(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:`~x7.compute.Unauthorized` if
        the credentials are wrong.
        """
        self.connection.authenticate()

    def _get_config(self, kwargs):
        """
        Get a Config object for this API client.

        Broken out into a seperate method so that the test client can easily
        mock it up.
        """
        return Config(config_file=kwargs.pop('config_file', None),
                      env=kwargs.pop('env', None), overrides=kwargs)
Exemple #5
0
class Extras(object):
    """
    Top-level object to access the X7 Admin API.

    Create an instance with your creds::

    >>> compute = Admin(username=USERNAME, apikey=API_KEY)

    Then call methods on its managers::

        >>> compute.servers.list()
        ...
        >>> compute.flavors.list()
        ...

    &c.
    """
    def __init__(self, **kwargs):
        self.config = self._get_config(kwargs)
        self.connection = ApiConnection(self.config)
        self.consoles = ConsoleManager(self)
        self.usage = UsageManager(self)
        self.flavors = FlavorManager(self)
        self.servers = ServerManager(self)
        self.keypairs = KeypairManager(self)
        self.snapshots = SnapshotManager(self)
        self.security_groups = SecurityGroupManager(self)
        self.security_group_rules = SecurityGroupRuleManager(self)
        self.virtual_interfaces = VirtualInterfacesManager(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:`~x7.compute.Unauthorized` if
        the credentials are wrong.
        """
        self.connection.authenticate()

    def _get_config(self, kwargs):
        """
        Get a Config object for this API client.

        Broken out into a seperate method so that the test client can easily
        mock it up.
        """
        return Config(config_file=kwargs.pop('config_file', None),
                      env=kwargs.pop('env', None),
                      overrides=kwargs)
Exemple #6
0
class Account(object):
    """
    API to use keystone extension for tenant / user management

    Create an instance with your creds::

    >>> accounts = Account(auth_token='123', management_url='...')

    Then call methods on its managers::

        >>> accounts.tenants.list()
        ...
        >>> accounts.users.list()
        ...

    &c.
    """

    def __init__(self, **kwargs):
        self.config = self._get_config(kwargs)
        self.connection = ApiConnection(self.config)
        self.tenants = TenantManager(self)
        self.users = UserManager(self)
        self.role_refs = RoleRefManager(self)
        self.roles = RoleManager(self)
        self.endpoint_templates = EndpointTemplateManager(self)
        self.endpoints = EndpointManager(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:`~x7.compute.Unauthorized` if
        the credentials are wrong.
        """
        self.connection.authenticate()

    def _get_config(self, kwargs):
        """
        Get a Config object for this API client.

        Broken out into a seperate method so that the test client can easily
        mock it up.
        """
        return Config(config_file=kwargs.pop('config_file', None),
                      env=kwargs.pop('env', None), overrides=kwargs)
Exemple #7
0
class Account(object):
    """
    API to use keystone extension for tenant / user management

    Create an instance with your creds::

    >>> accounts = Account(auth_token='123', management_url='...')

    Then call methods on its managers::

        >>> accounts.tenants.list()
        ...
        >>> accounts.users.list()
        ...

    &c.
    """
    def __init__(self, **kwargs):
        self.config = self._get_config(kwargs)
        self.connection = ApiConnection(self.config)
        self.tenants = TenantManager(self)
        self.users = UserManager(self)
        self.role_refs = RoleRefManager(self)
        self.roles = RoleManager(self)
        self.endpoint_templates = EndpointTemplateManager(self)
        self.endpoints = EndpointManager(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:`~x7.compute.Unauthorized` if
        the credentials are wrong.
        """
        self.connection.authenticate()

    def _get_config(self, kwargs):
        """
        Get a Config object for this API client.

        Broken out into a seperate method so that the test client can easily
        mock it up.
        """
        return Config(config_file=kwargs.pop('config_file', None),
                      env=kwargs.pop('env', None),
                      overrides=kwargs)
Exemple #8
0
class Admin(object):
    """
    Top-level object to access the X7 Admin API.

    Create an instance with your creds::

    >>> compute = Admin(username=USERNAME, apikey=API_KEY)

    Then call methods on its managers::

        >>> compute.servers.list()
        ...
        >>> compute.flavors.list()
        ...

    &c.
    """

    def __init__(self, **kwargs):
        self.config = self._get_config(kwargs)
        self.connection = ApiConnection(self.config)
        self.projects = ProjectManager(self)
        self.services = ServiceManager(self)
        self.flavors = FlavorManager(self)
        self.quota_sets = QuotaSetManager(self)
        self.servers = ServerManager(self)
        self.networks = NetworkManager(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:`~x7.compute.Unauthorized` if
        the credentials are wrong.
        """
        self.connection.authenticate()

    def _get_config(self, kwargs):
        """
        Get a Config object for this API client.

        Broken out into a seperate method so that the test client can easily
        mock it up.
        """
        return Config(config_file=kwargs.pop('config_file', None),
                      env=kwargs.pop('env', None), overrides=kwargs)
Exemple #9
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.connection = ApiConnection(self.config)
     self.tenants = TenantManager(self)
     self.users = UserManager(self)
     self.role_refs = RoleRefManager(self)
     self.roles = RoleManager(self)
     self.endpoint_templates = EndpointTemplateManager(self)
     self.endpoints = EndpointManager(self)
Exemple #10
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.backup_schedules = BackupScheduleManager(self)
     self.connection = ApiConnection(self.config)
     self.flavors = FlavorManager(self)
     self.images = ImageManager(self)
     self.servers = ServerManager(self)
     if 'IPGROUPS' in API_OPTIONS[self.config.cloud_api]:
         self.ipgroups = IPGroupManager(self)
Exemple #11
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.connection = ApiConnection(self.config)
     self.consoles = ConsoleManager(self)
     self.usage = UsageManager(self)
     self.flavors = FlavorManager(self)
     self.servers = ServerManager(self)
     self.keypairs = KeypairManager(self)
     self.snapshots = SnapshotManager(self)
     self.security_groups = SecurityGroupManager(self)
     self.security_group_rules = SecurityGroupRuleManager(self)
     self.virtual_interfaces = VirtualInterfacesManager(self)
Exemple #12
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.config.auth_token = 'ignore'
     self.connection = ApiConnection(self.config)
     self.tokens = TokenManager(self)
     self.tenants = TenantManager(self)
Exemple #13
0
 def __init__(self, **kwargs):
     self.config = self._get_config(kwargs)
     self.config.auth_token = 'ignore'
     self.connection = ApiConnection(self.config)
     self.tokens = TokenManager(self)
     self.tenants = TenantManager(self)