Clean up logging
This commit is contained in:
@@ -10,21 +10,35 @@
|
||||
# Options:
|
||||
# <targethost> : Host to perform refresh job
|
||||
|
||||
usage() { echo "Usage: $0 <host>" 1>&2; exit 1; }
|
||||
usage() { log_error "Usage: $0 <host>"; exit 1; }
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
usage
|
||||
usage
|
||||
fi
|
||||
|
||||
MYDIR="$(dirname "$(realpath "$0")")"
|
||||
|
||||
# Support -v/--verbose and strip it from positional args
|
||||
NEWARGS=()
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
-v|--verbose)
|
||||
VERBOSE=1
|
||||
;;
|
||||
*)
|
||||
NEWARGS+=("$arg")
|
||||
;;
|
||||
esac
|
||||
done
|
||||
set -- "${NEWARGS[@]}"
|
||||
|
||||
source $MYDIR/rsc_ops.sh
|
||||
|
||||
RBK_HOST=$1
|
||||
|
||||
rsc_get_host_id
|
||||
|
||||
echo "Host ID: $targetHostId"
|
||||
log_info "Host ID: $targetHostId"
|
||||
|
||||
gql_refreshHost='mutation RefreshHost($input: RefreshHostInput!) {
|
||||
refreshHost(input: $input) {
|
||||
@@ -48,9 +62,9 @@ variables="{
|
||||
gqlQuery="$(echo $gql_refreshHost)"
|
||||
gqlVars="$(echo $variables)"
|
||||
|
||||
echo "Refreshing host $RBK_HOST (ID: $targetHostId)"
|
||||
log_info "Refreshing host $RBK_HOST (ID: $targetHostId)"
|
||||
|
||||
rsc_gql_query
|
||||
|
||||
echo "Response:"
|
||||
log_info "Response:"
|
||||
cat /tmp/rbkresponse.$$ | jq
|
||||
Reference in New Issue
Block a user