Add support for deleting or clearing all flows:
web/delete_flow.py all
web/clear_flow.py all
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java
index f418c1e..ed6f0f7 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/DeleteFlowResource.java
@@ -27,11 +27,16 @@
// Extract the arguments
String flowIdStr = (String) getRequestAttributes().get("flow-id");
- FlowId flowId = new FlowId(flowIdStr);
- log.debug("Delete Flow Id: " + flowIdStr);
// Process the request
- result = flowService.deleteFlow(flowId);
+ if (flowIdStr.equals("all")) {
+ log.debug("Delete All Flows");
+ result = flowService.deleteAllFlows();
+ } else {
+ FlowId flowId = new FlowId(flowIdStr);
+ log.debug("Delete Flow Id: " + flowIdStr);
+ result = flowService.deleteFlow(flowId);
+ }
return result;
}
}