mirror of
https://github.com/status-im/infra-utils.git
synced 2025-02-23 09:28:08 +00:00
12 lines
314 B
Bash
Executable File
12 lines
314 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CONSUL_URL="${CONSUL_URL:-http://localhost:8500/v1/catalog}"
|
|
|
|
readarray -t DCS < <(curl -s "${CONSUL_URL}/datacenters" | jq -r '.[]')
|
|
|
|
for DC in "${DCS[@]}"; do
|
|
echo "# DC: ${DC}"
|
|
curl -s "${CONSUL_URL}/nodes?dc=${DC}" \
|
|
| jq -r '.[] | [.Address, .Node, .Meta.os] | @tsv'
|
|
done
|