diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-15 18:36:15 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-01-04 12:45:51 +0100 |
commit | 53f71b3a57b3c1828292e26b7865d31e9bec44d6 (patch) | |
tree | b874fa38a3680b7ba153d34a711f4ebff6884c00 /src/garage/cli/structs.rs | |
parent | 5b1117e582db16cc5aa50840a685875cbd5501f4 (diff) | |
download | garage-53f71b3a57b3c1828292e26b7865d31e9bec44d6.tar.gz garage-53f71b3a57b3c1828292e26b7865d31e9bec44d6.zip |
Implement bucket alias and bucket unalias
Diffstat (limited to 'src/garage/cli/structs.rs')
-rw-r--r-- | src/garage/cli/structs.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index b2b5375d..590be1c0 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -150,6 +150,14 @@ pub enum BucketOperation { #[structopt(name = "delete")] Delete(DeleteBucketOpt), + /// Alias bucket under new name + #[structopt(name = "alias")] + Alias(AliasBucketOpt), + + /// Remove bucket alias + #[structopt(name = "unalias")] + Unalias(UnaliasBucketOpt), + /// Allow key to read or write to bucket #[structopt(name = "allow")] Allow(PermBucketOpt), @@ -194,6 +202,29 @@ pub struct DeleteBucketOpt { } #[derive(Serialize, Deserialize, StructOpt, Debug)] +pub struct AliasBucketOpt { + /// Existing bucket name (its alias in global namespace or its full hex uuid) + pub existing_bucket: String, + + /// New bucket name + pub new_name: String, + + /// Make this alias local to the specified access key + #[structopt(long = "local")] + pub local: Option<String>, +} + +#[derive(Serialize, Deserialize, StructOpt, Debug)] +pub struct UnaliasBucketOpt { + /// Bucket name + pub name: String, + + /// Unalias in bucket namespace local to this access key + #[structopt(long = "local")] + pub local: Option<String>, +} + +#[derive(Serialize, Deserialize, StructOpt, Debug)] pub struct PermBucketOpt { /// Access key name or ID #[structopt(long = "key")] |