123456789101112131415161718192021222324252627282930 |
- #! /bin/bash
- usage() {
- cat << EOF
- Usage: ${0##*/} [-h] <image>
- Lists amphorae using a given image
- -h Print this help
- EOF
- }
- while getopts h opt; do
- case $opt in
- h) usage; exit 0 ;;
- esac
- done
- shift $(( OPTIND - 1 ))
- if [[ $# -ne 1 ]]; then
- 2>&1 usage
- exit 1
- fi
- . ~/.os_helpers
- endpoint="$(get_service_endpoint load-balancer)"
- curl -s -H "X-Auth-Token: $CURL_OS_TOKEN" "${endpoint}"'/v2.0/octavia/amphorae?image_id='"${1}"'&fields=id&fields=loadbalancer_id&fields=status' \
- | jq -r '["-----", "-----", "-----"], (.amphorae[] | [.id, .loadbalancer_id, .status]) | @tsv' \
- | column --table-columns id,loadbalancer_id,status -o' | ' -t
|