vmm: Implement the /api/v1/vm.delete endpoint

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-10-01 17:24:39 +02:00
parent f9daf2e247
commit 7328ecdb3b
4 changed files with 46 additions and 15 deletions
+3 -2
View File
@@ -5,8 +5,8 @@
use crate::api::http::EndpointHandler;
use crate::api::{
vm_boot, vm_create, vm_info, vm_reboot, vm_shutdown, ApiError, ApiRequest, ApiResult, VmAction,
VmConfig,
vm_boot, vm_create, vm_delete, vm_info, vm_reboot, vm_shutdown, ApiError, ApiRequest,
ApiResult, VmAction, VmConfig,
};
use micro_http::{Body, Method, Request, Response, StatusCode, Version};
use serde_json::Error as SerdeError;
@@ -97,6 +97,7 @@ impl VmActionHandler {
pub fn new(action: VmAction) -> Self {
let action_fn = Box::new(match action {
VmAction::Boot => vm_boot,
VmAction::Delete => vm_delete,
VmAction::Shutdown => vm_shutdown,
VmAction::Reboot => vm_reboot,
});