mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 18:07:56 +08:00
add getting bucket quota
This commit is contained in:
@@ -32,7 +32,7 @@ func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer
|
|||||||
|
|
||||||
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
|
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
|
||||||
bucketName := bucketCommand.String("name", "", "bucket name")
|
bucketName := bucketCommand.String("name", "", "bucket name")
|
||||||
operationName := bucketCommand.String("op", "set", "operation name [set|remove|enable|disable]")
|
operationName := bucketCommand.String("op", "set", "operation name [set|get|remove|enable|disable]")
|
||||||
sizeMB := bucketCommand.Int64("sizeMB", 0, "bucket quota size in MiB")
|
sizeMB := bucketCommand.Int64("sizeMB", 0, "bucket quota size in MiB")
|
||||||
if err = bucketCommand.Parse(args); err != nil {
|
if err = bucketCommand.Parse(args); err != nil {
|
||||||
return nil
|
return nil
|
||||||
@@ -64,6 +64,9 @@ func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer
|
|||||||
switch *operationName {
|
switch *operationName {
|
||||||
case "set":
|
case "set":
|
||||||
bucketEntry.Quota = *sizeMB * 1024 * 1024
|
bucketEntry.Quota = *sizeMB * 1024 * 1024
|
||||||
|
case "get":
|
||||||
|
fmt.Fprintf(writer, "bucket quota: %dMiB \n", bucketEntry.Quota/1024/1024)
|
||||||
|
return nil
|
||||||
case "remove":
|
case "remove":
|
||||||
bucketEntry.Quota = 0
|
bucketEntry.Quota = 0
|
||||||
case "enable":
|
case "enable":
|
||||||
|
Reference in New Issue
Block a user