The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

vultr_delete_snapshot.sh 798 B

123456789101112131415161718
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. SNAPSHOTID=${1:?no snapshot provided}
  6. THISDIR=$(cd $(dirname ${0}) && pwd)
  7. VCURL=${THISDIR}/vcurl
  8. if [[ ${SNAPSHOTID} == "-i" ]] ; then
  9. SNAPSHOTID=${2:?no snapshot ID provided}
  10. echo "Deleting snapshot with SNAPSHOTID: ${SNAPSHOTID}"
  11. ${VCURL} snapshot/destroy -X POST -d "SNAPSHOTID=${SNAPSHOTID}" || echo "Error deleting snapshot: ${SNAPSHOTID}"
  12. else
  13. SNAPSHOT_NAME="${SNAPSHOTID}"
  14. echo "Deleting snapshot named: ${SNAPSHOT_NAME}"
  15. ${0} -i $(${VCURL} snapshot/list | jq -r 'to_entries | .[] | select(.value.description=="'${SNAPSHOT_NAME}'") | .value.SNAPSHOTID') || echo "Error deleting snapshot named: ${SNAPSHOT_NAME}"
  16. fi