Ready to implement network routes contents
This commit is contained in:
@ -116,4 +116,31 @@ impl LibVirtClient {
|
||||
pub async fn delete_network(&self, id: XMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::DeleteNetwork(id)).await?
|
||||
}
|
||||
|
||||
/// Get auto-start status of a network
|
||||
pub async fn is_network_autostart(&self, id: XMLUuid) -> anyhow::Result<bool> {
|
||||
self.0.send(libvirt_actor::IsNetworkAutostart(id)).await?
|
||||
}
|
||||
|
||||
/// Update autostart value of a network
|
||||
pub async fn set_network_autostart(&self, id: XMLUuid, autostart: bool) -> anyhow::Result<()> {
|
||||
self.0
|
||||
.send(libvirt_actor::SetNetworkAutostart(id, autostart))
|
||||
.await?
|
||||
}
|
||||
|
||||
/// Check out whether a network is started or not
|
||||
pub async fn is_network_started(&self, id: XMLUuid) -> anyhow::Result<bool> {
|
||||
self.0.send(libvirt_actor::IsNetworkStarted(id)).await?
|
||||
}
|
||||
|
||||
/// Start a network
|
||||
pub async fn start_network(&self, id: XMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::StartNetwork(id)).await?
|
||||
}
|
||||
|
||||
/// Stop a network
|
||||
pub async fn stop_network(&self, id: XMLUuid) -> anyhow::Result<()> {
|
||||
self.0.send(libvirt_actor::StopNetwork(id)).await?
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user