Merge pull request #494 from n-shiota/rest

REST API refactoring
diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
index 39bdf3c..42fb3c6 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/Controller.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
@@ -61,6 +61,7 @@
 import net.floodlightcontroller.restserver.IRestApiService;
 import net.floodlightcontroller.threadpool.IThreadPoolService;
 import net.onrc.onos.ofcontroller.core.IOFSwitchPortListener;
+import net.onrc.onos.ofcontroller.core.web.OnosInternalWebRoutable;
 import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscoveryService;
 import net.onrc.onos.registry.controller.IControllerRegistryService;
 import net.onrc.onos.registry.controller.IControllerRegistryService.ControlChangeCallback;
@@ -1831,6 +1832,7 @@
        
         // Add our REST API
         restApi.addRestletRoutable(new CoreWebRoutable());
+        restApi.addRestletRoutable(new OnosInternalWebRoutable());
     }
     
     @Override
diff --git a/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java b/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java
index 9b22617..0e48975 100644
--- a/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java
+++ b/src/main/java/net/floodlightcontroller/core/web/CoreWebRoutable.java
@@ -19,10 +19,6 @@
 
 import net.floodlightcontroller.core.module.ModuleLoaderResource;
 import net.floodlightcontroller.restserver.RestletRoutable;
-import net.onrc.onos.ofcontroller.core.web.ClearFlowTableResource;
-import net.onrc.onos.ofcontroller.core.web.TopoLinksResource;
-import net.onrc.onos.ofcontroller.core.web.TopoSwitchesResource;
-import net.onrc.onos.ofcontroller.devicemanager.web.TopoDevicesResource;
 
 import org.restlet.Context;
 import org.restlet.Restlet;
@@ -35,7 +31,7 @@
 public class CoreWebRoutable implements RestletRoutable {
     @Override
     public String basePath() {
-        return "/wm/core";
+        return "/wm/floodlight/core";
     }
 
     @Override
@@ -57,11 +53,6 @@
                 EventHistoryTopologyClusterResource.class);
         router.attach("/health/json", HealthCheckResource.class);
         router.attach("/system/uptime/json", SystemUptimeResource.class);
-        // Following added by ONOS
-        router.attach("/topology/switches/{filter}/json", TopoSwitchesResource.class);
-        router.attach("/topology/links/json", TopoLinksResource.class);
-        router.attach("/topology/devices/json", TopoDevicesResource.class);
-        router.attach("/clearflowtable/json", ClearFlowTableResource.class);
         return router;
     }
 }
diff --git a/src/main/java/net/floodlightcontroller/devicemanager/web/DeviceRoutable.java b/src/main/java/net/floodlightcontroller/devicemanager/web/DeviceRoutable.java
index 9a76505..3648569 100644
--- a/src/main/java/net/floodlightcontroller/devicemanager/web/DeviceRoutable.java
+++ b/src/main/java/net/floodlightcontroller/devicemanager/web/DeviceRoutable.java
@@ -30,7 +30,7 @@
 
     @Override
     public String basePath() {
-        return "/wm/device";
+        return "/wm/floodlight/device";
     }
     
     @Override
diff --git a/src/main/java/net/floodlightcontroller/topology/web/TopologyWebRoutable.java b/src/main/java/net/floodlightcontroller/topology/web/TopologyWebRoutable.java
index 4f844b2..363a194 100644
--- a/src/main/java/net/floodlightcontroller/topology/web/TopologyWebRoutable.java
+++ b/src/main/java/net/floodlightcontroller/topology/web/TopologyWebRoutable.java
@@ -4,8 +4,6 @@
 import org.restlet.routing.Router;
 
 import net.floodlightcontroller.restserver.RestletRoutable;
-import net.onrc.onos.ofcontroller.linkdiscovery.web.LinksResource;
-import net.onrc.onos.ofcontroller.topology.web.RouteResource;
 
 public class TopologyWebRoutable implements RestletRoutable {
     /**
@@ -14,13 +12,11 @@
     @Override
     public Router getRestlet(Context context) {
         Router router = new Router(context);
-        router.attach("/links/json", LinksResource.class);
         router.attach("/tunnellinks/json", TunnelLinksResource.class);
         router.attach("/switchclusters/json", SwitchClustersResource.class);
         router.attach("/broadcastdomainports/json", BroadcastDomainPortsResource.class);
         router.attach("/enabledports/json", EnabledPortsResource.class);
         router.attach("/blockedports/json", BlockedPortsResource.class);
-        router.attach("/route/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", RouteResource.class);
         return router;
     }
 
@@ -29,6 +25,6 @@
      */
     @Override
     public String basePath() {
-        return "/wm/topology";
+        return "/wm/floodlight/topology";
     }
 }
diff --git a/src/main/java/net/floodlightcontroller/ui/web/StaticWebRoutable.java b/src/main/java/net/floodlightcontroller/ui/web/StaticWebRoutable.java
index c1d5b5f..e89f0be 100644
--- a/src/main/java/net/floodlightcontroller/ui/web/StaticWebRoutable.java
+++ b/src/main/java/net/floodlightcontroller/ui/web/StaticWebRoutable.java
@@ -64,7 +64,7 @@
 
 	@Override
 	public String basePath() {
-		return "/ui/";
+		return "/wm/floodlight/ui/";
 	}
 
 }
diff --git a/src/main/java/net/onrc/onos/datagrid/web/DatagridWebRoutable.java b/src/main/java/net/onrc/onos/datagrid/web/DatagridWebRoutable.java
index 2c99ece..1d3afe7 100644
--- a/src/main/java/net/onrc/onos/datagrid/web/DatagridWebRoutable.java
+++ b/src/main/java/net/onrc/onos/datagrid/web/DatagridWebRoutable.java
@@ -25,6 +25,6 @@
      */
     @Override
     public String basePath() {
-        return "/wm/datagrid";
+        return "/wm/onos/datagrid";
     }
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/devicemanager/web/TopoDevicesResource.java b/src/main/java/net/onrc/onos/graph/web/TopoDevicesResource.java
similarity index 88%
rename from src/main/java/net/onrc/onos/ofcontroller/devicemanager/web/TopoDevicesResource.java
rename to src/main/java/net/onrc/onos/graph/web/TopoDevicesResource.java
index ac9409f..18c1069 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/devicemanager/web/TopoDevicesResource.java
+++ b/src/main/java/net/onrc/onos/graph/web/TopoDevicesResource.java
@@ -1,4 +1,4 @@
-package net.onrc.onos.ofcontroller.devicemanager.web;
+package net.onrc.onos.graph.web;
 
 import java.util.Iterator;
 
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/web/OnosInternalWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/core/web/OnosInternalWebRoutable.java
new file mode 100644
index 0000000..78bb02b
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/web/OnosInternalWebRoutable.java
@@ -0,0 +1,22 @@
+package net.onrc.onos.ofcontroller.core.web;
+
+import org.restlet.Context;
+import org.restlet.Restlet;
+import org.restlet.routing.Router;
+
+import net.floodlightcontroller.restserver.RestletRoutable;
+
+public class OnosInternalWebRoutable implements RestletRoutable {
+    @Override
+    public String basePath() {
+        return "/wm/onos/internal";
+    }
+
+    @Override
+    public Restlet getRestlet(Context context) {
+        Router router = new Router(context);
+        // Following added by ONOS
+        router.attach("/clearflowtable/json", ClearFlowTableResource.class);
+        return router;
+    }
+}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java
index c358263..ec448a3 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/web/FlowWebRoutable.java
@@ -30,6 +30,6 @@
      */
     @Override
     public String basePath() {
-        return "/wm/flow";
+        return "/wm/onos/flows";
     }
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/FlowProgrammerWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/FlowProgrammerWebRoutable.java
index 22450f7..9325a00 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/FlowProgrammerWebRoutable.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/FlowProgrammerWebRoutable.java
@@ -22,7 +22,7 @@
 
 	@Override
 	public String basePath() {
-		return "/wm/fprog";
+		return "/wm/onos/flowprogrammer";
 	}
 
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinkDiscoveryWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinkDiscoveryWebRoutable.java
index 8eae558..4350ba6 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinkDiscoveryWebRoutable.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinkDiscoveryWebRoutable.java
@@ -12,6 +12,7 @@
     @Override
     public Router getRestlet(Context context) {
         Router router = new Router(context);
+        router.attach("/links/json", LinksResource.class);
         router.attach("/autoportfast/{state}/json", AutoPortFast.class); // enable/true or disable/false
         return router;
     }
@@ -21,6 +22,6 @@
      */
     @Override
     public String basePath() {
-        return "/wm/linkdiscovery";
+        return "/wm/onos/linkdiscovery";
     }
 }
\ No newline at end of file
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
index 02e0ffb..be207c6 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
@@ -10,10 +10,11 @@
 import net.floodlightcontroller.core.module.FloodlightModuleException;
 import net.floodlightcontroller.core.module.IFloodlightModule;
 import net.floodlightcontroller.core.module.IFloodlightService;
-
+import net.floodlightcontroller.restserver.IRestApiService;
 import net.onrc.onos.datagrid.IDatagridService;
 import net.onrc.onos.graph.GraphDBOperation;
 import net.onrc.onos.ofcontroller.floodlightlistener.INetworkGraphService;
+import net.onrc.onos.ofcontroller.topology.web.OnosTopologyWebRoutable;
 import net.onrc.onos.ofcontroller.util.DataPath;
 import net.onrc.onos.ofcontroller.util.FlowEntry;
 import net.onrc.onos.ofcontroller.util.FlowPath;
@@ -35,6 +36,7 @@
     protected IFloodlightProviderService floodlightProvider;
 
     protected GraphDBOperation dbHandler;
+    protected IRestApiService restApi;
 
 
     /**
@@ -145,6 +147,7 @@
     public void init(FloodlightModuleContext context)
 	throws FloodlightModuleException {
 	floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
+	restApi = context.getServiceImpl(IRestApiService.class);
 
 	String conf = "";
 	this.init(conf);
@@ -157,6 +160,7 @@
      */
     @Override
     public void startUp(FloodlightModuleContext context) {
+    	restApi.addRestletRoutable(new OnosTopologyWebRoutable());
 
     }
 
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/web/OnosTopologyWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/topology/web/OnosTopologyWebRoutable.java
new file mode 100644
index 0000000..90eed9a
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/web/OnosTopologyWebRoutable.java
@@ -0,0 +1,29 @@
+package net.onrc.onos.ofcontroller.topology.web;
+
+import org.restlet.Context;
+import org.restlet.Restlet;
+import org.restlet.routing.Router;
+
+import net.floodlightcontroller.restserver.RestletRoutable;
+import net.onrc.onos.graph.web.TopoDevicesResource;
+import net.onrc.onos.ofcontroller.core.web.TopoLinksResource;
+import net.onrc.onos.ofcontroller.core.web.TopoSwitchesResource;
+
+public class OnosTopologyWebRoutable implements RestletRoutable {
+
+	@Override
+	public Restlet getRestlet(Context context) {
+        Router router = new Router(context);
+        router.attach("/route/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", RouteResource.class);
+        router.attach("/switches/{filter}/json", TopoSwitchesResource.class);
+        router.attach("/links/json", TopoLinksResource.class);
+        router.attach("/devices/json", TopoDevicesResource.class);
+		return router;
+	}
+
+	@Override
+	public String basePath() {
+        return "/wm/onos/topology";
+	}
+
+}
diff --git a/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java b/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java
index b6d980a..82af20c 100644
--- a/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java
+++ b/src/main/java/net/onrc/onos/registry/controller/StandaloneRegistry.java
@@ -11,6 +11,7 @@
 import net.floodlightcontroller.core.module.IFloodlightModule;
 import net.floodlightcontroller.core.module.IFloodlightService;
 import net.floodlightcontroller.restserver.IRestApiService;
+import net.onrc.onos.registry.controller.web.RegistryWebRoutable;
 
 import org.openflow.util.HexString;
 import org.slf4j.Logger;
diff --git a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
index 50ee137..b03aea2 100644
--- a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
+++ b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
@@ -15,6 +15,7 @@
 import net.floodlightcontroller.core.module.IFloodlightModule;
 import net.floodlightcontroller.core.module.IFloodlightService;
 import net.floodlightcontroller.restserver.IRestApiService;
+import net.onrc.onos.registry.controller.web.RegistryWebRoutable;
 
 import org.openflow.util.HexString;
 import org.slf4j.Logger;
diff --git a/src/main/java/net/onrc/onos/registry/controller/ControllerRegistryResource.java b/src/main/java/net/onrc/onos/registry/controller/web/ControllerRegistryResource.java
similarity index 83%
rename from src/main/java/net/onrc/onos/registry/controller/ControllerRegistryResource.java
rename to src/main/java/net/onrc/onos/registry/controller/web/ControllerRegistryResource.java
index 8660688..676bcb3 100644
--- a/src/main/java/net/onrc/onos/registry/controller/ControllerRegistryResource.java
+++ b/src/main/java/net/onrc/onos/registry/controller/web/ControllerRegistryResource.java
@@ -1,8 +1,11 @@
-package net.onrc.onos.registry.controller;
+package net.onrc.onos.registry.controller.web;
 
 import java.util.ArrayList;
 import java.util.Collection;
 
+import net.onrc.onos.registry.controller.IControllerRegistryService;
+import net.onrc.onos.registry.controller.RegistryException;
+
 import org.restlet.resource.Get;
 import org.restlet.resource.ServerResource;
 import org.slf4j.Logger;
diff --git a/src/main/java/net/onrc/onos/registry/controller/RegistryWebRoutable.java b/src/main/java/net/onrc/onos/registry/controller/web/RegistryWebRoutable.java
similarity index 86%
rename from src/main/java/net/onrc/onos/registry/controller/RegistryWebRoutable.java
rename to src/main/java/net/onrc/onos/registry/controller/web/RegistryWebRoutable.java
index 74dede4..77dd72d 100644
--- a/src/main/java/net/onrc/onos/registry/controller/RegistryWebRoutable.java
+++ b/src/main/java/net/onrc/onos/registry/controller/web/RegistryWebRoutable.java
@@ -1,4 +1,4 @@
-package net.onrc.onos.registry.controller;
+package net.onrc.onos.registry.controller.web;
 
 import net.floodlightcontroller.restserver.RestletRoutable;
 
@@ -18,7 +18,7 @@
 
 	@Override
 	public String basePath() {
-		return "/wm/registry";
+		return "/wm/onos/registry";
 	}
 
 }
diff --git a/src/main/java/net/onrc/onos/registry/controller/SwitchRegistryResource.java b/src/main/java/net/onrc/onos/registry/controller/web/SwitchRegistryResource.java
similarity index 79%
rename from src/main/java/net/onrc/onos/registry/controller/SwitchRegistryResource.java
rename to src/main/java/net/onrc/onos/registry/controller/web/SwitchRegistryResource.java
index 599a1af..21b0c09 100644
--- a/src/main/java/net/onrc/onos/registry/controller/SwitchRegistryResource.java
+++ b/src/main/java/net/onrc/onos/registry/controller/web/SwitchRegistryResource.java
@@ -1,9 +1,12 @@
-package net.onrc.onos.registry.controller;
+package net.onrc.onos.registry.controller.web;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import net.onrc.onos.registry.controller.ControllerRegistryEntry;
+import net.onrc.onos.registry.controller.IControllerRegistryService;
+
 import org.restlet.resource.Get;
 import org.restlet.resource.ServerResource;
 
diff --git a/web/add_flow.py b/web/add_flow.py
index 9690024..9f85bb4 100755
--- a/web/add_flow.py
+++ b/web/add_flow.py
@@ -14,7 +14,7 @@
 from flask import Flask, json, Response, render_template, make_response, request
 
 #
-# curl http://127.0.0.1:8080/wm/topology/route/00:00:00:00:00:00:0a:01/1/00:00:00:00:00:00:0a:04/1/json
+# curl http://127.0.0.1:8080/wm/onos/topology/route/00:00:00:00:00:00:0a:01/1/00:00:00:00:00:00:0a:04/1/json
 #
 
 ## Global Var ##
@@ -37,14 +37,14 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/topology/route/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
+# @app.route("/wm/onos/topology/route/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
 #
 # Sample output:
 # {'dstPort': {'port': {'value': 0}, 'dpid': {'value': '00:00:00:00:00:00:00:02'}}, 'srcPort': {'port': {'value': 0}, 'dpid': {'value': '00:00:00:00:00:00:00:01'}}, 'flowEntries': [{'outPort': {'value': 1}, 'flowEntryErrorState': None, 'flowEntryMatch': None, 'flowEntryActions': None, 'inPort': {'value': 0}, 'flowEntryId': None, 'flowEntryUserState': 'FE_USER_UNKNOWN', 'dpid': {'value': '00:00:00:00:00:00:00:01'}, 'flowEntrySwitchState': 'FE_SWITCH_UNKNOWN'}, {'outPort': {'value': 0}, 'flowEntryErrorState': None, 'flowEntryMatch': None, 'flowEntryActions': None, 'inPort': {'value': 9}, 'flowEntryId': None, 'flowEntryUserState': 'FE_USER_UNKNOWN', 'dpid': {'value': '00:00:00:00:00:00:00:02'}, 'flowEntrySwitchState': 'FE_SWITCH_UNKNOWN'}]}
 #
 def shortest_path(v1, p1, v2, p2):
   try:
-    command = "curl -s http://%s:%s/wm/topology/route/%s/%s/%s/%s/json" % (ControllerIP, ControllerPort, v1, p1, v2, p2)
+    command = "curl -s http://%s:%s/wm/onos/topology/route/%s/%s/%s/%s/json" % (ControllerIP, ControllerPort, v1, p1, v2, p2)
     debug("shortest_path %s" % command)
     parsedResult = []
 
@@ -82,7 +82,7 @@
   flow_path_json = json.dumps(flow_path)
 
   try:
-    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/flow/add/json" % (flow_path_json, ControllerIP, ControllerPort)
+    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/onos/flows/add/json" % (flow_path_json, ControllerIP, ControllerPort)
     debug("add_flow_path %s" % command)
     result = os.popen(command).read()
     debug("result %s" % result)
@@ -96,7 +96,7 @@
   flow_path_json = json.dumps(flow_path)
 
   try:
-    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/flow/add-shortest-path/json" % (flow_path_json, ControllerIP, ControllerPort)
+    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/onos/flows/add-shortest-path/json" % (flow_path_json, ControllerIP, ControllerPort)
     debug("add_shortest_path_flow %s" % command)
     result = os.popen(command).read()
     debug("result %s" % result)
@@ -107,7 +107,7 @@
     exit(1)
 
 def delete_flow_path(flow_id):
-  command = "curl -s \"http://%s:%s/wm/flow/delete/%s/json\"" % (ControllerIP, ControllerPort, flow_id)
+  command = "curl -s \"http://%s:%s/wm/onos/flows/delete/%s/json\"" % (ControllerIP, ControllerPort, flow_id)
   debug("delete_flow_path %s" % command)
   result = os.popen(command).read()
   debug("result %s" % result)
diff --git a/web/clear_core.py b/web/clear_core.py
index ea3e964..36eadd6 100755
--- a/web/clear_core.py
+++ b/web/clear_core.py
@@ -23,7 +23,7 @@
 
   try:
     sw_list = json.dumps(core_switches)
-    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/core/clearflowtable/json" % (sw_list, controllers[0], onos_rest_port)
+    command = "curl -s -H 'Content-Type: application/json' -d '%s' http://%s:%s/wm/onos/internal/clearflowtable/json" % (sw_list, controllers[0], onos_rest_port)
 
     print command
     result = os.popen(command).read()
diff --git a/web/delete_flow.py b/web/delete_flow.py
index fff9319..d38e915 100755
--- a/web/delete_flow.py
+++ b/web/delete_flow.py
@@ -14,7 +14,7 @@
 
 #
 # TODO: remove this! We don't use JSON argument here!
-# curl http://127.0.0.1:8080/wm/flow/delete/{"value":"0xf"}/json'
+# curl http://127.0.0.1:8080/wm/onos/flows/delete/{"value":"0xf"}/json'
 #
 
 ## Global Var ##
@@ -34,9 +34,9 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/flow/delete/<flow-id>/json")
+# @app.route("/wm/onos/flows/delete/<flow-id>/json")
 def delete_flow_path(flow_id):
-  command = "curl -s \"http://%s:%s/wm/flow/delete/%s/json\"" % (ControllerIP, ControllerPort, flow_id)
+  command = "curl -s \"http://%s:%s/wm/onos/flows/delete/%s/json\"" % (ControllerIP, ControllerPort, flow_id)
   debug("delete_flow_path %s" % command)
   result = os.popen(command).read()
   debug("result %s" % result)
diff --git a/web/css/bootstrap.css b/web/floodlight/css/bootstrap.css
similarity index 100%
rename from web/css/bootstrap.css
rename to web/floodlight/css/bootstrap.css
diff --git a/web/css/styles.css b/web/floodlight/css/styles.css
similarity index 100%
rename from web/css/styles.css
rename to web/floodlight/css/styles.css
diff --git a/web/img/floodlight.png b/web/floodlight/img/floodlight.png
similarity index 100%
rename from web/img/floodlight.png
rename to web/floodlight/img/floodlight.png
Binary files differ
diff --git a/web/img/glyphicons-halflings-white.png b/web/floodlight/img/glyphicons-halflings-white.png
similarity index 100%
rename from web/img/glyphicons-halflings-white.png
rename to web/floodlight/img/glyphicons-halflings-white.png
Binary files differ
diff --git a/web/img/glyphicons-halflings.png b/web/floodlight/img/glyphicons-halflings.png
similarity index 100%
rename from web/img/glyphicons-halflings.png
rename to web/floodlight/img/glyphicons-halflings.png
Binary files differ
diff --git a/web/img/logo.jpg b/web/floodlight/img/logo.jpg
similarity index 100%
rename from web/img/logo.jpg
rename to web/floodlight/img/logo.jpg
Binary files differ
diff --git a/web/img/openflow-logo-40px.png b/web/floodlight/img/openflow-logo-40px.png
similarity index 100%
rename from web/img/openflow-logo-40px.png
rename to web/floodlight/img/openflow-logo-40px.png
Binary files differ
diff --git a/web/img/server.png b/web/floodlight/img/server.png
similarity index 100%
rename from web/img/server.png
rename to web/floodlight/img/server.png
Binary files differ
diff --git a/web/img/switch.png b/web/floodlight/img/switch.png
similarity index 100%
rename from web/img/switch.png
rename to web/floodlight/img/switch.png
Binary files differ
diff --git a/web/index.html b/web/floodlight/index.html
similarity index 100%
rename from web/index.html
rename to web/floodlight/index.html
diff --git a/web/js/controller-status.js b/web/floodlight/js/controller-status.js
similarity index 100%
rename from web/js/controller-status.js
rename to web/floodlight/js/controller-status.js
diff --git a/web/js/jquery-1.7.2.min.js b/web/floodlight/js/jquery-1.7.2.min.js
similarity index 100%
rename from web/js/jquery-1.7.2.min.js
rename to web/floodlight/js/jquery-1.7.2.min.js
diff --git a/web/js/main.js b/web/floodlight/js/main.js
similarity index 100%
rename from web/js/main.js
rename to web/floodlight/js/main.js
diff --git a/web/js/models/flowmodel.js b/web/floodlight/js/models/flowmodel.js
similarity index 100%
rename from web/js/models/flowmodel.js
rename to web/floodlight/js/models/flowmodel.js
diff --git a/web/js/models/hostmodel.js b/web/floodlight/js/models/hostmodel.js
similarity index 97%
rename from web/js/models/hostmodel.js
rename to web/floodlight/js/models/hostmodel.js
index 8de3dd6..1caff6c 100644
--- a/web/js/models/hostmodel.js
+++ b/web/floodlight/js/models/hostmodel.js
@@ -35,7 +35,7 @@
         var self = this;
         //console.log("fetching host list")
         $.ajax({
-            url:hackBase + "/wm/device/",
+            url:hackBase + "/wm/floodlight/device/",
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  host list: " + data.length);
diff --git a/web/js/models/portmodel.js b/web/floodlight/js/models/portmodel.js
similarity index 100%
rename from web/js/models/portmodel.js
rename to web/floodlight/js/models/portmodel.js
diff --git a/web/js/models/statusmodel.js b/web/floodlight/js/models/statusmodel.js
similarity index 89%
rename from web/js/models/statusmodel.js
rename to web/floodlight/js/models/statusmodel.js
index b7cdebd..5cbb526 100644
--- a/web/js/models/statusmodel.js
+++ b/web/floodlight/js/models/statusmodel.js
@@ -30,7 +30,7 @@
         var self = this;
         console.log("fetching controller status");
         $.ajax({
-            url:hackBase + "/wm/core/health/json",
+            url:hackBase + "/wm/floodlight/core/health/json",
             dataType:"json",
             success:function (data) {
                 console.log("fetched controller status: health");
@@ -39,7 +39,7 @@
             }
         });
         $.ajax({
-            url:hackBase + "/wm/core/system/uptime/json",
+            url:hackBase + "/wm/floodlight/core/system/uptime/json",
             dataType:"json",
             success:function (data) {
                 console.log("fetched controller status: uptime");
@@ -48,7 +48,7 @@
             }
         });
         $.ajax({
-            url:hackBase + "/wm/core/memory/json",
+            url:hackBase + "/wm/floodlight/core/memory/json",
             dataType:"json",
             success:function (data) {
                 console.log("fetched controller status: memory");
@@ -57,7 +57,7 @@
             }
         });
         $.ajax({
-            url:hackBase + "/wm/core/module/loaded/json",
+            url:hackBase + "/wm/floodlight/core/module/loaded/json",
             dataType:"json",
             success:function (data) {
                 console.log("fetched controller status: modules loaded");
diff --git a/web/js/models/switchmodel.js b/web/floodlight/js/models/switchmodel.js
similarity index 95%
rename from web/js/models/switchmodel.js
rename to web/floodlight/js/models/switchmodel.js
index 4104dd0..700a1cf 100644
--- a/web/js/models/switchmodel.js
+++ b/web/floodlight/js/models/switchmodel.js
@@ -16,7 +16,7 @@
 
 window.Switch = Backbone.Model.extend({
 
-    urlRoot:"/wm/core/switch/",
+    urlRoot:"/wm/floodlight/core/switch/",
     
     defaults: {
         datapathDescription: '',
@@ -34,7 +34,7 @@
 
         //console.log("fetching switch " + this.id + " desc")
         $.ajax({
-            url:hackBase + "/wm/core/switch/" + self.id + '/desc/json',
+            url:hackBase + "/wm/floodlight/core/switch/" + self.id + '/desc/json',
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  switch " + self.id + " desc");
@@ -45,7 +45,7 @@
 
         //console.log("fetching switch " + this.id + " aggregate")
         $.ajax({
-            url:hackBase + "/wm/core/switch/" + self.id + '/aggregate/json',
+            url:hackBase + "/wm/floodlight/core/switch/" + self.id + '/aggregate/json',
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  switch " + self.id + " aggregate");
@@ -69,7 +69,7 @@
         //console.log("fetching switch " + this.id + " ports")
         //console.log("fetching switch " + this.id + " features")
         $.when($.ajax({
-            url:hackBase + "/wm/core/switch/" + self.id + '/port/json',
+            url:hackBase + "/wm/floodlight/core/switch/" + self.id + '/port/json',
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  switch " + self.id + " ports");
@@ -106,7 +106,7 @@
             }
         }),
         $.ajax({
-            url:hackBase + "/wm/core/switch/" + self.id + '/features/json',
+            url:hackBase + "/wm/floodlight/core/switch/" + self.id + '/features/json',
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  switch " + self.id + " features");
@@ -163,7 +163,7 @@
         var self = this;
         //console.log("fetching switch " + this.id + " flows")
         $.ajax({
-            url:hackBase + "/wm/core/switch/" + self.id + '/flow/json',
+            url:hackBase + "/wm/floodlight/core/switch/" + self.id + '/flow/json',
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  switch " + self.id + " flows");
@@ -269,7 +269,7 @@
         var self = this;
         //console.log("fetching switch list")
         $.ajax({
-            url:hackBase + "/wm/core/controller/switches/json",
+            url:hackBase + "/wm/floodlight/core/controller/switches/json",
             dataType:"json",
             success:function (data) {
                 //console.log("fetched  switch list: " + data.length);
diff --git a/web/js/models/topologymodel.js b/web/floodlight/js/models/topologymodel.js
similarity index 97%
rename from web/js/models/topologymodel.js
rename to web/floodlight/js/models/topologymodel.js
index c5d8f9b..bcac141 100644
--- a/web/js/models/topologymodel.js
+++ b/web/floodlight/js/models/topologymodel.js
@@ -16,7 +16,7 @@
 
 window.Topology = Backbone.Model.extend({
 
-    url:"/wm/topology/links/json",
+    url:"/wm/onos/linkdiscovery/links/json",
     
     defaults:{
         nodes: [],
diff --git a/web/js/onos-topology-route.js b/web/floodlight/js/onos-topology-route.js
similarity index 100%
rename from web/js/onos-topology-route.js
rename to web/floodlight/js/onos-topology-route.js
diff --git a/web/js/onos-topology.js b/web/floodlight/js/onos-topology.js
similarity index 100%
rename from web/js/onos-topology.js
rename to web/floodlight/js/onos-topology.js
diff --git a/web/js/utils.js b/web/floodlight/js/utils.js
similarity index 100%
rename from web/js/utils.js
rename to web/floodlight/js/utils.js
diff --git a/web/js/views/flow.js b/web/floodlight/js/views/flow.js
similarity index 100%
rename from web/js/views/flow.js
rename to web/floodlight/js/views/flow.js
diff --git a/web/js/views/header.js b/web/floodlight/js/views/header.js
similarity index 100%
rename from web/js/views/header.js
rename to web/floodlight/js/views/header.js
diff --git a/web/js/views/home.js b/web/floodlight/js/views/home.js
similarity index 100%
rename from web/js/views/home.js
rename to web/floodlight/js/views/home.js
diff --git a/web/js/views/host.js b/web/floodlight/js/views/host.js
similarity index 100%
rename from web/js/views/host.js
rename to web/floodlight/js/views/host.js
diff --git a/web/js/views/port.js b/web/floodlight/js/views/port.js
similarity index 100%
rename from web/js/views/port.js
rename to web/floodlight/js/views/port.js
diff --git a/web/js/views/status.js b/web/floodlight/js/views/status.js
similarity index 100%
rename from web/js/views/status.js
rename to web/floodlight/js/views/status.js
diff --git a/web/js/views/switch.js b/web/floodlight/js/views/switch.js
similarity index 100%
rename from web/js/views/switch.js
rename to web/floodlight/js/views/switch.js
diff --git a/web/js/views/topology.js b/web/floodlight/js/views/topology.js
similarity index 100%
rename from web/js/views/topology.js
rename to web/floodlight/js/views/topology.js
diff --git a/web/lib/backbone-min.js b/web/floodlight/lib/backbone-min.js
similarity index 100%
rename from web/lib/backbone-min.js
rename to web/floodlight/lib/backbone-min.js
diff --git a/web/lib/bootstrap-alert.js b/web/floodlight/lib/bootstrap-alert.js
similarity index 100%
rename from web/lib/bootstrap-alert.js
rename to web/floodlight/lib/bootstrap-alert.js
diff --git a/web/lib/bootstrap-dropdown.js b/web/floodlight/lib/bootstrap-dropdown.js
similarity index 100%
rename from web/lib/bootstrap-dropdown.js
rename to web/floodlight/lib/bootstrap-dropdown.js
diff --git a/web/lib/d3.v2.min.js b/web/floodlight/lib/d3.v2.min.js
similarity index 100%
rename from web/lib/d3.v2.min.js
rename to web/floodlight/lib/d3.v2.min.js
diff --git a/web/lib/jquery.min.js b/web/floodlight/lib/jquery.min.js
similarity index 100%
rename from web/lib/jquery.min.js
rename to web/floodlight/lib/jquery.min.js
diff --git a/web/lib/underscore-min.js b/web/floodlight/lib/underscore-min.js
similarity index 100%
rename from web/lib/underscore-min.js
rename to web/floodlight/lib/underscore-min.js
diff --git a/web/tpl/flow-list-item.html b/web/floodlight/tpl/flow-list-item.html
similarity index 100%
rename from web/tpl/flow-list-item.html
rename to web/floodlight/tpl/flow-list-item.html
diff --git a/web/tpl/flow-list.html b/web/floodlight/tpl/flow-list.html
similarity index 100%
rename from web/tpl/flow-list.html
rename to web/floodlight/tpl/flow-list.html
diff --git a/web/tpl/header.html b/web/floodlight/tpl/header.html
similarity index 100%
rename from web/tpl/header.html
rename to web/floodlight/tpl/header.html
diff --git a/web/tpl/home.html b/web/floodlight/tpl/home.html
similarity index 100%
rename from web/tpl/home.html
rename to web/floodlight/tpl/home.html
diff --git a/web/tpl/host-list-item.html b/web/floodlight/tpl/host-list-item.html
similarity index 100%
rename from web/tpl/host-list-item.html
rename to web/floodlight/tpl/host-list-item.html
diff --git a/web/tpl/host-list.html b/web/floodlight/tpl/host-list.html
similarity index 100%
rename from web/tpl/host-list.html
rename to web/floodlight/tpl/host-list.html
diff --git a/web/tpl/host.html b/web/floodlight/tpl/host.html
similarity index 100%
rename from web/tpl/host.html
rename to web/floodlight/tpl/host.html
diff --git a/web/tpl/port-list-item.html b/web/floodlight/tpl/port-list-item.html
similarity index 100%
rename from web/tpl/port-list-item.html
rename to web/floodlight/tpl/port-list-item.html
diff --git a/web/tpl/port-list.html b/web/floodlight/tpl/port-list.html
similarity index 100%
rename from web/tpl/port-list.html
rename to web/floodlight/tpl/port-list.html
diff --git a/web/tpl/status.html b/web/floodlight/tpl/status.html
similarity index 100%
rename from web/tpl/status.html
rename to web/floodlight/tpl/status.html
diff --git a/web/tpl/switch-list-item.html b/web/floodlight/tpl/switch-list-item.html
similarity index 100%
rename from web/tpl/switch-list-item.html
rename to web/floodlight/tpl/switch-list-item.html
diff --git a/web/tpl/switch-list.html b/web/floodlight/tpl/switch-list.html
similarity index 100%
rename from web/tpl/switch-list.html
rename to web/floodlight/tpl/switch-list.html
diff --git a/web/tpl/switch.html b/web/floodlight/tpl/switch.html
similarity index 100%
rename from web/tpl/switch.html
rename to web/floodlight/tpl/switch.html
diff --git a/web/tpl/topology.html b/web/floodlight/tpl/topology.html
similarity index 100%
rename from web/tpl/topology.html
rename to web/floodlight/tpl/topology.html
diff --git a/web/tpl/vlan-list-item.html b/web/floodlight/tpl/vlan-list-item.html
similarity index 100%
rename from web/tpl/vlan-list-item.html
rename to web/floodlight/tpl/vlan-list-item.html
diff --git a/web/tpl/vlan.html b/web/floodlight/tpl/vlan.html
similarity index 100%
rename from web/tpl/vlan.html
rename to web/floodlight/tpl/vlan.html
diff --git a/web/flowsync.py b/web/flowsync.py
index 51399d5..ef1d9bd 100755
--- a/web/flowsync.py
+++ b/web/flowsync.py
@@ -29,12 +29,12 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/fprog/synchronizer/sync/<dpid>/json")
+# @app.route("/wm/onos/flowprogrammer/synchronizer/sync/<dpid>/json")
 # Sample output:
 #  "true"
 def synchronize(dpid):
   try:
-    command = "curl -s \"http://%s:%s/wm/fprog/synchronizer/sync/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+    command = "curl -s \"http://%s:%s/wm/onos/flowprogrammer/synchronizer/sync/%s/json\"" % (ControllerIP, ControllerPort, dpid)
     debug("synchronize %s" % command)
      
     result = os.popen(command).read()
@@ -48,12 +48,12 @@
   
   print "Synchronization of switch %s has successfully began" % (dpid)
 
-# @app.route("/wm/fprog/synchronizer/interrupt/<dpid>/json")
+# @app.route("/wm/onos/flowprogrammer/synchronizer/interrupt/<dpid>/json")
 # Sample output:
 #  "true"
 def interrupt(dpid):
   try:
-    command = "curl -s \"http://%s:%s/wm/fprog/synchronizer/interrupt/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+    command = "curl -s \"http://%s:%s/wm/onos/flowprogrammer/synchronizer/interrupt/%s/json\"" % (ControllerIP, ControllerPort, dpid)
     debug("interrupt %s" % command)
      
     result = os.popen(command).read()
diff --git a/web/get_datagrid.py b/web/get_datagrid.py
index 2d26846..43ab04f 100755
--- a/web/get_datagrid.py
+++ b/web/get_datagrid.py
@@ -29,7 +29,7 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/datagrid/get/map/<map-name>/json ")
+# @app.route("/wm/onos/datagrid/get/map/<map-name>/json ")
 # Sample output:
 
 def print_datagrid_map(parsedResult):
@@ -37,7 +37,7 @@
 
 def get_datagrid_map(map_name):
   try:
-    command = "curl -s \"http://%s:%s/wm/datagrid/get/map/%s/json\"" % (ControllerIP, ControllerPort, map_name)
+    command = "curl -s \"http://%s:%s/wm/onos/datagrid/get/map/%s/json\"" % (ControllerIP, ControllerPort, map_name)
     debug("get_datagrid_map %s" % command)
 
     result = os.popen(command).read()
diff --git a/web/get_flow.py b/web/get_flow.py
index 94b9a61..382238f 100755
--- a/web/get_flow.py
+++ b/web/get_flow.py
@@ -29,7 +29,7 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/flow/get/<flow-id>/json")
+# @app.route("/wm/onos/flows/get/<flow-id>/json")
 # Sample output:
 # {"flowId":{"value":"0x5"},"installerId":{"value":"FOOBAR"},"dataPath":{"srcPort":{"dpid":{"value":"00:00:00:00:00:00:00:01"},"port":{"value":0}},"dstPort":{"dpid":{"value":"00:00:00:00:00:00:00:02"},"port":{"value":0}},"flowEntries":[{"flowEntryId":"0x1389","flowEntryMatch":null,"flowEntryActions":null,"dpid":{"value":"00:00:00:00:00:00:00:01"},"inPort":{"value":0},"outPort":{"value":1},"flowEntryUserState":"FE_USER_DELETE","flowEntrySwitchState":"FE_SWITCH_NOT_UPDATED","flowEntryErrorState":null},{"flowEntryId":"0x138a","flowEntryMatch":null,"flowEntryActions":null,"dpid":{"value":"00:00:00:00:00:00:00:02"},"inPort":{"value":9},"outPort":{"value":0},"flowEntryUserState":"FE_USER_DELETE","flowEntrySwitchState":"FE_SWITCH_NOT_UPDATED","flowEntryErrorState":null}]}}
 
@@ -236,7 +236,7 @@
 
 def get_flow_path(flow_id):
   try:
-    command = "curl -s \"http://%s:%s/wm/flow/get/%s/json\"" % (ControllerIP, ControllerPort, flow_id)
+    command = "curl -s \"http://%s:%s/wm/onos/flows/get/%s/json\"" % (ControllerIP, ControllerPort, flow_id)
     debug("get_flow_path %s" % command)
 
     result = os.popen(command).read()
@@ -256,7 +256,7 @@
 
 def get_all_flow_paths():
   try:
-    command = "curl -s \"http://%s:%s/wm/flow/getall/json\"" % (ControllerIP, ControllerPort)
+    command = "curl -s \"http://%s:%s/wm/onos/flows/getall/json\"" % (ControllerIP, ControllerPort)
     debug("get_all_flow_paths %s" % command)
 
     result = os.popen(command).read()
diff --git a/web/onos-topology-route.html b/web/onos-topology-route.html
index 6c167c7..cbda5e9 100644
--- a/web/onos-topology-route.html
+++ b/web/onos-topology-route.html
@@ -42,7 +42,7 @@
     </marker>
   </defs>
 <script type="text/javascript">
-gui("http://onosnat.onlab.us:8080/wm/topology/toporoute/00:00:00:0d:00:d1/2/00:00:00:0d:00:d3/3/json");
+gui("http://onosnat.onlab.us:8080/wm/floodlight/topology/toporoute/00:00:00:0d:00:d1/2/00:00:00:0d:00:d3/3/json");
 </script>
 </svg>
 </body>
diff --git a/web/ons-demo/js/model.js b/web/ons-demo/js/model.js
index df4a751..bb1aaea 100644
--- a/web/ons-demo/js/model.js
+++ b/web/ons-demo/js/model.js
@@ -61,12 +61,12 @@
 }
 
 var urls = {
-	links: '/wm/core/topology/links/json',
-	switches: '/wm/core/topology/switches/all/json',
-	flows: '/wm/flow/getsummary/0/0/json?proxy',
-	activeControllers: '/wm/registry/controllers/json',
+	links: '/wm/onos/topology/links/json',
+	switches: '/wm/onos/topology/switches/all/json',
+	flows: '/wm/onos/flows/getsummary/0/0/json?proxy',
+	activeControllers: '/wm/onos/registry/controllers/json',
 	controllers: 'data/controllers.json',
-	mapping: '/wm/registry/switches/json',
+	mapping: '/wm/onos/registry/switches/json',
 	configuration: 'data/configuration.json'
 }
 
@@ -81,12 +81,12 @@
 }
 
 var proxyURLs = {
-	links: '/wm/core/topology/links/json?proxy',
-	switches: '/wm/core/topology/switches/all/json?proxy',
-	flows: '/wm/flow/getsummary/0/0/json?proxy',
-	activeControllers: '/wm/registry/controllers/json?proxy',
+	links: '/wm/onos/topology/links/json?proxy',
+	switches: '/wm/onos/topology/switches/all/json?proxy',
+	flows: '/wm/onos/flows/getsummary/0/0/json?proxy',
+	activeControllers: '/wm/onos/registry/controllers/json?proxy',
 	controllers: 'data/controllers.json',
-	mapping: '/wm/registry/switches/json?proxy',
+	mapping: '/wm/onos/registry/switches/json?proxy',
 	configuration: 'data/configuration.json'
 }
 
diff --git a/web/pusher.py b/web/pusher.py
index 2a3528b..dbbe7f9 100755
--- a/web/pusher.py
+++ b/web/pusher.py
@@ -29,12 +29,12 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/fprog/pusher/setrate/<dpid>/<rate>/json")
+# @app.route("/wm/onos/flowprogrammer/pusher/setrate/<dpid>/<rate>/json")
 # Sample output:
 #  "true"
 def set_rate(dpid,rate):
   try:
-    command = "curl -s \"http://%s:%s/wm/fprog/pusher/setrate/%s/%s/json\"" % (ControllerIP, ControllerPort, dpid, rate)
+    command = "curl -s \"http://%s:%s/wm/onos/flowprogrammer/pusher/setrate/%s/%s/json\"" % (ControllerIP, ControllerPort, dpid, rate)
     debug("set_rate %s" % command)
      
     result = os.popen(command).read()
@@ -48,12 +48,12 @@
   
   print "Sending rate to %s is successfully set to %s" % (dpid, rate)
 
-# @app.route("/wm/fprog/pusher/suspend/<dpid>/json")
+# @app.route("/wm/onos/flowprogrammer/pusher/suspend/<dpid>/json")
 # Sample output:
 #  "true"
 def suspend(dpid):
   try:
-    command = "curl -s \"http://%s:%s/wm/fprog/pusher/suspend/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+    command = "curl -s \"http://%s:%s/wm/onos/flowprogrammer/pusher/suspend/%s/json\"" % (ControllerIP, ControllerPort, dpid)
     debug("suspend %s" % command)
      
     result = os.popen(command).read()
@@ -67,12 +67,12 @@
   
   print "DPID %s is successfully suspended" % dpid
 
-# @app.route("/wm/fprog/pusher/resume/<dpid>/json")
+# @app.route("/wm/onos/flowprogrammer/pusher/resume/<dpid>/json")
 # Sample output:
 #  "true"
 def resume(dpid):
   try:
-    command = "curl -s \"http://%s:%s/wm/fprog/pusher/resume/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+    command = "curl -s \"http://%s:%s/wm/onos/flowprogrammer/pusher/resume/%s/json\"" % (ControllerIP, ControllerPort, dpid)
     debug("resume %s" % command)
      
     result = os.popen(command).read()
@@ -86,12 +86,12 @@
   
   print "DPID %s is successfully resumed" % dpid
 
-# @app.route("/wm/fprog/pusher/barrier/<dpid>/json")
+# @app.route("/wm/onos/flowprogrammer/pusher/barrier/<dpid>/json")
 # Sample output:
 #  "{"version":1,"type":"BARRIER_REPLY","length":8,"xid":4,"lengthU":8}"
 def barrier(dpid):
   try:
-    command = "curl -s \"http://%s:%s/wm/fprog/pusher/barrier/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+    command = "curl -s \"http://%s:%s/wm/onos/flowprogrammer/pusher/barrier/%s/json\"" % (ControllerIP, ControllerPort, dpid)
     debug("barrier %s" % command)
      
     result = os.popen(command).read()
diff --git a/web/rest-test.sh b/web/rest-test.sh
index 2551f12..c6c870b 100755
--- a/web/rest-test.sh
+++ b/web/rest-test.sh
@@ -2,7 +2,7 @@
 rm -f rest.json
 touch rest.json
 
-urls="http://localhost:8080/wm/core/topology/switches/all/json http://localhost:8080/wm/core/topology/links/json http://localhost:8080/wm/registry/controllers/json http://localhost:8080/wm/registry/switches/json"
+urls="http://localhost:8080/wm/onos/topology/switches/all/json http://localhost:8080/wm/onos/linkdiscovery/links/json http://localhost:8080/wm/onos/registry/controllers/json http://localhost:8080/wm/onos/registry/switches/json"
 
 for url in $urls; do
   echo "---REST CALL---" >> rest.json
diff --git a/web/restapi.py b/web/restapi.py
index a3bd51c..fd99ac6 100755
--- a/web/restapi.py
+++ b/web/restapi.py
@@ -54,21 +54,21 @@
   return response
 
 ## REST API ##
-#@app.route("/wm/topology/links/json")
+#@app.route("/wm/onos/linkdiscovery/links/json")
 #def links():
 #    global links_
 #    js = json.dumps(links_)
 #    resp = Response(js, status=200, mimetype='application/json')
 #    return resp
 
-#@app.route("/wm/core/controller/switches/json")
+#@app.route("/wm/floodlight/core/controller/switches/json")
 #def switches():
 #    global switches_
 #    js = json.dumps(switches_)
 #    resp = Response(js, status=200, mimetype='application/json')
 #    return resp
 
-@app.route("/wm/device/")
+@app.route("/wm/floodlight/device/")
 def devices():
   ret = []
   js = json.dumps(ret)
@@ -76,7 +76,7 @@
   return resp
 
 ## return fake stat for now
-@app.route("/wm/core/switch/<switchId>/<statType>/json")
+@app.route("/wm/floodlight/core/switch/<switchId>/<statType>/json")
 def switch_stat(switchId, statType):
     if statType == "desc":
         desc=[{"length":1056,"serialNumber":"None","manufacturerDescription":"Nicira Networks, Inc.","hardwareDescription":"Open vSwitch","softwareDescription":"1.4.0+build0","datapathDescription":"None"}]
@@ -93,7 +93,7 @@
     resp = Response(js, status=200, mimetype='application/json')
     return resp
 
-@app.route("/wm/core/controller/switches/json")
+@app.route("/wm/floodlight/core/controller/switches/json")
 def query_switch():
   try:
     command = "curl -s http://%s:%s/graphs/%s/vertices" % (RestIP, RestPort, DBName)
@@ -116,7 +116,7 @@
   resp = Response(js, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/topology/links/json")
+@app.route("/wm/onos/linkdiscovery/links/json")
 def query_links():
   try:
     command = "curl -s http://%s:%s/graphs/%s/edges" % (RestIP, RestPort, DBName)
diff --git a/web/restapi2.py b/web/restapi2.py
index c9952ac..050d8a4 100755
--- a/web/restapi2.py
+++ b/web/restapi2.py
@@ -57,7 +57,7 @@
 ONOS_GUI3_HOST="http://gui3.onlab.us:8080"
 ONOS_LOCAL_HOST="http://localhost:8080" ;# for Amazon EC2
 
-@app.route("/wm/core/topology/switches/all/json")
+@app.route("/wm/onos/topology/switches/all/json")
 def switches():
   if request.args.get('proxy') == None:
     host = ONOS_LOCAL_HOST
@@ -65,7 +65,7 @@
     host = ONOS_GUI3_HOST
 
   try:
-    command = "curl -s %s/wm/core/topology/switches/all/json" % (host)
+    command = "curl -s %s/wm/onos/topology/switches/all/json" % (host)
     print command
     result = os.popen(command).read()
   except:
@@ -75,7 +75,7 @@
   resp = Response(result, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/core/topology/links/json")
+@app.route("/wm/onos/topology/links/json")
 def links():
   if request.args.get('proxy') == None:
     host = ONOS_LOCAL_HOST
@@ -83,7 +83,7 @@
     host = ONOS_GUI3_HOST
 
   try:
-    command = "curl -s %s/wm/core/topology/links/json" % (host)
+    command = "curl -s %s/wm/onos/topology/links/json" % (host)
     print command
     result = os.popen(command).read()
   except:
@@ -93,7 +93,7 @@
   resp = Response(result, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/flow/getall/json")
+@app.route("/wm/onos/flows/getall/json")
 def flows():
   if request.args.get('proxy') == None:
     host = ONOS_LOCAL_HOST
@@ -101,7 +101,7 @@
     host = ONOS_GUI3_HOST
 
   try:
-    command = "curl -s %s/wm/flow/getall/json" % (host)
+    command = "curl -s %s/wm/onos/flows/getall/json" % (host)
     print command
     result = os.popen(command).read()
   except:
@@ -111,7 +111,7 @@
   resp = Response(result, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/registry/controllers/json")
+@app.route("/wm/onos/registry/controllers/json")
 def registry_controllers():
   if request.args.get('proxy') == None:
     host = ONOS_LOCAL_HOST
@@ -119,7 +119,7 @@
     host = ONOS_GUI3_HOST
 
   try:
-    command = "curl -s %s/wm/registry/controllers/json" % (host)
+    command = "curl -s %s/wm/onos/registry/controllers/json" % (host)
     print command
     result = os.popen(command).read()
   except:
@@ -129,7 +129,7 @@
   resp = Response(result, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/registry/switches/json")
+@app.route("/wm/onos/registry/switches/json")
 def registry_switches():
   if request.args.get('proxy') == None:
     host = ONOS_LOCAL_HOST
@@ -137,7 +137,7 @@
     host = ONOS_GUI3_HOST
 
   try:
-    command = "curl -s %s/wm/registry/switches/json" % (host)
+    command = "curl -s %s/wm/onos/registry/switches/json" % (host)
     print command
     result = os.popen(command).read()
   except:
@@ -151,21 +151,21 @@
 
 
 ## REST API ##
-#@app.route("/wm/topology/links/json")
+#@app.route("/wm/onos/linkdiscovery/links/json")
 #def links():
 #    global links_
 #    js = json.dumps(links_)
 #    resp = Response(js, status=200, mimetype='application/json')
 #    return resp
 
-#@app.route("/wm/core/controller/switches/json")
+#@app.route("/wm/floodlight/core/controller/switches/json")
 #def switches():
 #    global switches_
 #    js = json.dumps(switches_)
 #    resp = Response(js, status=200, mimetype='application/json')
 #    return resp
 
-@app.route("/wm/device/")
+@app.route("/wm/floodlight/device/")
 def devices():
   try:
     command = "curl -s http://%s:%s/graphs/%s/vertices?key=type\&value=device" % (RestIP, RestPort, DBName)
@@ -218,7 +218,7 @@
 #{"entityClass":"DefaultEntityClass","mac":["7c:d1:c3:e0:8c:a3"],"ipv4":["192.168.2.102","10.1.10.35"],"vlan":[],"attachmentPoint":[{"port":13,"switchDPID":"00:01:00:12:e2:78:32:44","errorStatus":null}],"lastSeen":1357333593496}
 
 ## return fake stat for now
-@app.route("/wm/core/switch/<switchId>/<statType>/json")
+@app.route("/wm/floodlight/core/switch/<switchId>/<statType>/json")
 def switch_stat(switchId, statType):
     if statType == "desc":
         desc=[{"length":1056,"serialNumber":"None","manufacturerDescription":"Nicira Networks, Inc.","hardwareDescription":"Open vSwitch","softwareDescription":"1.4.0+build0","datapathDescription":"None"}]
@@ -235,7 +235,7 @@
     resp = Response(js, status=200, mimetype='application/json')
     return resp
 
-@app.route("/wm/core/controller/switches/json")
+@app.route("/wm/floodlight/core/controller/switches/json")
 def query_switch():
   try:
     command = "curl -s http://%s:%s/graphs/%s/vertices?key=type\&value=switch" % (RestIP, RestPort, DBName)
@@ -258,7 +258,7 @@
   resp = Response(js, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/topology/links/json")
+@app.route("/wm/onos/linkdiscovery/links/json")
 def query_links():
   try:
     command = "curl -s http://%s:%s/graphs/%s/vertices?key=type\&value=port" % (RestIP, RestPort, DBName)
diff --git a/web/restapi3.py b/web/restapi3.py
index 001faa6..f3bb3eb 100755
--- a/web/restapi3.py
+++ b/web/restapi3.py
@@ -137,7 +137,7 @@
 
   return response
 
-@app.route("/wm/device/")
+@app.route("/wm/floodlight/device/")
 def devices():
   try:
     command = "curl -s http://%s:%s/graphs/%s/vertices\?key=type\&value=device" % (RestIP, RestPort, DBName)
@@ -182,7 +182,7 @@
 
 
 ## return fake stat for now
-@app.route("/wm/core/switch/<switchId>/<statType>/json")
+@app.route("/wm/floodlight/core/switch/<switchId>/<statType>/json")
 def switch_stat(switchId, statType):
     if statType == "desc":
         desc=[{"length":1056,"serialNumber":"None","manufacturerDescription":"Nicira Networks, Inc.","hardwareDescription":"Open vSwitch","softwareDescription":"1.4.0+build0","datapathDescription":"None"}]
@@ -199,7 +199,7 @@
     resp = Response(js, status=200, mimetype='application/json')
     return resp
 
-@app.route("/wm/core/controller/switches/json")
+@app.route("/wm/floodlight/core/controller/switches/json")
 def query_switch():
   try:
     command = "curl -s \'http://%s:%s/graphs/%s/vertices?key=type&value=switch\'" % (RestIP, RestPort, DBName)
@@ -226,7 +226,7 @@
   resp = Response(js, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/topology/links/json")
+@app.route("/wm/onos/linkdiscovery/links/json")
 def query_links():
   try:
     command = 'curl -s http://%s:%s/graphs/%s/vertices?key=type\&value=port' % (RestIP, RestPort, DBName)
diff --git a/web/shortest_path.py b/web/shortest_path.py
index 0f23bf4..805224b 100755
--- a/web/shortest_path.py
+++ b/web/shortest_path.py
@@ -13,7 +13,7 @@
 from flask import Flask, json, Response, render_template, make_response, request
 
 #
-# curl http://127.0.0.1:8080/wm/topology/route/00:00:00:00:00:00:0a:01/1/00:00:00:00:00:00:0a:04/1/json
+# curl http://127.0.0.1:8080/wm/onos/topology/route/00:00:00:00:00:00:0a:01/1/00:00:00:00:00:00:0a:04/1/json
 #
 
 ## Global Var ##
@@ -33,14 +33,14 @@
   if DEBUG:
     print '%s' % (txt)
 
-# @app.route("/wm/topology/route/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
+# @app.route("/wm/onos/topology/route/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
 #
 # Sample output:
 # {'dstPort': {'port': {'value': 0}, 'dpid': {'value': '00:00:00:00:00:00:00:02'}}, 'srcPort': {'port': {'value': 0}, 'dpid': {'value': '00:00:00:00:00:00:00:01'}}, 'flowEntries': [{'outPort': {'value': 1}, 'flowEntryErrorState': None, 'flowEntryMatch': None, 'flowEntryActions': None, 'inPort': {'value': 0}, 'flowEntryId': None, 'flowEntryUserState': 'FE_USER_UNKNOWN', 'dpid': {'value': '00:00:00:00:00:00:00:01'}, 'flowEntrySwitchState': 'FE_SWITCH_UNKNOWN'}, {'outPort': {'value': 0}, 'flowEntryErrorState': None, 'flowEntryMatch': None, 'flowEntryActions': None, 'inPort': {'value': 9}, 'flowEntryId': None, 'flowEntryUserState': 'FE_USER_UNKNOWN', 'dpid': {'value': '00:00:00:00:00:00:00:02'}, 'flowEntrySwitchState': 'FE_SWITCH_UNKNOWN'}]}
 #
 def shortest_path(v1, p1, v2, p2):
   try:
-    command = "curl -s http://%s:%s/wm/topology/route/%s/%s/%s/%s/json" % (ControllerIP, ControllerPort, v1, p1, v2, p2)
+    command = "curl -s http://%s:%s/wm/onos/topology/route/%s/%s/%s/%s/json" % (ControllerIP, ControllerPort, v1, p1, v2, p2)
     debug("shortest_path %s" % command)
 
     result = os.popen(command).read()
diff --git a/web/topology_rest.py b/web/topology_rest.py
index b3a415e..38dba5d 100755
--- a/web/topology_rest.py
+++ b/web/topology_rest.py
@@ -273,69 +273,69 @@
   return "http://" + host + ":8080"
 
 ## Switch ##
-@app.route("/wm/core/topology/switches/all/json")
+@app.route("/wm/onos/topology/switches/all/json")
 def switches():
   if request.args.get('proxy') == None:
     host = pick_host()
   else:
     host = ONOS_GUI3_HOST
 
-  url ="%s/wm/core/topology/switches/all/json" % (host)
+  url ="%s/wm/onos/topology/switches/all/json" % (host)
   (code, result) = get_json(url)
 
   resp = Response(result, status=code, mimetype='application/json')
   return resp
 
 ## Link ##
-@app.route("/wm/core/topology/links/json")
+@app.route("/wm/onos/topology/links/json")
 def links():
   if request.args.get('proxy') == None:
     host = pick_host()
   else:
     host = ONOS_GUI3_HOST
 
-  url ="%s/wm/core/topology/links/json" % (host)
+  url ="%s/wm/onos/topology/links/json" % (host)
   (code, result) = get_json(url)
 
   resp = Response(result, status=code, mimetype='application/json')
   return resp
 
 ## FlowSummary ##
-@app.route("/wm/flow/getsummary/<start>/<range>/json")
+@app.route("/wm/onos/flows/getsummary/<start>/<range>/json")
 def flows(start, range):
   if request.args.get('proxy') == None:
     host = pick_host()
   else:
     host = ONOS_GUI3_HOST
 
-  url ="%s/wm/flow/getsummary/%s/%s/json" % (host, start, range)
+  url ="%s/wm/onos/flows/getsummary/%s/%s/json" % (host, start, range)
   (code, result) = get_json(url)
 
   resp = Response(result, status=code, mimetype='application/json')
   return resp
 
-@app.route("/wm/registry/controllers/json")
+@app.route("/wm/onos/registry/controllers/json")
 def registry_controllers():
   if request.args.get('proxy') == None:
     host = pick_host()
   else:
     host = ONOS_GUI3_HOST
 
-  url= "%s/wm/registry/controllers/json" % (host)
+  url= "%s/wm/onos/registry/controllers/json" % (host)
   (code, result) = get_json(url)
 
   resp = Response(result, status=code, mimetype='application/json')
   return resp
 
 
-@app.route("/wm/registry/switches/json")
+@app.route("/wm/onos/registry/switches/json")
 def registry_switches():
   if request.args.get('proxy') == None:
     host = pick_host()
   else:
     host = ONOS_GUI3_HOST
 
-  url="%s/wm/registry/switches/json" % (host)
+  url="%s/wm/onos/registry/switches/json" % (host)
   (code, result) = get_json(url)
 
   resp = Response(result, status=code, mimetype='application/json')
@@ -354,7 +354,7 @@
 @app.route('/topology', methods=['GET'])
 def topology_for_gui():
   try:
-    command = "curl -s \'http://%s:%s/wm/core/topology/switches/all/json\'" % (RestIP, RestPort)
+    command = "curl -s \'http://%s:%s/wm/onos/topology/switches/all/json\'" % (RestIP, RestPort)
     result = os.popen(command).read()
     parsedResult = json.loads(result)
   except:
@@ -382,7 +382,7 @@
       switches.append(sw)
 
   try:
-    command = "curl -s \'http://%s:%s/wm/registry/switches/json\'" % (RestIP, RestPort)
+    command = "curl -s \'http://%s:%s/wm/onos/registry/switches/json\'" % (RestIP, RestPort)
     result = os.popen(command).read()
     parsedResult = json.loads(result)
   except:
@@ -404,7 +404,7 @@
 #    v2 = "00:00:00:00:00:0b:0d:03"
 #    v2 = "00:00:00:00:00:0d:00:d3"
 #    p2=1
-#    command = "curl -s http://%s:%s/wm/topology/route/%s/%s/%s/%s/json" % (RestIP, RestPort, v1, p1, v2, p2)
+#    command = "curl -s http://%s:%s/wm/onos/topology/route/%s/%s/%s/%s/json" % (RestIP, RestPort, v1, p1, v2, p2)
 #    result = os.popen(command).read()
 #    parsedResult = json.loads(result)
 #  except:
@@ -421,7 +421,7 @@
   #      path.append( (sdpid, ddpid))
 
   try:
-    command = "curl -s \'http://%s:%s/wm/core/topology/links/json\'" % (RestIP, RestPort)
+    command = "curl -s \'http://%s:%s/wm/onos/topology/links/json\'" % (RestIP, RestPort)
     result = os.popen(command).read()
     parsedResult = json.loads(result)
   except:
@@ -457,12 +457,12 @@
   resp = Response(js, status=200, mimetype='application/json')
   return resp
 
-#@app.route("/wm/topology/toporoute/00:00:00:00:00:a1/2/00:00:00:00:00:c1/3/json")
-#@app.route("/wm/topology/toporoute/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
-@app.route("/wm/topology/toporoute/<v1>/<p1>/<v2>/<p2>/json")
+#@app.route("/wm/floodlight/topology/toporoute/00:00:00:00:00:a1/2/00:00:00:00:00:c1/3/json")
+#@app.route("/wm/floodlight/topology/toporoute/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
+@app.route("/wm/floodlight/topology/toporoute/<v1>/<p1>/<v2>/<p2>/json")
 def shortest_path(v1, p1, v2, p2):
   try:
-    command = "curl -s \'http://%s:%s/wm/core/topology/switches/all/json\'" % (RestIP, RestPort)
+    command = "curl -s \'http://%s:%s/wm/onos/topology/switches/all/json\'" % (RestIP, RestPort)
     result = os.popen(command).read()
     parsedResult = json.loads(result)
   except:
@@ -494,7 +494,7 @@
       switches.append(sw)
 
   try:
-    command = "curl -s http://%s:%s/wm/topology/route/%s/%s/%s/%s/json" % (RestIP, RestPort, v1, p1, v2, p2)
+    command = "curl -s http://%s:%s/wm/onos/topology/route/%s/%s/%s/%s/json" % (RestIP, RestPort, v1, p1, v2, p2)
     result = os.popen(command).read()
     parsedResult = json.loads(result)
   except:
@@ -510,7 +510,7 @@
       path.append( (sdpid, ddpid))
 
   try:
-    command = "curl -s \'http://%s:%s/wm/core/topology/links/json\'" % (RestIP, RestPort)
+    command = "curl -s \'http://%s:%s/wm/onos/topology/links/json\'" % (RestIP, RestPort)
     result = os.popen(command).read()
     parsedResult = json.loads(result)
   except:
@@ -545,11 +545,11 @@
   resp = Response(js, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/core/controller/switches/json")
+@app.route("/wm/floodlight/core/controller/switches/json")
 def query_switch():
   try:
-    command = "curl -s \'http://%s:%s/wm/core/topology/switches/all/json\'" % (RestIP, RestPort)
-#    http://localhost:8080/wm/core/topology/switches/active/json
+    command = "curl -s \'http://%s:%s/wm/onos/topology/switches/all/json\'" % (RestIP, RestPort)
+#    http://localhost:8080/wm/onos/topology/switches/active/json
     print command
     result = os.popen(command).read()
     parsedResult = json.loads(result)
@@ -577,7 +577,7 @@
   resp = Response(js, status=200, mimetype='application/json')
   return resp
 
-@app.route("/wm/device/")
+@app.route("/wm/floodlight/device/")
 def devices():
   try:
     command = "curl -s http://%s:%s/graphs/%s/vertices\?key=type\&value=device" % (RestIP, RestPort, DBName)
@@ -621,7 +621,7 @@
 #{"entityClass":"DefaultEntityClass","mac":["7c:d1:c3:e0:8c:a3"],"ipv4":["192.168.2.102","10.1.10.35"],"vlan":[],"attachmentPoint":[{"port":13,"switchDPID":"00:01:00:12:e2:78:32:44","errorStatus":null}],"lastSeen":1357333593496}
 
 ## return fake stat for now
-@app.route("/wm/core/switch/<switchId>/<statType>/json")
+@app.route("/wm/floodlight/core/switch/<switchId>/<statType>/json")
 def switch_stat(switchId, statType):
     if statType == "desc":
         desc=[{"length":1056,"serialNumber":"None","manufacturerDescription":"Nicira Networks, Inc.","hardwareDescription":"Open vSwitch","softwareDescription":"1.4.0+build0","datapathDescription":"None"}]
@@ -639,7 +639,7 @@
     return resp
 
 
-@app.route("/wm/topology/links/json")
+@app.route("/wm/onos/linkdiscovery/links/json")
 def query_links():
   try:
     command = 'curl -s http://%s:%s/graphs/%s/vertices?key=type\&value=port' % (RestIP, RestPort, DBName)
@@ -955,7 +955,7 @@
 @app.route("/gui/addflow/<src_dpid>/<src_port>/<dst_dpid>/<dst_port>/<srcMAC>/<dstMAC>")
 def add_flow(src_dpid, src_port, dst_dpid, dst_port, srcMAC, dstMAC):
   host = pick_host()
-  url ="%s/wm/flow/getsummary/%s/%s/json" % (host, 0, 0)
+  url ="%s/wm/onos/flows/getsummary/%s/%s/json" % (host, 0, 0)
   (code, result) = get_json(url)
   parsedResult = json.loads(result)
   if len(parsedResult) > 0:
@@ -990,7 +990,7 @@
 @app.route("/gui/iperf/start/<flow_id>/<duration>/<samples>")
 def iperf_start(flow_id,duration,samples):
   try:
-    command = "curl -s \'http://%s:%s/wm/flow/get/%s/json\'" % (RestIP, RestPort, flow_id)
+    command = "curl -s \'http://%s:%s/wm/onos/flows/get/%s/json\'" % (RestIP, RestPort, flow_id)
     print command
     result = os.popen(command).read()
     if len(result) == 0:
@@ -1055,7 +1055,7 @@
 @app.route("/gui/iperf/rate/<flow_id>")
 def iperf_rate(flow_id):
   try:
-    command = "curl -s \'http://%s:%s/wm/flow/get/%s/json\'" % (RestIP, RestPort, flow_id)
+    command = "curl -s \'http://%s:%s/wm/onos/flows/get/%s/json\'" % (RestIP, RestPort, flow_id)
     print command
     result = os.popen(command).read()
     if len(result) == 0: