Delete VMs
Deleting a single VM
Request:
DELETE /api/vms/334
Upon success, Vm targeted for deletion asynchronously and No Response Content with HTTP status code 204
Deleting multiple VMs
Request:
DELETE /api/vms
{
"action" : "delete",
"resources" : [
{ "href" : "http://localhost:3000/api/vms/348" },
{ "href" : "http://localhost:3000/api/vms/349" }
]
}
Response:
{
"results": [
{
"success": true,
"message": "VM id:348 name:'aab-temp1' deleting",
"task_id": "616",
"task_href": "http://localhost:3000/api/tasks/616",
"href": "http://localhost:3000/api/vms/348"
},
{
"success": true,
"message": "VM id:349 name:'aab-temp2' deleting",
"task_id": "617",
"task_href": "http://localhost:3000/api/tasks/617",
"href": "http://localhost:3000/api/vms/349"
}
]
}
Optionally monitoring the asynchronous Vm deletion by accessing the related Task as follows:
Request:
GET /api/tasks/616
Response:
{
"href": "http://localhost:3000/api/tasks/616",
"id": "616",
"name": "VM id:348 name:'aab-temp1' deleting",
"state": "Finished",
"status": "Ok",
"message": "Task completed successfully",
"userid": "admin",
"created_on": "2015-05-05T19:33:35Z",
"updated_on": "2015-05-05T19:33:40Z"
}