Can view from web UI XML definition of domains

This commit is contained in:
2023-12-08 18:14:01 +01:00
parent 74b77be013
commit 82447a0018
13 changed files with 632 additions and 135 deletions

View File

@ -73,6 +73,21 @@ pub async fn get_single(client: LibVirtReq, id: web::Path<SingleVMUUidReq>) -> H
}))
}
/// Get the XML configuration of a VM
pub async fn get_single_src_def(client: LibVirtReq, id: web::Path<SingleVMUUidReq>) -> HttpResult {
let info = match client.get_single_domain_xml(id.uid).await {
Ok(i) => i,
Err(e) => {
log::error!("Failed to get domain source XML! {e}");
return Ok(HttpResponse::InternalServerError().json(e.to_string()));
}
};
Ok(HttpResponse::Ok()
.content_type("application/xml")
.body(info))
}
/// Update a VM information
pub async fn update(
client: LibVirtReq,