1
0
mirror of https://github.com/minio/mc.git synced 2025-11-25 08:23:07 +03:00

modify operation type in message (#4339)

This commit is contained in:
dorman
2022-11-02 05:10:26 +08:00
committed by GitHub
parent b5ee028536
commit 2f5bf0c17f
43 changed files with 45 additions and 45 deletions

View File

@@ -140,7 +140,7 @@ func mainAdminBucketQuota(ctx *cli.Context) error {
})).Trace(args...), "Unable to set bucket quota")
printMsg(quotaMessage{
op: "set",
op: ctx.Command.Name,
Bucket: targetURL,
Quota: quota,
QuotaType: string(qType),
@@ -151,7 +151,7 @@ func mainAdminBucketQuota(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to clear bucket quota config")
}
printMsg(quotaMessage{
op: "unset",
op: ctx.Command.Name,
Bucket: targetURL,
Status: "success",
})
@@ -160,7 +160,7 @@ func mainAdminBucketQuota(ctx *cli.Context) error {
qCfg, e := client.GetBucketQuota(globalContext, targetURL)
fatalIf(probe.NewError(e).Trace(args...), "Unable to get bucket quota")
printMsg(quotaMessage{
op: "get",
op: ctx.Command.Name,
Bucket: targetURL,
Quota: qCfg.Quota,
QuotaType: string(qCfg.Type),

View File

@@ -116,7 +116,7 @@ func mainClusterBucketImport(ctx *cli.Context) error {
BucketMetaImportErrs: rpt,
Status: "success",
URL: aliasedURL,
Op: "import",
Op: ctx.Command.Name,
})
return nil

View File

@@ -136,7 +136,7 @@ func mainAdminGroupAdd(ctx *cli.Context) error {
fatalIf(probe.NewError(client.UpdateGroupMembers(globalContext, gAddRemove)).Trace(args...), "Unable to add new group")
printMsg(groupMessage{
op: "add",
op: ctx.Command.Name,
GroupName: args.Get(1),
Members: members,
})

View File

@@ -72,7 +72,7 @@ func mainAdminGroupInfo(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to fetch group info")
printMsg(groupMessage{
op: "info",
op: ctx.Command.Name,
GroupName: group,
GroupStatus: gd.Status,
GroupPolicy: gd.Policy,

View File

@@ -71,7 +71,7 @@ func mainAdminGroupList(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to list groups")
printMsg(groupMessage{
op: "list",
op: ctx.Command.Name,
Groups: gs,
})

View File

@@ -85,7 +85,7 @@ func mainAdminGroupRemove(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Could not perform remove operation")
printMsg(groupMessage{
op: "remove",
op: ctx.Command.Name,
GroupName: args.Get(1),
Members: members,
})

View File

@@ -136,7 +136,7 @@ func mainAdminPolicyAdd(ctx *cli.Context) error {
fatalIf(probe.NewError(client.AddCannedPolicy(globalContext, args.Get(1), policy)).Trace(args...), "Unable to add new policy")
printMsg(userPolicyMessage{
op: "add",
op: ctx.Command.Name,
Policy: args.Get(1),
})

View File

@@ -118,7 +118,7 @@ func mainAdminPolicyInfo(ctx *cli.Context) error {
}
printMsg(userPolicyMessage{
op: "info",
op: ctx.Command.Name,
Policy: policyName,
PolicyInfo: *pinfo,
})

View File

@@ -72,7 +72,7 @@ func mainAdminPolicyList(ctx *cli.Context) error {
for k := range policies {
printMsg(userPolicyMessage{
op: "list",
op: ctx.Command.Name,
Policy: k,
})
}

View File

@@ -73,7 +73,7 @@ func mainAdminPolicyRemove(ctx *cli.Context) error {
fatalIf(probe.NewError(client.RemoveCannedPolicy(globalContext, args.Get(1))).Trace(args...), "Unable to remove policy")
printMsg(userPolicyMessage{
op: "remove",
op: ctx.Command.Name,
Policy: args.Get(1),
})

View File

@@ -107,7 +107,7 @@ func mainAdminPolicySet(ctx *cli.Context) error {
e := client.SetPolicy(globalContext, policyName, userOrGroup, isGroup)
if e == nil {
printMsg(userPolicyMessage{
op: "set",
op: ctx.Command.Name,
Policy: policyName,
UserOrGroup: userOrGroup,
IsGroup: isGroup,

View File

@@ -125,7 +125,7 @@ func mainAdminPolicyUnset(ctx *cli.Context) error {
e = client.SetPolicy(globalContext, newPolicies, userOrGroup, isGroup)
if e == nil {
printMsg(userPolicyMessage{
op: "unset",
op: ctx.Command.Name,
Policy: policiesToUnset,
UserOrGroup: userOrGroup,
IsGroup: isGroup,

View File

@@ -130,7 +130,7 @@ func mainAdminPolicyUpdate(ctx *cli.Context) error {
e = client.SetPolicy(globalContext, updatedPolicies, userOrGroup, isGroup)
if e == nil {
printMsg(userPolicyMessage{
op: "update",
op: ctx.Command.Name,
Policy: policiesToAdd,
UserOrGroup: userOrGroup,
IsGroup: isGroup,

View File

@@ -380,7 +380,7 @@ func mainAdminTierAdd(ctx *cli.Context) error {
fatalIf(probe.NewError(client.AddTier(globalContext, tCfg)).Trace(args...), "Unable to configure remote tier target")
msg := &tierMessage{
op: "add",
op: ctx.Command.Name,
Status: "success",
}
msg.SetTierConfig(tCfg)

View File

@@ -139,7 +139,7 @@ func mainAdminTierEdit(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to edit remote tier")
printMsg(&tierMessage{
op: "edit",
op: ctx.Command.Name,
Status: "success",
TierName: tierName,
})

View File

@@ -72,7 +72,7 @@ func mainAdminTierRm(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to remove remote tier target")
printMsg(&tierMessage{
op: "rm",
op: ctx.Command.Name,
Status: "success",
TierName: tierName,
})

View File

@@ -72,7 +72,7 @@ func mainAdminTierVerify(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to verify remote tier target")
printMsg(&tierMessage{
op: "verify",
op: ctx.Command.Name,
Status: "success",
TierName: tierName,
})

View File

@@ -187,7 +187,7 @@ func mainAdminUserAdd(ctx *cli.Context) error {
fatalIf(probe.NewError(client.AddUser(globalContext, accessKey, secretKey)).Trace(args...), "Unable to add new user")
printMsg(userMessage{
op: "add",
op: ctx.Command.Name,
AccessKey: accessKey,
SecretKey: secretKey,
UserStatus: "enabled",

View File

@@ -72,7 +72,7 @@ func mainAdminUserDisable(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to disable user")
printMsg(userMessage{
op: "disable",
op: ctx.Command.Name,
AccessKey: args.Get(1),
})

View File

@@ -72,7 +72,7 @@ func mainAdminUserEnable(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to enable user")
printMsg(userMessage{
op: "enable",
op: ctx.Command.Name,
AccessKey: args.Get(1),
})

View File

@@ -71,7 +71,7 @@ func mainAdminUserInfo(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to get user info")
printMsg(userMessage{
op: "info",
op: ctx.Command.Name,
AccessKey: args.Get(1),
PolicyName: user.PolicyName,
UserStatus: string(user.Status),

View File

@@ -76,7 +76,7 @@ func mainAdminUserList(ctx *cli.Context) error {
for k, v := range users {
printMsg(userMessage{
op: "list",
op: ctx.Command.Name,
AccessKey: k,
PolicyName: v.PolicyName,
UserStatus: string(v.Status),

View File

@@ -71,7 +71,7 @@ func mainAdminUserRemove(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to remove %s", args.Get(1))
printMsg(userMessage{
op: "remove",
op: ctx.Command.Name,
AccessKey: args.Get(1),
})

View File

@@ -183,7 +183,7 @@ func mainAdminUserSvcAcctAdd(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to add a new service account")
printMsg(svcAcctMessage{
op: "add",
op: ctx.Command.Name,
AccessKey: creds.AccessKey,
SecretKey: creds.SecretKey,
AccountStatus: "enabled",

View File

@@ -77,7 +77,7 @@ func mainAdminUserSvcAcctDisable(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to disable the specified service account")
printMsg(svcAcctMessage{
op: "disable",
op: ctx.Command.Name,
AccessKey: svcAccount,
})

View File

@@ -77,7 +77,7 @@ func mainAdminUserSvcAcctEnable(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to enable the specified service account")
printMsg(svcAcctMessage{
op: "enable",
op: ctx.Command.Name,
AccessKey: svcAccount,
})

View File

@@ -96,7 +96,7 @@ func mainAdminUserSvcAcctInfo(ctx *cli.Context) error {
}
printMsg(svcAcctMessage{
op: "info",
op: ctx.Command.Name,
AccessKey: svcAccount,
AccountStatus: svcInfo.AccountStatus,
ParentUser: svcInfo.ParentUser,

View File

@@ -78,7 +78,7 @@ func mainAdminUserSvcAcctList(ctx *cli.Context) error {
for _, svc := range svcList.Accounts {
printMsg(svcAcctMessage{
op: "list",
op: ctx.Command.Name,
AccessKey: svc,
})
}

View File

@@ -73,7 +73,7 @@ func mainAdminUserSvcAcctRemove(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to remove the specified service account")
printMsg(svcAcctMessage{
op: "rm",
op: ctx.Command.Name,
AccessKey: svcAccount,
})

View File

@@ -98,7 +98,7 @@ func mainAdminUserSvcAcctSet(ctx *cli.Context) error {
fatalIf(probe.NewError(e).Trace(args...), "Unable to edit the specified service account")
printMsg(svcAcctMessage{
op: "set",
op: ctx.Command.Name,
AccessKey: svcAccount,
})

View File

@@ -90,7 +90,7 @@ func mainEncryptClear(cliCtx *cli.Context) error {
fatalIf(err, "Unable to initialize connection.")
fatalIf(client.DeleteEncryption(ctx), "Unable to clear auto encryption configuration")
printMsg(encryptClearMessage{
Op: "clear",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
})

View File

@@ -109,7 +109,7 @@ func mainEncryptSet(cliCtx *cli.Context) error {
}
fatalIf(client.SetEncryption(ctx, algorithm, keyID), "Unable to enable auto encryption")
msg := encryptSetMessage{
Op: "set",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
}

View File

@@ -199,7 +199,7 @@ func mainReplicateAdd(cliCtx *cli.Context) error {
}
fatalIf(client.SetReplication(ctx, &rcfg, opts), "Could not add replication rule")
printMsg(replicateAddMessage{
Op: "add",
Op: cliCtx.Command.Name,
URL: aliasedURL,
ID: opts.ID,
})

View File

@@ -207,7 +207,7 @@ func mainReplicateEdit(cliCtx *cli.Context) error {
fatalIf(client.SetReplication(ctx, &rcfg, opts), "Could not modify replication rule")
printMsg(replicateEditMessage{
Op: "set",
Op: cliCtx.Command.Name,
URL: aliasedURL,
ID: opts.ID,
})

View File

@@ -101,7 +101,7 @@ func mainReplicateExport(cliCtx *cli.Context) error {
rCfg, err := client.GetReplication(ctx)
fatalIf(err.Trace(args...), "Unable to get replication configuration")
printMsg(replicateExportMessage{
Op: "export",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
ReplicationConfig: rCfg,

View File

@@ -111,7 +111,7 @@ func mainReplicateImport(cliCtx *cli.Context) error {
fatalIf(client.SetReplication(ctx, rCfg, replication.Options{Op: replication.ImportOption}).Trace(aliasedURL), "Unable to set replication configuration")
printMsg(replicateImportMessage{
Op: "import",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
})

View File

@@ -132,7 +132,7 @@ func mainReplicateResyncStart(cliCtx *cli.Context) error {
rinfo, err := client.ResetReplication(ctx, olderThan, cliCtx.String("remote-bucket"))
fatalIf(err.Trace(args...), "Unable to reset replication")
printMsg(replicateResyncMessage{
Op: "start",
Op: cliCtx.Command.Name,
URL: aliasedURL,
ResyncTargetsInfo: rinfo,
})

View File

@@ -152,7 +152,7 @@ func mainreplicateResyncStatus(cliCtx *cli.Context) error {
rinfo, err := client.ReplicationResyncStatus(ctx, cliCtx.String("remote-bucket"))
fatalIf(err.Trace(args...), "Unable to get replication resync status")
printMsg(replicateResyncStatusMessage{
Op: "status",
Op: cliCtx.Command.Name,
URL: aliasedURL,
ResyncTargetsInfo: rinfo,
TargetArn: cliCtx.String("remote-bucket"),

View File

@@ -147,7 +147,7 @@ func mainReplicateRemove(cliCtx *cli.Context) error {
fatalIf(client.SetReplication(ctx, &rcfg, opts), "Could not remove replication rule")
}
printMsg(replicateRemoveMessage{
Op: "rm",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
ID: ruleID,

View File

@@ -199,7 +199,7 @@ func mainReplicateStatus(cliCtx *cli.Context) error {
fatalIf(err.Trace(args...), "Unable to get replication status")
printMsg(replicateStatusMessage{
Op: "status",
Op: cliCtx.Command.Name,
URL: aliasedURL,
ReplicationStatus: replicateStatus,
})

View File

@@ -123,7 +123,7 @@ func mainVersionEnable(cliCtx *cli.Context) error {
fatalIf(err, "Unable to initialize connection.")
fatalIf(client.SetVersion(ctx, "enable", excludedPrefixes, excludeFolders), "Unable to enable versioning")
printMsg(versionEnableMessage{
Op: "enable",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
})

View File

@@ -105,7 +105,7 @@ func mainVersionInfo(cliCtx *cli.Context) error {
vConfig, e := client.GetVersion(ctx)
fatalIf(e, "Unable to get versioning info")
vMsg := versioningInfoMessage{
Op: "info",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
}

View File

@@ -95,7 +95,7 @@ func mainVersionSuspend(cliCtx *cli.Context) error {
fatalIf(err, "Unable to initialize connection.")
fatalIf(client.SetVersion(ctx, "suspend", nil, false), "Unable to suspend versioning")
printMsg(versionSuspendMessage{
Op: "suspend",
Op: cliCtx.Command.Name,
Status: "success",
URL: aliasedURL,
})