Files
nokia-hpux-oracle/list_mv.sh
2025-10-24 12:39:08 -04:00

36 lines
773 B
Bash
Executable File

#!/bin/bash
#
# List MVs using API call to RSC, for diagnostic purposes
# Written for HCL / Nokia
# v1.1 - James Pattinson - October 2025
#
# usage: list_mv.sh
get_script_dir() {
# Portable way to get script directory for Linux and HP/UX
local src="$0"
while [ -h "$src" ]; do
dir="$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)"
src="$(readlink "$src")"
[[ $src != /* ]] && src="$dir/$src"
done
cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd
}
MYDIR="$(get_script_dir)"
source $MYDIR/rbk_api.conf
source $MYDIR/oracle_funcs.sh
# Script starts here
echo Service account in use is $ID
echo "Managed Volumes"
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume"
rest_api_get
grep -o '"name":"[^"]*"' /tmp/rbkresponse.$$ | cut -d'"' -f4
cleanup