@@ -0,0 +1,16 @@ | |||||
#!/bin/bash | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ | |||||
# | |||||
LABEL=${1:?no label provided} | |||||
THISDIR=$(cd $(dirname ${0}) && pwd) | |||||
VCURL=${THISDIR}/vcurl | |||||
SUBID=$(${THISDIR}/vultr_subid_for_instance.sh ${LABEL}) | |||||
if [[ -z "${SUBID}" ]] ; then | |||||
echo "No instance found with label ${LABEL}" | |||||
exit 1 | |||||
fi | |||||
echo "Deleting instance: ${SUBID}" | |||||
${VCURL} server/destroy -X POST -d "SUBID=${SUBID}" || echo "Error deleting instance: ${SUBID}" |
@@ -4,11 +4,10 @@ | |||||
# | # | ||||
THISDIR=$(cd $(dirname ${0}) && pwd) | THISDIR=$(cd $(dirname ${0}) && pwd) | ||||
VCURL=${THISDIR}/vcurl | VCURL=${THISDIR}/vcurl | ||||
LABEL=${1} | |||||
VULTR_OUTPUT=${1} | |||||
if [[ -z "${VULTR_OUTPUT}" ]] ; then | |||||
if [[ -z "${LABEL}" ]] ; then | |||||
${VCURL} server/list | jq . | ${VCURL} server/list | jq . | ||||
else | else | ||||
${VCURL} server/list | jq -r .[].${VULTR_OUTPUT} | |||||
${VCURL} server/list?label=${LABEL} | jq . | |||||
fi | fi |
@@ -0,0 +1,9 @@ | |||||
#!/bin/bash | |||||
# | |||||
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ | |||||
# | |||||
THISDIR=$(cd $(dirname ${0}) && pwd) | |||||
VCURL=${THISDIR}/vcurl | |||||
LABEL=${1?no label provided} | |||||
${VCURL} server/list?label=${LABEL} | jq -r '.[].SUBID' |