This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from cloudflare/alewis/feat-delete-namespace
feat: #341 delete namespace
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use cloudflare::apiclient::APIClient; | ||
|
||
use cloudflare::workerskv::remove_namespace::RemoveNamespace; | ||
|
||
use crate::terminal::message; | ||
|
||
pub fn delete_namespace(id: &str) -> Result<(), failure::Error> { | ||
let client = super::api_client()?; | ||
let account_id = super::account_id()?; | ||
|
||
let msg = format!("Deleting namespace {}", id); | ||
message::working(&msg); | ||
|
||
let response = client.request(&RemoveNamespace { | ||
account_identifier: &account_id, | ||
namespace_identifier: id, | ||
}); | ||
|
||
match response { | ||
Ok(_success) => message::success("Success"), | ||
Err(e) => super::print_error(e), | ||
} | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters