From 8cf4c57a6c93058161bde4d406b6ca6444e772f3 Mon Sep 17 00:00:00 2001 From: Alex Aizman Date: Wed, 3 Jan 2024 19:49:57 -0500 Subject: [PATCH] follow-up Signed-off-by: Alex Aizman --- cmd/cli/cli/bucket_hdlr.go | 29 +++++++++++++++++++---------- cmd/cli/cli/const.go | 14 +++++++++----- cmd/cli/go.mod | 2 +- cmd/cli/go.sum | 4 ++-- cmn/tests/iter_fields_test.go | 2 ++ 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/cmd/cli/cli/bucket_hdlr.go b/cmd/cli/cli/bucket_hdlr.go index 3f086352722..d41d7bdb457 100644 --- a/cmd/cli/cli/bucket_hdlr.go +++ b/cmd/cli/cli/bucket_hdlr.go @@ -184,6 +184,24 @@ var ( Action: mvBucketHandler, BashComplete: manyBucketsCompletions([]cli.BashCompleteFunc{}, 0, 2), } + bucketCmdSetProps = cli.Command{ + Name: cmdSetBprops, + Usage: "update bucket properties; the command accepts both JSON-formatted input and plain Name=Value pairs, e.g.:\n" + + indent1 + "\t* ais bucket props set ais://nnn backend_bck=s3://mmm\n" + + indent1 + "\t* ais bucket props set ais://nnn backend_bck=none\n" + + indent1 + "\t* ais bucket props set gs://vvv versioning.validate_warm_get=false versioning.sync_warm_get=true\n" + + indent1 + "\t* ais bucket props set gs://vvv mirror.enabled=true mirror.copies=4 checksum.type=md5\n" + + indent1 + "\t* ais bucket props set s3://mmm ec.enabled true ec.data_slices 6 ec.parity_slices 4 --force\n" + + indent1 + "\tReferences:\n" + + indent1 + "\t* for details and many more examples, see docs/cli/bucket.md\n" + + indent1 + "\t* to show bucket properties (names and current values), use 'ais bucket show'", + ArgsUsage: bucketPropsArgument, + Flags: bucketCmdsFlags[cmdSetBprops], + Action: setPropsHandler, + BashComplete: bucketCompletions( + bcmplop{additionalCompletions: []cli.BashCompleteFunc{bpropCompletions}}, + ), + } bucketCmd = cli.Command{ Name: commandBucket, @@ -218,16 +236,7 @@ var ( Usage: "show, update or reset bucket properties", Action: showBckPropsHandler, Subcommands: []cli.Command{ - { - Name: cmdSetBprops, - Usage: "update bucket properties", - ArgsUsage: bucketPropsArgument, - Flags: bucketCmdsFlags[cmdSetBprops], - Action: setPropsHandler, - BashComplete: bucketCompletions( - bcmplop{additionalCompletions: []cli.BashCompleteFunc{bpropCompletions}}, - ), - }, + bucketCmdSetProps, { Name: cmdResetBprops, Usage: "reset bucket properties", diff --git a/cmd/cli/cli/const.go b/cmd/cli/cli/const.go index ffdc20f0d72..e9c4943afb8 100644 --- a/cmd/cli/cli/const.go +++ b/cmd/cli/cli/const.go @@ -474,20 +474,24 @@ var ( latestVersionFlag = cli.BoolFlag{ Name: "latest", Usage: "GET, prefetch, or copy the latest object version from the associated remote bucket;\n" + - indent1 + "\tallows operation-level control without changing bucket configuration\n" + - indent1 + "\t(see also: 'ais bucket props ... versioning.validate_warm_get')", + indent1 + "\tallows operation-level control over object version synchronization _without_ changing bucket configuration\n" + + indent1 + "\t(the latter can be done using 'ais bucket props set BUCKET versioning')", } averageSizeFlag = cli.BoolFlag{Name: "average-size", Usage: "show average GET, PUT, etc. request size"} ignoreErrorFlag = cli.BoolFlag{ Name: "ignore-error", - Usage: "ignore \"soft\" failures, such as \"bucket already exists\", etc.", + Usage: "ignore \"soft\" failures such as \"bucket already exists\", etc.", } bucketPropsFlag = cli.StringFlag{ - Name: "props", - Usage: "bucket properties, e.g. --props=\"mirror.enabled=true mirror.copies=4 checksum.type=md5\"", + Name: "props", + Usage: "create bucket with the specified (non-default) properties, e.g.:\n" + + indent1 + "\t* ais create ais://mmm --props=\"versioning.validate_warm_get=false versioning.sync_warm_get=true\"\n" + + indent1 + "\t* ais create ais://nnn --props='mirror.enabled=true mirror.copies=4 checksum.type=md5'\n" + + indent1 + "\t(tip: use '--props' to override properties that a new bucket inherits from cluster config at creation time;\n" + + indent1 + "\t see also: 'ais bucket props show' and 'ais bucket props set')", } forceFlag = cli.BoolFlag{Name: "force,f", Usage: "force an action"} diff --git a/cmd/cli/go.mod b/cmd/cli/go.mod index e2b9a40fbb8..62b9843c86d 100644 --- a/cmd/cli/go.mod +++ b/cmd/cli/go.mod @@ -4,7 +4,7 @@ go 1.21 // direct require ( - github.com/NVIDIA/aistore v1.3.22-0.20240103194416-6c392663de57 + github.com/NVIDIA/aistore v1.3.22-0.20240103204855-931b61196f9d github.com/fatih/color v1.16.0 github.com/json-iterator/go v1.1.12 github.com/onsi/ginkgo v1.16.5 diff --git a/cmd/cli/go.sum b/cmd/cli/go.sum index 4139ca9f410..445b2f7efd3 100644 --- a/cmd/cli/go.sum +++ b/cmd/cli/go.sum @@ -1,7 +1,7 @@ code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/NVIDIA/aistore v1.3.22-0.20240103194416-6c392663de57 h1:MVioJtJDm3Jvtx/AuSIW8lxdzBMxWHBfUDfIto+M0eA= -github.com/NVIDIA/aistore v1.3.22-0.20240103194416-6c392663de57/go.mod h1:jpWmGuqxnY+akx81S5eqHhGdgSENm0mVYRrVbpCW4/I= +github.com/NVIDIA/aistore v1.3.22-0.20240103204855-931b61196f9d h1:egELPvC4dg42ASwZSe93f46e5HSBFLeFbIcyuBY/JRk= +github.com/NVIDIA/aistore v1.3.22-0.20240103204855-931b61196f9d/go.mod h1:jpWmGuqxnY+akx81S5eqHhGdgSENm0mVYRrVbpCW4/I= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= diff --git a/cmn/tests/iter_fields_test.go b/cmn/tests/iter_fields_test.go index e849ac7851d..afa41b62557 100644 --- a/cmn/tests/iter_fields_test.go +++ b/cmn/tests/iter_fields_test.go @@ -79,6 +79,7 @@ var _ = Describe("IterFields", func() { "versioning.enabled": false, "versioning.validate_warm_get": false, + "versioning.sync_warm_get": false, "checksum.type": cos.ChecksumXXHash, "checksum.validate_warm_get": false, @@ -134,6 +135,7 @@ var _ = Describe("IterFields", func() { "versioning.enabled": (*bool)(nil), "versioning.validate_warm_get": (*bool)(nil), + "versioning.sync_warm_get": (*bool)(nil), "checksum.type": apc.String(cos.ChecksumXXHash), "checksum.validate_warm_get": (*bool)(nil),