diff options
author | Mendes <mendes.oulamara@pm.me> | 2022-10-05 16:04:19 +0200 |
---|---|---|
committer | Mendes <mendes.oulamara@pm.me> | 2022-10-05 16:04:19 +0200 |
commit | a951b6c45273e59b98f974937aebb8ada8816ab8 (patch) | |
tree | da8f89d774929082936a947ae8d7462568ab6c4f /src/garage/cli/structs.rs | |
parent | ceac3713d6639f9170fc3b4475fae4a30b34483c (diff) | |
download | garage-a951b6c45273e59b98f974937aebb8ada8816ab8.tar.gz garage-a951b6c45273e59b98f974937aebb8ada8816ab8.zip |
Added a CLI command to update the parameters for the layout computation (for now, only the zone redundancy)
Diffstat (limited to 'src/garage/cli/structs.rs')
-rw-r--r-- | src/garage/cli/structs.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index 06548e89..896379bb 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -86,6 +86,10 @@ pub enum LayoutOperation { /// Remove role from Garage cluster node #[structopt(name = "remove", version = garage_version())] Remove(RemoveRoleOpt), + + /// Configure parameters value for the layout computation + #[structopt(name = "config", version = garage_version())] + Config(ConfigLayoutOpt), /// Show roles currently assigned to nodes and changes staged for commit #[structopt(name = "show", version = garage_version())] @@ -100,6 +104,7 @@ pub enum LayoutOperation { Revert(RevertLayoutOpt), } + #[derive(StructOpt, Debug)] pub struct AssignRoleOpt { /// Node(s) to which to assign role (prefix of hexadecimal node id) @@ -110,7 +115,7 @@ pub struct AssignRoleOpt { #[structopt(short = "z", long = "zone")] pub(crate) zone: Option<String>, - /// Capacity (in relative terms, use 1 to represent your smallest server) + /// Capacity (in relative terms) #[structopt(short = "c", long = "capacity")] pub(crate) capacity: Option<u32>, @@ -134,6 +139,13 @@ pub struct RemoveRoleOpt { } #[derive(StructOpt, Debug)] +pub struct ConfigLayoutOpt { + /// Zone redundancy parameter + #[structopt(short = "r", long = "redundancy")] + pub(crate) redundancy: Option<usize>, +} + +#[derive(StructOpt, Debug)] pub struct ApplyLayoutOpt { /// Version number of new configuration: this command will fail if /// it is not exactly 1 + the previous configuration's version |