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