implement server destroy

This commit is contained in:
Robin Appelman 2021-03-29 20:50:58 +02:00
commit 55f11c6ccb
2 changed files with 10 additions and 3 deletions

View file

@ -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> {