blob: 15a19ce34f4e0b67144fa48480cca0e141d3f5a7 [file] [log] [blame]
Ray Milkeya481a112016-07-11 16:38:47 -07001# /bin/sh
2
3if [ "$#" -ne 6 ]
4then
5 echo usage: create-forward-objective.sh onos device src-mac dst-mac src-port dst-port
6 exit 1
7fi
8
9
10onos=$1
11device=$2
12srcMac=$3
13dstMac=$4
14srcPort=$5
15dstPort=$6
16
17curl -u onos:rocks -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{
18 \"priority\": 100,
19 \"isPermanent\": \"false\",
20 \"timeout\": 100,
21 \"flag\": \"VERSATILE\",
22 \"operation\": \"REMOVE\",
23 \"selector\": {
24 \"criteria\": [
25 {\"type\": \"ETH_TYPE\", \"ethType\": 2048},
26 {\"type\": \"IN_PORT\", \"port\": \"$srcPort\"},
27 {\"type\": \"ETH_DST\", \"mac\": \"$dstMac\"},
28 {\"type\": \"ETH_SRC\", \"mac\": \"$srcMac\"}
29 ]
30 },
31 \"treatment\":
32 {
33 \"instructions\":
34 [
35 {\"type\":\"OUTPUT\",\"port\":$dstPort}
36 ],
37 \"deferred\":[]
38 }
39}" http://${onos}:8181/onos/v1/flowobjectives/$device/forward
40
41echo