Chetan Gaonker | eb2b24b | 2016-03-01 14:04:45 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | json="$1" |
| 3 | controller="$2" |
| 4 | if [ x"$json" = "x" ]; then |
| 5 | echo "No json file specified. Exiting" |
| 6 | exit 127 |
| 7 | fi |
| 8 | if [ x"$controller" = "x" ]; then |
| 9 | controller=`ovs-vsctl show | egrep "Controller|tcp" | grep -v ptcp | sed 's,Controller,,g' | sed 's,\",,g' | tr -s ' '|awk -F":" '{print $2}'` |
| 10 | #echo "Controller at $controller" |
| 11 | fi |
| 12 | #echo "Loading ssm translate json file $json to controller at $controller" |
| 13 | curl --fail -sSL --user karaf:karaf \ |
| 14 | -X POST -H 'Content-Type:application/json' \ |
| 15 | http://$controller:8181/onos/v1/network/configuration/ -d@$json |
| 16 | |
| 17 | |