Can update and delete networks
This commit is contained in:
@ -413,3 +413,18 @@ impl Handler<GetNetworkXMLReq> for LibVirtActor {
|
||||
Ok(serde_xml_rs::from_str(&xml)?)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Message)]
|
||||
#[rtype(result = "anyhow::Result<()>")]
|
||||
pub struct DeleteNetwork(pub XMLUuid);
|
||||
|
||||
impl Handler<DeleteNetwork> for LibVirtActor {
|
||||
type Result = anyhow::Result<()>;
|
||||
|
||||
fn handle(&mut self, msg: DeleteNetwork, _ctx: &mut Self::Context) -> Self::Result {
|
||||
log::debug!("Delete network: {}\n", msg.0.as_string());
|
||||
let network = Network::lookup_by_uuid_string(&self.m, &msg.0.as_string())?;
|
||||
network.undefine()?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user