Browse Source

Increase volume size

pull/1/head
Luke Childs 5 years ago
parent
commit
ce3d6fa19b
  1. 7
      checkvolumesize

7
checkvolumesize

@ -98,6 +98,13 @@ main () {
volume_id=$(echo $volume_json | jq -r .id) volume_id=$(echo $volume_json | jq -r .id)
volume_size=$(echo $volume_json | jq -r .size_gigabytes) volume_size=$(echo $volume_json | jq -r .size_gigabytes)
log "Volume ID is \"${volume_id}\" and is currently ${volume_size}GB" log "Volume ID is \"${volume_id}\" and is currently ${volume_size}GB"
# Increase volume size
new_volume_size=$(expr $volume_size + $BUFFER)
log "Increasing volume size to ${new_volume_size}GB..."
action_json=$(digital_ocean_api "volumes/2cbebc6a-ff42-11e9-a238-0a58ac14a19d/actions" '{"type":"resize","size_gigabytes":'$new_volume_size'}')
action_id=$(echo $action_json | jq -r '.action.id')
log "Created action \"${action_id}\""
} }
main main

Loading…
Cancel
Save