HP VAN SDN Controller Administrator Guide

86
D Scripts
Configuring a Controller Team
This script configures a team composed of three controllers.
Note
Because the scripts in this appendix cross page boundaries, be careful to avoid including
the page number when copying a script. Copying a script one page at a time can prevent
inclusion of page numbers.
========== ===== ===================================================
#!/bin/bash
#-------------------------------------------------------------------------------
# Copyright 2013 Hewlett Packard Co., All Rights Reserved.
#-------------------------------------------------------------------------------
#
# Script to configuring a team (ie, create a team).
#
#
#
#-------------------------------------------------------------------------------
tok="/tmp/tok.txt"
token="$([ -f $tok ] && cat $tok)"
#echo $token
url="https://127.0.0.1:8443/sdn/v2.0/team"
#echo $url
createTeam="{
\"team\": {
\"name\": \"TestCluster\",
\"ip\": \"10.143.0.100\",
\"systems\":[
{
\"name\": \"member1\",
\"ip\": \"10.143.0.10\",
\"priority\": 10
},
{
\"name\": \"member2\",
\"ip\": \"10.143.0.11\",
\"priority\": 20
},
{
\"name\": \"member3\",
\"ip\": \"10.143.0.12\",
\"priority\": 30
}
]
}
}"
#echo $createTeam
# Attempt to create team
postResp=`curl --noproxy ${SCA:-localhost} --header "X-Auth-Token:$token" \