new scripts written
[vsorcdistro/.git] / scripts / resetflows.sh
1 #!/bin/bash
2 : '
3 Written by: Felix G. Tejada
4
5 This script is applied to a linear 3 topo, just for show the example
6 '
7 dpid=$1
8 echo "Cleaning all flows entrys"
9 curl -X DELETE http://localhost:8080/stats/flowentry/clear/$dpid
10 echo "adding default flows entry to all switches"
11 sleep 1
12 curl -X POST -d '{
13     "dpid": "'"$dpid"'",
14     "cookie": 0,
15     "cookie_mask": 0,
16     "table_id": 0,
17     "idle_timeout": 0,
18     "hard_timeout": 0,
19     "priority": 0,
20     "flags": 0,
21     "match":{},
22     "actions":[
23         {
24             "type":"OUTPUT",
25             "port": "CONTROLLER"
26         }
27     ]
28  }' http://localhost:8080/stats/flowentry/add
29 echo "Done"