Can update or delete domains

This commit is contained in:
2023-10-13 16:44:56 +02:00
parent 52d7e35d10
commit 6a3cf2e5c8
6 changed files with 111 additions and 22 deletions

View File

@ -33,6 +33,13 @@ impl LibVirtClient {
self.0.send(libvirt_actor::DefineDomainReq(xml)).await?
}
/// Delete a domain
pub async fn delete_domain(&self, id: DomainXMLUuid, keep_files: bool) -> anyhow::Result<()> {
self.0
.send(libvirt_actor::DeleteDomainReq { id, keep_files })
.await?
}
/// Get the state of a domain
pub async fn get_domain_state(&self, id: DomainXMLUuid) -> anyhow::Result<DomainState> {
self.0.send(libvirt_actor::GetDomainStateReq(id)).await?