diff --git a/README.md b/README.md index 2411723f..e4fa9068 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ policy manage anonymous access to buckets and objects tag manage tags for bucket(s) and object(s) lock manage default bucket object lock configuration ilm manage bucket lifecycle -versioning manage bucket versioning -replicate manage bucket replication +version manage bucket versioning +replicate configure server side bucket replication admin manage MinIO servers update update mc to latest release ``` diff --git a/cmd/auto-complete.go b/cmd/auto-complete.go index 64e089f6..bf45e775 100644 --- a/cmd/auto-complete.go +++ b/cmd/auto-complete.go @@ -266,9 +266,9 @@ var completeCmds = map[string]complete.Predictor{ "/tag/remove": s3Completer, "/tag/set": s3Completer, - "/versioning/info": s3Complete{deepLevel: 2}, - "/versioning/enable": s3Complete{deepLevel: 2}, - "/versioning/suspend": s3Complete{deepLevel: 2}, + "/version/info": s3Complete{deepLevel: 2}, + "/version/enable": s3Complete{deepLevel: 2}, + "/version/suspend": s3Complete{deepLevel: 2}, "/lock/compliance": s3Completer, "/lock/governance": s3Completer, diff --git a/cmd/client-fs.go b/cmd/client-fs.go index 494de9ed..42e66c6d 100644 --- a/cmd/client-fs.go +++ b/cmd/client-fs.go @@ -1130,18 +1130,18 @@ func (f *fsClient) SetLifecycle(ctx context.Context, _ *lifecycle.Configuration) }) } -// Get versioning info for a bucket, not implemented. -func (f *fsClient) GetVersioning(ctx context.Context) (minio.BucketVersioningConfiguration, *probe.Error) { +// Get version info for a bucket, not implemented. +func (f *fsClient) GetVersion(ctx context.Context) (minio.BucketVersioningConfiguration, *probe.Error) { return minio.BucketVersioningConfiguration{}, probe.NewError(APINotImplemented{ - API: "GetVersioning", + API: "GetVersion", APIType: "filesystem", }) } -// SetVersioning - Set versioning configuration on a bucket, not implemented -func (f *fsClient) SetVersioning(ctx context.Context, status string) *probe.Error { +// SetVersion - Set version configuration on a bucket, not implemented +func (f *fsClient) SetVersion(ctx context.Context, status string) *probe.Error { return probe.NewError(APINotImplemented{ - API: "SetVersioning", + API: "SetVersion", APIType: "filesystem", }) } diff --git a/cmd/client-s3.go b/cmd/client-s3.go index d900ae60..5870fa5f 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -2393,8 +2393,8 @@ func (c *S3Client) SetLifecycle(ctx context.Context, config *lifecycle.Configura return nil } -// GetVersioning - gets bucket versioning info. -func (c *S3Client) GetVersioning(ctx context.Context) (config minio.BucketVersioningConfiguration, err *probe.Error) { +// GetVersion - gets bucket version info. +func (c *S3Client) GetVersion(ctx context.Context) (config minio.BucketVersioningConfiguration, err *probe.Error) { bucket, _ := c.url2BucketAndObject() if bucket == "" { return config, probe.NewError(BucketNameEmpty{}) @@ -2408,8 +2408,8 @@ func (c *S3Client) GetVersioning(ctx context.Context) (config minio.BucketVersio return config, nil } -// SetVersioning - Set versioning configuration on a bucket -func (c *S3Client) SetVersioning(ctx context.Context, status string) *probe.Error { +// SetVersion - Set version configuration on a bucket +func (c *S3Client) SetVersion(ctx context.Context, status string) *probe.Error { bucket, _ := c.url2BucketAndObject() if bucket == "" { return probe.NewError(BucketNameEmpty{}) diff --git a/cmd/client.go b/cmd/client.go index e3f101e1..16368e16 100644 --- a/cmd/client.go +++ b/cmd/client.go @@ -137,8 +137,8 @@ type Client interface { SetLifecycle(ctx context.Context, config *lifecycle.Configuration) *probe.Error // Versioning operations - GetVersioning(ctx context.Context) (minio.BucketVersioningConfiguration, *probe.Error) - SetVersioning(ctx context.Context, status string) *probe.Error + GetVersion(ctx context.Context) (minio.BucketVersioningConfiguration, *probe.Error) + SetVersion(ctx context.Context, status string) *probe.Error // Replication operations GetReplication(ctx context.Context) (replication.Config, *probe.Error) SetReplication(ctx context.Context, cfg *replication.Config, opts replication.Options) *probe.Error diff --git a/cmd/main.go b/cmd/main.go index 8256ac67..3cb3169b 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -339,7 +339,7 @@ var appCmds = []cli.Command{ legalHoldCmd, diffCmd, rmCmd, - versioningCmd, + versionCmd, bucketLockCmd, bucketILMCmd, encryptCmd, diff --git a/cmd/replicate-main.go b/cmd/replicate-main.go index 978407b0..9f17e819 100644 --- a/cmd/replicate-main.go +++ b/cmd/replicate-main.go @@ -20,7 +20,7 @@ import "github.com/minio/cli" var replicateCmd = cli.Command{ Name: "replicate", - Usage: "manage bucket server side replication", + Usage: "configure server side bucket replication", HideHelpCommand: true, Action: mainReplicate, Before: setGlobalsFromContext, diff --git a/cmd/versioning-enable.go b/cmd/version-enable.go similarity index 83% rename from cmd/versioning-enable.go rename to cmd/version-enable.go index a5da3857..1a2ca054 100644 --- a/cmd/versioning-enable.go +++ b/cmd/version-enable.go @@ -27,10 +27,10 @@ import ( "github.com/minio/minio/pkg/console" ) -var versioningEnableCmd = cli.Command{ +var versionEnableCmd = cli.Command{ Name: "enable", Usage: "Enable bucket versioning", - Action: mainVersioningEnable, + Action: mainVersionEnable, Before: setGlobalsFromContext, Flags: globalFlags, CustomHelpTemplate: `NAME: @@ -47,8 +47,8 @@ EXAMPLES: `, } -// checkVersioningEnableSyntax - validate all the passed arguments -func checkVersioningEnableSyntax(ctx *cli.Context) { +// checkVersionEnableSyntax - validate all the passed arguments +func checkVersionEnableSyntax(ctx *cli.Context) { if len(ctx.Args()) != 1 { cli.ShowCommandHelpAndExit(ctx, "enable", 1) // last argument is exit code } @@ -75,13 +75,13 @@ func (v versionEnableMessage) String() string { return console.Colorize("versionEnableMessage", fmt.Sprintf("%s versioning is enabled", v.URL)) } -func mainVersioningEnable(cliCtx *cli.Context) error { - ctx, cancelVersioningEnable := context.WithCancel(globalContext) - defer cancelVersioningEnable() +func mainVersionEnable(cliCtx *cli.Context) error { + ctx, cancelVersionEnable := context.WithCancel(globalContext) + defer cancelVersionEnable() console.SetColor("versionEnableMessage", color.New(color.FgGreen)) - checkVersioningEnableSyntax(cliCtx) + checkVersionEnableSyntax(cliCtx) // Get the alias parameter from cli args := cliCtx.Args() @@ -89,7 +89,7 @@ func mainVersioningEnable(cliCtx *cli.Context) error { // Create a new Client client, err := newClient(aliasedURL) fatalIf(err, "Unable to initialize connection.") - fatalIf(client.SetVersioning(ctx, "enable"), "Cannot enable versioning") + fatalIf(client.SetVersion(ctx, "enable"), "Cannot enable versioning") printMsg(versionEnableMessage{ Op: "enable", Status: "success", diff --git a/cmd/versioning-info.go b/cmd/version-info.go similarity index 87% rename from cmd/versioning-info.go rename to cmd/version-info.go index 2d02c5c6..c624a53f 100644 --- a/cmd/versioning-info.go +++ b/cmd/version-info.go @@ -28,10 +28,10 @@ import ( "github.com/minio/minio/pkg/console" ) -var versioningInfoCmd = cli.Command{ +var versionInfoCmd = cli.Command{ Name: "info", Usage: "Show bucket versioning status", - Action: mainVersioningInfo, + Action: mainVersionInfo, Before: setGlobalsFromContext, Flags: globalFlags, CustomHelpTemplate: `NAME: @@ -49,8 +49,8 @@ EXAMPLES: `, } -// checkVersioningInfoSyntax - validate all the passed arguments -func checkVersioningInfoSyntax(ctx *cli.Context) { +// checkVersionInfoSyntax - validate all the passed arguments +func checkVersionInfoSyntax(ctx *cli.Context) { if len(ctx.Args()) != 1 { cli.ShowCommandHelpAndExit(ctx, "info", 1) // last argument is exit code } @@ -77,20 +77,20 @@ func (v versioningInfoMessage) String() string { msg := "" switch v.Versioning.Status { case "": - msg = fmt.Sprintf("%s is un-versioninged", v.URL) + msg = fmt.Sprintf("%s is un-versioned", v.URL) default: msg = fmt.Sprintf("%s versioning status is %s", v.URL, strings.ToLower(v.Versioning.Status)) } return console.Colorize("versioningInfoMessage", msg) } -func mainVersioningInfo(cliCtx *cli.Context) error { +func mainVersionInfo(cliCtx *cli.Context) error { ctx, cancelVersioningInfo := context.WithCancel(globalContext) defer cancelVersioningInfo() console.SetColor("versioningInfoMessage", color.New(color.FgGreen)) - checkVersioningInfoSyntax(cliCtx) + checkVersionInfoSyntax(cliCtx) // Get the alias parameter from cli args := cliCtx.Args() @@ -98,7 +98,7 @@ func mainVersioningInfo(cliCtx *cli.Context) error { // Create a new Client client, err := newClient(aliasedURL) fatalIf(err, "Unable to initialize connection.") - vConfig, e := client.GetVersioning(ctx) + vConfig, e := client.GetVersion(ctx) fatalIf(e, "Cannot get versioning info") vMsg := versioningInfoMessage{ Op: "info", diff --git a/cmd/versioning-main.go b/cmd/version-main.go similarity index 77% rename from cmd/versioning-main.go rename to cmd/version-main.go index 6318356d..d824d15c 100644 --- a/cmd/versioning-main.go +++ b/cmd/version-main.go @@ -18,22 +18,22 @@ package cmd import "github.com/minio/cli" -var versioningCmd = cli.Command{ - Name: "versioning", +var versionCmd = cli.Command{ + Name: "version", Usage: "manage bucket versioning", HideHelpCommand: true, - Action: mainVersioning, + Action: mainVersion, Before: setGlobalsFromContext, Flags: globalFlags, Subcommands: []cli.Command{ - versioningEnableCmd, - versioningSuspendCmd, - versioningInfoCmd, + versionEnableCmd, + versionSuspendCmd, + versionInfoCmd, }, } -// mainVersioning is the handle for "mc versioning" command. -func mainVersioning(ctx *cli.Context) error { +// mainVersion is the handle for "mc version" command. +func mainVersion(ctx *cli.Context) error { cli.ShowCommandHelp(ctx, ctx.Args().First()) return nil // Sub-commands like "info", "enable", "suspend" have their own main. diff --git a/cmd/versioning-suspend.go b/cmd/version-suspend.go similarity index 83% rename from cmd/versioning-suspend.go rename to cmd/version-suspend.go index b72105fd..7f260e46 100644 --- a/cmd/versioning-suspend.go +++ b/cmd/version-suspend.go @@ -27,10 +27,10 @@ import ( "github.com/minio/minio/pkg/console" ) -var versioningSuspendCmd = cli.Command{ +var versionSuspendCmd = cli.Command{ Name: "suspend", Usage: "Suspend bucket versioning", - Action: mainVersioningSuspend, + Action: mainVersionSuspend, Before: setGlobalsFromContext, Flags: globalFlags, CustomHelpTemplate: `NAME: @@ -47,8 +47,8 @@ EXAMPLES: `, } -// checkVersioningSuspendSyntax - validate all the passed arguments -func checkVersioningSuspendSyntax(ctx *cli.Context) { +// checkVersionSuspendSyntax - validate all the passed arguments +func checkVersionSuspendSyntax(ctx *cli.Context) { if len(ctx.Args()) != 1 { cli.ShowCommandHelpAndExit(ctx, "suspend", 1) // last argument is exit code } @@ -75,13 +75,13 @@ func (v versionSuspendMessage) String() string { return console.Colorize("versionSuspendMessage", fmt.Sprintf("%s versioning is suspended", v.URL)) } -func mainVersioningSuspend(cliCtx *cli.Context) error { - ctx, cancelVersioningSuspend := context.WithCancel(globalContext) - defer cancelVersioningSuspend() +func mainVersionSuspend(cliCtx *cli.Context) error { + ctx, cancelVersionSuspend := context.WithCancel(globalContext) + defer cancelVersionSuspend() console.SetColor("versionSuspendMessage", color.New(color.FgGreen)) - checkVersioningSuspendSyntax(cliCtx) + checkVersionSuspendSyntax(cliCtx) // Get the alias parameter from cli args := cliCtx.Args() @@ -89,7 +89,7 @@ func mainVersioningSuspend(cliCtx *cli.Context) error { // Create a new Client client, err := newClient(aliasedURL) fatalIf(err, "Unable to initialize connection.") - fatalIf(client.SetVersioning(ctx, "suspend"), "Cannot suspend versioning") + fatalIf(client.SetVersion(ctx, "suspend"), "Cannot suspend versioning") printMsg(versionSuspendMessage{ Op: "suspend", Status: "success", diff --git a/docs/minio-client-complete-guide.md b/docs/minio-client-complete-guide.md index ab031437..37e06feb 100644 --- a/docs/minio-client-complete-guide.md +++ b/docs/minio-client-complete-guide.md @@ -23,7 +23,7 @@ retention set retention for object(s) legalhold set legal hold for object(s) diff list differences in object name, size, and date between two buckets rm remove objects -versioning manage bucket versioning +version manage bucket versioning lock manage default bucket object lock configuration ilm manage bucket lifecycle encrypt manage bucket encryption config @@ -31,7 +31,7 @@ event manage object notifications watch listen for object notification events policy manage anonymous access to buckets and objects tag manage tags for bucket(s) and object(s) -replicate manage bucket server side replication +replicate configure server side bucket replication admin manage MinIO servers update update mc to latest release ``` @@ -1504,16 +1504,16 @@ Metadata : Content-Type: application/octet-stream ``` - -### Command `versioning` -`versioning` manage bucket versioning + +### Command `version` +`version` manage bucket versioning ``` NAME: - mc versioning - manage bucket versioning + mc version - manage bucket versioning USAGE: - mc versioning TARGET [enable | suspend | info] + mc version TARGET [enable | suspend | info] COMMANDS: enable Enable bucket versioning @@ -1524,20 +1524,20 @@ COMMANDS: *Example: Enable versioning on bucket `mybucket`* ``` -mc versioning enable myminio/mybucket +mc version enable myminio/mybucket myminio/mybucket versioning is enabled ``` -*Example: Display the versioning configuration for bucket `mybucket`* +*Example: Display the version configuration for bucket `mybucket`* ``` -mc versioning info myminio/mybucket +mc version info myminio/mybucket myminio/mybucket versioning status is enabled ``` *Example: Suspend versioning for bucket `mybucket`* ``` -mc versioning suspend myminio/mybucket +mc version suspend myminio/mybucket myminio/mybucket versioning is suspended ```