Adding original DM files

This commit is contained in:
2025-10-03 10:15:23 -04:00
parent 1508078efb
commit bc30f7b788
31 changed files with 2818 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
#!/bin/bash
#
# Example API call script for Die Mobiliar
# v0.2 - James Pattinson - August 2021
#
# Set the backup settings for a given Oracle DB
#
# usage: oracle_set_config.sh <HOSTNAME> <CDBNAME> <log freq (mins)> <log retn (hours)> <host retn (hours)> <channels>
#
# Log backup of 0 disables log backup
# host retention of -1 disables host log retention
MYDIR="$(dirname "$(realpath "$0")")"
# source $MYDIR/rbk_api.conf
source $MYDIR/oracle_funcs.sh
usage() { echo "Usage: $0 [-h <dbhost>] <SID> <channels>" 1>&2; exit 1; }
dg=0
while getopts "h:" o; do
case "${o}" in
h)
RBK_HOST=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
RBK_SID=$1
if [ -z "${RBK_SID}" ]; then
usage
fi
channels=$2
echo Connecting to Rubrik with IP $RUBRIK_IP
# API call to get DB details
find_database
# API call to set configuration
if [ "$dg_type" == "DataGuardMember" ]; then
ENDPOINT="https://$RUBRIK_IP/api/v1/oracle/data_guard_group/$db_id"
else
ENDPOINT="https://$RUBRIK_IP/api/v1/oracle/db/$db_id"
fi
PAYLOAD={\"numChannels\":$channels}
rest_api_patch
echo New configuration for $RBK_SID on $RBK_HOST is set
cleanup