Can query hypervisor information
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
use crate::actors::libvirt_actor::HypervisorInfo;
|
||||
use crate::app_config::AppConfig;
|
||||
use crate::constants;
|
||||
use crate::controllers::{HttpResult, LibVirtReq};
|
||||
use crate::extractors::local_auth_extractor::LocalAuthEnabled;
|
||||
use actix_web::{HttpResponse, Responder};
|
||||
|
||||
@ -23,3 +25,14 @@ pub async fn static_config(local_auth: LocalAuthEnabled) -> impl Responder {
|
||||
iso_max_size: constants::ISO_MAX_SIZE,
|
||||
})
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct ServerInfo {
|
||||
hypervisor: HypervisorInfo,
|
||||
}
|
||||
|
||||
pub async fn server_info(client: LibVirtReq) -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(ServerInfo {
|
||||
hypervisor: client.get_info().await?,
|
||||
}))
|
||||
}
|
||||
|
Reference in New Issue
Block a user