added --fail opt

pull/2/head
Hari Sekhon 5 years ago
parent 929ee5bcef
commit 9b97fae70d

@ -67,7 +67,7 @@ shift
# https://docs.cloudera.com/documentation/enterprise/6/6.3/topics/cn_navigator_api_overview.html#api-version-compatility
api_version="${CLOUDERA_API_VERSION:-7}"
"$srcdir/curl_auth.sh" -sS --connect-timeout 5 "$CLOUDERA_MANAGER/api/v${api_version}${url_path}" "$@"
"$srcdir/curl_auth.sh" --fail -sS --connect-timeout 5 "$CLOUDERA_MANAGER/api/v${api_version}${url_path}" "$@"
result=$?
echo
exit "$result"

@ -43,10 +43,6 @@ Environment variables (prompts for address and password if not passed via enviro
./cloudera_navigator_api.sh /path
If outputting to a file and wanting full curl interactive progress on stderr:
PROGRESS=1 ./cloudera_navigator_api.sh /path > file.txt
Used by various adjacent cloudera_navigator_*.sh scripts
Tested on Cloudera Enterprise 5.10
@ -73,12 +69,7 @@ shift
api_version="${CLOUDERA_API_VERSION:-10}"
quiet='-sS'
if [ -n "${PROGRESS:-}" ]; then
quiet=''
fi
"$srcdir/curl_auth.sh" "$quiet" --connect-timeout 5 "$CLOUDERA_NAVIGATOR/api/v${api_version}${url_path}" "$@"
"$srcdir/curl_auth.sh" --fail -sS --connect-timeout 5 "$CLOUDERA_NAVIGATOR/api/v${api_version}${url_path}" "$@"
result=$?
echo
exit "$result"

@ -67,4 +67,4 @@ url_path="${url_path##/}"
shift
eval "$srcdir/curl_auth.sh" -sS --connect-timeout 3 "${CURL_OPTS:-}" "https://api.github.com/$url_path" "$@"
eval "$srcdir/curl_auth.sh" --fail -sS --connect-timeout 3 "${CURL_OPTS:-}" "https://api.github.com/$url_path" "$@"

Loading…
Cancel
Save