def update_named_zone(zone, zone_type, conf, username): return HostGroupConfDal.update_named_zone(zone, zone_type, conf, username)
def check_named_zone(zone, conf): for group, zone_conf in conf.items(): HostGroupConfDal.check_zone_conf(group, zone, zone_conf)
def add_named_zone(zone, zone_type, conf, add_header, username): return HostGroupConfDal.add_named_zone(zone, zone_type, conf, add_header, username)
def get_host_group(host_ip): return HostGroupConfDal.get_group_by_ip(host_ip)
def get_named_zone(zone_name): return HostGroupConfDal.get_named_zone(zone_name)
def delete_host_group(group_name): return HostGroupConfDal.delete_host_group(group_name)
def get_host_group(host_ip): return HostGroupConfDal.get_group_by_ip(host_ip)
def get_named_conf(group_name): return HostGroupConfDal.get_named_conf_header(group_name)
def update_group_reload_status(group_name, reload_status): if not HostGroupConfDal.update_group_reload_status(group_name, reload_status): raise BadParam('No such group', msg_ch=u'没有主机组:%s' % group_name)
def add_host(group_name, host_name, host_ip): HostGroupConfDal.check_host(host_name, host_ip) return HostGroupConfDal.add_host(group_name, host_name, host_ip)
def list_host_group(): return HostGroupConfDal.list_host_group()
def update_host_conf_md5(host_ip, host_conf_md5): return HostGroupConfDal.update_host_conf_md5(host_ip, host_conf_md5)
def update_host_conf_md5(host_ip, host_conf_md5): return HostGroupConfDal.update_host_conf_md5(host_ip, host_conf_md5)
def get_group_named(group_name): return HostGroupConfDal.build_complete_named_conf(group_name)
def delete_named_zone(zone, username): return HostGroupConfDal.delete_named_zone(zone, username)
def update_named_conf(name, conf_content, username): return HostGroupConfDal.update_named_conf(name, conf_content, username)
def add_host_group(): params = request.get_json(force=True) group_name, group_type, hosts = _check_and_format_params( params['group_name'], params['hosts']) HostGroupConfDal.add_host_group(group_name, group_type, hosts) return group_name, hosts
def get_host_group(): group = [] for item in HostGroupConfDal.list_host_group(): if item['has_conf']: group.append({'group_name': item['group_name']}) return group
def get_reload_status(group_name): return HostGroupConfDal.get_group_by_name(group_name).reload_status
def list_named_zone(): return HostGroupConfDal.list_named_zone()
def get_group_named(group_name): return HostGroupConfDal.build_complete_named_conf(group_name)
def get_reload_status(group_name): return HostGroupConfDal.get_group_by_name(group_name).reload_status