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])
diff --git a/src/main/java/net/onrc/onos/core/topology/web/TopologyShortestPathResource.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyShortestPathResource.java
deleted file mode 100644
index 29fd716..0000000
--- a/src/main/java/net/onrc/onos/core/topology/web/TopologyShortestPathResource.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package net.onrc.onos.core.topology.web;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-
-import net.onrc.onos.core.intent.ConstrainedBFSTree;
-import net.onrc.onos.core.intent.Path;
-import net.onrc.onos.core.topology.ITopologyService;
-import net.onrc.onos.core.topology.Link;
-import net.onrc.onos.core.topology.LinkEvent;
-import net.onrc.onos.core.topology.Topology;
-import net.onrc.onos.core.topology.Switch;
-import net.onrc.onos.core.topology.serializers.LinkSerializer;
-import net.onrc.onos.core.util.Dpid;
-
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.module.SimpleModule;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TopologyShortestPathResource extends ServerResource {
-
-    private static final Logger log = LoggerFactory.getLogger(TopologyShortestPathResource.class);
-
-    @Get("json")
-    public String retrieve() {
-        ITopologyService topologyService =
-                (ITopologyService) getContext().getAttributes().
-                        get(ITopologyService.class.getCanonicalName());
-
-        Topology topology = topologyService.getTopology();
-
-        ObjectMapper mapper = new ObjectMapper();
-        SimpleModule module = new SimpleModule("module", new Version(1, 0, 0, null));
-        module.addSerializer(new LinkSerializer());
-        mapper.registerModule(module);
-
-        //
-        // Fetch the attributes
-        //
-        String srcDpidStr = (String) getRequestAttributes().get("src-dpid");
-        String dstDpidStr = (String) getRequestAttributes().get("dst-dpid");
-        Dpid srcDpid = new Dpid(srcDpidStr);
-        Dpid dstDpid = new Dpid(dstDpidStr);
-        log.debug("Getting Shortest Path {}--{}", srcDpidStr, dstDpidStr);
-
-        //
-        // Do the Shortest Path computation and return the result: list of
-        // links.
-        //
-        try {
-            topology.acquireReadLock();
-            Switch srcSwitch = topology.getSwitch(srcDpid.value());
-            Switch dstSwitch = topology.getSwitch(dstDpid.value());
-            if ((srcSwitch == null) || (dstSwitch == null)) {
-                return "";
-            }
-            ConstrainedBFSTree bfsTree = new ConstrainedBFSTree(srcSwitch);
-            Path path = bfsTree.getPath(dstSwitch);
-            List<Link> links = new LinkedList<>();
-            for (LinkEvent linkEvent : path) {
-                Link link = topology.getLink(linkEvent.getSrc().getDpid(),
-                        linkEvent.getSrc().getNumber(),
-                        linkEvent.getDst().getDpid(),
-                        linkEvent.getDst().getNumber());
-                if (link == null) {
-                    return "";
-                }
-                links.add(link);
-            }
-            return mapper.writeValueAsString(links);
-        } catch (IOException e) {
-            log.error("Error writing Shortest Path to JSON", e);
-            return "";
-        } finally {
-            topology.releaseReadLock();
-        }
-    }
-}
diff --git a/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java b/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
index 9e5dabe..0959ca6 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/TopologyWebRoutable.java
@@ -21,8 +21,6 @@
         router.attach("/devices", TopologyDevicesResource.class);
         router.attach("/links", TopologyLinksResource.class);
         router.attach("/switches", TopologySwitchesResource.class);
-        // TODO: Move the Shortest Path REST API to the Intent framework
-        router.attach("/shortest-path/{src-dpid}/{dst-dpid}/json", TopologyShortestPathResource.class);
 
         return router;
     }
