Get Geo Mode Status
Scenario Overview
Once Geo mode has been enabled, the user may want to fetch the currently active geo status of the cluster. This API returns the geo mode status of the cluster. In such cases the client provides the request payload listed JSON file. The complete request could fail or succeed.
Prerequisites
Before running this example, ensure to obtain access token. Refer 'Getting Started' section.
Get Geo ModeStatus
Run the script get_geo_mode_status.sh from the example directory.
cd cnc-geo-redundancy-api-examples;./get_geo_mode_status.sh
Script Details
#!/bin/bash
. ./cnc-api-common.sh
get_geo_mode_status() {
# assume cnc jwt is obtained prior to invoking this method by executing get-cnc-jwt.sh script
# read from jwt file and export it as AUTH_TOKEN_HDR
export_jwt
# STEP 1 : User to update input json with details of job to be created in the file CNC_API_INPUT
# STEP 2 : trigger get_geo_mode_status API
# STEP 3 : store the output in CNC_API_OUTPUT file
CNC_GEO_REDUNDANCY_API=$CNC_GEO_REDUNDANCY_API_CTX/geomodestatus/query
CNC_API_INPUT="@$PRJ/input/get_geo_mode_status.json"
CNC_API_OUTPUT="$PRJ/output/get_geo_mode_status.json"
http_post $CNC_GEO_REDUNDANCY_API $CNC_API_INPUT $CNC_API_OUTPUT
}
get_geo_mode_status