Activate Geo Mode

Scenario Overview

Once the geo cluster deployment is complete, they must be logically tied together to form a geo redundant cluster setup. The geo activation must be performed on all three clusters of geo setup. The client provides the geo inventory payload in the below listed JSON file. The complete request could fail or succeed, but no partial settings are accepted.

Prerequisites

Before running this example, ensure to obtain access token. Refer 'Getting Started' section.

Activate Geo Mode

Run the script activate_geo_mode.sh from the example directory.

cd cnc-geo-redundancy-api-examples;./activate_geo_mode.sh

Script Details

#!/bin/bash
. ./cnc-api-common.sh

activate_geo_mode() {
    # 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 activate geo mode API
    # STEP 3 :  store the output in CNC_API_OUTPUT file

    CNC_GEO_REDUNDANCY_API=$CNC_GEO_REDUNDANCY_API_CTX/geomode/activate
    CNC_API_INPUT="@$PRJ/input/activate_geo_mode.json"
    CNC_API_OUTPUT="$PRJ/output/activate_geo_mode.json"
    http_post $CNC_GEO_REDUNDANCY_API $CNC_API_INPUT $CNC_API_OUTPUT

}
activate_geo_mode