#!/usr/bin/ksh # # List MVs using API call to RSC, for diagnostic purposes # Written for HCL / Nokia # v1.1 - James Pattinson - October 2025 # # usage: list_mv.ksh get_script_dir() { src="$0" dir=$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd) echo "$dir" } MYDIR=$(get_script_dir) . $MYDIR/rubrik.conf . $MYDIR/oracle_funcs.ksh # Script starts here echo "Service account in use is $ID" echo "Managed Volumes visible to this account:" ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume" rest_api_get awk ' { line = $0 pos = 1 while (match(substr(line, pos), /"name":"[^"]*"/)) { start = pos + RSTART + 7 len = RLENGTH - 9 name = substr(line, start, len) pos += RSTART + RLENGTH - 1 if (match(substr(line, pos), /"isWritable":[ ]*(true|false)/)) { start_w = pos + RSTART + 12 len_w = RLENGTH - 13 writable = substr(line, start_w, len_w) print name ": isWritable=" writable pos += RSTART + RLENGTH - 1 } } } ' /tmp/rbkresponse.$$ cleanup