diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-09 15:43:26 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-09 15:43:26 +0200 |
commit | c1baa102029e8706e1a7ffdd58dde2afc2a690d5 (patch) | |
tree | 17123b6568f6f1746f2710bf2d57bb4992931213 /src/garage | |
parent | ea1022f8325591b5e6e2addd457eb23a1783dc5f (diff) | |
download | garage-c1baa102029e8706e1a7ffdd58dde2afc2a690d5.tar.gz garage-c1baa102029e8706e1a7ffdd58dde2afc2a690d5.zip |
Add quotas to bucket table and show them in CLI
Diffstat (limited to 'src/garage')
-rw-r--r-- | src/garage/cli/util.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/garage/cli/util.rs b/src/garage/cli/util.rs index f859c9bc..153e77a8 100644 --- a/src/garage/cli/util.rs +++ b/src/garage/cli/util.rs @@ -154,7 +154,7 @@ pub fn print_bucket_info( let size = bytesize::ByteSize::b(counters.get(BYTES).cloned().unwrap_or_default() as u64); println!( - "Size: {} ({})", + "\nSize: {} ({})", size.to_string_as(true), size.to_string_as(false) ); @@ -170,7 +170,23 @@ pub fn print_bucket_info( .unwrap_or_default() ); - println!("Website access: {}", p.website_config.get().is_some()); + println!("\nWebsite access: {}", p.website_config.get().is_some()); + + let quotas = p.quotas.get(); + if quotas.max_size.is_some() || quotas.max_objects.is_some() { + println!("\nQuotas:"); + if let Some(ms) = quotas.max_size { + let ms = bytesize::ByteSize::b(ms); + println!( + " maximum size: {} ({})", + ms.to_string_as(true), + ms.to_string_as(false) + ); + } + if let Some(mo) = quotas.max_objects { + println!(" maximum number of objects: {}", mo); + } + } println!("\nGlobal aliases:"); for (alias, _, active) in p.aliases.items().iter() { |