Delete VS
To delete a VS, use the following request:
DELETE /virtual_machines/:id.xml
DELETE /virtual_machines/:id.json
To delete a virtual server together with its backups, the user needs to have the Destroy any backup or Destroy own backup permission enabled. Otherwise, the backups of the VS deleted by the user will remain in the system.
XML Request Example
curl -i -X DELETE -u user:userpass http://onapp.test/virtual_machines/12.xml?convert_last_backup=1&destroy_all_backups=1
JSON Request Example
curl -i -X DELETE -u user:userpass http://onapp.test/virtual_machines/12.json?convert_last_backup=1&destroy_all_backups=1
Where:
id – the ID of a VS you want to delete
convert_last_backup – set 1 to convert the last VS's backup to template, otherwise set 0
destroy_all_backups – set 1 to destroy all existing backups of this VS, otherwise set 0