aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2022-06-10 09:31:46 -0400
committerCara Salter <cara@devcara.com>2022-06-10 09:32:43 -0400
commiteec3c3b7736f7ec54b25712761d00caaa3f78619 (patch)
tree7fe67ac045f6daf8c575be15d81cd906af6f62f0
parentf73eb90d830df1a0881447d918985e315aed6fb7 (diff)
downloadsolarlib-1.5.0.tar.gz
solarlib-1.5.0.zip
star: Add struct for new Planet HTTP requests1.5.0
-rw-r--r--Cargo.toml2
-rw-r--r--src/ship.rs2
-rw-r--r--src/star.rs10
3 files changed, 12 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 677a210..d0e9dbb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "solarlib"
-version = "1.4.1"
+version = "1.5.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/src/ship.rs b/src/ship.rs
index f38d1f9..ed2d95c 100644
--- a/src/ship.rs
+++ b/src/ship.rs
@@ -29,7 +29,7 @@ impl ToString for Sha256 {
}
/// Describes a starship, or a way to install a distribution
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Debug)]
pub struct Ship {
/// The common name of the distribution (e.g "Arch Linux")
pub name: String,
diff --git a/src/star.rs b/src/star.rs
index 53c9124..a9f3bfa 100644
--- a/src/star.rs
+++ b/src/star.rs
@@ -44,6 +44,16 @@ pub struct Star {
con: Option<Connect>,
}
+/// The proper JSON request to make to a solard server to introduce a new planet
+#[derive(Debug, Serialize, Deserialize)]
+pub struct NewPlanet {
+ pub name: String,
+ pub max_mem: Memory,
+ pub max_cpus: CpuCount,
+ pub disk_size_mb: u64,
+ pub ship: Ship,
+}
+
impl Star {
/// Creates a new Planet based on a libvirtd connect URL
///