Implements VM groups API (#206)
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #206
This commit is contained in:
2024-11-28 18:06:20 +00:00
parent 821021e66f
commit ee77bd11c9
9 changed files with 420 additions and 31 deletions

View File

@ -122,6 +122,21 @@ impl LibVirtClient {
Ok(out)
}
/// Get the full list of VMs of a given group
pub async fn get_full_group_vm_list(
&self,
group: &VMGroupId,
) -> anyhow::Result<Vec<DomainXML>> {
let vms = self.get_full_domains_list().await?;
let mut out = Vec::new();
for vm in vms {
if VMInfo::from_domain(vm.clone())?.group == Some(group.clone()) {
out.push(vm);
}
}
Ok(out)
}
/// Update a network configuration
pub async fn update_network(
&self,