3 # Copyright © 2018 Amdocs
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 if ! [ "$(command -v jq)" ]; then
18 echo "Error: jq is not installed."
19 echo "use: sudo apt install jq"
24 IS_PRIMARY_CLUSTER=$( $dir/sdnc.isPrimaryCluster )
26 case $IS_PRIMARY_CLUSTER in
34 echo "Error: isPrimaryCluster not defined in $dir/../../../values.yaml."
42 for pod_number in {0..2}
45 response=`curl -s -u $USERNAME:$PASSWORD -H "Content-Type: application/json" -H "Accept: application/json" -X GET http://localhost:3026$((${pod_number} + 1))/jolokia/read/org.opendaylight.controller:Category=Shards,name=member-$((${MEMBER_NUMBER} + ${pod_number}))-shard-default-config,type=DistributedConfigDatastore`
51 status=$( echo -E "$response" | jq -r ".status" )
52 if [ "$status" != "200" ]; then
56 voting=$( echo -E "$response" | jq -r ".value.Voting" )
67 echo "Error: Voting status could not be determined."
73 echo "Error: Voting status could not be determined."