diff options
author | Neha Jain <neha.jain3@amdocs.com> | 2018-04-05 11:51:29 -0400 |
---|---|---|
committer | Neha Jain <neha.jain3@amdocs.com> | 2018-04-05 11:51:35 -0400 |
commit | de45c68c288c44af517d4a403b8a154a715df555 (patch) | |
tree | 7b6c2662d129094f4b01cf4293753893c8f8f3b6 /kubernetes/sdnc/resources/geo/bin/switchVoting.sh | |
parent | 283a3d9cbb7e9d18294bfaa6f67f980880e57d4a (diff) |
Multi-site High-availability Manual Failover (PoC)
Change-Id: I0d5644790441099434322d486f4ba014fd8bc1f7
Signed-off-by: Neha Jain <neha.jain3@amdocs.com>
Issue-ID: SDNC-214
Diffstat (limited to 'kubernetes/sdnc/resources/geo/bin/switchVoting.sh')
-rwxr-xr-x | kubernetes/sdnc/resources/geo/bin/switchVoting.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kubernetes/sdnc/resources/geo/bin/switchVoting.sh b/kubernetes/sdnc/resources/geo/bin/switchVoting.sh new file mode 100755 index 0000000000..05d1e0fd68 --- /dev/null +++ b/kubernetes/sdnc/resources/geo/bin/switchVoting.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +function usage() +{ + echo usage: switchVoting.sh primary\|secondary + exit 1 +} + +if [ $# -ne 1 ]; then + usage +fi + +partition=$1 + +if [ "$partition" == "primary" ]; then + curl -u admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:30202/restconf/operations/cluster-admin:change-member-voting-states-for-all-shards -d '{ "input" : { "member-voting-state" : [ { "member-name" : "member-1", "voting":true}, { "member-name" : "member-2", "voting":true}, { "member-name" : "member-3", "voting":true},{ "member-name" : "member-4", "voting":false},{ "member-name" : "member-5", "voting":false},{ "member-name" : "member-6", "voting":false}] } }' > switch_voting_resp.json 2>/dev/null + echo "" >> switch_voting_resp.json + exit 0 +fi + +if [ "$partition" == "secondary" ]; then + curl -u admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:30202/restconf/operations/cluster-admin:change-member-voting-states-for-all-shards -d '{ "input" : { "member-voting-state" : [ { "member-name" : "member-1", "voting":false}, { "member-name" : "member-2", "voting":false}, { "member-name" : "member-3", "voting":false},{ "member-name" : "member-4", "voting":true},{ "member-name" : "member-5", "voting":true},{ "member-name" : "member-6", "voting":true}] } }' > switch_voting_resp.json 2>/dev/null + echo "" >> switch_voting_resp.json + exit 0 +fi + +usage |