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