new scripts written
[vsorcdistro/.git] / scripts / removeflows.sh
diff --git a/scripts/removeflows.sh b/scripts/removeflows.sh
new file mode 100755 (executable)
index 0000000..e3d1bd9
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash
+: '
+Written by: Felix G. Tejada
+
+This script is applied to a linear 3 topo, just for show the example
+'
+echo "Cleaning all flows entry switch dpid 1 and 2"
+curl -X DELETE http://localhost:8080/stats/flowentry/clear/1
+curl -X DELETE http://localhost:8080/stats/flowentry/clear/2
+curl -X DELETE http://localhost:8080/stats/flowentry/clear/3
+echo "adding default flows entry to all switches"
+
+curl -X POST -d '{
+    "dpid": 1,
+    "cookie": 0,
+    "cookie_mask": 0,
+    "table_id": 0,
+    "idle_timeout": 0,
+    "hard_timeout": 0,
+    "priority": 0,
+    "flags": 0,
+    "match":{},
+    "actions":[
+        {
+            "type":"OUTPUT",
+            "port": "CONTROLLER"
+        }
+    ]
+ }' http://localhost:8080/stats/flowentry/add
+
+
+curl -X POST -d '{
+    "dpid": 2,
+    "cookie": 0,
+    "cookie_mask": 0,
+    "table_id": 0,
+    "idle_timeout": 0,
+    "hard_timeout": 0,
+    "priority": 0,
+    "flags": 0,
+    "match":{},
+    "actions":[
+        {
+            "type":"OUTPUT",
+            "port": "CONTROLLER"
+        }
+    ]
+ }' http://localhost:8080/stats/flowentry/add
+
+curl -X POST -d '{
+    "dpid": 3,
+    "cookie": 0,
+    "cookie_mask": 0,
+    "table_id": 0,
+    "idle_timeout": 0,
+    "hard_timeout": 0,
+    "priority": 0,
+    "flags": 0,
+    "match":{},
+    "actions":[
+        {
+            "type":"OUTPUT",
+            "port": "CONTROLLER"
+        }
+    ]
+ }' http://localhost:8080/stats/flowentry/add
+