pub struct Vm<O> {
pub id: VmId,
pub name_label: String,
pub name_description: String,
pub power_state: PowerState,
pub pool: String,
pub tags: Vec<String>,
pub os_version: BTreeMap<String, String>,
pub other: O,
/* private fields */
}
Expand description
Type representing a VM
Note that the “other” property contains a lot of different data. In the Xen Orchestra the user may
even add additional values. For this reason the struct is made generic over the type O
.
See the trait OtherInfo
for more info
Also see https://github.com/vatesfr/xen-orchestra/blob/a505cd9567233aab7ca6488b2fb8a0b6c610fa08/packages/xo-server/src/xapi-object-to-xo.mjs#L273
Fields§
§id: VmId
§name_label: String
§name_description: String
§power_state: PowerState
§pool: String
§os_version: BTreeMap<String, String>
§other: O
Implementations§
Source§impl<'a, O: DeserializeOwned> Vm<O>
impl<'a, O: DeserializeOwned> Vm<O>
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if VM is running.
Sourcepub fn distro(&self) -> Option<&str>
pub fn distro(&self) -> Option<&str>
Try to guess OS distro of VM
Note: This only works for running VMs, returns None
when distro
can not be determined.
Sourcepub fn ipv4_addresses(&self) -> impl Iterator<Item = Ipv4Addr> + '_
pub fn ipv4_addresses(&self) -> impl Iterator<Item = Ipv4Addr> + '_
Get iterator of all valid IPv4 addresses for VM.
Note: This only works for running VMs, returns empty iterator otherwise
Trait Implementations§
Source§impl<'de, O> Deserialize<'de> for Vm<O>where
O: Deserialize<'de>,
impl<'de, O> Deserialize<'de> for Vm<O>where
O: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<O> Freeze for Vm<O>where
O: Freeze,
impl<O> RefUnwindSafe for Vm<O>where
O: RefUnwindSafe,
impl<O> Send for Vm<O>where
O: Send,
impl<O> Sync for Vm<O>where
O: Sync,
impl<O> Unpin for Vm<O>where
O: Unpin,
impl<O> UnwindSafe for Vm<O>where
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more