#! /bin/bash

case $RESALLOC_POOL_ID in
    *s390x*tokyo*)
        zone=jp-tok
        ;;
    *s390x*us_east*)
        zone=us-east
        ;;
    *)
        echo "Can't decide what location to assign from pool id: '$RESALLOC_POOL_ID'"
        exit 1
        ;;
esac

exec resalloc-ibm-cloud-list-vms \
    --token-file "{{ ibmcloud_token_file }}" \
    --zone "$zone" \
    "$@"
