def query_flow(dpid): #dpid = request.args.get("dpid") flow_table = Rest.get_flow_table(dpid) #print flow_table return render_template("policy.html", flow_table=flow_table)
def query_flow(dpid): # dpid = request.args.get("dpid") flow_table = Rest.get_flow_table(dpid) # print flow_table return render_template("policy.html", flow_table=flow_table)
def dpid_policy(dpid): sw_dpid_list = Rest.get_switch_list() if sw_dpid_list is False or int(dpid) not in sw_dpid_list: abort(404) flow_table = None flow_table = Rest.get_flow_table(dpid) global global_flow_table global_flow_table = flow_table port = Rest.get_switch_port(dpid) return render_template("policy.html", sw_dpid_list=sw_dpid_list, dpid=dpid, port=port, flow_table=flow_table)
def main(): print "test" sw_desc = Rest.get_switch_desc() print sw_desc sw_dpid_list = Rest.get_switch_list() print sw_dpid_list #if sw_desc is False or int(dpid) not in sw_dpid_list: # sw_desc = "not connected" for dpid in sw_dpid_list: print dpid dpid_t = dpid flow_table = None flow_table = Rest.get_flow_table(dpid) global global_flow_table global_flow_table = flow_table port = Rest.get_switch_port(dpid) print "test" return render_template("index.html",sw_desc=sw_desc,dpid=dpid_t, port=port, flow_table=flow_table)