Example #1
0
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}
Example #2
0
def delete_acl_subnet(subnet_id, username):
    return ViewIspAclDal.delete_acl_subnet(subnet_id, username)
Example #3
0
def add_acl_subnet(subnet, acl, username):
    return ViewIspAclDal.add_acl_subnet(subnet, acl, username)
Example #4
0
def migrate_subnet_acl(acl_subnet_id, to_acl):
    return ViewIspAclDal.migrate_acl(acl_subnet_id, to_acl)
Example #5
0
def migrate_subnet_acl(acl_subnet_id, to_acl):
    return ViewIspAclDal.migrate_acl(acl_subnet_id, to_acl)
Example #6
0
def add_isp(username):
    params = request.get_json(force=True)
    data = _validate_args(params)
    data['username'] = username
    ViewIspAclDal.add_isp(data)
    return data
Example #7
0
def list_migrate_subnet():
    return ViewIspAclDal.get_migrate_subnet()
Example #8
0
def list_acl_isp_info():
    return ViewIspAclDal.list_acl_isp()
Example #9
0
def list_acl_subnet_by_ip(ip):
    return ViewIspAclDal.list_acl_subnet_by_ip(ip)
Example #10
0
def list_acl_isp_info():
    return ViewIspAclDal.list_acl_isp()
Example #11
0
def list_isp():
    return ViewIspAclDal.list_isp()
Example #12
0
def delete_acl_subnet(subnet_id, username):
    return ViewIspAclDal.delete_acl_subnet(subnet_id, username)
Example #13
0
def add_acl_subnet(subnet, acl, username):
    return ViewIspAclDal.add_acl_subnet(subnet, acl, username)
Example #14
0
def list_isp():
    return ViewIspAclDal.list_isp()
Example #15
0
def add_isp(username):
    params = request.get_json(force=True)
    data = _validate_args(params)
    data['username'] = username
    ViewIspAclDal.add_isp(data)
    return data
Example #16
0
def list_acl_subnet_by_ip(ip):
    return ViewIspAclDal.list_acl_subnet_by_ip(ip)
Example #17
0
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'没有对应的运营商记录')
Example #18
0
def list_migrate_subnet():
    return ViewIspAclDal.get_migrate_subnet()
Example #19
0
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'没有对应的运营商记录')
Example #20
0
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'没有对应的运营商记录')
Example #21
0
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'没有对应的运营商记录')
Example #22
0
def get_acl_file_content(acl_file):
    return ViewIspAclDal.get_acl_file_content(acl_file)
Example #23
0
def get_acl_file_content(acl_file):
    return ViewIspAclDal.get_acl_file_content(acl_file)