Delete Disk

To remove a disk from a virtual server, use one of the following requests:

DELETE /virtual_machines/:virtual_machine_id/disks/:disk_id.xml
DELETE /virtual_machines/:virtual_machine_id/disks/:disk_id.json

or

DELETE /settings/disks/:disk_id.xml?force=1&shutdown_type=graceful&required_startup=0
DELETE /settings/disks/:disk_id.json?force=1&shutdown_type=graceful&required_startup=0

XML Request Example

curl -i -X DELETE http://onapp.test/settings/disks/2.xml?force=1&shutdown_type=graceful&required_startup=0 -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON Request Example

curl -i -X DELETE http://onapp.test/settings/disks/2.json?force=1&shutdown_type=graceful&required_startup=0 -u user:userpass -H 'Accept: application/json' -H 'Content-type:application/json'

Where:

shutdown_type - type of the VS shutdown: hard, graceful or soft

required_startup - set 1 to start up the VS automatically after deleting a disk, otherwise set 0

Returns HTTP 204 response on successful deletion, or HTTP 404 when a disk with the ID specified is not found, or the URL requested is incorrect.