Removed REST call
/wm/onos/topology/shortest-path/{src-dpid}/{dst-dpid}/json
because it is replaced by
/wm/onos/intent//path/switch/{src-dpid}/shortest-path/{dst-dpid}
Change-Id: Ia710b282cf98c96981646f642d415b209bee68c6
diff --git a/scripts/get_network_graph.py b/scripts/get_network_graph.py
index b91b569..4a85192 100755
--- a/scripts/get_network_graph.py
+++ b/scripts/get_network_graph.py
@@ -5,7 +5,6 @@
# Get Network Graph Information:
# - Switches
# - Links
-# - Shortest Path
#
import pprint
@@ -39,7 +38,6 @@
# @app.route("/wm/onos/topology/links/json ")
# @app.route("/wm/onos/topology/switches/json ")
-# @app.route("/wm/onos/topology/shortest-path/<src-dpid>/<dst-dpid>/json ")
# Sample output:
def print_parsed_result(parsedResult):
@@ -87,27 +85,6 @@
print_parsed_result(parsedResult)
-def get_network_shortest_path(src_dpid, dst_dpid):
- try:
- command = "curl -s \"http://%s:%s/wm/onos/topology/shortest-path/%s/%s/json\"" % (ControllerIP, ControllerPort, src_dpid, dst_dpid)
- debug("get_network_switches %s" % command)
-
- result = os.popen(command).read()
- debug("result %s" % result)
- if len(result) == 0:
- print "No Path found"
- return;
-
- # parsedResult = result
- parsedResult = json.loads(result, object_pairs_hook=collections.OrderedDict)
- parsedResult = json.dumps(parsedResult, indent=4)
- debug("parsed %s" % parsedResult)
- except:
- log_error("Controller IF has issue")
- exit(1)
-
- print_parsed_result(parsedResult)
-
if __name__ == "__main__":
usage_msg1 = "Usage:\n"
@@ -116,10 +93,8 @@
usage_msg4 = " all : Print all network elements\n"
usage_msg5 = " switches : Print all switches and ports\n"
usage_msg6 = " links : Print all links\n"
- usage_msg7 = " shortest-path <src-dpid> <dst-dpid> : Print shortest-path\n"
- usage_msg8 = " (links between <src-dpid> and <dst-dpid>)\n"
usage_msg = usage_msg1 + usage_msg2 + usage_msg3 + usage_msg4 + usage_msg5
- usage_msg = usage_msg + usage_msg6 + usage_msg7 + usage_msg8
+ usage_msg = usage_msg + usage_msg6
# Usage info
if len(sys.argv) > 1 and (sys.argv[1] == "-h" or sys.argv[1] == "--help"):
@@ -131,19 +106,12 @@
log_error(usage_msg)
exit(1)
- if (sys.argv[1] != "all" and sys.argv[1] != "switches" and sys.argv[1] != "links" and sys.argv[1] != "shortest-path"):
+ if (sys.argv[1] != "all" and sys.argv[1] != "switches" and sys.argv[1] != "links"):
log_error(usage_msg)
exit(1)
- if (sys.argv[1] == "shortest-path"):
- if len(sys.argv) < 4:
- log_error(usage_msg)
- exit(1)
-
# Do the work
if (sys.argv[1] == "all" or sys.argv[1] == "switches"):
get_network_switches()
if (sys.argv[1] == "all" or sys.argv[1] == "links"):
get_network_links()
- if (sys.argv[1] == "shortest-path"):
- get_network_shortest_path(sys.argv[2], sys.argv[3])