HP VAN SDN Controller Administrator Guide

87
--fail -ksSfL --request POST --url "$url" \
-H "Content-Type: application/json" --data-binary "$createTeam" `
errorCode=$?
echo $errorCode
echo $postResp
echo "exiting script"
exit 0
Triggering the Controller Team Election Process
After all team members have been configured, run this script on the controller selected to be the
team manager.
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 trigger the team leader election process
#
#
#
#-------------------------------------------------------------------------------
tok="/tmp/tok.txt"
token="$([ -f $tok ] && cat $tok)"
#echo $token
url="https://127.0.0.1:8443/sdn/v2.0/team/action"
#echo $url
# Attempt to create team
postResp=`curl --noproxy <controller_ip> --header "X-Auth-Token:$token" \
--fail -ksSfL --request POST --url "$url" --data-binary "election"`
errorCode=$?
echo $errorCode
echo $postResp
echo "exiting script"
exit 0