aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml2
-rw-r--r--src/planet.rs5
2 files changed, 6 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index fc1b885..3f0496f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "solarlib"
-version = "1.2.1"
+version = "1.3.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
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<Arc<Domain>>,
}
@@ -103,6 +106,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(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)),
})
}