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)
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)
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)
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.')
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.')
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')
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.')
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
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.')
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.')
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.')
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.')
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)
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)
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.')
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.')
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)
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.')
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)
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)
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
def setUpClass(cls): cls.conf = service.prepare_service([]) cls.vitrage_client = \ v_client.Client('1', session=keystone_client.get_session(cls.conf))