aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-23 18:36:12 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-23 18:36:12 +0000
commit4ef84a0558c0bf6641094e762ede0c962781204d (patch)
tree8e6014ee12541c7085b371e99941c5c3da53f2b0 /src/main.rs
parent44a1089d9569b442c098c2ceebb3f691816e52d2 (diff)
downloadgarage-4ef84a0558c0bf6641094e762ede0c962781204d.tar.gz
garage-4ef84a0558c0bf6641094e762ede0c962781204d.zip
Move repair to separate file
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index c693b12c..cf3a4130 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -70,6 +70,10 @@ pub enum Command {
#[structopt(name = "bucket")]
Bucket(BucketOperation),
+ /// Key operations
+ #[structopt(name = "key")]
+ Key(KeyOperation),
+
/// Start repair of node data
#[structopt(name = "repair")]
Repair(RepairOpt),
@@ -182,6 +186,27 @@ pub struct PermBucketOpt {
pub bucket: String,
}
+#[derive(Serialize, Deserialize, StructOpt, Debug)]
+pub enum KeyOperation {
+ /// List keys
+ #[structopt(name = "list")]
+ List,
+
+ /// Create new key
+ #[structopt(name = "new")]
+ New,
+
+ /// Delete key
+ #[structopt(name = "delete")]
+ Delete(KeyDeleteOpt),
+}
+
+#[derive(Serialize, Deserialize, StructOpt, Debug)]
+pub struct KeyDeleteOpt {
+ /// Name of the bucket to delete
+ bucket: String,
+}
+
#[derive(Serialize, Deserialize, StructOpt, Debug, Clone)]
pub struct RepairOpt {
/// Launch repair operation on all nodes
@@ -257,6 +282,9 @@ async fn main() {
Command::Bucket(bo) => {
cmd_admin(admin_rpc_cli, opt.rpc_host, AdminRPC::BucketOperation(bo)).await
}
+ Command::Key(bo) => {
+ cmd_admin(admin_rpc_cli, opt.rpc_host, AdminRPC::KeyOperation(bo)).await
+ }
Command::Repair(ro) => {
cmd_admin(admin_rpc_cli, opt.rpc_host, AdminRPC::LaunchRepair(ro)).await
}