Skip to content

Commit 264728f

Browse files
committed
rust 1.0.1
1 parent 25ec89f commit 264728f

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "xnode-deployer"
33
description = "Deploy new Xnodes on several hardware providers"
4-
version = "1.0.0"
4+
version = "1.0.1"
55
edition = "2024"
66
repository = "https://github.com/Openmesh-Network/xnode-deployer"
77
license = "MIT"

rust/src/hivelocity/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ impl HivelocityDeployer {
5555
hardware,
5656
}
5757
}
58+
59+
pub async fn undeploy(&self, input: HivelocityUndeployInput) -> Option<Error> {
60+
let scope = match input {
61+
HivelocityUndeployInput::BareMetal { device_id } => {
62+
format!("bare-metal-devices/{device_id}")
63+
}
64+
HivelocityUndeployInput::Compute { device_id } => format!("compute/{device_id}"),
65+
};
66+
self.client
67+
.delete(format!("https://core.hivelocity.net/api/v2/{scope}"))
68+
.header("X-API-KEY", self.api_key.clone())
69+
.send()
70+
.await
71+
.err()
72+
.map(Error::ReqwestError)
73+
}
5874
}
5975

6076
impl XnodeDeployer for HivelocityDeployer {
@@ -207,3 +223,9 @@ pub enum HivelocityHardware {
207223
hostname: String,
208224
},
209225
}
226+
227+
#[derive(Debug)]
228+
pub enum HivelocityUndeployInput {
229+
BareMetal { device_id: u64 },
230+
Compute { device_id: u64 },
231+
}

0 commit comments

Comments
 (0)