16 lines
432 B
Bash
Executable File
16 lines
432 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
BASE_URL="${BASE_URL:-http://127.0.0.1:8000}"
|
|
NETWORK="${NETWORK:-tjwater}"
|
|
URL="${BASE_URL%/}/api/v1/burst-detection/schemes/?network=${NETWORK}"
|
|
|
|
headers=(-H "Accept: application/json")
|
|
if [[ -n "${AUTH_TOKEN:-}" ]]; then
|
|
headers+=(-H "Authorization: Bearer ${AUTH_TOKEN}")
|
|
fi
|
|
|
|
echo "[api-operations] GET ${URL}" >&2
|
|
curl --silent --show-error --fail-with-body "${headers[@]}" "$URL"
|
|
echo
|