def list_domain_name(): json_data = request.get_json(force=True) domain_name = json_data.get('domain_name', '').strip() server_rooms = json_data.get("server_rooms", []) isps = json_data.get("isps", []) select_cdn = json_data.get("select_cdn", True) return ViewRecordDal.search_view_domain(domain_name, server_rooms, isps, select_cdn)
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_view_domain(domain_name): view_domain, record_dict = ViewRecordDal.get_domain_name_record( domain_name) ViewRecordDal.delete_view_domain(view_domain) return record_dict
def update_view_domain(username, domain_name, rooms=None, cnames=None): return ViewRecordDal.upsert_view_domain(username, domain_name, rooms, cnames, "update")
def add_view_domain(username, domain_name, rooms=None, cnames=None): return ViewRecordDal.upsert_view_domain(username, domain_name, rooms, cnames, "insert")
def get_view_domain_info(domain_name): return ViewRecordDal.get_view_domain_info(domain_name)
def list_server_room(): return [ item.colo_name for item in ViewRecordDal.list_server_room(colo_group='view') ]
def update_view_domain_state(domain_name, isps): return ViewRecordDal.update_view_domain_state(domain_name, isps)
def list_server_room(): return [item.colo_name for item in ViewRecordDal.list_server_room(colo_group='view')]
def delete_view_domain(domain_name): view_domain, record_dict = ViewRecordDal.get_domain_name_record(domain_name) ViewRecordDal.delete_view_domain(view_domain) return record_dict