Esempio n. 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}
Esempio n. 2
0
def delete_acl_subnet(subnet_id, username):
    return ViewIspAclDal.delete_acl_subnet(subnet_id, username)
Esempio n. 3
0
def add_acl_subnet(subnet, acl, username):
    return ViewIspAclDal.add_acl_subnet(subnet, acl, username)
Esempio n. 4
0
def migrate_subnet_acl(acl_subnet_id, to_acl):
    return ViewIspAclDal.migrate_acl(acl_subnet_id, to_acl)
Esempio n. 5
0
def migrate_subnet_acl(acl_subnet_id, to_acl):
    return ViewIspAclDal.migrate_acl(acl_subnet_id, to_acl)
Esempio n. 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
Esempio n. 7
0
def list_migrate_subnet():
    return ViewIspAclDal.get_migrate_subnet()
Esempio n. 8
0
def list_acl_isp_info():
    return ViewIspAclDal.list_acl_isp()
Esempio n. 9
0
def list_acl_subnet_by_ip(ip):
    return ViewIspAclDal.list_acl_subnet_by_ip(ip)
Esempio n. 10
0
def list_acl_isp_info():
    return ViewIspAclDal.list_acl_isp()
Esempio n. 11
0
def list_isp():
    return ViewIspAclDal.list_isp()
Esempio n. 12
0
def delete_acl_subnet(subnet_id, username):
    return ViewIspAclDal.delete_acl_subnet(subnet_id, username)
Esempio n. 13
0
def add_acl_subnet(subnet, acl, username):
    return ViewIspAclDal.add_acl_subnet(subnet, acl, username)
Esempio n. 14
0
def list_isp():
    return ViewIspAclDal.list_isp()
Esempio n. 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
Esempio n. 16
0
def list_acl_subnet_by_ip(ip):
    return ViewIspAclDal.list_acl_subnet_by_ip(ip)
Esempio n. 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'没有对应的运营商记录')
Esempio n. 18
0
def list_migrate_subnet():
    return ViewIspAclDal.get_migrate_subnet()
Esempio n. 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'没有对应的运营商记录')
Esempio n. 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'没有对应的运营商记录')
Esempio n. 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'没有对应的运营商记录')
Esempio n. 22
0
def get_acl_file_content(acl_file):
    return ViewIspAclDal.get_acl_file_content(acl_file)
Esempio n. 23
0
def get_acl_file_content(acl_file):
    return ViewIspAclDal.get_acl_file_content(acl_file)