Can get domains list
This commit is contained in:
@ -13,6 +13,16 @@ impl LibVirtClient {
|
||||
self.0.send(libvirt_actor::GetHypervisorInfo).await?
|
||||
}
|
||||
|
||||
/// Get the full list of domain
|
||||
pub async fn get_full_list(&self) -> anyhow::Result<Vec<DomainXML>> {
|
||||
let ids = self.0.send(libvirt_actor::GetDomainsListReq).await??;
|
||||
let mut info = Vec::with_capacity(ids.len());
|
||||
for id in ids {
|
||||
info.push(self.get_single_domain(id).await?)
|
||||
}
|
||||
Ok(info)
|
||||
}
|
||||
|
||||
/// Get the information about a single domain
|
||||
pub async fn get_single_domain(&self, id: DomainXMLUuid) -> anyhow::Result<DomainXML> {
|
||||
self.0.send(libvirt_actor::GetDomainXMLReq(id)).await?
|
||||
|
Reference in New Issue
Block a user