mirror of
https://codeberg.org/spire/dispenser.git
synced 2026-06-03 10:04:07 +02:00
implement server destroy
This commit is contained in:
parent
bfd76ffa67
commit
55f11c6ccb
2 changed files with 10 additions and 3 deletions
|
|
@ -17,4 +17,4 @@ FROM alpine:latest
|
|||
|
||||
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/dispenser /
|
||||
|
||||
CMD ["/dispenser" "/config.toml"]
|
||||
CMD ["/dispenser", "/config.toml"]
|
||||
|
|
@ -74,8 +74,15 @@ impl Cloud for Vultr {
|
|||
}
|
||||
}
|
||||
|
||||
async fn kill(&self, _id: &str) -> Result<()> {
|
||||
todo!()
|
||||
async fn kill(&self, id: &str) -> Result<()> {
|
||||
let response = self
|
||||
.client
|
||||
.delete(format!("https://api.vultr.com/v2/instances/{}", id))
|
||||
.bearer_auth(&self.token)
|
||||
.send()
|
||||
.await
|
||||
.map_err(NetworkError::from)?;
|
||||
CloudError::from_status_code(response.status())
|
||||
}
|
||||
|
||||
async fn wait_for_ip(&self, id: &str) -> Result<Server> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue