rename all 'cannot' messages to 'unable to' (#3388)
This commit is contained in:
@@ -81,24 +81,24 @@ var adminBucketQuotaCmd = cli.Command{
|
||||
Flags: append(adminQuotaFlags, globalFlags...),
|
||||
CustomHelpTemplate: `NAME:
|
||||
{{.HelpName}} - {{.Usage}}
|
||||
|
||||
|
||||
USAGE:
|
||||
{{.HelpName}} TARGET [--fifo QUOTA | --hard QUOTA | --clear]
|
||||
|
||||
|
||||
QUOTA
|
||||
quota accepts human-readable case-insensitive number
|
||||
suffixes such as "k", "m", "g" and "t" referring to the metric units KB,
|
||||
MB, GB and TB respectively. Adding an "i" to these prefixes, uses the IEC
|
||||
units, so that "gi" refers to "gibibyte" or "GiB". A "b" at the end is
|
||||
also accepted. Without suffixes the unit is bytes.
|
||||
|
||||
|
||||
FLAGS:
|
||||
{{range .VisibleFlags}}{{.}}
|
||||
{{end}}
|
||||
EXAMPLES:
|
||||
1. Display bucket quota configured for "mybucket" on MinIO.
|
||||
{{.Prompt}} {{.HelpName}} myminio/mybucket
|
||||
|
||||
|
||||
2. Set FIFO quota for a bucket "mybucket" on MinIO.
|
||||
{{.Prompt}} {{.HelpName}} myminio/mybucket --fifo 10GB
|
||||
|
||||
@@ -113,7 +113,7 @@ EXAMPLES:
|
||||
// checkAdminBucketQuotaSyntax - validate all the passed arguments
|
||||
func checkAdminBucketQuotaSyntax(ctx *cli.Context) {
|
||||
if len(ctx.Args()) == 0 || len(ctx.Args()) > 1 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "quota", 1) // last argument is exit code
|
||||
cli.ShowCommandHelpAndExit(ctx, ctx.Command.Name, 1) // last argument is exit code
|
||||
}
|
||||
|
||||
if ctx.IsSet("hard") && ctx.IsSet("fifo") {
|
||||
|
||||
@@ -91,7 +91,7 @@ EXAMPLES:
|
||||
func checkAdminBucketRemoteAddSyntax(ctx *cli.Context) {
|
||||
argsNr := len(ctx.Args())
|
||||
if argsNr < 2 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "add", 1) // last argument is exit code
|
||||
cli.ShowCommandHelpAndExit(ctx, ctx.Command.Name, 1) // last argument is exit code
|
||||
}
|
||||
if argsNr > 2 {
|
||||
fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...),
|
||||
@@ -215,11 +215,11 @@ func mainAdminBucketRemoteAdd(ctx *cli.Context) error {
|
||||
sourceBucket, bktTarget := fetchRemoteTarget(ctx)
|
||||
arn, e := client.SetRemoteTarget(globalContext, sourceBucket, bktTarget)
|
||||
if e != nil {
|
||||
fatalIf(probe.NewError(e), "Cannot add new Remote target")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to configure remote target")
|
||||
}
|
||||
|
||||
printMsg(RemoteMessage{
|
||||
op: "add",
|
||||
op: ctx.Command.Name,
|
||||
TargetURL: bktTarget.URL(),
|
||||
TargetBucket: bktTarget.TargetBucket,
|
||||
AccessKey: bktTarget.Credentials.AccessKey,
|
||||
|
||||
@@ -63,7 +63,7 @@ EXAMPLES:
|
||||
// checkAdminBucketRemoteListSyntax - validate all the passed arguments
|
||||
func checkAdminBucketRemoteListSyntax(ctx *cli.Context) {
|
||||
if len(ctx.Args()) != 1 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "ls", 1) // last argument is exit code
|
||||
cli.ShowCommandHelpAndExit(ctx, ctx.Command.Name, 1) // last argument is exit code
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ func mainAdminBucketRemoteList(ctx *cli.Context) error {
|
||||
|
||||
// Additional command specific theme customization.
|
||||
console.SetColor("RemoteListMessage", color.New(color.Bold, color.FgHiGreen))
|
||||
console.SetColor("RemoteListEmpty", color.New(color.FgRed))
|
||||
console.SetColor("RemoteListEmpty", color.New(color.FgYellow))
|
||||
console.SetColor("SourceBucket", color.New(color.FgYellow))
|
||||
console.SetColor("TargetBucket", color.New(color.FgYellow))
|
||||
console.SetColor("TargetURL", color.New(color.FgHiWhite))
|
||||
@@ -88,14 +88,13 @@ func mainAdminBucketRemoteList(ctx *cli.Context) error {
|
||||
// Create a new MinIO Admin Client
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
svcType := ctx.String("service")
|
||||
targets, e := client.ListRemoteTargets(globalContext, sourceBucket, svcType)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot list remote target(s)")
|
||||
printRemotes(aliasedURL, targets)
|
||||
targets, e := client.ListRemoteTargets(globalContext, sourceBucket, ctx.String("service"))
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to list remote target")
|
||||
printRemotes(ctx, aliasedURL, targets)
|
||||
return nil
|
||||
}
|
||||
|
||||
func printRemotes(urlStr string, targets []madmin.BucketTarget) {
|
||||
func printRemotes(ctx *cli.Context, urlStr string, targets []madmin.BucketTarget) {
|
||||
|
||||
maxURLLen := 10
|
||||
maxTgtLen := 6
|
||||
@@ -103,7 +102,7 @@ func printRemotes(urlStr string, targets []madmin.BucketTarget) {
|
||||
|
||||
if !globalJSON {
|
||||
if len(targets) == 0 {
|
||||
console.Print(console.Colorize("RemoteListEmpty", fmt.Sprintf("No remote targets found for`%s`. \n", urlStr)))
|
||||
console.Print(console.Colorize("RemoteListEmpty", fmt.Sprintf("No remote targets found for `%s`. \n", urlStr)))
|
||||
return
|
||||
}
|
||||
for _, t := range targets {
|
||||
@@ -139,7 +138,7 @@ func printRemotes(urlStr string, targets []madmin.BucketTarget) {
|
||||
}
|
||||
|
||||
printMsg(RemoteMessage{
|
||||
op: "ls",
|
||||
op: ctx.Command.Name,
|
||||
AccessKey: target.Credentials.AccessKey,
|
||||
TargetBucket: target.TargetBucket,
|
||||
TargetURL: targetURL,
|
||||
|
||||
@@ -47,7 +47,7 @@ FLAGS:
|
||||
EXAMPLES:
|
||||
1. Remove existing remote target with arn "arn:minio:replication:us-west-1:993bc6b6-accd-45e3-884f-5f3e652aed2a:dest1"
|
||||
for bucket srcbucket on MinIO server.
|
||||
{{.Prompt}} {{.HelpName}} myminio/srcbucket --arn "arn:minio:replication:us-west-1:993bc6b6-accd-45e3-884f-5f3e652aed2a:dest1"
|
||||
{{.Prompt}} {{.HelpName}} myminio/srcbucket --arn "arn:minio:replication:us-west-1:993bc6b6-accd-45e3-884f-5f3e652aed2a:dest1"
|
||||
`,
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ EXAMPLES:
|
||||
func checkAdminBucketRemoteRemoveSyntax(ctx *cli.Context) {
|
||||
|
||||
if len(ctx.Args()) != 1 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "rm", 1) // last argument is exit code
|
||||
cli.ShowCommandHelpAndExit(ctx, ctx.Command.Name, 1) // last argument is exit code
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,19 +70,19 @@ func mainAdminBucketRemoteRemove(ctx *cli.Context) error {
|
||||
aliasedURL := args.Get(0)
|
||||
// Create a new MinIO Admin Client
|
||||
client, cerr := newAdminClient(aliasedURL)
|
||||
fatalIf(cerr, "Unable to initialize admin connection.")
|
||||
fatalIf(cerr.Trace(aliasedURL), "Unable to initialize admin connection.")
|
||||
_, sourceBucket := url2Alias(args[0])
|
||||
if sourceBucket == "" {
|
||||
fatalIf(errInvalidArgument(), "Source bucket not specified in `"+args[0]+"`.")
|
||||
}
|
||||
arn := ctx.String("arn")
|
||||
if arn == "" {
|
||||
fatalIf(errInvalidArgument(), "Arn needs to be specified.")
|
||||
fatalIf(errInvalidArgument(), "ARN needs to be specified.")
|
||||
}
|
||||
fatalIf(probe.NewError(client.RemoveRemoteTarget(globalContext, sourceBucket, arn)).Trace(args...), "Cannot remove Remote target")
|
||||
fatalIf(probe.NewError(client.RemoveRemoteTarget(globalContext, sourceBucket, arn)).Trace(args...), "Unable to remove remote target")
|
||||
|
||||
printMsg(RemoteMessage{
|
||||
op: "rm",
|
||||
op: ctx.Command.Name,
|
||||
SourceBucket: sourceBucket,
|
||||
RemoteARN: arn,
|
||||
})
|
||||
|
||||
@@ -84,7 +84,7 @@ func mainAdminConfigExport(ctx *cli.Context) error {
|
||||
|
||||
// Call get config API
|
||||
buf, e := client.GetConfig(globalContext)
|
||||
fatalIf(probe.NewError(e), "Cannot get server config")
|
||||
fatalIf(probe.NewError(e), "Unable to get server config")
|
||||
|
||||
// Print
|
||||
printMsg(configExportMessage{
|
||||
|
||||
@@ -96,7 +96,7 @@ func mainAdminConfigGet(ctx *cli.Context) error {
|
||||
if len(ctx.Args()) == 1 {
|
||||
// Call get config API
|
||||
hr, e := client.HelpConfigKV(globalContext, "", "", false)
|
||||
fatalIf(probe.NewError(e), "Cannot get help for the sub-system")
|
||||
fatalIf(probe.NewError(e), "Unable to get help for the sub-system")
|
||||
|
||||
// Print
|
||||
printMsg(configHelpMessage{
|
||||
@@ -109,7 +109,7 @@ func mainAdminConfigGet(ctx *cli.Context) error {
|
||||
|
||||
// Call get config API
|
||||
buf, e := client.GetConfigKV(globalContext, strings.Join(args.Tail(), " "))
|
||||
fatalIf(probe.NewError(e), "Cannot get server '%s' config", args.Tail())
|
||||
fatalIf(probe.NewError(e), "Unable to get server '%s' config", args.Tail())
|
||||
|
||||
// Print
|
||||
printMsg(configGetMessage{
|
||||
|
||||
@@ -66,7 +66,7 @@ func (u configHelpMessage) String() string {
|
||||
} else {
|
||||
e = HelpEnvTemplate.Execute(w, u.Value)
|
||||
}
|
||||
fatalIf(probe.NewError(e), "Cannot initialize template writer")
|
||||
fatalIf(probe.NewError(e), "Unable to initialize template writer")
|
||||
|
||||
w.Flush()
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ func (u configHistoryMessage) String() string {
|
||||
var s strings.Builder
|
||||
w := tabwriter.NewWriter(&s, 1, 8, 2, ' ', 0)
|
||||
e := HistoryTemplate.Execute(w, u.Entries)
|
||||
fatalIf(probe.NewError(e), "Cannot initialize template writer")
|
||||
fatalIf(probe.NewError(e), "Unable to initialize template writer")
|
||||
|
||||
w.Flush()
|
||||
return s.String()
|
||||
@@ -127,7 +127,7 @@ func mainAdminConfigHistory(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
if ctx.IsSet("clear") {
|
||||
fatalIf(probe.NewError(client.ClearConfigHistoryKV(globalContext, "all")), "Cannot clear server configuration.")
|
||||
fatalIf(probe.NewError(client.ClearConfigHistoryKV(globalContext, "all")), "Unable to clear server configuration.")
|
||||
|
||||
// Print
|
||||
printMsg(configHistoryMessage{})
|
||||
@@ -135,7 +135,7 @@ func mainAdminConfigHistory(ctx *cli.Context) error {
|
||||
}
|
||||
|
||||
chEntries, e := client.ListConfigHistoryKV(globalContext, ctx.Int("count"))
|
||||
fatalIf(probe.NewError(e), "Cannot list server history configuration.")
|
||||
fatalIf(probe.NewError(e), "Unable to list server history configuration.")
|
||||
|
||||
hentries := make([]historyEntry, len(chEntries))
|
||||
for i, chEntry := range chEntries {
|
||||
|
||||
@@ -96,7 +96,7 @@ func mainAdminConfigImport(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
// Call set config API
|
||||
fatalIf(probe.NewError(client.SetConfig(globalContext, os.Stdin)), "Cannot set server config")
|
||||
fatalIf(probe.NewError(client.SetConfig(globalContext, os.Stdin)), "Unable to set server config")
|
||||
|
||||
// Print
|
||||
printMsg(configImportMessage{
|
||||
|
||||
@@ -108,7 +108,7 @@ func mainAdminConfigReset(ctx *cli.Context) error {
|
||||
if len(ctx.Args()) == 1 {
|
||||
// Call get config API
|
||||
hr, e := client.HelpConfigKV(globalContext, "", "", ctx.IsSet("env"))
|
||||
fatalIf(probe.NewError(e), "Cannot get help for the sub-system")
|
||||
fatalIf(probe.NewError(e), "Unable to get help for the sub-system")
|
||||
|
||||
// Print
|
||||
printMsg(configHelpMessage{
|
||||
@@ -122,7 +122,7 @@ func mainAdminConfigReset(ctx *cli.Context) error {
|
||||
// Call reset config API
|
||||
input := strings.Join(args.Tail(), " ")
|
||||
fatalIf(probe.NewError(client.DelConfigKV(globalContext, input)),
|
||||
"Cannot reset '%s' on the server", input)
|
||||
"Unable to reset '%s' on the server", input)
|
||||
|
||||
// Print set config result
|
||||
printMsg(configResetMessage{
|
||||
|
||||
@@ -94,7 +94,7 @@ func mainAdminConfigRestore(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
// Call get config API
|
||||
fatalIf(probe.NewError(client.RestoreConfigHistoryKV(globalContext, args.Get(1))), "Cannot restore server configuration.")
|
||||
fatalIf(probe.NewError(client.RestoreConfigHistoryKV(globalContext, args.Get(1))), "Unable to restore server configuration.")
|
||||
|
||||
// Print
|
||||
printMsg(configRestoreMessage{
|
||||
|
||||
@@ -106,7 +106,7 @@ func mainAdminConfigSet(ctx *cli.Context) error {
|
||||
if !strings.Contains(input, madmin.KvSeparator) {
|
||||
// Call get config API
|
||||
hr, e := client.HelpConfigKV(globalContext, args.Get(1), args.Get(2), ctx.IsSet("env"))
|
||||
fatalIf(probe.NewError(e), "Cannot get help for the sub-system")
|
||||
fatalIf(probe.NewError(e), "Unable to get help for the sub-system")
|
||||
|
||||
// Print
|
||||
printMsg(configHelpMessage{
|
||||
@@ -120,7 +120,7 @@ func mainAdminConfigSet(ctx *cli.Context) error {
|
||||
|
||||
// Call set config API
|
||||
fatalIf(probe.NewError(client.SetConfigKV(globalContext, input)),
|
||||
"Cannot set '%s' to server", input)
|
||||
"Unable to set '%s' to server", input)
|
||||
|
||||
// Print set config result
|
||||
printMsg(configSetMessage{
|
||||
|
||||
@@ -192,7 +192,7 @@ func mainAdminConsole(ctx *cli.Context) error {
|
||||
// Create a new MinIO Admin Client
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(aliasedURL), "Cannot initialize admin client.")
|
||||
fatalIf(err.Trace(aliasedURL), "Unable to initialize admin client.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ func mainAdminConsole(ctx *cli.Context) error {
|
||||
logCh := client.GetLogs(ctxt, node, limit, logType)
|
||||
for logInfo := range logCh {
|
||||
if logInfo.Err != nil {
|
||||
fatalIf(probe.NewError(logInfo.Err), "Cannot listen to console logs")
|
||||
fatalIf(probe.NewError(logInfo.Err), "Unable to listen to console logs")
|
||||
}
|
||||
// drop nodeName from output if specified as cli arg
|
||||
if node != "" {
|
||||
|
||||
@@ -131,7 +131,7 @@ func mainAdminGroupAdd(ctx *cli.Context) error {
|
||||
Members: members,
|
||||
IsRemove: false,
|
||||
}
|
||||
fatalIf(probe.NewError(client.UpdateGroupMembers(globalContext, gAddRemove)).Trace(args...), "Cannot add new group")
|
||||
fatalIf(probe.NewError(client.UpdateGroupMembers(globalContext, gAddRemove)).Trace(args...), "Unable to add new group")
|
||||
|
||||
printMsg(groupMessage{
|
||||
op: "add",
|
||||
|
||||
+9
-31
@@ -38,34 +38,34 @@ const (
|
||||
var adminHealFlags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "scan",
|
||||
Usage: "select the healing scan mode (normal/deep)",
|
||||
Usage: "[DEPRECATED] select the healing scan mode (normal/deep)",
|
||||
Value: scanNormalMode,
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "recursive, r",
|
||||
Usage: "heal recursively",
|
||||
Usage: "[DEPRECATED] heal recursively",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "dry-run, n",
|
||||
Usage: "only inspect data, but do not mutate",
|
||||
Usage: "[DEPRECATED] only inspect data, but do not mutate",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "force-start, f",
|
||||
Usage: "force start a new heal sequence",
|
||||
Usage: "[DEPRECATED] force start a new heal sequence",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "force-stop, s",
|
||||
Usage: "force stop a running heal sequence",
|
||||
Usage: "[DEPRECATED] force stop a running heal sequence",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "remove",
|
||||
Usage: "remove dangling objects in heal sequence",
|
||||
Usage: "[DEPRECATED] remove dangling objects in heal sequence",
|
||||
},
|
||||
}
|
||||
|
||||
var adminHealCmd = cli.Command{
|
||||
Name: "heal",
|
||||
Usage: "heal disks, buckets and objects on MinIO server",
|
||||
Usage: "[DEPRECATED] heal disks, buckets and objects on MinIO server",
|
||||
Action: mainAdminHeal,
|
||||
Before: setGlobalsFromContext,
|
||||
Flags: append(adminHealFlags, globalFlags...),
|
||||
@@ -84,29 +84,7 @@ SCAN MODES:
|
||||
deep : Heal objects which are missing or with silent data corruption on one or more disks.
|
||||
|
||||
EXAMPLES:
|
||||
1. To format newly replaced disks in a MinIO server with alias 'myminio'
|
||||
{{.Prompt}} {{.HelpName}} myminio
|
||||
|
||||
2. Heal 'testbucket' in a MinIO server with alias 'myminio'
|
||||
{{.Prompt}} {{.HelpName}} myminio/testbucket/
|
||||
|
||||
3. Heal all objects under 'dir' prefix
|
||||
{{.Prompt}} {{.HelpName}} --recursive myminio/testbucket/dir/
|
||||
|
||||
4. Issue a dry-run heal operation to inspect objects health but not heal them
|
||||
{{.Prompt}} {{.HelpName}} --dry-run myminio
|
||||
|
||||
5. Issue a dry-run heal operation to inspect objects health under 'dir' prefix
|
||||
{{.Prompt}} {{.HelpName}} --recursive --dry-run myminio/testbucket/dir/
|
||||
|
||||
6. Force start a running heal sequence (meaning it will force kill the running heal sequence and start a new one)
|
||||
{{.Prompt}} {{.HelpName}} --force-start myminio/testbucket/dir/
|
||||
|
||||
7. Force stop a running heal sequence (meaning it will force kill the running heal sequence)
|
||||
{{.Prompt}} {{.HelpName}} --force-stop myminio/testbucket/dir/
|
||||
|
||||
8. Issue a dry-run heal operation to inspect objects health under 'dir' prefix
|
||||
{{.Prompt}} {{.HelpName}} --dry-run myminio/testbucket/dir/
|
||||
DEPRECATED
|
||||
`,
|
||||
}
|
||||
|
||||
@@ -207,7 +185,7 @@ func mainAdminHeal(ctx *cli.Context) error {
|
||||
// Create a new MinIO Admin Client
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(aliasedURL), "Cannot initialize admin client.")
|
||||
fatalIf(err.Trace(aliasedURL), "Unable to initialize admin client.")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -78,12 +78,12 @@ type clusterStruct struct {
|
||||
func (u clusterStruct) String() (msg string) {
|
||||
// Check cluster level "Status" field for error
|
||||
if u.Status == "error" {
|
||||
fatal(probe.NewError(errors.New(u.Error)), "Cannot get service status")
|
||||
fatal(probe.NewError(errors.New(u.Error)), "Unable to get service status")
|
||||
}
|
||||
|
||||
// If nothing has been collected, error out
|
||||
if u.Info.Servers == nil {
|
||||
fatal(probe.NewError(errors.New("Cannot get service status")), "")
|
||||
fatal(probe.NewError(errors.New("Unable to get service status")), "")
|
||||
}
|
||||
|
||||
// Initialization
|
||||
|
||||
@@ -54,7 +54,7 @@ func mainAdminKMSKeyStatus(ctx *cli.Context) error {
|
||||
}
|
||||
|
||||
client, err := newAdminClient(ctx.Args().Get(0))
|
||||
fatalIf(err, "Cannot get a configured admin connection.")
|
||||
fatalIf(err, "Unable to get a configured admin connection.")
|
||||
|
||||
var keyID string
|
||||
if len(ctx.Args()) == 2 {
|
||||
|
||||
@@ -73,7 +73,7 @@ func mainAdminPolicyInfo(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection")
|
||||
|
||||
policies, e := client.ListCannedPolicies(globalContext)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot list policy")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to list policy")
|
||||
|
||||
iamp, ok := policies[policyName]
|
||||
if ok {
|
||||
|
||||
@@ -67,7 +67,7 @@ func mainAdminPolicyList(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
policies, e := client.ListCannedPolicies(globalContext)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot list policy")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to list policy")
|
||||
|
||||
for k := range policies {
|
||||
printMsg(userPolicyMessage{
|
||||
|
||||
@@ -68,7 +68,7 @@ func mainAdminPolicyRemove(ctx *cli.Context) error {
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
fatalIf(probe.NewError(client.RemoveCannedPolicy(globalContext, args.Get(1))).Trace(args...), "Cannot remove policy")
|
||||
fatalIf(probe.NewError(client.RemoveCannedPolicy(globalContext, args.Get(1))).Trace(args...), "Unable to remove policy")
|
||||
|
||||
printMsg(userPolicyMessage{
|
||||
op: "remove",
|
||||
|
||||
@@ -113,7 +113,7 @@ func mainAdminPolicySet(ctx *cli.Context) error {
|
||||
IsGroup: isGroup,
|
||||
})
|
||||
} else {
|
||||
fatalIf(probe.NewError(e), "Cannot set the policy")
|
||||
fatalIf(probe.NewError(e), "Unable to set the policy")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ func mainAdminProfileStart(ctx *cli.Context) error {
|
||||
// Create a new MinIO Admin Client
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(aliasedURL), "Cannot initialize admin client.")
|
||||
fatalIf(err.Trace(aliasedURL), "Unable to initialize admin client.")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ func mainAdminProfileStop(ctx *cli.Context) error {
|
||||
// Create a new MinIO Admin Client
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(aliasedURL), "Cannot initialize admin client.")
|
||||
fatalIf(err.Trace(aliasedURL), "Unable to initialize admin client.")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ func mainAdminServiceRestart(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
// Restart the specified MinIO server
|
||||
fatalIf(probe.NewError(client.ServiceRestart(globalContext)), "Cannot restart the server.")
|
||||
fatalIf(probe.NewError(client.ServiceRestart(globalContext)), "Unable to restart the server.")
|
||||
|
||||
// Success..
|
||||
printMsg(serviceRestartCommand{Status: "success", ServerURL: aliasedURL})
|
||||
|
||||
@@ -113,7 +113,7 @@ func mainAdminTopLocks(ctx *cli.Context) error {
|
||||
|
||||
// Call top locks API
|
||||
entries, e := client.TopLocks(globalContext)
|
||||
fatalIf(probe.NewError(e), "Cannot get server locks list.")
|
||||
fatalIf(probe.NewError(e), "Unable to get server locks list.")
|
||||
|
||||
console.SetColor("StaleLock", color.New(color.FgRed, color.Bold))
|
||||
console.SetColor("Lock", color.New(color.FgBlue, color.Bold))
|
||||
|
||||
+2
-2
@@ -115,7 +115,7 @@ func mainAdminTrace(ctx *cli.Context) error {
|
||||
// Create a new MinIO Admin Client
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(aliasedURL), "Cannot initialize admin client.")
|
||||
fatalIf(err.Trace(aliasedURL), "Unable to initialize admin client.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ func mainAdminTrace(ctx *cli.Context) error {
|
||||
traceCh := client.ServiceTrace(ctxt, all, errfltr)
|
||||
for traceInfo := range traceCh {
|
||||
if traceInfo.Err != nil {
|
||||
fatalIf(probe.NewError(traceInfo.Err), "Cannot listen to http trace")
|
||||
fatalIf(probe.NewError(traceInfo.Err), "Unable to listen to http trace")
|
||||
}
|
||||
if verbose {
|
||||
printMsg(traceMessage{traceInfo})
|
||||
|
||||
@@ -180,7 +180,7 @@ func mainAdminUserAdd(ctx *cli.Context) error {
|
||||
client, err := newAdminClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
fatalIf(probe.NewError(client.AddUser(globalContext, accessKey, secretKey)).Trace(args...), "Cannot add new user")
|
||||
fatalIf(probe.NewError(client.AddUser(globalContext, accessKey, secretKey)).Trace(args...), "Unable to add new user")
|
||||
|
||||
printMsg(userMessage{
|
||||
op: "add",
|
||||
|
||||
@@ -67,7 +67,7 @@ func mainAdminUserDisable(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
e := client.SetUserStatus(globalContext, args.Get(1), madmin.AccountDisabled)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot disable user")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to disable user")
|
||||
|
||||
printMsg(userMessage{
|
||||
op: "disable",
|
||||
|
||||
@@ -67,7 +67,7 @@ func mainAdminUserEnable(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
e := client.SetUserStatus(globalContext, args.Get(1), madmin.AccountEnabled)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot enable user")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to enable user")
|
||||
|
||||
printMsg(userMessage{
|
||||
op: "enable",
|
||||
|
||||
@@ -66,7 +66,7 @@ func mainAdminUserInfo(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
user, e := client.GetUserInfo(globalContext, args.Get(1))
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot get user info")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to get user info")
|
||||
|
||||
printMsg(userMessage{
|
||||
op: "info",
|
||||
|
||||
@@ -70,7 +70,7 @@ func mainAdminUserList(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
users, e := client.ListUsers(globalContext)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot list user")
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to list user")
|
||||
|
||||
for k, v := range users {
|
||||
printMsg(userMessage{
|
||||
|
||||
@@ -66,7 +66,7 @@ func mainAdminUserRemove(ctx *cli.Context) error {
|
||||
fatalIf(err, "Unable to initialize admin connection.")
|
||||
|
||||
e := client.RemoveUser(globalContext, args.Get(1))
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Cannot remove %s", args.Get(1))
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to remove %s", args.Get(1))
|
||||
|
||||
printMsg(userMessage{
|
||||
op: "remove",
|
||||
|
||||
+3
-3
@@ -88,17 +88,17 @@ func (m lockCmdMessage) JSON() string {
|
||||
func lock(urlStr string, mode minio.RetentionMode, validity uint64, unit minio.ValidityUnit, op string) error {
|
||||
client, err := newClient(urlStr)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
ctx, cancelLock := context.WithCancel(globalContext)
|
||||
defer cancelLock()
|
||||
if op == "clear" || mode != "" {
|
||||
err = client.SetObjectLockConfig(ctx, mode, validity, unit)
|
||||
fatalIf(err, "Cannot enable object lock configuration on the specified bucket.")
|
||||
fatalIf(err, "Unable to enable object lock configuration on the specified bucket.")
|
||||
} else {
|
||||
mode, validity, unit, err = client.GetObjectLockConfig(ctx)
|
||||
fatalIf(err, "Cannot get object lock configuration on the specified bucket.")
|
||||
fatalIf(err, "Unable to get object lock configuration on the specified bucket.")
|
||||
}
|
||||
|
||||
printMsg(lockCmdMessage{
|
||||
|
||||
@@ -86,7 +86,7 @@ func mainEncryptClear(cliCtx *cli.Context) error {
|
||||
// Create a new Client
|
||||
client, err := newClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize connection.")
|
||||
fatalIf(client.DeleteEncryption(ctx), "Cannot clear auto encryption configuration")
|
||||
fatalIf(client.DeleteEncryption(ctx), "Unable to clear auto encryption configuration")
|
||||
printMsg(encryptClearMessage{
|
||||
Op: "clear",
|
||||
Status: "success",
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ func mainEncryptInfo(cliCtx *cli.Context) error {
|
||||
client, err := newClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize connection.")
|
||||
algorithm, keyID, e := client.GetEncryption(ctx)
|
||||
fatalIf(e, "Cannot get encryption info")
|
||||
fatalIf(e, "Unable to get encryption info")
|
||||
msg := encryptInfoMessage{
|
||||
Op: "info",
|
||||
Status: "success",
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ func mainEncryptSet(cliCtx *cli.Context) error {
|
||||
if algorithm != "sse-s3" && algorithm != "sse-kms" {
|
||||
fatalIf(probe.NewError(fmt.Errorf("Unknown argument `%s` passed", algorithm)), "Invalid encryption algorithm")
|
||||
}
|
||||
fatalIf(client.SetEncryption(ctx, algorithm, keyID), "Cannot enable auto encryption")
|
||||
fatalIf(client.SetEncryption(ctx, algorithm, keyID), "Unable to enable auto encryption")
|
||||
msg := encryptSetMessage{
|
||||
Op: "set",
|
||||
Status: "success",
|
||||
|
||||
+2
-2
@@ -124,7 +124,7 @@ func mainEventAdd(cliCtx *cli.Context) error {
|
||||
|
||||
client, err := newClient(path)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
s3Client, ok := client.(*S3Client)
|
||||
@@ -133,7 +133,7 @@ func mainEventAdd(cliCtx *cli.Context) error {
|
||||
}
|
||||
|
||||
err = s3Client.AddNotificationConfig(ctx, arn, event, prefix, suffix, ignoreExisting)
|
||||
fatalIf(err, "Cannot enable notification on the specified bucket.")
|
||||
fatalIf(err, "Unable to enable notification on the specified bucket.")
|
||||
printMsg(eventAddMessage{
|
||||
ARN: arn,
|
||||
Event: event,
|
||||
|
||||
+2
-2
@@ -116,7 +116,7 @@ func mainEventList(cliCtx *cli.Context) error {
|
||||
|
||||
client, err := newClient(path)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
s3Client, ok := client.(*S3Client)
|
||||
@@ -125,7 +125,7 @@ func mainEventList(cliCtx *cli.Context) error {
|
||||
}
|
||||
|
||||
configs, err := s3Client.ListNotificationConfigs(ctx, arn)
|
||||
fatalIf(err, "Cannot list notifications on the specified bucket.")
|
||||
fatalIf(err, "Unable to list notifications on the specified bucket.")
|
||||
|
||||
for _, config := range configs {
|
||||
printMsg(eventListMessage{
|
||||
|
||||
+2
-2
@@ -119,7 +119,7 @@ func mainEventRemove(cliCtx *cli.Context) error {
|
||||
|
||||
client, err := newClient(path)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
s3Client, ok := client.(*S3Client)
|
||||
@@ -134,7 +134,7 @@ func mainEventRemove(cliCtx *cli.Context) error {
|
||||
|
||||
err = s3Client.RemoveNotificationConfig(ctx, arn, event, prefix, suffix)
|
||||
if err != nil {
|
||||
fatalIf(err, "Cannot disable notification on the specified bucket.")
|
||||
fatalIf(err, "Unable to disable notification on the specified bucket.")
|
||||
}
|
||||
|
||||
printMsg(eventRemoveMessage{ARN: arn})
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ func watchFind(ctxCtx context.Context, ctx *findContext) {
|
||||
Events: []string{"put"},
|
||||
}
|
||||
watchObj, err := ctx.clnt.Watch(ctxCtx, options)
|
||||
fatalIf(err.Trace(ctx.targetAlias), "Cannot watch with given options.")
|
||||
fatalIf(err.Trace(ctx.targetAlias), "Unable to watch with given options.")
|
||||
|
||||
// Loop until user CTRL-C the command line.
|
||||
for {
|
||||
|
||||
@@ -73,7 +73,7 @@ type legalHoldCmdMessage struct {
|
||||
// Colorized message for console printing.
|
||||
func (l legalHoldCmdMessage) String() string {
|
||||
if l.Err != nil {
|
||||
return console.Colorize("LegalHoldMessageFailure", "Cannot set object legal hold status `"+l.URLPath+"`. "+l.Err.Error())
|
||||
return console.Colorize("LegalHoldMessageFailure", "Unable to set object legal hold status `"+l.URLPath+"`. "+l.Err.Error())
|
||||
}
|
||||
return console.Colorize("LegalHoldSuccess", fmt.Sprintf("Object legal hold successfully set for `%s`.", l.URLPath))
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func setLegalHold(urlStr string, lhold minio.LegalHoldStatus, isRecursive bool)
|
||||
|
||||
clnt, err := newClient(urlStr)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
if !isRecursive {
|
||||
err = clnt.PutObjectLegalHold(ctx, lhold)
|
||||
|
||||
+1
-1
@@ -301,7 +301,7 @@ func mainMove(cliCtx *cli.Context) error {
|
||||
for _, urlStr := range cliCtx.Args() {
|
||||
client, err := newClient(urlStr)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
if s3Client, ok := client.(*S3Client); ok {
|
||||
|
||||
+1
-1
@@ -464,7 +464,7 @@ func runPolicyCmd(args cli.Args) {
|
||||
policyJSON := map[string]interface{}{}
|
||||
if policyStr != "" {
|
||||
e := json.Unmarshal([]byte(policyStr), &policyJSON)
|
||||
fatalIf(probe.NewError(e), "Cannot unmarshal custom policy file.")
|
||||
fatalIf(probe.NewError(e), "Unable to unmarshal custom policy file.")
|
||||
}
|
||||
printMsg(policyMessage{
|
||||
Status: "success",
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ func mainReplicateRemove(cliCtx *cli.Context) error {
|
||||
rmForce := cliCtx.Bool("force")
|
||||
ruleID := cliCtx.String("id")
|
||||
if rmAll && rmForce {
|
||||
fatalIf(client.RemoveReplication(ctx), "Cannot remove replication configuration")
|
||||
fatalIf(client.RemoveReplication(ctx), "Unable to remove replication configuration")
|
||||
} else {
|
||||
opts := replication.Options{
|
||||
ID: ruleID,
|
||||
|
||||
@@ -85,7 +85,7 @@ type retentionCmdMessage struct {
|
||||
// Colorized message for console printing.
|
||||
func (m retentionCmdMessage) String() string {
|
||||
if m.Err != nil {
|
||||
return console.Colorize("RetentionMessageFailure", fmt.Sprintf("Cannot set object retention on `%s`: %s", m.URLPath, m.Err))
|
||||
return console.Colorize("RetentionMessageFailure", fmt.Sprintf("Unable to set object retention on `%s`: %s", m.URLPath, m.Err))
|
||||
}
|
||||
return console.Colorize("RetentionSuccess", fmt.Sprintf("Object retention successfully set for `%s`", m.URLPath))
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func setRetention(urlStr string, mode minio.RetentionMode, validity uint64, unit
|
||||
|
||||
clnt, err := newClient(urlStr)
|
||||
if err != nil {
|
||||
fatalIf(err.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(err.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
// Quit early if urlStr does not point to an S3 server
|
||||
|
||||
@@ -90,7 +90,7 @@ func mainVersionEnable(cliCtx *cli.Context) error {
|
||||
// Create a new Client
|
||||
client, err := newClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize connection.")
|
||||
fatalIf(client.SetVersion(ctx, "enable"), "Cannot enable versioning")
|
||||
fatalIf(client.SetVersion(ctx, "enable"), "Unable to enable versioning")
|
||||
printMsg(versionEnableMessage{
|
||||
Op: "enable",
|
||||
Status: "success",
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ func mainVersionInfo(cliCtx *cli.Context) error {
|
||||
client, err := newClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize connection.")
|
||||
vConfig, e := client.GetVersion(ctx)
|
||||
fatalIf(e, "Cannot get versioning info")
|
||||
fatalIf(e, "Unable to get versioning info")
|
||||
vMsg := versioningInfoMessage{
|
||||
Op: "info",
|
||||
Status: "success",
|
||||
|
||||
@@ -90,7 +90,7 @@ func mainVersionSuspend(cliCtx *cli.Context) error {
|
||||
// Create a new Client
|
||||
client, err := newClient(aliasedURL)
|
||||
fatalIf(err, "Unable to initialize connection.")
|
||||
fatalIf(client.SetVersion(ctx, "suspend"), "Cannot suspend versioning")
|
||||
fatalIf(client.SetVersion(ctx, "suspend"), "Unable to suspend versioning")
|
||||
printMsg(versionSuspendMessage{
|
||||
Op: "suspend",
|
||||
Status: "success",
|
||||
|
||||
+2
-2
@@ -148,7 +148,7 @@ func mainWatch(cliCtx *cli.Context) error {
|
||||
|
||||
s3Client, pErr := newClient(path)
|
||||
if pErr != nil {
|
||||
fatalIf(pErr.Trace(), "Cannot parse the provided url.")
|
||||
fatalIf(pErr.Trace(), "Unable to parse the provided url.")
|
||||
}
|
||||
|
||||
options := WatchOptions{
|
||||
@@ -163,7 +163,7 @@ func mainWatch(cliCtx *cli.Context) error {
|
||||
|
||||
// Start watching on events
|
||||
wo, err := s3Client.Watch(ctx, options)
|
||||
fatalIf(err, "Cannot watch on the specified bucket.")
|
||||
fatalIf(err, "Unable to watch on the specified bucket.")
|
||||
|
||||
// Initialize.. waitgroup to track the go-routine.
|
||||
var wg sync.WaitGroup
|
||||
|
||||
@@ -154,7 +154,6 @@ You may add shell aliases for info, healing.
|
||||
|
||||
```
|
||||
alias minfo='mc admin info'
|
||||
alias mheal='mc admin heal'
|
||||
```
|
||||
|
||||
## 6. Global Options
|
||||
@@ -321,7 +320,7 @@ mc admin update play
|
||||
Server `play` updated successfully from RELEASE.2019-08-14T20-49-49Z to RELEASE.2019-08-21T19-59-10Z
|
||||
```
|
||||
|
||||
#### Steps to update MinIO using a private mirror
|
||||
#### Steps to update MinIO using a private mirror
|
||||
For using `update` command with private mirror server, you need to mirror the directory structure on `https://dl.minio.io/server/minio/release/linux-amd64/` on your private mirror server and then provide:
|
||||
|
||||
```
|
||||
@@ -630,51 +629,7 @@ mc admin config set myminio < /tmp/my-serverconfig
|
||||
|
||||
<a name="heal"></a>
|
||||
### Command `heal` - Heal disks, buckets and objects on MinIO server
|
||||
`heal` command heals disks, missing buckets, objects on MinIO server. NOTE: This command is only applicable for MinIO erasure coded setup (standalone and distributed).
|
||||
|
||||
The server already has a light background process to heal disks, buckets and objects when necessary. However, it does not detect some types of data corruption, especially the ones that rarely happen, such as silent data corruption. In that case, you need, once a while, to manually run the heal command providing this flag: `--scan deep`.
|
||||
|
||||
To show the status of the background healing process, just type the following command: `mc admin heal your-alias`.
|
||||
|
||||
To scan and heal everything, type: `mc admin heal -r your-alias`.
|
||||
|
||||
```
|
||||
NAME:
|
||||
mc admin heal - heal disks, buckets and objects on MinIO server
|
||||
|
||||
FLAGS:
|
||||
--scan value select the healing scan mode (normal/deep) (default: "normal")
|
||||
--recursive, -r heal recursively
|
||||
--dry-run, -n only inspect data, but do not mutate
|
||||
--force-start, -f force start a new heal sequence
|
||||
--force-stop, -s force stop a running heal sequence
|
||||
--remove remove dangling objects in heal sequence
|
||||
--help, -h show help
|
||||
```
|
||||
|
||||
*Example: Heal MinIO cluster after replacing a fresh disk, recursively heal all buckets and objects, where 'myminio' is the MinIO server alias.*
|
||||
|
||||
```
|
||||
mc admin heal -r myminio
|
||||
```
|
||||
|
||||
*Example: Heal MinIO cluster on a specific bucket recursively, where 'myminio' is the MinIO server alias.*
|
||||
|
||||
```
|
||||
mc admin heal -r myminio/mybucket
|
||||
```
|
||||
|
||||
*Example: Heal MinIO cluster on a specific object prefix recursively, where 'myminio' is the MinIO server alias.*
|
||||
|
||||
```
|
||||
mc admin heal -r myminio/mybucket/myobjectprefix
|
||||
```
|
||||
|
||||
*Example: Show the status of the self-healing process in a MinIO cluster.*
|
||||
|
||||
```
|
||||
mc admin heal myminio/
|
||||
```
|
||||
Healing is automatic on server side which runs on a continuous basis on a low priority thread, `mc admin heal` is deprecated and will be removed in future.
|
||||
|
||||
<a name="profile"></a>
|
||||
### Command `profile` - generate profile data for debugging purposes
|
||||
|
||||
Reference in New Issue
Block a user