def get_previewinfo(): trans = MigrateDal.get_isp_trans() domain_count = ViewRecordDal.zone_domain_count() migrate_list = [] histories = MigrateDal.get_migrated_history() for history in histories: migrate_list.append({ 'migrate_rooms': sorted(json.loads(history.migrate_rooms)), 'dst_rooms': sorted(json.loads(history.dst_rooms)), 'migrate_isps': sorted([trans[isp] for isp in json.loads(history.migrate_isps)]) }) migrate_acl_subnet = ViewIspAclDal.get_migrate_subnet() return {'domain_count': domain_count, 'migrate': migrate_list, 'acl_migrate': migrate_acl_subnet}
def delete_acl_subnet(subnet_id, username): return ViewIspAclDal.delete_acl_subnet(subnet_id, username)
def add_acl_subnet(subnet, acl, username): return ViewIspAclDal.add_acl_subnet(subnet, acl, username)
def migrate_subnet_acl(acl_subnet_id, to_acl): return ViewIspAclDal.migrate_acl(acl_subnet_id, to_acl)
def add_isp(username): params = request.get_json(force=True) data = _validate_args(params) data['username'] = username ViewIspAclDal.add_isp(data) return data
def list_migrate_subnet(): return ViewIspAclDal.get_migrate_subnet()
def list_acl_isp_info(): return ViewIspAclDal.list_acl_isp()
def list_acl_subnet_by_ip(ip): return ViewIspAclDal.list_acl_subnet_by_ip(ip)
def list_isp(): return ViewIspAclDal.list_isp()
def delete_isp(name_in_english): count = ViewIspAclDal.delete_isp(name_in_english) if count == 0: raise BadParam('No such isp: %s' % name_in_english, msg_ch=u'没有对应的运营商记录')
def update_isp(name_in_english, update_data, username): count = ViewIspAclDal.update_isp(name_in_english, update_data, username) if count == 0: raise BadParam('No such isp: %s' % name_in_english, msg_ch=u'没有对应的运营商记录')
def get_acl_file_content(acl_file): return ViewIspAclDal.get_acl_file_content(acl_file)