Separated ONOS specific REST API modules from floodlight.
Renamed floodlight REST API paths.
diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
index 39bdf3c..d5074f3 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.OnosCoreWebRoutable;
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 OnosCoreWebRoutable());
}
@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..e55c6cf 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 "/fl/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..b77bd2b 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 "/fl/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..b3e4a0b 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 "/fl/topology";
}
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/Main.java b/src/main/java/net/onrc/onos/ofcontroller/core/Main.java
index a80ac36..30544f7 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/Main.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/Main.java
@@ -9,6 +9,7 @@
import net.floodlightcontroller.core.module.FloodlightModuleLoader;
import net.floodlightcontroller.core.module.IFloodlightModuleContext;
import net.floodlightcontroller.restserver.IRestApiService;
+import net.onrc.onos.ofcontroller.core.web.OnosCoreWebRoutable;
/**
* Host for the ONOS main method
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/web/OnosCoreWebRoutable.java b/src/main/java/net/onrc/onos/ofcontroller/core/web/OnosCoreWebRoutable.java
new file mode 100644
index 0000000..35fa3ea
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/web/OnosCoreWebRoutable.java
@@ -0,0 +1,26 @@
+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;
+import net.onrc.onos.ofcontroller.devicemanager.web.TopoDevicesResource;
+
+public class OnosCoreWebRoutable implements RestletRoutable {
+ @Override
+ public String basePath() {
+ return "/wm/core";
+ }
+
+ @Override
+ public Restlet getRestlet(Context context) {
+ Router router = new Router(context);
+ // 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/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..75ad931
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/web/OnosTopologyWebRoutable.java
@@ -0,0 +1,25 @@
+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.ofcontroller.linkdiscovery.web.LinksResource;
+
+public class OnosTopologyWebRoutable implements RestletRoutable {
+
+ @Override
+ public Restlet getRestlet(Context context) {
+ Router router = new Router(context);
+ router.attach("/links/json", LinksResource.class);
+ router.attach("/route/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", RouteResource.class);
+ return router;
+ }
+
+ @Override
+ public String basePath() {
+ return "/wm/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 91%
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..ce1b48f 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;
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/js/models/hostmodel.js b/web/js/models/hostmodel.js
index 8de3dd6..370ef02 100644
--- a/web/js/models/hostmodel.js
+++ b/web/js/models/hostmodel.js
@@ -35,7 +35,7 @@
var self = this;
//console.log("fetching host list")
$.ajax({
- url:hackBase + "/wm/device/",
+ url:hackBase + "/fl/device/",
dataType:"json",
success:function (data) {
//console.log("fetched host list: " + data.length);
diff --git a/web/js/models/statusmodel.js b/web/js/models/statusmodel.js
index b7cdebd..2dbb143 100644
--- a/web/js/models/statusmodel.js
+++ b/web/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 + "/fl/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 + "/fl/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 + "/fl/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 + "/fl/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/js/models/switchmodel.js
index 4104dd0..79f2016 100644
--- a/web/js/models/switchmodel.js
+++ b/web/js/models/switchmodel.js
@@ -16,7 +16,7 @@
window.Switch = Backbone.Model.extend({
- urlRoot:"/wm/core/switch/",
+ urlRoot:"/fl/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 + "/fl/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 + "/fl/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 + "/fl/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 + "/fl/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 + "/fl/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 + "/fl/core/controller/switches/json",
dataType:"json",
success:function (data) {
//console.log("fetched switch list: " + data.length);
diff --git a/web/onos-topology-route.html b/web/onos-topology-route.html
index 6c167c7..5f19144 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/fl/topology/toporoute/00:00:00:0d:00:d1/2/00:00:00:0d:00:d3/3/json");
</script>
</svg>
</body>
diff --git a/web/restapi.py b/web/restapi.py
index a3bd51c..028d11e 100755
--- a/web/restapi.py
+++ b/web/restapi.py
@@ -61,14 +61,14 @@
# resp = Response(js, status=200, mimetype='application/json')
# return resp
-#@app.route("/wm/core/controller/switches/json")
+#@app.route("/fl/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("/fl/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("/fl/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("/fl/core/controller/switches/json")
def query_switch():
try:
command = "curl -s http://%s:%s/graphs/%s/vertices" % (RestIP, RestPort, DBName)
diff --git a/web/restapi2.py b/web/restapi2.py
index c9952ac..b341033 100755
--- a/web/restapi2.py
+++ b/web/restapi2.py
@@ -158,14 +158,14 @@
# resp = Response(js, status=200, mimetype='application/json')
# return resp
-#@app.route("/wm/core/controller/switches/json")
+#@app.route("/fl/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("/fl/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("/fl/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("/fl/core/controller/switches/json")
def query_switch():
try:
command = "curl -s http://%s:%s/graphs/%s/vertices?key=type\&value=switch" % (RestIP, RestPort, DBName)
diff --git a/web/restapi3.py b/web/restapi3.py
index 001faa6..79eb189 100755
--- a/web/restapi3.py
+++ b/web/restapi3.py
@@ -137,7 +137,7 @@
return response
-@app.route("/wm/device/")
+@app.route("/fl/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("/fl/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("/fl/core/controller/switches/json")
def query_switch():
try:
command = "curl -s \'http://%s:%s/graphs/%s/vertices?key=type&value=switch\'" % (RestIP, RestPort, DBName)
diff --git a/web/topology_rest.py b/web/topology_rest.py
index b3a415e..0e54347 100755
--- a/web/topology_rest.py
+++ b/web/topology_rest.py
@@ -457,9 +457,9 @@
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("/fl/topology/toporoute/00:00:00:00:00:a1/2/00:00:00:00:00:c1/3/json")
+#@app.route("/fl/topology/toporoute/<srcdpid>/<srcport>/<destdpid>/<destport>/json")
+@app.route("/fl/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)
@@ -545,7 +545,7 @@
resp = Response(js, status=200, mimetype='application/json')
return resp
-@app.route("/wm/core/controller/switches/json")
+@app.route("/fl/core/controller/switches/json")
def query_switch():
try:
command = "curl -s \'http://%s:%s/wm/core/topology/switches/all/json\'" % (RestIP, RestPort)
@@ -577,7 +577,7 @@
resp = Response(js, status=200, mimetype='application/json')
return resp
-@app.route("/wm/device/")
+@app.route("/fl/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("/fl/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"}]