def create_producer(self, name=None, pattern=None, durable=None, encrypted=None): """ @summary: Helper function to create a producer for fixtures. All parameters set to None will be loaded from configuration file. @return: Dictionary with request object, and producer id """ if name is None: name = self.tenant_config.producer_name if pattern is None: pattern = self.tenant_config.producer_pattern if durable is None: durable = self.tenant_config.producer_durable if encrypted is None: encrypted = self.tenant_config.producer_encrypted req = self.producer_client.create_producer( name=name, pattern=pattern, durable=durable, encrypted=encrypted) producer_id = RequestUtilities.get_id(req) self.producers_created.append(producer_id) return { 'request': req, 'producer_id': producer_id }
def create_new_host(self, hostname=None, ip_v4=None, ip_v6=None, profile_id=None): if hostname is None: hostname = self.tenant_config.hostname host_req = self.host_client.create_host(hostname=hostname, ip_v4=ip_v4, ip_v6=ip_v6, profile_id=profile_id) host_id = RequestUtilities.get_id(host_req) self.hosts_created.append(host_id) return {"request": host_req, "host_id": host_id}
def create_profile(self, name=None, producer_ids=None): profile_req = self.profile_client.create_profile( name=name, producer_ids=producer_ids) profile_id = RequestUtilities.get_id(profile_req) self.profiles_created.append(profile_id) return { 'request': profile_req, 'profile_id': profile_id }
def create_new_profile(self, name=None, producer_ids=None): if name is None: name = self.tenant_config.profile_name profile_req = self.profile_client.create_profile(name=name, producer_ids=producer_ids) profile_id = RequestUtilities.get_id(profile_req) self.profiles_created.append(profile_id) return {"request": profile_req, "profile_id": profile_id}
def create_producer(self, name=None, pattern=None, durable=None, encrypted=None): req = self.producer_client.create_producer( name=name, pattern=pattern, durable=durable, encrypted=encrypted) producer_id = RequestUtilities.get_id(req) self.producers_created.append(producer_id) return { 'request': req, 'producer_id': producer_id }
def create_host(self, hostname, ip_v4=None, ip_v6=None, profile_id=None): host_req = self.host_client.create_host( hostname=hostname, ip_v4=ip_v4, ip_v6=ip_v6, profile_id=profile_id) host_id = RequestUtilities.get_id(host_req) self.hosts_created.append(host_id) return { 'request': host_req, 'host_id': host_id }
def create_producer(self, name=None, pattern=None, durable=None, encrypted=None): req = self.producer_client.create_producer(name=name, pattern=pattern, durable=durable, encrypted=encrypted) producer_id = RequestUtilities.get_id(req) self.producers_created.append(producer_id) return {'request': req, 'producer_id': producer_id}
def create_new_profile(self, name=None, producer_ids=None): if name is None: name = self.tenant_config.profile_name profile_req = self.profile_client.create_profile( name=name, producer_ids=producer_ids) profile_id = RequestUtilities.get_id(profile_req) self.profiles_created.append(profile_id) return { 'request': profile_req, 'profile_id': profile_id }
def create_new_host(self, hostname=None, ip_v4=None, ip_v6=None, profile_id=None): if hostname is None: hostname = self.tenant_config.hostname host_req = self.host_client.create_host( hostname=hostname, ip_v4=ip_v4, ip_v6=ip_v6, profile_id=profile_id) host_id = RequestUtilities.get_id(host_req) self.hosts_created.append(host_id) return { 'request': host_req, 'host_id': host_id }