def _create_pools(self): for vipname, vip_dict in self._vips_dict["load_balancing"].iteritems(): domain = vip_dict["dns"] port = vip_dict["back_port"] pool = utils.pool_name(domain, port) monitor = vip_dict["monitor"] members = vip_dict["members"] monitor = "/Common/%(monitor)s" % vip_dict if members: # skip unconfigured members self._create_pool(pool, members, port) self._set_monitor(pool, monitor) # Add new members if necesssary. Probably will want to handle # the removal of old members at some point. self._add_missing_members(pool, members, port)
def _create_pools(self): for vipname, vip_dict in self._vips_dict['load_balancing'].iteritems(): domain = vip_dict['dns'] port = vip_dict['back_port'] pool = utils.pool_name(domain, port) monitor = vip_dict['monitor'] members = vip_dict['members'] monitor = '/Common/%(monitor)s' % vip_dict if members: # skip unconfigured members self._create_pool(pool, members, port) self._set_monitor(pool, monitor) # Add new members if necesssary. Probably will want to handle # the removal of old members at some point. self._add_missing_members(pool, members, port)
def _create_virtual_server(self, name, vip_dict): virtual_servers = self._virtual_server.get_list() domain = vip_dict['dns'] if name in virtual_servers: msg = ' - {0} already exists'.format(name) utils.print_yellow(msg) else: vss = self._get_virtual_server_definition(name, vip_dict['ip'], vip_dict['front_port'], self.PROTOCOL_TYPE) pool = utils.pool_name(domain, vip_dict['back_port']) vsrs = self._get_virtual_server_resource(pool) vsps = self._get_virtual_server_profile(vip_dict['monitor'], domain) self._virtual_server.create(definitions=vss, wildmasks=[self.WILDMASKS], resources=vsrs, profiles=[vsps]) msg = ' - {0} created'.format(name) utils.print_green(msg)