blob: f1d3429370ac0afc54a14d29f28ebe109e621845 [file] [log] [blame]
Thomas Vachuskade563cf2015-04-01 00:28:50 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Forms ONOS cluster using REST API.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
Thomas Vachuska132001a2015-06-09 02:50:33 -07009node=${1:-$OCI}
Thomas Vachuskade563cf2015-04-01 00:28:50 -070010
Thomas Vachuska132001a2015-06-09 02:50:33 -070011if [ $node = "cell" ]; then
12 nodes=$(env | grep "OC[0-9]*=" | cut -d= -f2)
13 node=${OCI}
Thomas Vachuskade563cf2015-04-01 00:28:50 -070014else
Thomas Vachuska132001a2015-06-09 02:50:33 -070015 nodes="$@"
Thomas Vachuskade563cf2015-04-01 00:28:50 -070016fi
17
Thomas Vachuska132001a2015-06-09 02:50:33 -070018set -x
Thomas Vachuskade563cf2015-04-01 00:28:50 -070019
Thomas Vachuska132001a2015-06-09 02:50:33 -070020ssh $ONOS_USER@$node /tmp/$ONOS_BITS/bin/onos-form-cluster $nodes