Can get the list of groups
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
16
virtweb_backend/src/controllers/groups_controller.rs
Normal file
16
virtweb_backend/src/controllers/groups_controller.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use crate::controllers::{HttpResult, LibVirtReq};
|
||||
use actix_web::HttpResponse;
|
||||
|
||||
/// Get the list of groups
|
||||
pub async fn list(client: LibVirtReq) -> HttpResult {
|
||||
let groups = match client.get_full_groups_list().await {
|
||||
Err(e) => {
|
||||
log::error!("Failed to get the list of groups! {e}");
|
||||
return Ok(HttpResponse::InternalServerError()
|
||||
.json(format!("Failed to get the list of groups! {e}")));
|
||||
}
|
||||
Ok(l) => l,
|
||||
};
|
||||
|
||||
Ok(HttpResponse::Ok().json(groups))
|
||||
}
|
@ -8,6 +8,7 @@ use std::io::ErrorKind;
|
||||
|
||||
pub mod api_tokens_controller;
|
||||
pub mod auth_controller;
|
||||
pub mod groups_controller;
|
||||
pub mod iso_controller;
|
||||
pub mod network_controller;
|
||||
pub mod nwfilter_controller;
|
||||
|
Reference in New Issue
Block a user