Cloud Panel

Delete a volume

DELETE/api/v1/volumes/{disk_uuid}

Deletes the volume and its data. Detach it first. Billing stops at once; Get a volume answers 404 once it is gone.

Parameters

NameInDescription
disk_uuidpath, stringrequiredVolume id, from Create a volume or List volumes

Example request

curl -X DELETE "https://platform.serverscamp.com/api/v1/volumes/$DISK_UUID" \
  -H "Authorization: Bearer $API_TOKEN"

Answer

Status 200 with this body.

FieldTypeDescription
successbooleanrequired
messagestringrequired
{
  "success": true,
  "message": "Volume deletion started"
}

Wait until it is ready

The answer comes at once. Get a volume answers 404 once the volume is gone.

Check the state

Ask Get a volume with the volume's id. After the delete it answers 404.

curl "https://platform.serverscamp.com/api/v1/volumes/$DISK_UUID" \
  -H "Authorization: Bearer $API_TOKEN"

Wait in a loop

Ask every few seconds until the answer is 404.

# DISK_UUID: disk_uuid of the volume, from the answer above
until [ "$(curl -s -o /dev/null -w '%{http_code}' \
    "https://platform.serverscamp.com/api/v1/volumes/$DISK_UUID" -H "Authorization: Bearer $API_TOKEN")" = 404 ]; do
  sleep 5
done
echo deleted

Errors

StatusWhen
400The volume is attached; detach it first
401No token, or a token that is not valid
404No such volume in your account
409The volume is busy
422The body or a parameter is not what the operation takes

Every operation can also answer 401 without a valid token. All errors