Exemple #1
0
 def setUpClass(cls):
     super(BaseApiTest, cls).setUpClass()
     cls.conf = utils.get_conf()
     cls.conf.register_opts(list(OPTS), group='keystone_authtoken')
     cls.vitrage_client = \
         v_client.Client('1', session=keystone_client.get_session(cls.conf))
     cls.nova_client = clients.nova_client(cls.conf)
     cls.cinder_client = clients.cinder_client(cls.conf)
Exemple #2
0
 def setUpClass(cls):
     super(BaseApiTest, cls).setUpClass()
     cls.conf = service.prepare_service([])
     cls.conf.register_opts(list(OPTS), group='keystone_authtoken')
     cls.vitrage_client = \
         v_client.Client('1', session=keystone_client.get_session(cls.conf))
     cls.nova_client = clients.nova_client(cls.conf)
     cls.cinder_client = clients.cinder_client(cls.conf)
Exemple #3
0
 def setUpClass(cls):
     super(BaseTopologyTest, cls).setUpClass()
     cls.conf = service.prepare_service([])
     cls.conf.register_opts(list(OPTS), group='keystone_authtoken')
     cls.vitrage_client = \
         v_client.Client('1', session=keystone_client.get_session(cls.conf))
     cls.nova_client = clients.nova_client(cls.conf)
     cls.cinder_client = clients.cinder_client(cls.conf)
Exemple #4
0
def neutron_client():
    """Get an instance of neutron client"""
    try:
        ne_client = driver_module('neutron')
        client = ne_client.Client(session=keystone_client.get_session())
        LOG.info('Neutron client created')
        return client
    except Exception:
        LOG.exception('Create Neutron client - Got Exception.')
Exemple #5
0
def zaqar_client():
    """Get an instance of Zaqar client"""
    try:
        z_client = driver_module('zaqar')
        client = z_client.Client(session=keystone_client.get_session(), )
        LOG.info('Zaqar client created')
        return client
    except Exception:
        LOG.exception('Create Zaqar client - Got Exception.')
Exemple #6
0
def gnocchi_client():
    """Get an instance of the gnocchi client"""
    try:
        gn_client = driver_module('gnocchi')
        client = gn_client.Client(session=keystone_client.get_session())
        LOG.info('Gnocchi client created')
        return client
    except Exception:
        LOG.exception('Create Gnocchi client - Got Exception')
Exemple #7
0
def mistral_client():
    """Get an instance of Mistral client"""
    try:
        mi_client = driver_module('mistral')
        client = mi_client.Client(session=keystone_client.get_session(), )
        LOG.info('Mistral client created')
        return client
    except Exception:
        LOG.exception('Create Mistral client - Got Exception.')
Exemple #8
0
def heat_client():
    """Get an instance of heat client"""
    try:
        he_client = driver_module('heat')
        client = he_client.Client(version=CONF.heat_version,
                                  session=keystone_client.get_session())
        LOG.info('Heat client created')
        return client
    except Exception:
        LOG.exception('Create Heat client - Got Exception.')
    def vitrage(cls):
        """vitrage client

        :rtype: vitrageclient.v1.client.Client
        """
        if not cls._vitrage:
            cls._vitrage = vc.Client('1',
                                     session=keystone_client.get_session(
                                         cls._conf))
        return cls._vitrage
Exemple #10
0
def aodh_client():
    """Get an instance of aodh client"""
    try:
        ao_client = driver_module('aodh')
        client = ao_client.Client(CONF.aodh_version,
                                  session=keystone_client.get_session())
        LOG.info('Aodh client created')
        return client
    except Exception:
        LOG.exception('Create Aodh client - Got Exception.')
Exemple #11
0
def mistral_client(conf):
    """Get an instance of Mistral client"""
    try:
        session = keystone_client.get_session(conf)
        endpoint = session.get_endpoint(service_type='workflowv2',
                                        endpoint_type='internalURL')
        args = {'mistral_url': endpoint, 'session': session}
        client = driver_module('mistral').Client(**args)
        LOG.info('Mistral client created')
        return client
    except Exception as e:
        LOG.exception('Create Mistral client - Got Exception: %s', e)
def glance_client(conf):
    """Get an instance of glance client"""
    try:
        glan_client = driver_module('glance')
        client = glan_client.Client(
            version=conf.glance_version,
            session=keystone_client.get_session(conf),
        )
        LOG.info('Glance client created')
        return client
    except Exception:
        LOG.exception('Create Glance client - Got Exception')
def nova_client(conf):
    """Get an instance of nova client"""
    try:
        n_client = driver_module('nova')
        client = n_client.Client(
            version=conf.nova_version,
            session=keystone_client.get_session(conf),
        )
        LOG.info('Nova client created')
        return client
    except Exception:
        LOG.exception('Create Nova client - Got Exception.')
Exemple #14
0
def trove_client():
    """Get an instance of trove client"""
    try:
        tr_client = driver_module('trove')
        client = tr_client.Client(
            version=CONF.trove_version,
            session=keystone_client.get_session(),
        )
        LOG.info('Trove client created')
        return client
    except Exception:
        LOG.exception('Create Trove client - Got Exception.')
def cinder_client(conf):
    """Get an instance of cinder client"""
    try:
        cin_client = driver_module('cinder')
        client = cin_client.Client(
            version=conf.cinder_version,
            session=keystone_client.get_session(conf),
        )
        LOG.info('Cinder client created')
        return client
    except Exception:
        LOG.exception('Create Cinder client - Got Exception.')
Exemple #16
0
def ceilometer_client():
    """Get an instance of ceilometer client"""
    try:
        cm_client = driver_module('ceilometer')
        client = cm_client.get_client(
            version=CONF.ceilometer_version,
            session=keystone_client.get_session(),
        )
        LOG.info('Ceilometer client created')
        return client
    except Exception:
        LOG.exception('Create Ceilometer client - Got Exception.')
Exemple #17
0
def neutron_client(conf):
    """Get an instance of neutron client"""
    auth_config = conf.service_credentials
    try:
        client = ne_client.Client(
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Neutron client created')
        return client
    except Exception as e:
        LOG.exception('Create Neutron client - Got Exception: %s', e)
Exemple #18
0
def heat_client(conf):
    """Get an instance of heat client"""
    # auth_config = conf.service_credentials
    try:
        session = keystone_client.get_session(conf)
        endpoint = session.get_endpoint(service_type='orchestration',
                                        interface='publicURL')
        he_client = driver_module('heat')
        client = he_client.Client(session=session, endpoint=endpoint)
        LOG.info('Heat client created')
        return client
    except Exception as e:
        LOG.exception('Create Heat client - Got Exception: %s', e)
Exemple #19
0
def cinder_client():
    """Get an instance of cinder client"""
    try:
        cin_client = driver_module('cinder')
        client = cin_client.Client(
            version=CONF.cinder_version,
            region_name=CONF.service_credentials.region_name,
            session=keystone_client.get_session(),
        )
        LOG.info('Cinder client created')
        return client
    except Exception:
        LOG.exception('Create Cinder client - Got Exception.')
Exemple #20
0
def neutron_client(conf):
    """Get an instance of neutron client"""
    auth_config = conf.service_credentials
    try:
        client = ne_client.Client(
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Neutron client created')
        return client
    except Exception as e:
        LOG.exception('Create Neutron client - Got Exception: %s', e)
Exemple #21
0
def nova_client():
    """Get an instance of nova client"""
    try:
        n_client = driver_module('nova')
        client = n_client.Client(
            version=CONF.nova_version,
            region_name=CONF.service_credentials.region_name,
            session=keystone_client.get_session(),
        )
        LOG.info('Nova client created')
        return client
    except Exception:
        LOG.exception('Create Nova client - Got Exception.')
Exemple #22
0
def cinder_client(conf):
    """Get an instance of cinder client"""
    auth_config = conf.service_credentials
    try:
        client = cin_client.Client(
            version=conf.cinder_version,
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Cinder client created')
        return client
    except Exception as e:
        LOG.exception('Create Cinder client - Got Exception: %s', e)
Exemple #23
0
def cinder_client(conf):
    """Get an instance of cinder client"""
    auth_config = conf.service_credentials
    try:
        client = cin_client.Client(
            version=conf.cinder_version,
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Cinder client created')
        return client
    except Exception as e:
        LOG.exception('Create Cinder client - Got Exception: %s', e)
Exemple #24
0
def monasca_client():
    """Get an instance of Monasca client"""
    try:
        mon_client = driver_module('monasca')

        session = keystone_client.get_session()
        endpoint = session.get_endpoint(service_type='monitoring',
                                        interface='publicURL')
        client = mon_client.Client(api_version=CONF.monasca_version,
                                   session=session,
                                   endpoint=endpoint)
        LOG.info('Monasca client created')
        return client
    except Exception:
        LOG.exception('Create Monasca client - Got Exception.')
Exemple #25
0
def nova_client(conf):
    """Get an instance of nova client"""
    auth_config = conf.service_credentials
    try:
        n_client = driver_module('nova')
        client = n_client.Client(
            version=conf.nova_version,
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Nova client created')
        return client
    except Exception as e:
        LOG.exception('Create Nova client - Got Exception: %s', e)
Exemple #26
0
def ceilometer_client(conf):
    """Get an instance of ceilometer client"""
    auth_config = conf.service_credentials
    try:
        cm_client = driver_module('ceilometer')
        client = cm_client.get_client(
            version=conf.aodh_version,
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Ceilometer client created')
        return client
    except Exception as e:
        LOG.exception('Create Ceilometer client - Got Exception: %s', e)
Exemple #27
0
def ceilometer_client(conf):
    """Get an instance of ceilometer client"""
    auth_config = conf.service_credentials
    try:
        cm_client = driver_module('ceilometer')
        client = cm_client.get_client(
            version=conf.aodh_version,
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Ceilometer client created')
        return client
    except Exception as e:
        LOG.exception('Create Ceilometer client - Got Exception: %s', e)
Exemple #28
0
def nova_client(conf):
    """Get an instance of nova client"""
    auth_config = conf.service_credentials
    try:
        n_client = driver_module('nova')
        client = n_client.Client(
            version=conf.nova_version,
            session=keystone_client.get_session(conf),
            region_name=auth_config.region_name,
            interface=auth_config.interface,
        )
        LOG.info('Nova client created')
        return client
    except Exception as e:
        LOG.exception('Create Nova client - Got Exception: %s', e)
Exemple #29
0
    def setUpClass(cls):
        super(BaseApiTest, cls).setUpClass()
        cls.conf = service.prepare_service([])

        cls.vitrage_client = \
            v_client.Client('1', session=keystone_client.get_session(cls.conf))
        cls.nova_client = os_clients.nova_client(cls.conf)
        cls.cinder_client = os_clients.cinder_client(cls.conf)
        cls.neutron_client = os_clients.neutron_client(cls.conf)
        cls.heat_client = os_clients.heat_client(cls.conf)

        cls.num_default_networks = \
            len(cls.neutron_client.list_networks()['networks'])
        cls.num_default_ports = \
            len(cls.neutron_client.list_ports()['ports'])
        cls.num_default_entities = 3
        cls.num_default_edges = 2
Exemple #30
0
    def setUpClass(cls):
        super(BaseApiTest, cls).setUpClass()
        cls.conf = service.prepare_service([])

        cls.vitrage_client = \
            v_client.Client('1', session=keystone_client.get_session(cls.conf))
        cls.nova_client = os_clients.nova_client(cls.conf)
        cls.cinder_client = os_clients.cinder_client(cls.conf)
        cls.neutron_client = os_clients.neutron_client(cls.conf)
        cls.heat_client = os_clients.heat_client(cls.conf)

        cls.num_default_networks = \
            len(cls.neutron_client.list_networks()['networks'])
        cls.num_default_ports = \
            len(cls.neutron_client.list_ports()['ports'])
        cls.num_default_entities = 3
        cls.num_default_edges = 2
Exemple #31
0
 def setUpClass(cls):
     cls.conf = service.prepare_service([])
     cls.vitrage_client = \
         v_client.Client('1', session=keystone_client.get_session(cls.conf))