diff options
Diffstat (limited to 'src/garage/cli')
-rw-r--r-- | src/garage/cli/cmd.rs | 3 | ||||
-rw-r--r-- | src/garage/cli/structs.rs | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/garage/cli/cmd.rs b/src/garage/cli/cmd.rs index b7508e45..b65fea02 100644 --- a/src/garage/cli/cmd.rs +++ b/src/garage/cli/cmd.rs @@ -29,6 +29,9 @@ pub async fn cli_command_dispatch( Command::Key(ko) => { cmd_admin(admin_rpc_endpoint, rpc_host, AdminRpc::KeyOperation(ko)).await } + Command::Migrate(mo) => { + cmd_admin(admin_rpc_endpoint, rpc_host, AdminRpc::Migrate(mo)).await + } Command::Repair(ro) => { cmd_admin(admin_rpc_endpoint, rpc_host, AdminRpc::LaunchRepair(ro)).await } diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index 1905069e..bd7abc8e 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -28,6 +28,11 @@ pub enum Command { #[structopt(name = "key")] Key(KeyOperation), + /// Run migrations from previous Garage version + /// (DO NOT USE WITHOUT READING FULL DOCUMENTATION) + #[structopt(name = "migrate")] + Migrate(MigrateOpt), + /// Start repair of node data #[structopt(name = "repair")] Repair(RepairOpt), @@ -320,6 +325,23 @@ pub struct KeyImportOpt { } #[derive(Serialize, Deserialize, StructOpt, Debug, Clone)] +pub struct MigrateOpt { + /// Confirm the launch of the migrate operation + #[structopt(long = "yes")] + pub yes: bool, + + #[structopt(subcommand)] + pub what: MigrateWhat, +} + +#[derive(Serialize, Deserialize, StructOpt, Debug, Eq, PartialEq, Clone)] +pub enum MigrateWhat { + /// Migrate buckets and permissions from v0.5.0 + #[structopt(name = "buckets050")] + Buckets050, +} + +#[derive(Serialize, Deserialize, StructOpt, Debug, Clone)] pub struct RepairOpt { /// Launch repair operation on all nodes #[structopt(short = "a", long = "all-nodes")] |