aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-01-21 00:55:04 -0800
committerchrislu <chris.lu@gmail.com>2022-01-21 00:55:04 -0800
commitb1063162b68ff2e84d3038c13c151e479475b6ef (patch)
tree4a0ae50f90f9f4c5b9ad457f4481ece7cf39ca56 /weed/shell
parentf10349191228cb945cabfe049b601ab3e251b55c (diff)
downloadseaweedfs-b1063162b68ff2e84d3038c13c151e479475b6ef.tar.xz
seaweedfs-b1063162b68ff2e84d3038c13c151e479475b6ef.zip
display bucket quota
Diffstat (limited to 'weed/shell')
-rw-r--r--weed/shell/command_s3_bucket_list.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/weed/shell/command_s3_bucket_list.go b/weed/shell/command_s3_bucket_list.go
index 540365af5..37bb0ec20 100644
--- a/weed/shell/command_s3_bucket_list.go
+++ b/weed/shell/command_s3_bucket_list.go
@@ -63,7 +63,14 @@ func (c *commandS3BucketList) Do(args []string, commandEnv *CommandEnv, writer i
collectionSize = collectionInfo.Size
fileCount = collectionInfo.FileCount - collectionInfo.DeleteCount
}
- fmt.Fprintf(writer, " %s\tsize:%d bytes\tfile:%d\treplication: %s\n", entry.Name, collectionSize, fileCount, entry.Attributes.Replication)
+ fmt.Fprintf(writer, " %s\tsize:%d\tfile:%d", entry.Name, collectionSize, fileCount)
+ if entry.Quota > 0 {
+ fmt.Fprintf(writer, "\tquota:%d\tusage:%.2f%%", entry.Quota, float64(collectionSize)*100/float64(entry.Quota))
+ }
+ if entry.Attributes.Replication != "" && entry.Attributes.Replication != "000" {
+ fmt.Fprintf(writer, "\treplication:%s", entry.Attributes.Replication)
+ }
+ fmt.Fprintln(writer)
return nil
}, "", false, math.MaxUint32)
if err != nil {