bin.api
from flask import Flask from flask_restx import fields, Api, Resource
class bgpapi: instance = None
def __init__(self, graph):
if instance is None:
instance = Api(Flask(__name__))
self.graph = graph
@bgpapi.instance.route("/get") class bgp_monitor(Resource): def post(self): return {"hello": "world"}
if date:
# retrieve graph earlier than date
# retrieve records after this date
# rebuild the whole graph using these records
#
pass
else:
self.graph.get()
# retrieve graph
pass
1""" 2from flask import Flask 3from flask_restx import fields, Api, Resource 4 5 6class bgpapi: 7 instance = None 8 9 def __init__(self, graph): 10 if instance is None: 11 instance = Api(Flask(__name__)) 12 self.graph = graph 13 14 15@bgpapi.instance.route("/get") 16class bgp_monitor(Resource): 17 def post(self): 18 return {"hello": "world"} 19 20 if date: 21 # retrieve graph earlier than date 22 # retrieve records after this date 23 # rebuild the whole graph using these records 24 # 25 pass 26 else: 27 self.graph.get() 28 # retrieve graph 29 pass 30"""