diff --git a/cmd/admin-bucket-quota.go b/cmd/admin-bucket-quota.go index f3b6d00c..244fe4ba 100644 --- a/cmd/admin-bucket-quota.go +++ b/cmd/admin-bucket-quota.go @@ -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), diff --git a/cmd/admin-cluster-bucket-import.go b/cmd/admin-cluster-bucket-import.go index 642c5c30..3f773fca 100644 --- a/cmd/admin-cluster-bucket-import.go +++ b/cmd/admin-cluster-bucket-import.go @@ -116,7 +116,7 @@ func mainClusterBucketImport(ctx *cli.Context) error { BucketMetaImportErrs: rpt, Status: "success", URL: aliasedURL, - Op: "import", + Op: ctx.Command.Name, }) return nil diff --git a/cmd/admin-group-add.go b/cmd/admin-group-add.go index 378082c0..29ad7e70 100644 --- a/cmd/admin-group-add.go +++ b/cmd/admin-group-add.go @@ -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, }) diff --git a/cmd/admin-group-info.go b/cmd/admin-group-info.go index e2fe4bd8..d6995365 100644 --- a/cmd/admin-group-info.go +++ b/cmd/admin-group-info.go @@ -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, diff --git a/cmd/admin-group-list.go b/cmd/admin-group-list.go index 67a0d156..f00d7bd7 100644 --- a/cmd/admin-group-list.go +++ b/cmd/admin-group-list.go @@ -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, }) diff --git a/cmd/admin-group-remove.go b/cmd/admin-group-remove.go index 794c29df..b0e3cab7 100644 --- a/cmd/admin-group-remove.go +++ b/cmd/admin-group-remove.go @@ -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, }) diff --git a/cmd/admin-policy-add.go b/cmd/admin-policy-add.go index 8cb9502d..09f08d8b 100644 --- a/cmd/admin-policy-add.go +++ b/cmd/admin-policy-add.go @@ -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), }) diff --git a/cmd/admin-policy-info.go b/cmd/admin-policy-info.go index 0e08206c..b4c3d809 100644 --- a/cmd/admin-policy-info.go +++ b/cmd/admin-policy-info.go @@ -118,7 +118,7 @@ func mainAdminPolicyInfo(ctx *cli.Context) error { } printMsg(userPolicyMessage{ - op: "info", + op: ctx.Command.Name, Policy: policyName, PolicyInfo: *pinfo, }) diff --git a/cmd/admin-policy-list.go b/cmd/admin-policy-list.go index 48f67754..cf0494d5 100644 --- a/cmd/admin-policy-list.go +++ b/cmd/admin-policy-list.go @@ -72,7 +72,7 @@ func mainAdminPolicyList(ctx *cli.Context) error { for k := range policies { printMsg(userPolicyMessage{ - op: "list", + op: ctx.Command.Name, Policy: k, }) } diff --git a/cmd/admin-policy-remove.go b/cmd/admin-policy-remove.go index 2019c372..515a01df 100644 --- a/cmd/admin-policy-remove.go +++ b/cmd/admin-policy-remove.go @@ -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), }) diff --git a/cmd/admin-policy-set.go b/cmd/admin-policy-set.go index 553af681..3ef3a7bb 100644 --- a/cmd/admin-policy-set.go +++ b/cmd/admin-policy-set.go @@ -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, diff --git a/cmd/admin-policy-unset.go b/cmd/admin-policy-unset.go index fc6ef9cb..b6327776 100644 --- a/cmd/admin-policy-unset.go +++ b/cmd/admin-policy-unset.go @@ -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, diff --git a/cmd/admin-policy-update.go b/cmd/admin-policy-update.go index 8e06f150..4d8a3111 100644 --- a/cmd/admin-policy-update.go +++ b/cmd/admin-policy-update.go @@ -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, diff --git a/cmd/admin-tier-add.go b/cmd/admin-tier-add.go index 64f109b0..eba3dbea 100644 --- a/cmd/admin-tier-add.go +++ b/cmd/admin-tier-add.go @@ -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) diff --git a/cmd/admin-tier-edit.go b/cmd/admin-tier-edit.go index fc05cb3f..0c971be1 100644 --- a/cmd/admin-tier-edit.go +++ b/cmd/admin-tier-edit.go @@ -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, }) diff --git a/cmd/admin-tier-rm.go b/cmd/admin-tier-rm.go index 6101601c..68423840 100644 --- a/cmd/admin-tier-rm.go +++ b/cmd/admin-tier-rm.go @@ -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, }) diff --git a/cmd/admin-tier-verify.go b/cmd/admin-tier-verify.go index 4154d8e6..c3ecbe74 100644 --- a/cmd/admin-tier-verify.go +++ b/cmd/admin-tier-verify.go @@ -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, }) diff --git a/cmd/admin-user-add.go b/cmd/admin-user-add.go index 17907db2..483733f6 100644 --- a/cmd/admin-user-add.go +++ b/cmd/admin-user-add.go @@ -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", diff --git a/cmd/admin-user-disable.go b/cmd/admin-user-disable.go index f22d18da..e6a81053 100644 --- a/cmd/admin-user-disable.go +++ b/cmd/admin-user-disable.go @@ -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), }) diff --git a/cmd/admin-user-enable.go b/cmd/admin-user-enable.go index 864ff9cb..18dc7403 100644 --- a/cmd/admin-user-enable.go +++ b/cmd/admin-user-enable.go @@ -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), }) diff --git a/cmd/admin-user-info.go b/cmd/admin-user-info.go index 8e72e1f3..6385fdcd 100644 --- a/cmd/admin-user-info.go +++ b/cmd/admin-user-info.go @@ -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), diff --git a/cmd/admin-user-list.go b/cmd/admin-user-list.go index 3d513bae..175446f3 100644 --- a/cmd/admin-user-list.go +++ b/cmd/admin-user-list.go @@ -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), diff --git a/cmd/admin-user-remove.go b/cmd/admin-user-remove.go index 1366fc09..e5ccce1d 100644 --- a/cmd/admin-user-remove.go +++ b/cmd/admin-user-remove.go @@ -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), }) diff --git a/cmd/admin-user-svcacct-add.go b/cmd/admin-user-svcacct-add.go index 5b0b226f..d5630c4a 100644 --- a/cmd/admin-user-svcacct-add.go +++ b/cmd/admin-user-svcacct-add.go @@ -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", diff --git a/cmd/admin-user-svcacct-disable.go b/cmd/admin-user-svcacct-disable.go index 7b5a5045..3f006cf1 100644 --- a/cmd/admin-user-svcacct-disable.go +++ b/cmd/admin-user-svcacct-disable.go @@ -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, }) diff --git a/cmd/admin-user-svcacct-enable.go b/cmd/admin-user-svcacct-enable.go index a9078dd3..78689076 100644 --- a/cmd/admin-user-svcacct-enable.go +++ b/cmd/admin-user-svcacct-enable.go @@ -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, }) diff --git a/cmd/admin-user-svcacct-info.go b/cmd/admin-user-svcacct-info.go index 76d7f4d6..e4e87c9e 100644 --- a/cmd/admin-user-svcacct-info.go +++ b/cmd/admin-user-svcacct-info.go @@ -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, diff --git a/cmd/admin-user-svcacct-list.go b/cmd/admin-user-svcacct-list.go index 398e086f..c2e117eb 100644 --- a/cmd/admin-user-svcacct-list.go +++ b/cmd/admin-user-svcacct-list.go @@ -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, }) } diff --git a/cmd/admin-user-svcacct-rm.go b/cmd/admin-user-svcacct-rm.go index 19522168..637d59bc 100644 --- a/cmd/admin-user-svcacct-rm.go +++ b/cmd/admin-user-svcacct-rm.go @@ -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, }) diff --git a/cmd/admin-user-svcacct-set.go b/cmd/admin-user-svcacct-set.go index 1cb92076..81f2c7f9 100644 --- a/cmd/admin-user-svcacct-set.go +++ b/cmd/admin-user-svcacct-set.go @@ -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, }) diff --git a/cmd/encrypt-clear.go b/cmd/encrypt-clear.go index aa1b4ac2..eb3d3129 100644 --- a/cmd/encrypt-clear.go +++ b/cmd/encrypt-clear.go @@ -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, }) diff --git a/cmd/encrypt-set.go b/cmd/encrypt-set.go index 0a242577..f174035a 100644 --- a/cmd/encrypt-set.go +++ b/cmd/encrypt-set.go @@ -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, } diff --git a/cmd/replicate-add.go b/cmd/replicate-add.go index fea4e98d..c0ac642e 100644 --- a/cmd/replicate-add.go +++ b/cmd/replicate-add.go @@ -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, }) diff --git a/cmd/replicate-edit.go b/cmd/replicate-edit.go index 62586412..1e560641 100644 --- a/cmd/replicate-edit.go +++ b/cmd/replicate-edit.go @@ -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, }) diff --git a/cmd/replicate-export.go b/cmd/replicate-export.go index cc99acd9..838bf9ce 100644 --- a/cmd/replicate-export.go +++ b/cmd/replicate-export.go @@ -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, diff --git a/cmd/replicate-import.go b/cmd/replicate-import.go index 29de3311..b25ad7b7 100644 --- a/cmd/replicate-import.go +++ b/cmd/replicate-import.go @@ -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, }) diff --git a/cmd/replicate-reset-start.go b/cmd/replicate-reset-start.go index 7a40e3a1..c4d2099c 100644 --- a/cmd/replicate-reset-start.go +++ b/cmd/replicate-reset-start.go @@ -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, }) diff --git a/cmd/replicate-reset-status.go b/cmd/replicate-reset-status.go index 841be360..2f4972a4 100644 --- a/cmd/replicate-reset-status.go +++ b/cmd/replicate-reset-status.go @@ -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"), diff --git a/cmd/replicate-rm.go b/cmd/replicate-rm.go index 0094635a..58e05a0e 100644 --- a/cmd/replicate-rm.go +++ b/cmd/replicate-rm.go @@ -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, diff --git a/cmd/replicate-status.go b/cmd/replicate-status.go index 4939a52b..c7268bdd 100644 --- a/cmd/replicate-status.go +++ b/cmd/replicate-status.go @@ -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, }) diff --git a/cmd/version-enable.go b/cmd/version-enable.go index 60a6e220..49df44d8 100644 --- a/cmd/version-enable.go +++ b/cmd/version-enable.go @@ -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, }) diff --git a/cmd/version-info.go b/cmd/version-info.go index 567f8c00..139a33bc 100644 --- a/cmd/version-info.go +++ b/cmd/version-info.go @@ -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, } diff --git a/cmd/version-suspend.go b/cmd/version-suspend.go index b96bc9c4..ad25a9c4 100644 --- a/cmd/version-suspend.go +++ b/cmd/version-suspend.go @@ -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, })