David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #D provides access to the CORD POD fabric configuration generation |
| 3 | |
| 4 | PROG=$(echo $(basename $0) | sed -e 's/^cord-/cord /g') |
| 5 | |
| 6 | usage() { |
| 7 | echo "usage: $PROG [options]" |
| 8 | echo " -hc|--host-count number of hosts to expect to find in ONOS" |
| 9 | echo " -sc|--switch-count number of switches to expect to find in ONOS" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 10 | echo " -h|--help this message" |
| 11 | } |
| 12 | |
| 13 | HOST_COUNT=0 |
| 14 | SWITCH_COUNT=0 |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 15 | |
| 16 | while [ $# -gt 0 ]; do |
| 17 | case $1 in |
| 18 | -hc|--host-count) |
| 19 | shift |
| 20 | HOST_COUNT=$1 |
| 21 | ;; |
| 22 | -sc|--switch-count) |
| 23 | shift |
| 24 | SWITCH_COUNT=$1 |
| 25 | ;; |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 26 | -h|--help) |
| 27 | usage |
| 28 | exit 0 |
| 29 | ;; |
| 30 | esac |
| 31 | shift |
| 32 | done |
| 33 | |
David K. Bainbridge | 5b4041e | 2016-11-09 17:29:00 -0800 | [diff] [blame^] | 34 | exec curl --fail -sSL -XPOST http://$CORD_HEAD_NODE:4245/config/ -d "{\"hostcount\":$HOST_COUNT,\"switchcount\":$SWITCH_COUNT}" |