blob: 1ac130c03fc4b3e07a60f2a85f3e7b5b3e3468b2 [file] [log] [blame]
David K. Bainbridge7ae4f192016-09-29 09:01:38 -07001#!/bin/bash
2#D provides access to the CORD POD fabric configuration generation
3
4PROG=$(echo $(basename $0) | sed -e 's/^cord-/cord /g')
5
6usage() {
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. Bainbridge7ae4f192016-09-29 09:01:38 -070010 echo " -h|--help this message"
11}
12
13HOST_COUNT=0
14SWITCH_COUNT=0
David K. Bainbridge7ae4f192016-09-29 09:01:38 -070015
16while [ $# -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. Bainbridge7ae4f192016-09-29 09:01:38 -070026 -h|--help)
27 usage
28 exit 0
29 ;;
30 esac
31 shift
32done
33
David K. Bainbridge5b4041e2016-11-09 17:29:00 -080034exec curl --fail -sSL -XPOST http://$CORD_HEAD_NODE:4245/config/ -d "{\"hostcount\":$HOST_COUNT,\"switchcount\":$SWITCH_COUNT}"