Can view from web UI XML definition of domains
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user