Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iam export:designate zip file name #4995

Merged
merged 27 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fca4018
iam export:designate zip file name
dormanze Jul 24, 2024
9d6d81b
Update admin-cluster-iam-export.go
dormanze Jul 25, 2024
7593fa8
Merge branch 'master' into iamexport
dormanze Jul 27, 2024
bc13d01
Update admin-cluster-iam-export.go
dormanze Jul 29, 2024
9c9ed4a
Merge branch 'iamexport' of https://github.com/dormanze/mc into iamex…
dormanze Jul 29, 2024
5c564b2
Update cmd/admin-cluster-iam-export.go
dormanze Jul 29, 2024
ff0bb5c
Update cmd/admin-cluster-iam-export.go
dormanze Jul 29, 2024
bb26827
Update cmd/admin-cluster-iam-export.go
dormanze Jul 29, 2024
4f60618
Update admin-cluster-iam-export.go
dormanze Jul 29, 2024
bcb0a92
Update admin-cluster-iam-export.go
dormanze Jul 29, 2024
c29a408
Update admin-cluster-iam-export.go
dormanze Jul 29, 2024
5c9ef71
Merge branch 'master' into iamexport
dormanze Aug 1, 2024
bffa716
Merge branch 'master' into iamexport
klauspost Aug 5, 2024
150d62b
Update admin-cluster-iam-export.go
dormanze Aug 5, 2024
ffd135b
Merge branch 'iamexport' of https://github.com/dormanze/mc into iamex…
dormanze Aug 5, 2024
f731b26
Merge branch 'master' into iamexport
dormanze Aug 6, 2024
fc3c0f1
Merge branch 'master' into iamexport
dormanze Aug 7, 2024
eecf06e
Merge branch 'master' into iamexport
dormanze Aug 9, 2024
b65ceac
Merge branch 'master' into iamexport
dormanze Aug 9, 2024
7c8675f
Update admin-cluster-iam-export.go
dormanze Aug 9, 2024
a3d6eae
Merge branch 'master' into iamexport
dormanze Aug 12, 2024
f3815dc
Merge branch 'master' into iamexport
dormanze Aug 13, 2024
f21d5d6
Merge branch 'master' into iamexport
dormanze Aug 16, 2024
7a9c947
Merge branch 'master' into iamexport
dormanze Aug 19, 2024
3b7ed85
Merge branch 'master' into iamexport
dormanze Aug 27, 2024
0b5d7e2
Merge branch 'master' into iamexport
dormanze Sep 9, 2024
944abe6
Merge branch 'master' into iamexport
donatello Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cmd/admin-cluster-iam-export.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,23 @@ import (
"github.com/minio/pkg/v3/console"
)

// iam export specific flags.
var (
iamExportFlags = []cli.Flag{
cli.StringFlag{
Name: "output,o",
Usage: "output iam export to a custom file path",
},
}
)

var adminClusterIAMExportCmd = cli.Command{
Name: "export",
Usage: "exports IAM info to zipped file",
Action: mainClusterIAMExport,
OnUsageError: onUsageError,
Before: setGlobalsFromContext,
Flags: globalFlags,
Flags: append(iamExportFlags, globalFlags...),
HideHelpCommand: true,
CustomHelpTemplate: `NAME:
{{.HelpName}} - {{.Usage}}
Expand All @@ -52,6 +62,9 @@ FLAGS:
EXAMPLES:
1. Download all IAM metadata for cluster into zip file.
{{.Prompt}} {{.HelpName}} myminio

2. Download all IAM metadata to a custom file.
{{.Prompt}} {{.HelpName}} myminio --output /tmp/myminio-iam.zip
`,
}

Expand Down Expand Up @@ -97,6 +110,9 @@ func mainClusterIAMExport(ctx *cli.Context) error {
tmpFile.Close()

downloadPath := fmt.Sprintf("%s-iam-info.%s", aliasedURL, ext)
if ctx.String("output") != "" {
downloadPath = ctx.String("output")
}
fi, e := os.Stat(downloadPath)
if e == nil && !fi.IsDir() {
e = moveFile(downloadPath, downloadPath+"."+time.Now().Format(dateTimeFormatFilename))
Expand Down
Loading