Merge branch 'master' into support_ssd_volume

This commit is contained in:
Chris Lu
2020-12-22 17:44:52 -08:00
24 changed files with 739 additions and 301 deletions

View File

@@ -88,7 +88,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
// check collection
if *collection != "" && strings.HasPrefix(*locationPrefix, "/buckets/") {
return fmt.Errorf("one s3 bucket goes to one collection and not customizable.")
return fmt.Errorf("one s3 bucket goes to one collection and not customizable")
}
// check replication

View File

@@ -12,29 +12,29 @@ import (
)
func init() {
Commands = append(Commands, &commandBucketCreate{})
Commands = append(Commands, &commandS3BucketCreate{})
}
type commandBucketCreate struct {
type commandS3BucketCreate struct {
}
func (c *commandBucketCreate) Name() string {
return "bucket.create"
func (c *commandS3BucketCreate) Name() string {
return "s3.bucket.create"
}
func (c *commandBucketCreate) Help() string {
func (c *commandS3BucketCreate) Help() string {
return `create a bucket with a given name
Example:
bucket.create -name <bucket_name> -replication 001
s3.bucket.create -name <bucket_name> -replication 001
`
}
func (c *commandBucketCreate) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
func (c *commandS3BucketCreate) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
bucketName := bucketCommand.String("name", "", "bucket name")
replication := bucketCommand.String("replication", "", "replication setting for the bucket")
replication := bucketCommand.String("replication", "", "replication setting for the bucket, if not set it will honor the setting defined by the filer or master")
if err = bucketCommand.Parse(args); err != nil {
return nil
}

View File

@@ -9,24 +9,24 @@ import (
)
func init() {
Commands = append(Commands, &commandBucketDelete{})
Commands = append(Commands, &commandS3BucketDelete{})
}
type commandBucketDelete struct {
type commandS3BucketDelete struct {
}
func (c *commandBucketDelete) Name() string {
return "bucket.delete"
func (c *commandS3BucketDelete) Name() string {
return "s3.bucket.delete"
}
func (c *commandBucketDelete) Help() string {
func (c *commandS3BucketDelete) Help() string {
return `delete a bucket by a given name
bucket.delete -name <bucket_name>
s3.bucket.delete -name <bucket_name>
`
}
func (c *commandBucketDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
func (c *commandS3BucketDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
bucketName := bucketCommand.String("name", "", "bucket name")

View File

@@ -11,23 +11,23 @@ import (
)
func init() {
Commands = append(Commands, &commandBucketList{})
Commands = append(Commands, &commandS3BucketList{})
}
type commandBucketList struct {
type commandS3BucketList struct {
}
func (c *commandBucketList) Name() string {
return "bucket.list"
func (c *commandS3BucketList) Name() string {
return "s3.bucket.list"
}
func (c *commandBucketList) Help() string {
func (c *commandS3BucketList) Help() string {
return `list all buckets
`
}
func (c *commandBucketList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
func (c *commandS3BucketList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
if err = bucketCommand.Parse(args); err != nil {