Changed REST API routes of FlowPusher.
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 21e5bfb..00d7fc9 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
@@ -11,10 +11,10 @@
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
- router.attach("/setrate/{dpid}/{rate}/json", SetPushRateResource.class);
- router.attach("/suspend/{dpid}/json", SuspendPusherResource.class);
- router.attach("/resume/{dpid}/json", ResumePusherResource.class);
- router.attach("/barrier/{dpid}/json", SendBarrierResource.class);
+ router.attach("/pusher/setrate/{dpid}/{rate}/json", SetPushRateResource.class);
+ router.attach("/pusher/suspend/{dpid}/json", SuspendPusherResource.class);
+ router.attach("/pusher/resume/{dpid}/json", ResumePusherResource.class);
+ router.attach("/pusher/barrier/{dpid}/json", SendBarrierResource.class);
return router;
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/ResumePusherResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/ResumePusherResource.java
index ca1ec00..dcbe3e9 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/ResumePusherResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/ResumePusherResource.java
@@ -8,7 +8,7 @@
/**
* FlowProgrammer REST API implementation: Resume sending message to switch.
*
- * GET /wm/fprog/resume/{dpid}/json"
+ * GET /wm/fprog/pusher/resume/{dpid}/json"
*/
public class ResumePusherResource extends PusherResource {
/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SendBarrierResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SendBarrierResource.java
index 9c348ff..33b666a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SendBarrierResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SendBarrierResource.java
@@ -9,7 +9,7 @@
/**
* FlowProgrammer REST API implementation: Send barrier message to switch.
*
- * GET /wm/fprog/barrier/{dpid}/json"
+ * GET /wm/fprog/pusher/barrier/{dpid}/json"
*/
public class SendBarrierResource extends PusherResource {
/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SetPushRateResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SetPushRateResource.java
index 08a728e..9431d65 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SetPushRateResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SetPushRateResource.java
@@ -8,7 +8,7 @@
/**
* FlowProgrammer REST API implementation: Set sending rate to the switch.
*
- * GET /wm/fprog/setrate/{dpid}/{rate}/json"
+ * GET /wm/fprog/pusher/setrate/{dpid}/{rate}/json"
*/
public class SetPushRateResource extends PusherResource {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SuspendPusherResource.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SuspendPusherResource.java
index 39d245b..1a5266b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SuspendPusherResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/web/SuspendPusherResource.java
@@ -10,7 +10,7 @@
/**
* FlowProgrammer REST API implementation: Suspend sending message to switch.
*
- * GET /wm/fprog/suspend/{dpid}/json"
+ * GET /wm/fprog/pusher/suspend/{dpid}/json"
*/
public class SuspendPusherResource extends PusherResource {
diff --git a/web/pusher.py b/web/pusher.py
index f53e3ea..2a3528b 100755
--- a/web/pusher.py
+++ b/web/pusher.py
@@ -29,14 +29,12 @@
if DEBUG:
print '%s' % (txt)
-# @app.route("/wm/fprog/setrate/<dpid>/<rate>/json")
+# @app.route("/wm/fprog/pusher/setrate/<dpid>/<rate>/json")
# Sample output:
# "true"
-
-
def set_rate(dpid,rate):
try:
- command = "curl -s \"http://%s:%s/wm/fprog/setrate/%s/%s/json\"" % (ControllerIP, ControllerPort, dpid, rate)
+ command = "curl -s \"http://%s:%s/wm/fprog/pusher/setrate/%s/%s/json\"" % (ControllerIP, ControllerPort, dpid, rate)
debug("set_rate %s" % command)
result = os.popen(command).read()
@@ -50,9 +48,12 @@
print "Sending rate to %s is successfully set to %s" % (dpid, rate)
+# @app.route("/wm/fprog/pusher/suspend/<dpid>/json")
+# Sample output:
+# "true"
def suspend(dpid):
try:
- command = "curl -s \"http://%s:%s/wm/fprog/suspend/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+ command = "curl -s \"http://%s:%s/wm/fprog/pusher/suspend/%s/json\"" % (ControllerIP, ControllerPort, dpid)
debug("suspend %s" % command)
result = os.popen(command).read()
@@ -66,9 +67,12 @@
print "DPID %s is successfully suspended" % dpid
+# @app.route("/wm/fprog/pusher/resume/<dpid>/json")
+# Sample output:
+# "true"
def resume(dpid):
try:
- command = "curl -s \"http://%s:%s/wm/fprog/resume/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+ command = "curl -s \"http://%s:%s/wm/fprog/pusher/resume/%s/json\"" % (ControllerIP, ControllerPort, dpid)
debug("resume %s" % command)
result = os.popen(command).read()
@@ -82,9 +86,12 @@
print "DPID %s is successfully resumed" % dpid
+# @app.route("/wm/fprog/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/barrier/%s/json\"" % (ControllerIP, ControllerPort, dpid)
+ command = "curl -s \"http://%s:%s/wm/fprog/pusher/barrier/%s/json\"" % (ControllerIP, ControllerPort, dpid)
debug("barrier %s" % command)
result = os.popen(command).read()