def get_interface_graph(interface_id, graph_type): """获取任务流拓扑结构""" # 任务流中任务依赖 result = [] if graph_type == 1: data = InterfaceModel.get_interface_graph(db.etl_db, interface_id) result = job_nodes_graph(data, interface_id) # 局部-任务流依赖 elif graph_type == 2: # 任务流详情 detail = InterfaceModel.get_interface_detail( db.etl_db, interface_id) # 前后置依赖 parent = InterfaceModel.get_interface_parent_all(db.etl_db) child = InterfaceModel.get_interface_child_all(db.etl_db) result = interface_local_graph(detail, parent, child) # 全局-任务流依赖 elif graph_type == 3: # 任务流详情 detail = InterfaceModel.get_interface_detail( db.etl_db, interface_id) # 所有前后置依赖 parent = InterfaceModel.get_interface_parent_all(db.etl_db) child = InterfaceModel.get_interface_child_all(db.etl_db) result = interface_global_graph(detail, parent, child) return Response(result=result)
def get_interface_graph(interface_id): """获取接口拓扑结构""" # 接口任务依赖 job_nodes = InterfaceModel.get_interface_graph(db.etl_db, interface_id) return Response(job_nodes=job_nodes)