4 # Copyright © 2018 Amdocs
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
19 if ! [ "$(command -v jq)" ]; then
20 echo "Error: jq is not installed."
21 echo "use: sudo apt install jq"
26 IS_PRIMARY_CLUSTER=$( $dir/sdnc.isPrimaryCluster )
28 case $IS_PRIMARY_CLUSTER in
36 echo "Error: isPrimaryCluster not defined in $dir/../../../values.yaml."
44 for pod_number in {0..2}
47 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`
53 status=$( echo -E "$response" | jq -r ".status" )
54 if [ "$status" != "200" ]; then
58 voting=$( echo -E "$response" | jq -r ".value.Voting" )
69 echo "Error: Voting status could not be determined."
75 echo "Error: Voting status could not be determined."