From d674951ce8cb5b41afe68bbeefcd9ee585125ab9 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 9 Jun 2022 08:17:23 -0400 Subject: planet: Add "orbiting" field True when the Planet is running, false when not --- src/planet.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/planet.rs') diff --git a/src/planet.rs b/src/planet.rs index 004f223..60e9b3b 100644 --- a/src/planet.rs +++ b/src/planet.rs @@ -57,6 +57,9 @@ pub struct Planet { /// The amount of vCPUs assigned to this machine pub cpu_count: CpuCount, + /// Whether the planet is "orbiting" (running) + pub orbiting: bool, + #[serde(skip)] domain: Option>, } @@ -103,6 +106,7 @@ impl TryFrom for Planet { uuid: d.get_uuid_string()?, mem: d.get_max_memory()?.into(), cpu_count: d.get_max_vcpus()?.into(), + orbiting: d.is_active()?, domain: Some(Arc::new(d)), }) } @@ -147,6 +151,7 @@ impl TryFrom<&Domain> for Planet { uuid: d.get_uuid_string()?, mem: d.get_max_memory()?.into(), cpu_count: d.get_max_vcpus()?.into(), + orbiting: d.is_active()?, domain: Some(Arc::new(new_d)), }) } -- cgit v1.2.3