mygithub.libinneed.workers.dev/stackitcloud/stackit-cli
Advanced tools
| ## stackit mongodbflex backup describe | ||
| Shows details of a backup for a MongoDB Flex instance | ||
| ### Synopsis | ||
| Shows details of a backup for a MongoDB Flex instance. | ||
| ``` | ||
| stackit mongodbflex backup describe BACKUP_ID [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| Get details of a backup with ID "xxx" for a MongoDB Flex instance with ID "yyy" | ||
| $ stackit mongodbflex backup describe xxx --instance-id yyy | ||
| Get details of a backup with ID "xxx" for a MongoDB Flex instance with ID "yyy" in JSON format | ||
| $ stackit mongodbflex backup describe xxx --instance-id yyy --output-format json | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit mongodbflex backup describe" | ||
| --instance-id string Instance ID | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| ## stackit mongodbflex backup list | ||
| Lists all backups which are available for a MongoDB Flex instance | ||
| ### Synopsis | ||
| Lists all backups which are available for a MongoDB Flex instance. | ||
| ``` | ||
| stackit mongodbflex backup list [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| List all backups of instance with ID "xxx" | ||
| $ stackit mongodbflex backup list --instance-id xxx | ||
| List all backups of instance with ID "xxx" in JSON format | ||
| $ stackit mongodbflex backup list --instance-id xxx --output-format json | ||
| List up to 10 backups of instance with ID "xxx" | ||
| $ stackit mongodbflex backup list --instance-id xxx --limit 10 | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit mongodbflex backup list" | ||
| --instance-id string Instance ID | ||
| --limit int Maximum number of entries to list | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| ## stackit mongodbflex backup restore-jobs | ||
| Lists all restore jobs which have been run for a MongoDB Flex instance | ||
| ### Synopsis | ||
| Lists all restore jobs which have been run for a MongoDB Flex instance. | ||
| ``` | ||
| stackit mongodbflex backup restore-jobs [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| List all restore jobs of instance with ID "xxx" | ||
| $ stackit mongodbflex backup restore-jobs --instance-id xxx | ||
| List all restore jobs of instance with ID "xxx" in JSON format | ||
| $ stackit mongodbflex backup restore-jobs --instance-id xxx --output-format json | ||
| List up to 10 restore jobs of instance with ID "xxx" | ||
| $ stackit mongodbflex backup restore-jobs --instance-id xxx --limit 10 | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit mongodbflex backup restore-jobs" | ||
| --instance-id string Instance ID | ||
| --limit int Maximum number of entries to list | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| ## stackit mongodbflex backup restore | ||
| Restores a MongoDB Flex instance from a backup | ||
| ### Synopsis | ||
| Restores a MongoDB Flex instance from a backup of an instance or clones a MongoDB Flex instance from a point-in-time snapshot. | ||
| The backup is specified by a backup ID and the point-in-time snapshot is specified by a timestamp. | ||
| You can specify the instance to which the backup will be applied. If not specified, the backup will be applied to the same instance from which it was taken. | ||
| ``` | ||
| stackit mongodbflex backup restore [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| Restore a MongoDB Flex instance with ID "yyy" using backup with ID "zzz" | ||
| $ stackit mongodbflex backup restore --instance-id yyy --backup-id zzz | ||
| Clone a MongoDB Flex instance with ID "yyy" via point-in-time restore to timestamp "2024-05-14T14:31:48Z" | ||
| $ stackit mongodbflex backup restore --instance-id yyy --timestamp 2024-05-14T14:31:48Z | ||
| Restore a MongoDB Flex instance with ID "yyy", using backup from instance with ID "zzz" with backup ID "xxx" | ||
| $ stackit mongodbflex backup restore --instance-id zzz --backup-instance-id yyy --backup-id xxx | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| --backup-id string Backup ID | ||
| --backup-instance-id string Instance ID of the target instance to restore the backup to | ||
| -h, --help Help for "stackit mongodbflex backup restore" | ||
| --instance-id string Instance ID | ||
| --timestamp string Timestamp of the snapshot to use as a source for cloning the instance in a date-time with the RFC3339 layout format, e.g. 2024-01-01T00:00:00Z | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| ## stackit mongodbflex backup schedule | ||
| Shows details of the backup schedule and retention policy of a MongoDB Flex instance | ||
| ### Synopsis | ||
| Shows details of the backup schedule and retention policy of a MongoDB Flex instance. | ||
| ``` | ||
| stackit mongodbflex backup schedule [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| Get details of the backup schedule of a MongoDB Flex instance with ID "xxx" | ||
| $ stackit mongodbflex backup schedule --instance-id xxx | ||
| Get details of the backup schedule of a MongoDB Flex instance with ID "xxx" in JSON format | ||
| $ stackit mongodbflex backup schedule --instance-id xxx --output-format json | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit mongodbflex backup schedule" | ||
| --instance-id string Instance ID | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| ## stackit mongodbflex backup update-schedule | ||
| Updates the backup schedule and retention policy for a MongoDB Flex instance | ||
| ### Synopsis | ||
| Updates the backup schedule and retention policy for a MongoDB Flex instance. | ||
| The current backup schedule and retention policy can be seen in the output of the "stackit mongodbflex backup schedule" command. | ||
| The backup schedule is defined in the cron scheduling system format e.g. '0 0 * * *'. | ||
| See below for more detail on the retention policy options. | ||
| ``` | ||
| stackit mongodbflex backup update-schedule [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| Update the backup schedule of a MongoDB Flex instance with ID "xxx" | ||
| $ stackit mongodbflex backup update-schedule --instance-id xxx --schedule '6 6 * * *' | ||
| Update the retention days for snapshots of a MongoDB Flex instance with ID "xxx" to 5 days | ||
| $ stackit mongodbflex backup update-schedule --instance-id xxx --save-snapshot-days 5 | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit mongodbflex backup update-schedule" | ||
| --instance-id string Instance ID | ||
| --save-daily-snapshot-days int Number of days to retain daily snapshots. Should be less than or equal to the number of days of the selected weekly or monthly value. | ||
| --save-monthly-snapshot-months int Number of months to retain monthly snapshots | ||
| --save-snapshot-days int Number of days to retain snapshots. Should be less than or equal to the value of the daily backup. | ||
| --save-weekly-snapshot-weeks int Number of weeks to retain weekly snapshots. Should be less than or equal to the number of weeks of the selected monthly value. | ||
| --schedule string Backup schedule, in the cron scheduling system format e.g. '0 0 * * *' | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| ## stackit mongodbflex backup | ||
| Provides functionality for MongoDB Flex instance backups | ||
| ### Synopsis | ||
| Provides functionality for MongoDB Flex instance backups. | ||
| ``` | ||
| stackit mongodbflex backup [flags] | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit mongodbflex backup" | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit mongodbflex](./stackit_mongodbflex.md) - Provides functionality for MongoDB Flex | ||
| * [stackit mongodbflex backup describe](./stackit_mongodbflex_backup_describe.md) - Shows details of a backup for a MongoDB Flex instance | ||
| * [stackit mongodbflex backup list](./stackit_mongodbflex_backup_list.md) - Lists all backups which are available for a MongoDB Flex instance | ||
| * [stackit mongodbflex backup restore](./stackit_mongodbflex_backup_restore.md) - Restores a MongoDB Flex instance from a backup | ||
| * [stackit mongodbflex backup restore-jobs](./stackit_mongodbflex_backup_restore-jobs.md) - Lists all restore jobs which have been run for a MongoDB Flex instance | ||
| * [stackit mongodbflex backup schedule](./stackit_mongodbflex_backup_schedule.md) - Shows details of the backup schedule and retention policy of a MongoDB Flex instance | ||
| * [stackit mongodbflex backup update-schedule](./stackit_mongodbflex_backup_update-schedule.md) - Updates the backup schedule and retention policy for a MongoDB Flex instance | ||
| ## stackit ske kubeconfig login | ||
| Login plugin for kubernetes clients | ||
| ### Synopsis | ||
| Login plugin for kubernetes clients, that creates short-lived credentials to authenticate against a STACKIT Kubernetes Engine (SKE) cluster. | ||
| First you need to obtain a kubeconfig for use with the login command (first example). | ||
| Secondly you use the kubeconfig with your chosen Kubernetes client (second example), the client will automatically retrieve the credentials via the STACKIT CLI. | ||
| ``` | ||
| stackit ske kubeconfig login [flags] | ||
| ``` | ||
| ### Examples | ||
| ``` | ||
| Get a login kubeconfig for the SKE cluster with name "my-cluster". This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command. | ||
| $ stackit ske kubeconfig create my-cluster --login | ||
| Use the previously saved kubeconfig to authenticate to the SKE cluster, in this case with kubectl. | ||
| $ kubectl cluster-info | ||
| $ kubectl get pods | ||
| ``` | ||
| ### Options | ||
| ``` | ||
| -h, --help Help for "stackit ske kubeconfig login" | ||
| ``` | ||
| ### Options inherited from parent commands | ||
| ``` | ||
| -y, --assume-yes If set, skips all confirmation prompts | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
| --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| ``` | ||
| ### SEE ALSO | ||
| * [stackit ske kubeconfig](./stackit_ske_kubeconfig.md) - Provides functionality for SKE kubeconfig | ||
| package backup | ||
| import ( | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/describe" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/list" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/restore" | ||
| restorejobs "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/restore-jobs" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/schedule" | ||
| updateschedule "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/update-schedule" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "backup", | ||
| Short: "Provides functionality for MongoDB Flex instance backups", | ||
| Long: "Provides functionality for MongoDB Flex instance backups.", | ||
| Args: args.NoArgs, | ||
| Run: utils.CmdHelp, | ||
| } | ||
| addSubcommands(cmd, p) | ||
| return cmd | ||
| } | ||
| func addSubcommands(cmd *cobra.Command, p *print.Printer) { | ||
| cmd.AddCommand(updateschedule.NewCmd(p)) | ||
| cmd.AddCommand(schedule.NewCmd(p)) | ||
| cmd.AddCommand(restore.NewCmd(p)) | ||
| cmd.AddCommand(list.NewCmd(p)) | ||
| cmd.AddCommand(describe.NewCmd(p)) | ||
| cmd.AddCommand(restorejobs.NewCmd(p)) | ||
| } |
| package describe | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| type testCtxKey struct{} | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &mongodbflex.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testInstanceId = uuid.NewString() | ||
| var testBackupId = "backupID" | ||
| func fixtureArgValues(mods ...func(argValues []string)) []string { | ||
| argValues := []string{ | ||
| testBackupId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(argValues) | ||
| } | ||
| return argValues | ||
| } | ||
| func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string { | ||
| flagValues := map[string]string{ | ||
| projectIdFlag: testProjectId, | ||
| instanceIdFlag: testInstanceId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(flagValues) | ||
| } | ||
| return flagValues | ||
| } | ||
| func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| InstanceId: testInstanceId, | ||
| BackupId: testBackupId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(model) | ||
| } | ||
| return model | ||
| } | ||
| func fixtureRequest(mods ...func(request *mongodbflex.ApiGetBackupRequest)) mongodbflex.ApiGetBackupRequest { | ||
| request := testClient.GetBackup(testCtx, testProjectId, testInstanceId, testBackupId) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func TestParseInput(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| argValues []string | ||
| flagValues map[string]string | ||
| isValid bool | ||
| expectedModel *inputModel | ||
| }{ | ||
| { | ||
| description: "base", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(), | ||
| }, | ||
| { | ||
| description: "no values", | ||
| argValues: []string{}, | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "no arg values", | ||
| argValues: []string{}, | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "no flag values", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id missing", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, projectIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 1", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 2", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id missing", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, instanceIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 1", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 2", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "backup id invalid 1", | ||
| argValues: []string{""}, | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| p := print.NewPrinter() | ||
| cmd := NewCmd(p) | ||
| err := globalflags.Configure(cmd.Flags()) | ||
| if err != nil { | ||
| t.Fatalf("configure global flags: %v", err) | ||
| } | ||
| for flag, value := range tt.flagValues { | ||
| err := cmd.Flags().Set(flag, value) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("setting flag --%s=%s: %v", flag, value, err) | ||
| } | ||
| } | ||
| err = cmd.ValidateArgs(tt.argValues) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating args: %v", err) | ||
| } | ||
| err = cmd.ValidateRequiredFlags() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flags: %v", err) | ||
| } | ||
| model, err := parseInput(p, cmd, tt.argValues) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error parsing input: %v", err) | ||
| } | ||
| if !tt.isValid { | ||
| t.Fatalf("did not fail on invalid input") | ||
| } | ||
| diff := cmp.Diff(model, tt.expectedModel) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiGetBackupRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(), | ||
| expectedRequest: fixtureRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package describe | ||
| import ( | ||
| "context" | ||
| "encoding/json" | ||
| "fmt" | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/inhies/go-bytesize" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/utils" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/tables" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| const ( | ||
| backupIdArg = "BACKUP_ID" | ||
| instanceIdFlag = "instance-id" | ||
| ) | ||
| type inputModel struct { | ||
| *globalflags.GlobalFlagModel | ||
| InstanceId string | ||
| BackupId string | ||
| } | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: fmt.Sprintf("describe %s", backupIdArg), | ||
| Short: "Shows details of a backup for a MongoDB Flex instance", | ||
| Long: "Shows details of a backup for a MongoDB Flex instance.", | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `Get details of a backup with ID "xxx" for a MongoDB Flex instance with ID "yyy"`, | ||
| "$ stackit mongodbflex backup describe xxx --instance-id yyy"), | ||
| examples.NewExample( | ||
| `Get details of a backup with ID "xxx" for a MongoDB Flex instance with ID "yyy" in JSON format`, | ||
| "$ stackit mongodbflex backup describe xxx --instance-id yyy --output-format json"), | ||
| ), | ||
| Args: args.SingleArg(backupIdArg, nil), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| model, err := parseInput(p, cmd, args) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| instanceLabel, err := utils.GetInstanceName(ctx, apiClient, model.ProjectId, model.InstanceId) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "get instance name: %v", err) | ||
| instanceLabel = model.InstanceId | ||
| } | ||
| // Call API | ||
| req := buildRequest(ctx, model, apiClient) | ||
| resp, err := req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("describe backup for MongoDB Flex instance: %w", err) | ||
| } | ||
| restoreJobs, err := apiClient.ListRestoreJobs(ctx, model.ProjectId, model.InstanceId).Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("get restore jobs for MongoDB Flex instance %q: %w", instanceLabel, err) | ||
| } | ||
| restoreJobState := utils.GetRestoreStatus(model.BackupId, restoreJobs) | ||
| return outputResult(p, cmd, model.OutputFormat, restoreJobState, *resp.Item) | ||
| }, | ||
| } | ||
| configureFlags(cmd) | ||
| return cmd | ||
| } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") | ||
| err := flags.MarkFlagsRequired(cmd, instanceIdFlag) | ||
| cobra.CheckErr(err) | ||
| } | ||
| func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { | ||
| backupId := inputArgs[0] | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &errors.ProjectIdError{} | ||
| } | ||
| model := inputModel{ | ||
| GlobalFlagModel: globalFlags, | ||
| InstanceId: flags.FlagToStringValue(p, cmd, instanceIdFlag), | ||
| BackupId: backupId, | ||
| } | ||
| if p.IsVerbosityDebug() { | ||
| modelStr, err := print.BuildDebugStrFromInputModel(model) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err) | ||
| } else { | ||
| p.Debug(print.DebugLevel, "parsed input values: %s", modelStr) | ||
| } | ||
| } | ||
| return &model, nil | ||
| } | ||
| func buildRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiGetBackupRequest { | ||
| req := apiClient.GetBackup(ctx, model.ProjectId, model.InstanceId, model.BackupId) | ||
| return req | ||
| } | ||
| func outputResult(p *print.Printer, cmd *cobra.Command, outputFormat, restoreStatus string, backup mongodbflex.Backup) error { | ||
| switch outputFormat { | ||
| case print.JSONOutputFormat: | ||
| details, err := json.MarshalIndent(backup, "", " ") | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex backup: %w", err) | ||
| } | ||
| cmd.Println(string(details)) | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex backup: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
| table := tables.NewTable() | ||
| table.AddRow("ID", *backup.Id) | ||
| table.AddSeparator() | ||
| table.AddRow("CREATED AT", *backup.StartTime) | ||
| table.AddSeparator() | ||
| table.AddRow("EXPIRES AT", *backup.EndTime) | ||
| table.AddSeparator() | ||
| table.AddRow("BACKUP SIZE", bytesize.New(float64(*backup.Size))) | ||
| table.AddSeparator() | ||
| table.AddRow("RESTORE STATUS", restoreStatus) | ||
| err := table.Display(p) | ||
| if err != nil { | ||
| return fmt.Errorf("render table: %w", err) | ||
| } | ||
| return nil | ||
| } | ||
| } |
| package list | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| type testCtxKey struct{} | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &mongodbflex.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testInstanceId = uuid.NewString() | ||
| func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string { | ||
| flagValues := map[string]string{ | ||
| projectIdFlag: testProjectId, | ||
| instanceIdFlag: testInstanceId, | ||
| limitFlag: "10", | ||
| } | ||
| for _, mod := range mods { | ||
| mod(flagValues) | ||
| } | ||
| return flagValues | ||
| } | ||
| func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| InstanceId: utils.Ptr(testInstanceId), | ||
| Limit: utils.Ptr(int64(10)), | ||
| } | ||
| for _, mod := range mods { | ||
| mod(model) | ||
| } | ||
| return model | ||
| } | ||
| func fixtureRequest(mods ...func(request *mongodbflex.ApiListBackupsRequest)) mongodbflex.ApiListBackupsRequest { | ||
| request := testClient.ListBackups(testCtx, testProjectId, testInstanceId) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func TestParseInput(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| flagValues map[string]string | ||
| isValid bool | ||
| expectedModel *inputModel | ||
| }{ | ||
| { | ||
| description: "base", | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(), | ||
| }, | ||
| { | ||
| description: "no values", | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, projectIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, instanceIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "limit invalid", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[limitFlag] = "invalid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "limit invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[limitFlag] = "0" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| p := print.NewPrinter() | ||
| cmd := NewCmd(p) | ||
| err := globalflags.Configure(cmd.Flags()) | ||
| if err != nil { | ||
| t.Fatalf("configure global flags: %v", err) | ||
| } | ||
| for flag, value := range tt.flagValues { | ||
| err := cmd.Flags().Set(flag, value) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("setting flag --%s=%s: %v", flag, value, err) | ||
| } | ||
| } | ||
| err = cmd.ValidateRequiredFlags() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flags: %v", err) | ||
| } | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error parsing input: %v", err) | ||
| } | ||
| if !tt.isValid { | ||
| t.Fatalf("did not fail on invalid input") | ||
| } | ||
| diff := cmp.Diff(model, tt.expectedModel) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiListBackupsRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(), | ||
| expectedRequest: fixtureRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package list | ||
| import ( | ||
| "context" | ||
| "encoding/json" | ||
| "fmt" | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/inhies/go-bytesize" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client" | ||
| mongodbflexUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/utils" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/tables" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| const ( | ||
| instanceIdFlag = "instance-id" | ||
| limitFlag = "limit" | ||
| ) | ||
| type inputModel struct { | ||
| *globalflags.GlobalFlagModel | ||
| InstanceId *string | ||
| Limit *int64 | ||
| } | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "list", | ||
| Short: "Lists all backups which are available for a MongoDB Flex instance", | ||
| Long: "Lists all backups which are available for a MongoDB Flex instance.", | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `List all backups of instance with ID "xxx"`, | ||
| "$ stackit mongodbflex backup list --instance-id xxx"), | ||
| examples.NewExample( | ||
| `List all backups of instance with ID "xxx" in JSON format`, | ||
| "$ stackit mongodbflex backup list --instance-id xxx --output-format json"), | ||
| examples.NewExample( | ||
| `List up to 10 backups of instance with ID "xxx"`, | ||
| "$ stackit mongodbflex backup list --instance-id xxx --limit 10"), | ||
| ), | ||
| Args: args.NoArgs, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| instanceLabel, err := mongodbflexUtils.GetInstanceName(ctx, apiClient, model.ProjectId, *model.InstanceId) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "get instance name: %v", err) | ||
| instanceLabel = *model.InstanceId | ||
| } | ||
| // Call API | ||
| req := buildRequest(ctx, model, apiClient) | ||
| resp, err := req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("get backups for MongoDB Flex instance %q: %w", instanceLabel, err) | ||
| } | ||
| if resp.Items == nil || len(*resp.Items) == 0 { | ||
| cmd.Printf("No backups found for instance %q\n", instanceLabel) | ||
| return nil | ||
| } | ||
| backups := *resp.Items | ||
| restoreJobs, err := apiClient.ListRestoreJobs(ctx, model.ProjectId, *model.InstanceId).Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("get restore jobs for MongoDB Flex instance %q: %w", instanceLabel, err) | ||
| } | ||
| // Truncate output | ||
| if model.Limit != nil && len(backups) > int(*model.Limit) { | ||
| backups = backups[:*model.Limit] | ||
| } | ||
| return outputResult(p, model.OutputFormat, backups, restoreJobs) | ||
| }, | ||
| } | ||
| configureFlags(cmd) | ||
| return cmd | ||
| } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") | ||
| cmd.Flags().Int64(limitFlag, 0, "Maximum number of entries to list") | ||
| err := flags.MarkFlagsRequired(cmd, instanceIdFlag) | ||
| cobra.CheckErr(err) | ||
| } | ||
| func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) { | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &errors.ProjectIdError{} | ||
| } | ||
| limit := flags.FlagToInt64Pointer(p, cmd, limitFlag) | ||
| if limit != nil && *limit < 1 { | ||
| return nil, &errors.FlagValidationError{ | ||
| Flag: limitFlag, | ||
| Details: "must be greater than 0", | ||
| } | ||
| } | ||
| model := inputModel{ | ||
| GlobalFlagModel: globalFlags, | ||
| InstanceId: flags.FlagToStringPointer(p, cmd, instanceIdFlag), | ||
| Limit: flags.FlagToInt64Pointer(p, cmd, limitFlag), | ||
| } | ||
| if p.IsVerbosityDebug() { | ||
| modelStr, err := print.BuildDebugStrFromInputModel(model) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err) | ||
| } else { | ||
| p.Debug(print.DebugLevel, "parsed input values: %s", modelStr) | ||
| } | ||
| } | ||
| return &model, nil | ||
| } | ||
| func buildRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiListBackupsRequest { | ||
| req := apiClient.ListBackups(ctx, model.ProjectId, *model.InstanceId) | ||
| return req | ||
| } | ||
| func outputResult(p *print.Printer, outputFormat string, backups []mongodbflex.Backup, restoreJobs *mongodbflex.ListRestoreJobsResponse) error { | ||
| switch outputFormat { | ||
| case print.JSONOutputFormat: | ||
| details, err := json.MarshalIndent(backups, "", " ") | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex backups list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex backups list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
| table := tables.NewTable() | ||
| table.SetHeader("ID", "CREATED AT", "EXPIRES AT", "BACKUP SIZE", "RESTORE STATUS") | ||
| for i := range backups { | ||
| backup := backups[i] | ||
| restoreStatus := mongodbflexUtils.GetRestoreStatus(*backup.Id, restoreJobs) | ||
| table.AddRow(*backup.Id, *backup.StartTime, *backup.EndTime, bytesize.New(float64(*backup.Size)), restoreStatus) | ||
| } | ||
| err := table.Display(p) | ||
| if err != nil { | ||
| return fmt.Errorf("render table: %w", err) | ||
| } | ||
| return nil | ||
| } | ||
| } |
| package restorejobs | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| type testCtxKey struct{} | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &mongodbflex.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testInstanceId = uuid.NewString() | ||
| func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string { | ||
| flagValues := map[string]string{ | ||
| projectIdFlag: testProjectId, | ||
| instanceIdFlag: testInstanceId, | ||
| limitFlag: "10", | ||
| } | ||
| for _, mod := range mods { | ||
| mod(flagValues) | ||
| } | ||
| return flagValues | ||
| } | ||
| func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| InstanceId: utils.Ptr(testInstanceId), | ||
| Limit: utils.Ptr(int64(10)), | ||
| } | ||
| for _, mod := range mods { | ||
| mod(model) | ||
| } | ||
| return model | ||
| } | ||
| func fixtureRequest(mods ...func(request *mongodbflex.ApiListRestoreJobsRequest)) mongodbflex.ApiListRestoreJobsRequest { | ||
| request := testClient.ListRestoreJobs(testCtx, testProjectId, testInstanceId) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func TestParseInput(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| flagValues map[string]string | ||
| isValid bool | ||
| expectedModel *inputModel | ||
| }{ | ||
| { | ||
| description: "base", | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(), | ||
| }, | ||
| { | ||
| description: "no values", | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, projectIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, instanceIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "limit invalid", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[limitFlag] = "invalid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "limit invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[limitFlag] = "0" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| p := print.NewPrinter() | ||
| cmd := NewCmd(p) | ||
| err := globalflags.Configure(cmd.Flags()) | ||
| if err != nil { | ||
| t.Fatalf("configure global flags: %v", err) | ||
| } | ||
| for flag, value := range tt.flagValues { | ||
| err := cmd.Flags().Set(flag, value) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("setting flag --%s=%s: %v", flag, value, err) | ||
| } | ||
| } | ||
| err = cmd.ValidateRequiredFlags() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flags: %v", err) | ||
| } | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error parsing input: %v", err) | ||
| } | ||
| if !tt.isValid { | ||
| t.Fatalf("did not fail on invalid input") | ||
| } | ||
| diff := cmp.Diff(model, tt.expectedModel) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiListRestoreJobsRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(), | ||
| expectedRequest: fixtureRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package restorejobs | ||
| import ( | ||
| "context" | ||
| "encoding/json" | ||
| "fmt" | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client" | ||
| mongodbflexUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/utils" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/tables" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| const ( | ||
| instanceIdFlag = "instance-id" | ||
| limitFlag = "limit" | ||
| ) | ||
| type inputModel struct { | ||
| *globalflags.GlobalFlagModel | ||
| InstanceId *string | ||
| Limit *int64 | ||
| } | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "restore-jobs", | ||
| Short: "Lists all restore jobs which have been run for a MongoDB Flex instance", | ||
| Long: "Lists all restore jobs which have been run for a MongoDB Flex instance.", | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `List all restore jobs of instance with ID "xxx"`, | ||
| "$ stackit mongodbflex backup restore-jobs --instance-id xxx"), | ||
| examples.NewExample( | ||
| `List all restore jobs of instance with ID "xxx" in JSON format`, | ||
| "$ stackit mongodbflex backup restore-jobs --instance-id xxx --output-format json"), | ||
| examples.NewExample( | ||
| `List up to 10 restore jobs of instance with ID "xxx"`, | ||
| "$ stackit mongodbflex backup restore-jobs --instance-id xxx --limit 10"), | ||
| ), | ||
| Args: args.NoArgs, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| instanceLabel, err := mongodbflexUtils.GetInstanceName(ctx, apiClient, model.ProjectId, *model.InstanceId) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "get instance name: %v", err) | ||
| instanceLabel = *model.InstanceId | ||
| } | ||
| // Call API | ||
| req := buildRequest(ctx, model, apiClient) | ||
| resp, err := req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("get restore jobs for MongoDB Flex instance %q: %w", instanceLabel, err) | ||
| } | ||
| if resp.Items == nil || len(*resp.Items) == 0 { | ||
| cmd.Printf("No restore jobs found for instance %q\n", instanceLabel) | ||
| return nil | ||
| } | ||
| restoreJobs := *resp.Items | ||
| // Truncate output | ||
| if model.Limit != nil && len(restoreJobs) > int(*model.Limit) { | ||
| restoreJobs = restoreJobs[:*model.Limit] | ||
| } | ||
| return outputResult(p, model.OutputFormat, restoreJobs) | ||
| }, | ||
| } | ||
| configureFlags(cmd) | ||
| return cmd | ||
| } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") | ||
| cmd.Flags().Int64(limitFlag, 0, "Maximum number of entries to list") | ||
| err := flags.MarkFlagsRequired(cmd, instanceIdFlag) | ||
| cobra.CheckErr(err) | ||
| } | ||
| func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) { | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &errors.ProjectIdError{} | ||
| } | ||
| limit := flags.FlagToInt64Pointer(p, cmd, limitFlag) | ||
| if limit != nil && *limit < 1 { | ||
| return nil, &errors.FlagValidationError{ | ||
| Flag: limitFlag, | ||
| Details: "must be greater than 0", | ||
| } | ||
| } | ||
| model := inputModel{ | ||
| GlobalFlagModel: globalFlags, | ||
| InstanceId: flags.FlagToStringPointer(p, cmd, instanceIdFlag), | ||
| Limit: flags.FlagToInt64Pointer(p, cmd, limitFlag), | ||
| } | ||
| if p.IsVerbosityDebug() { | ||
| modelStr, err := print.BuildDebugStrFromInputModel(model) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err) | ||
| } else { | ||
| p.Debug(print.DebugLevel, "parsed input values: %s", modelStr) | ||
| } | ||
| } | ||
| return &model, nil | ||
| } | ||
| func buildRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiListRestoreJobsRequest { | ||
| req := apiClient.ListRestoreJobs(ctx, model.ProjectId, *model.InstanceId) | ||
| return req | ||
| } | ||
| func outputResult(p *print.Printer, outputFormat string, restoreJobs []mongodbflex.RestoreInstanceStatus) error { | ||
| switch outputFormat { | ||
| case print.JSONOutputFormat: | ||
| details, err := json.MarshalIndent(restoreJobs, "", " ") | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex restore jobs list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(restoreJobs, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex restore jobs list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
| table := tables.NewTable() | ||
| table.SetHeader("ID", "BACKUP ID", "BACKUP INSTANCE ID", "DATE", "STATUS") | ||
| for i := range restoreJobs { | ||
| restoreJob := restoreJobs[i] | ||
| table.AddRow(*restoreJob.Id, *restoreJob.BackupID, *restoreJob.InstanceId, *restoreJob.Date, *restoreJob.Status) | ||
| } | ||
| err := table.Display(p) | ||
| if err != nil { | ||
| return fmt.Errorf("render table: %w", err) | ||
| } | ||
| return nil | ||
| } | ||
| } |
| package restore | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| type testCtxKey struct{} | ||
| const ( | ||
| testBackupId = "backupID" | ||
| testTimestamp = "2021-01-01T00:00:00Z" | ||
| ) | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &mongodbflex.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testInstanceId = uuid.NewString() | ||
| var testBackupInstanceId = uuid.NewString() | ||
| func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string { | ||
| flagValues := map[string]string{ | ||
| projectIdFlag: testProjectId, | ||
| backupIdFlag: testBackupId, | ||
| backupInstanceIdFlag: testBackupInstanceId, | ||
| instanceIdFlag: testInstanceId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(flagValues) | ||
| } | ||
| return flagValues | ||
| } | ||
| func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| InstanceId: testInstanceId, | ||
| BackupId: testBackupId, | ||
| BackupInstanceId: testBackupInstanceId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(model) | ||
| } | ||
| return model | ||
| } | ||
| func fixtureRestoreRequest(mods ...func(request mongodbflex.ApiRestoreInstanceRequest)) mongodbflex.ApiRestoreInstanceRequest { | ||
| request := testClient.RestoreInstance(testCtx, testProjectId, testInstanceId) | ||
| request = request.RestoreInstancePayload(mongodbflex.RestoreInstancePayload{ | ||
| BackupId: utils.Ptr(testBackupId), | ||
| InstanceId: utils.Ptr(testBackupInstanceId), | ||
| }) | ||
| for _, mod := range mods { | ||
| mod(request) | ||
| } | ||
| return request | ||
| } | ||
| func fixtureCloneRequest(mods ...func(request mongodbflex.ApiCloneInstanceRequest)) mongodbflex.ApiCloneInstanceRequest { | ||
| request := testClient.CloneInstance(testCtx, testProjectId, testInstanceId) | ||
| request = request.CloneInstancePayload(mongodbflex.CloneInstancePayload{ | ||
| Timestamp: utils.Ptr(testTimestamp), | ||
| InstanceId: utils.Ptr(testBackupInstanceId), | ||
| }) | ||
| for _, mod := range mods { | ||
| mod(request) | ||
| } | ||
| return request | ||
| } | ||
| func TestParseInput(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| flagValues map[string]string | ||
| aclValues []string | ||
| isValid bool | ||
| expectedModel *inputModel | ||
| }{ | ||
| { | ||
| description: "no values", | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "base", | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(), | ||
| }, | ||
| { | ||
| description: "project id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, projectIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "backup instance id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[backupInstanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "backup instance id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[backupInstanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "timestamp and backup id both provided", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[timestampFlag] = testTimestamp | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "timestamp and backup id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, backupIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| p := print.NewPrinter() | ||
| cmd := NewCmd(p) | ||
| err := globalflags.Configure(cmd.Flags()) | ||
| if err != nil { | ||
| t.Fatalf("configure global flags: %v", err) | ||
| } | ||
| for flag, value := range tt.flagValues { | ||
| err := cmd.Flags().Set(flag, value) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("setting flag --%s=%s: %v", flag, value, err) | ||
| } | ||
| } | ||
| err = cmd.ValidateRequiredFlags() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flags: %v", err) | ||
| } | ||
| err = cmd.ValidateFlagGroups() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flag groups: %v", err) | ||
| } | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error parsing flags: %v", err) | ||
| } | ||
| if !tt.isValid { | ||
| t.Fatalf("did not fail on invalid input") | ||
| } | ||
| diff := cmp.Diff(model, tt.expectedModel) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildRestoreRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiRestoreInstanceRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(), | ||
| expectedRequest: fixtureRestoreRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildRestoreRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx)) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildCloneRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiCloneInstanceRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(func(model *inputModel) { | ||
| model.BackupId = "" | ||
| model.Timestamp = testTimestamp | ||
| }), | ||
| expectedRequest: fixtureCloneRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildCloneRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx)) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestGetIsRestoreOperation(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expected bool | ||
| }{ | ||
| { | ||
| description: "true", | ||
| model: fixtureInputModel(), | ||
| expected: true, | ||
| }, | ||
| { | ||
| description: "false", | ||
| model: fixtureInputModel(func(model *inputModel) { | ||
| model.BackupId = "" | ||
| model.Timestamp = testTimestamp | ||
| }), | ||
| expected: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| result := getIsRestoreOperation(tt.model.BackupId, tt.model.Timestamp) | ||
| if result != tt.expected { | ||
| t.Fatalf("Data does not match: %t", result) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package restore | ||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client" | ||
| mongodbUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/utils" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/spinner" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex/wait" | ||
| ) | ||
| const ( | ||
| instanceIdFlag = "instance-id" | ||
| backupInstanceIdFlag = "backup-instance-id" | ||
| backupIdFlag = "backup-id" | ||
| timestampFlag = "timestamp" | ||
| ) | ||
| type inputModel struct { | ||
| *globalflags.GlobalFlagModel | ||
| InstanceId string | ||
| BackupInstanceId string | ||
| BackupId string | ||
| Timestamp string | ||
| } | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "restore", | ||
| Short: "Restores a MongoDB Flex instance from a backup", | ||
| Long: fmt.Sprintf("%s\n%s\n%s", | ||
| "Restores a MongoDB Flex instance from a backup of an instance or clones a MongoDB Flex instance from a point-in-time snapshot.", | ||
| "The backup is specified by a backup ID and the point-in-time snapshot is specified by a timestamp.", | ||
| "You can specify the instance to which the backup will be applied. If not specified, the backup will be applied to the same instance from which it was taken.", | ||
| ), | ||
| Args: args.NoArgs, | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `Restore a MongoDB Flex instance with ID "yyy" using backup with ID "zzz"`, | ||
| `$ stackit mongodbflex backup restore --instance-id yyy --backup-id zzz`), | ||
| examples.NewExample( | ||
| `Clone a MongoDB Flex instance with ID "yyy" via point-in-time restore to timestamp "2024-05-14T14:31:48Z"`, | ||
| `$ stackit mongodbflex backup restore --instance-id yyy --timestamp 2024-05-14T14:31:48Z`), | ||
| examples.NewExample( | ||
| `Restore a MongoDB Flex instance with ID "yyy", using backup from instance with ID "zzz" with backup ID "xxx"`, | ||
| `$ stackit mongodbflex backup restore --instance-id zzz --backup-instance-id yyy --backup-id xxx`), | ||
| ), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| instanceLabel, err := mongodbUtils.GetInstanceName(ctx, apiClient, model.ProjectId, model.InstanceId) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "get instance name: %v", err) | ||
| instanceLabel = model.ProjectId | ||
| } | ||
| if !model.AssumeYes { | ||
| prompt := fmt.Sprintf("Are you sure you want to restore MongoDB Flex instance %q?", instanceLabel) | ||
| err = p.PromptForConfirmation(prompt) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } | ||
| // If backupInstanceId is not provided, the target is the same instance as the backup | ||
| if model.BackupInstanceId == "" { | ||
| model.BackupInstanceId = model.InstanceId | ||
| } | ||
| isRestoreOperation := getIsRestoreOperation(model.BackupId, model.Timestamp) | ||
| // If backupId is provided, restore the instance from the backup with the backupId | ||
| if isRestoreOperation { | ||
| req := buildRestoreRequest(ctx, model, apiClient) | ||
| _, err = req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("restore MongoDB Flex instance: %w", err) | ||
| } | ||
| if !model.Async { | ||
| s := spinner.New(p) | ||
| s.Start("Restoring instance") | ||
| _, err = wait.RestoreInstanceWaitHandler(ctx, apiClient, model.ProjectId, model.InstanceId, model.BackupId).WaitWithContext(ctx) | ||
| if err != nil { | ||
| return fmt.Errorf("wait for MongoDB Flex instance restoration: %w", err) | ||
| } | ||
| s.Stop() | ||
| } | ||
| p.Outputf("Restored instance %q with backup %q\n", model.InstanceId, model.BackupId) | ||
| return nil | ||
| } | ||
| // Else, if timestamp is provided, clone the instance from a point-in-time snapshot | ||
| req := buildCloneRequest(ctx, model, apiClient) | ||
| _, err = req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("clone MongoDB Flex instance: %w", err) | ||
| } | ||
| if !model.Async { | ||
| s := spinner.New(p) | ||
| s.Start("Cloning instance") | ||
| _, err = wait.CloneInstanceWaitHandler(ctx, apiClient, model.ProjectId, model.InstanceId).WaitWithContext(ctx) | ||
| if err != nil { | ||
| return fmt.Errorf("wait for MongoDB Flex instance cloning: %w", err) | ||
| } | ||
| s.Stop() | ||
| } | ||
| p.Outputf("Cloned instance %q from backup with timestamp %q\n", model.InstanceId, model.Timestamp) | ||
| return nil | ||
| }, | ||
| } | ||
| configureFlags(cmd) | ||
| return cmd | ||
| } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") | ||
| cmd.Flags().Var(flags.UUIDFlag(), backupInstanceIdFlag, "Instance ID of the target instance to restore the backup to") | ||
| cmd.Flags().String(backupIdFlag, "", "Backup ID") | ||
| cmd.Flags().String(timestampFlag, "", "Timestamp of the snapshot to use as a source for cloning the instance in a date-time with the RFC3339 layout format, e.g. 2024-01-01T00:00:00Z") | ||
| err := flags.MarkFlagsRequired(cmd, instanceIdFlag) | ||
| cobra.CheckErr(err) | ||
| } | ||
| func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) { | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &cliErr.ProjectIdError{} | ||
| } | ||
| backupId := flags.FlagToStringValue(p, cmd, backupIdFlag) | ||
| timestamp := flags.FlagToStringValue(p, cmd, timestampFlag) | ||
| if backupId != "" && timestamp != "" || backupId == "" && timestamp == "" { | ||
| return nil, &cliErr.RequiredMutuallyExclusiveFlagsError{ | ||
| Flags: []string{backupIdFlag, timestampFlag}, | ||
| } | ||
| } | ||
| model := inputModel{ | ||
| GlobalFlagModel: globalFlags, | ||
| InstanceId: flags.FlagToStringValue(p, cmd, instanceIdFlag), | ||
| BackupInstanceId: flags.FlagToStringValue(p, cmd, backupInstanceIdFlag), | ||
| BackupId: flags.FlagToStringValue(p, cmd, backupIdFlag), | ||
| Timestamp: flags.FlagToStringValue(p, cmd, timestampFlag), | ||
| } | ||
| if p.IsVerbosityDebug() { | ||
| modelStr, err := print.BuildDebugStrFromInputModel(model) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err) | ||
| } else { | ||
| p.Debug(print.DebugLevel, "parsed input values: %s", modelStr) | ||
| } | ||
| } | ||
| return &model, nil | ||
| } | ||
| func buildRestoreRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiRestoreInstanceRequest { | ||
| req := apiClient.RestoreInstance(ctx, model.ProjectId, model.InstanceId) | ||
| req = req.RestoreInstancePayload(mongodbflex.RestoreInstancePayload{ | ||
| BackupId: &model.BackupId, | ||
| InstanceId: &model.BackupInstanceId, | ||
| }) | ||
| return req | ||
| } | ||
| func buildCloneRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiCloneInstanceRequest { | ||
| req := apiClient.CloneInstance(ctx, model.ProjectId, model.InstanceId) | ||
| req = req.CloneInstancePayload(mongodbflex.CloneInstancePayload{ | ||
| Timestamp: &model.Timestamp, | ||
| InstanceId: &model.BackupInstanceId, | ||
| }) | ||
| return req | ||
| } | ||
| func getIsRestoreOperation(backupId, timestamp string) bool { | ||
| return backupId != "" && timestamp == "" | ||
| } |
| package schedule | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| type testCtxKey struct{} | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &mongodbflex.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testInstanceId = uuid.NewString() | ||
| func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string { | ||
| flagValues := map[string]string{ | ||
| projectIdFlag: testProjectId, | ||
| instanceIdFlag: testInstanceId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(flagValues) | ||
| } | ||
| return flagValues | ||
| } | ||
| func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| InstanceId: testInstanceId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(model) | ||
| } | ||
| return model | ||
| } | ||
| func fixtureRequest(mods ...func(request *mongodbflex.ApiGetInstanceRequest)) mongodbflex.ApiGetInstanceRequest { | ||
| request := testClient.GetInstance(testCtx, testProjectId, testInstanceId) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func TestParseInput(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| flagValues map[string]string | ||
| isValid bool | ||
| expectedModel *inputModel | ||
| }{ | ||
| { | ||
| description: "base", | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(), | ||
| }, | ||
| { | ||
| description: "no values", | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, projectIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, instanceIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| cmd := &cobra.Command{} | ||
| err := globalflags.Configure(cmd.Flags()) | ||
| if err != nil { | ||
| t.Fatalf("configure global flags: %v", err) | ||
| } | ||
| configureFlags(cmd) | ||
| for flag, value := range tt.flagValues { | ||
| err := cmd.Flags().Set(flag, value) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("setting flag --%s=%s: %v", flag, value, err) | ||
| } | ||
| } | ||
| err = cmd.ValidateRequiredFlags() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flags: %v", err) | ||
| } | ||
| p := print.NewPrinter() | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error parsing flags: %v", err) | ||
| } | ||
| if !tt.isValid { | ||
| t.Fatalf("did not fail on invalid input") | ||
| } | ||
| diff := cmp.Diff(model, tt.expectedModel) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiGetInstanceRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(), | ||
| expectedRequest: fixtureRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package schedule | ||
| import ( | ||
| "context" | ||
| "encoding/json" | ||
| "fmt" | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/tables" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| const ( | ||
| instanceIdFlag = "instance-id" | ||
| ) | ||
| type inputModel struct { | ||
| *globalflags.GlobalFlagModel | ||
| InstanceId string | ||
| } | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "schedule", | ||
| Short: "Shows details of the backup schedule and retention policy of a MongoDB Flex instance", | ||
| Long: "Shows details of the backup schedule and retention policy of a MongoDB Flex instance.", | ||
| Args: args.NoArgs, | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `Get details of the backup schedule of a MongoDB Flex instance with ID "xxx"`, | ||
| "$ stackit mongodbflex backup schedule --instance-id xxx"), | ||
| examples.NewExample( | ||
| `Get details of the backup schedule of a MongoDB Flex instance with ID "xxx" in JSON format`, | ||
| "$ stackit mongodbflex backup schedule --instance-id xxx --output-format json"), | ||
| ), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Call API | ||
| req := buildRequest(ctx, model, apiClient) | ||
| resp, err := req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("read MongoDB Flex instance: %w", err) | ||
| } | ||
| return outputResult(p, model.OutputFormat, resp.Item) | ||
| }, | ||
| } | ||
| configureFlags(cmd) | ||
| return cmd | ||
| } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") | ||
| err := flags.MarkFlagsRequired(cmd, instanceIdFlag) | ||
| cobra.CheckErr(err) | ||
| } | ||
| func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) { | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &errors.ProjectIdError{} | ||
| } | ||
| model := inputModel{ | ||
| GlobalFlagModel: globalFlags, | ||
| InstanceId: *flags.FlagToStringPointer(p, cmd, instanceIdFlag), | ||
| } | ||
| if p.IsVerbosityDebug() { | ||
| modelStr, err := print.BuildDebugStrFromInputModel(model) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err) | ||
| } else { | ||
| p.Debug(print.DebugLevel, "parsed input values: %s", modelStr) | ||
| } | ||
| } | ||
| return &model, nil | ||
| } | ||
| func buildRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiGetInstanceRequest { | ||
| req := apiClient.GetInstance(ctx, model.ProjectId, model.InstanceId) | ||
| return req | ||
| } | ||
| func outputResult(p *print.Printer, outputFormat string, instance *mongodbflex.Instance) error { | ||
| output := struct { | ||
| BackupSchedule string `json:"backup_schedule"` | ||
| DailySnaphotRetentionDays string `json:"daily_snapshot_retention_days"` | ||
| MonthlySnapshotRetentionMonths string `json:"monthly_snapshot_retention_months"` | ||
| PointInTimeWindowHours string `json:"point_in_time_window_hours"` | ||
| SnapshotRetentionDays string `json:"snapshot_retention_days"` | ||
| WeeklySnapshotRetentionWeeks string `json:"weekly_snapshot_retention_weeks"` | ||
| }{ | ||
| BackupSchedule: *instance.BackupSchedule, | ||
| DailySnaphotRetentionDays: (*instance.Options)["dailySnapshotRetentionDays"], | ||
| MonthlySnapshotRetentionMonths: (*instance.Options)["monthlySnapshotRetentionDays"], | ||
| PointInTimeWindowHours: (*instance.Options)["pointInTimeWindowHours"], | ||
| SnapshotRetentionDays: (*instance.Options)["snapshotRetentionDays"], | ||
| WeeklySnapshotRetentionWeeks: (*instance.Options)["weeklySnapshotRetentionWeeks"], | ||
| } | ||
| switch outputFormat { | ||
| case print.JSONOutputFormat: | ||
| details, err := json.MarshalIndent(output, "", " ") | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex backup schedule: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex backup schedule: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
| table := tables.NewTable() | ||
| table.AddRow("BACKUP SCHEDULE", *instance.BackupSchedule) | ||
| table.AddSeparator() | ||
| table.AddRow("DAILY SNAPSHOT RETENTION (DAYS)", (*instance.Options)["dailySnapshotRetentionDays"]) | ||
| table.AddSeparator() | ||
| table.AddRow("MONTHLY SNAPSHOT RETENTION (MONTHS)", (*instance.Options)["monthlySnapshotRetentionMonths"]) | ||
| table.AddSeparator() | ||
| table.AddRow("POINT IN TIME WINDOW (HOURS)", (*instance.Options)["pointInTimeWindowHours"]) | ||
| table.AddSeparator() | ||
| table.AddRow("SNAPSHOT RETENTION (DAYS)", (*instance.Options)["snapshotRetentionDays"]) | ||
| table.AddSeparator() | ||
| table.AddRow("WEEKLY SNAPSHOT RETENTION (WEEKS)", (*instance.Options)["weeklySnapshotRetentionWeeks"]) | ||
| table.AddSeparator() | ||
| err := table.Display(p) | ||
| if err != nil { | ||
| return fmt.Errorf("render table: %w", err) | ||
| } | ||
| return nil | ||
| } | ||
| } |
| package updateschedule | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| type testCtxKey struct{} | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &mongodbflex.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testInstanceId = uuid.NewString() | ||
| var testSchedule = "0 0/6 * * *" | ||
| func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string { | ||
| flagValues := map[string]string{ | ||
| projectIdFlag: testProjectId, | ||
| scheduleFlag: testSchedule, | ||
| instanceIdFlag: testInstanceId, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(flagValues) | ||
| } | ||
| return flagValues | ||
| } | ||
| func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | ||
| model := &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| Verbosity: globalflags.VerbosityDefault, | ||
| }, | ||
| InstanceId: utils.Ptr(testInstanceId), | ||
| BackupSchedule: &testSchedule, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(model) | ||
| } | ||
| return model | ||
| } | ||
| func fixturePayload(mods ...func(payload *mongodbflex.UpdateBackupSchedulePayload)) mongodbflex.UpdateBackupSchedulePayload { | ||
| payload := mongodbflex.UpdateBackupSchedulePayload{ | ||
| BackupSchedule: utils.Ptr(testSchedule), | ||
| SnapshotRetentionDays: utils.Ptr(int64(3)), | ||
| DailySnapshotRetentionDays: utils.Ptr(int64(0)), | ||
| WeeklySnapshotRetentionWeeks: utils.Ptr(int64(3)), | ||
| MonthlySnapshotRetentionMonths: utils.Ptr(int64(1)), | ||
| PointInTimeWindowHours: utils.Ptr(int64(30)), | ||
| } | ||
| for _, mod := range mods { | ||
| mod(&payload) | ||
| } | ||
| return payload | ||
| } | ||
| func fixtureUpdateBackupScheduleRequest(mods ...func(request *mongodbflex.ApiUpdateBackupScheduleRequest)) mongodbflex.ApiUpdateBackupScheduleRequest { | ||
| request := testClient.UpdateBackupSchedule(testCtx, testProjectId, testInstanceId) | ||
| request = request.UpdateBackupSchedulePayload(fixturePayload()) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func fixtureGetInstanceRequest(mods ...func(request *mongodbflex.ApiGetInstanceRequest)) mongodbflex.ApiGetInstanceRequest { | ||
| request := testClient.GetInstance(testCtx, testProjectId, testInstanceId) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func fixtureInstance(mods ...func(instance *mongodbflex.Instance)) *mongodbflex.Instance { | ||
| instance := mongodbflex.Instance{ | ||
| BackupSchedule: &testSchedule, | ||
| Options: &map[string]string{ | ||
| "dailySnapshotRetentionDays": "0", | ||
| "weeklySnapshotRetentionWeeks": "3", | ||
| "monthlySnapshotRetentionMonths": "1", | ||
| "pointInTimeWindowHours": "30", | ||
| "snapshotRetentionDays": "3", | ||
| }, | ||
| } | ||
| for _, mod := range mods { | ||
| mod(&instance) | ||
| } | ||
| return &instance | ||
| } | ||
| func TestParseInput(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| flagValues map[string]string | ||
| aclValues []string | ||
| isValid bool | ||
| expectedModel *inputModel | ||
| }{ | ||
| { | ||
| description: "base", | ||
| flagValues: fixtureFlagValues(), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(), | ||
| }, | ||
| { | ||
| description: "no values", | ||
| flagValues: map[string]string{}, | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, projectIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "project id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[projectIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, instanceIdFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 1", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "instance id invalid 2", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues[instanceIdFlag] = "invalid-uuid" | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| { | ||
| description: "backup schedule missing", | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| delete(flagValues, scheduleFlag) | ||
| }), | ||
| isValid: false, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| cmd := NewCmd(nil) | ||
| err := globalflags.Configure(cmd.Flags()) | ||
| if err != nil { | ||
| t.Fatalf("configure global flags: %v", err) | ||
| } | ||
| for flag, value := range tt.flagValues { | ||
| err := cmd.Flags().Set(flag, value) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("setting flag --%s=%s: %v", flag, value, err) | ||
| } | ||
| } | ||
| err = cmd.ValidateRequiredFlags() | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error validating flags: %v", err) | ||
| } | ||
| model, err := parseInput(nil, cmd) | ||
| if err != nil { | ||
| if !tt.isValid { | ||
| return | ||
| } | ||
| t.Fatalf("error parsing flags: %v", err) | ||
| } | ||
| if !tt.isValid { | ||
| t.Fatalf("did not fail on invalid input") | ||
| } | ||
| diff := cmp.Diff(model, tt.expectedModel) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildGetInstanceRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| expectedRequest mongodbflex.ApiGetInstanceRequest | ||
| }{ | ||
| { | ||
| description: "base", | ||
| model: fixtureInputModel(), | ||
| expectedRequest: fixtureGetInstanceRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildGetInstanceRequest(testCtx, tt.model, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestBuildUpdateBackupScheduleRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| model *inputModel | ||
| instance *mongodbflex.Instance | ||
| expectedRequest mongodbflex.ApiUpdateBackupScheduleRequest | ||
| }{ | ||
| { | ||
| description: "update backup schedule, read retention policy from instance", | ||
| model: fixtureInputModel(), | ||
| instance: fixtureInstance(), | ||
| expectedRequest: fixtureUpdateBackupScheduleRequest(), | ||
| }, | ||
| { | ||
| description: "update retention policy, read backup schedule from instance", | ||
| model: &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| }, | ||
| InstanceId: utils.Ptr(testInstanceId), | ||
| DailySnaphotRetentionDays: utils.Ptr(int64(2)), | ||
| }, | ||
| instance: fixtureInstance(), | ||
| expectedRequest: fixtureUpdateBackupScheduleRequest().UpdateBackupSchedulePayload( | ||
| fixturePayload(func(payload *mongodbflex.UpdateBackupSchedulePayload) { | ||
| payload.DailySnapshotRetentionDays = utils.Ptr(int64(2)) | ||
| }), | ||
| ), | ||
| }, | ||
| { | ||
| description: "update backup schedule and retention policy", | ||
| model: &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| }, | ||
| InstanceId: utils.Ptr(testInstanceId), | ||
| BackupSchedule: utils.Ptr("0 0/6 5 2 1"), | ||
| DailySnaphotRetentionDays: utils.Ptr(int64(2)), | ||
| WeeklySnapshotRetentionWeeks: utils.Ptr(int64(2)), | ||
| MonthlySnapshotRetentionMonths: utils.Ptr(int64(2)), | ||
| SnapshotRetentionDays: utils.Ptr(int64(2)), | ||
| }, | ||
| instance: fixtureInstance(), | ||
| expectedRequest: fixtureUpdateBackupScheduleRequest().UpdateBackupSchedulePayload( | ||
| fixturePayload(func(payload *mongodbflex.UpdateBackupSchedulePayload) { | ||
| payload.BackupSchedule = utils.Ptr("0 0/6 5 2 1") | ||
| payload.DailySnapshotRetentionDays = utils.Ptr(int64(2)) | ||
| payload.WeeklySnapshotRetentionWeeks = utils.Ptr(int64(2)) | ||
| payload.MonthlySnapshotRetentionMonths = utils.Ptr(int64(2)) | ||
| payload.SnapshotRetentionDays = utils.Ptr(int64(2)) | ||
| }), | ||
| ), | ||
| }, | ||
| { | ||
| description: "no fields set, empty instance (use defaults)", | ||
| model: &inputModel{ | ||
| GlobalFlagModel: &globalflags.GlobalFlagModel{ | ||
| ProjectId: testProjectId, | ||
| }, | ||
| InstanceId: utils.Ptr(testInstanceId), | ||
| }, | ||
| instance: &mongodbflex.Instance{}, | ||
| expectedRequest: fixtureUpdateBackupScheduleRequest(), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildUpdateBackupScheduleRequest(testCtx, tt.model, tt.instance, testClient) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package updateschedule | ||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "strconv" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/flags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/client" | ||
| mongoDBflexUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/mongodbflex/utils" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex" | ||
| ) | ||
| const ( | ||
| instanceIdFlag = "instance-id" | ||
| scheduleFlag = "schedule" | ||
| snapshotRetentionDaysFlag = "save-snapshot-days" | ||
| dailySnapshotRetentionDaysFlag = "save-daily-snapshot-days" | ||
| weeklySnapshotRetentionWeeksFlag = "save-weekly-snapshot-weeks" | ||
| monthlySnapshotRetentionMonthsFlag = "save-monthly-snapshot-months" | ||
| // Default values for the backup schedule options | ||
| defaultBackupSchedule = "0 0/6 * * *" | ||
| defaultSnapshotRetentionDays int64 = 3 | ||
| defaultDailySnapshotRetentionDays int64 = 0 | ||
| defaultWeeklySnapshotRetentionWeeks int64 = 3 | ||
| defaultMonthlySnapshotRetentionMonths int64 = 1 | ||
| defaultPointInTimeWindowHours int64 = 30 | ||
| ) | ||
| type inputModel struct { | ||
| *globalflags.GlobalFlagModel | ||
| InstanceId *string | ||
| BackupSchedule *string | ||
| SnapshotRetentionDays *int64 | ||
| DailySnaphotRetentionDays *int64 | ||
| WeeklySnapshotRetentionWeeks *int64 | ||
| MonthlySnapshotRetentionMonths *int64 | ||
| } | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "update-schedule", | ||
| Short: "Updates the backup schedule and retention policy for a MongoDB Flex instance", | ||
| Long: fmt.Sprintf("%s\n%s\n%s\n%s", | ||
| "Updates the backup schedule and retention policy for a MongoDB Flex instance.", | ||
| `The current backup schedule and retention policy can be seen in the output of the "stackit mongodbflex backup schedule" command.`, | ||
| "The backup schedule is defined in the cron scheduling system format e.g. '0 0 * * *'.", | ||
| "See below for more detail on the retention policy options.", | ||
| ), | ||
| Args: args.NoArgs, | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `Update the backup schedule of a MongoDB Flex instance with ID "xxx"`, | ||
| "$ stackit mongodbflex backup update-schedule --instance-id xxx --schedule '6 6 * * *'"), | ||
| examples.NewExample( | ||
| `Update the retention days for snapshots of a MongoDB Flex instance with ID "xxx" to 5 days`, | ||
| "$ stackit mongodbflex backup update-schedule --instance-id xxx --save-snapshot-days 5"), | ||
| ), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| model, err := parseInput(p, cmd) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| instanceLabel, err := mongoDBflexUtils.GetInstanceName(ctx, apiClient, model.ProjectId, *model.InstanceId) | ||
| if err != nil { | ||
| p.Debug(print.ErrorLevel, "get instance name: %v", err) | ||
| instanceLabel = *model.InstanceId | ||
| } | ||
| if !model.AssumeYes { | ||
| prompt := fmt.Sprintf("Are you sure you want to update backup schedule of instance %q?", instanceLabel) | ||
| err = p.PromptForConfirmation(prompt) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } | ||
| // Get current instance | ||
| getReq := buildGetInstanceRequest(ctx, model, apiClient) | ||
| getResp, err := getReq.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("get MongoDB Flex instance %q: %w", instanceLabel, err) | ||
| } | ||
| instance := getResp.Item | ||
| // Call API | ||
| req := buildUpdateBackupScheduleRequest(ctx, model, instance, apiClient) | ||
| _, err = req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("update backup schedule of MongoDB Flex instance: %w", err) | ||
| } | ||
| cmd.Printf("Updated backup schedule of instance %q\n", instanceLabel) | ||
| return nil | ||
| }, | ||
| } | ||
| configureFlags(cmd) | ||
| return cmd | ||
| } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") | ||
| cmd.Flags().String(scheduleFlag, "", "Backup schedule, in the cron scheduling system format e.g. '0 0 * * *'") | ||
| cmd.Flags().Int64(snapshotRetentionDaysFlag, 0, "Number of days to retain snapshots. Should be less than or equal to the value of the daily backup.") | ||
| cmd.Flags().Int64(dailySnapshotRetentionDaysFlag, 0, "Number of days to retain daily snapshots. Should be less than or equal to the number of days of the selected weekly or monthly value.") | ||
| cmd.Flags().Int64(weeklySnapshotRetentionWeeksFlag, 0, "Number of weeks to retain weekly snapshots. Should be less than or equal to the number of weeks of the selected monthly value.") | ||
| cmd.Flags().Int64(monthlySnapshotRetentionMonthsFlag, 0, "Number of months to retain monthly snapshots") | ||
| err := flags.MarkFlagsRequired(cmd, instanceIdFlag) | ||
| cobra.CheckErr(err) | ||
| } | ||
| func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) { | ||
| globalFlags := globalflags.Parse(p, cmd) | ||
| if globalFlags.ProjectId == "" { | ||
| return nil, &cliErr.ProjectIdError{} | ||
| } | ||
| schedule := flags.FlagToStringPointer(p, cmd, scheduleFlag) | ||
| snapshotRetentionDays := flags.FlagToInt64Pointer(p, cmd, snapshotRetentionDaysFlag) | ||
| dailySnapshotRetentionDays := flags.FlagToInt64Pointer(p, cmd, dailySnapshotRetentionDaysFlag) | ||
| weeklySnapshotRetentionWeeks := flags.FlagToInt64Pointer(p, cmd, weeklySnapshotRetentionWeeksFlag) | ||
| monthlySnapshotRetentionMonths := flags.FlagToInt64Pointer(p, cmd, monthlySnapshotRetentionMonthsFlag) | ||
| if schedule == nil && snapshotRetentionDays == nil && dailySnapshotRetentionDays == nil && weeklySnapshotRetentionWeeks == nil && monthlySnapshotRetentionMonths == nil { | ||
| return nil, &cliErr.EmptyUpdateError{} | ||
| } | ||
| return &inputModel{ | ||
| GlobalFlagModel: globalFlags, | ||
| InstanceId: flags.FlagToStringPointer(p, cmd, instanceIdFlag), | ||
| BackupSchedule: schedule, | ||
| DailySnaphotRetentionDays: dailySnapshotRetentionDays, | ||
| MonthlySnapshotRetentionMonths: monthlySnapshotRetentionMonths, | ||
| SnapshotRetentionDays: snapshotRetentionDays, | ||
| WeeklySnapshotRetentionWeeks: weeklySnapshotRetentionWeeks, | ||
| }, nil | ||
| } | ||
| func buildUpdateBackupScheduleRequest(ctx context.Context, model *inputModel, instance *mongodbflex.Instance, apiClient *mongodbflex.APIClient) mongodbflex.ApiUpdateBackupScheduleRequest { | ||
| req := apiClient.UpdateBackupSchedule(ctx, model.ProjectId, *model.InstanceId) | ||
| payload := getUpdateBackupSchedulePayload(instance) | ||
| if model.BackupSchedule != nil { | ||
| payload.BackupSchedule = model.BackupSchedule | ||
| } | ||
| if model.DailySnaphotRetentionDays != nil { | ||
| payload.DailySnapshotRetentionDays = model.DailySnaphotRetentionDays | ||
| } | ||
| if model.MonthlySnapshotRetentionMonths != nil { | ||
| payload.MonthlySnapshotRetentionMonths = model.MonthlySnapshotRetentionMonths | ||
| } | ||
| if model.SnapshotRetentionDays != nil { | ||
| payload.SnapshotRetentionDays = model.SnapshotRetentionDays | ||
| } | ||
| if model.WeeklySnapshotRetentionWeeks != nil { | ||
| payload.WeeklySnapshotRetentionWeeks = model.WeeklySnapshotRetentionWeeks | ||
| } | ||
| req = req.UpdateBackupSchedulePayload(payload) | ||
| return req | ||
| } | ||
| // getUpdateBackupSchedulePayload creates a payload for the UpdateBackupSchedule API call | ||
| // it will use the values already set in the instance object | ||
| // falls back to default values if the values are not set | ||
| func getUpdateBackupSchedulePayload(instance *mongodbflex.Instance) mongodbflex.UpdateBackupSchedulePayload { | ||
| options := make(map[string]string) | ||
| if instance == nil || instance.Options != nil { | ||
| options = *instance.Options | ||
| } | ||
| backupSchedule := instance.BackupSchedule | ||
| if backupSchedule == nil { | ||
| backupSchedule = utils.Ptr(defaultBackupSchedule) | ||
| } | ||
| dailySnapshotRetentionDays, err := strconv.ParseInt(options["dailySnapshotRetentionDays"], 10, 64) | ||
| if err != nil { | ||
| dailySnapshotRetentionDays = defaultDailySnapshotRetentionDays | ||
| } | ||
| weeklySnapshotRetentionWeeks, err := strconv.ParseInt(options["weeklySnapshotRetentionWeeks"], 10, 64) | ||
| if err != nil { | ||
| weeklySnapshotRetentionWeeks = defaultWeeklySnapshotRetentionWeeks | ||
| } | ||
| monthlySnapshotRetentionMonths, err := strconv.ParseInt(options["monthlySnapshotRetentionMonths"], 10, 64) | ||
| if err != nil { | ||
| monthlySnapshotRetentionMonths = defaultMonthlySnapshotRetentionMonths | ||
| } | ||
| pointInTimeWindowHours, err := strconv.ParseInt(options["pointInTimeWindowHours"], 10, 64) | ||
| if err != nil { | ||
| pointInTimeWindowHours = defaultPointInTimeWindowHours | ||
| } | ||
| snapshotRetentionDays, err := strconv.ParseInt(options["snapshotRetentionDays"], 10, 64) | ||
| if err != nil { | ||
| snapshotRetentionDays = defaultSnapshotRetentionDays | ||
| } | ||
| defaultPayload := mongodbflex.UpdateBackupSchedulePayload{ | ||
| BackupSchedule: backupSchedule, | ||
| DailySnapshotRetentionDays: &dailySnapshotRetentionDays, | ||
| MonthlySnapshotRetentionMonths: &monthlySnapshotRetentionMonths, | ||
| PointInTimeWindowHours: &pointInTimeWindowHours, | ||
| SnapshotRetentionDays: &snapshotRetentionDays, | ||
| WeeklySnapshotRetentionWeeks: &weeklySnapshotRetentionWeeks, | ||
| } | ||
| return defaultPayload | ||
| } | ||
| func buildGetInstanceRequest(ctx context.Context, model *inputModel, apiClient *mongodbflex.APIClient) mongodbflex.ApiGetInstanceRequest { | ||
| req := apiClient.GetInstance(ctx, model.ProjectId, *model.InstanceId) | ||
| return req | ||
| } |
| package login | ||
| import ( | ||
| "context" | ||
| "testing" | ||
| "time" | ||
| "github.com/google/go-cmp/cmp" | ||
| "github.com/google/go-cmp/cmp/cmpopts" | ||
| "github.com/google/uuid" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/ske" | ||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1" | ||
| "k8s.io/client-go/rest" | ||
| ) | ||
| type testCtxKey struct{} | ||
| var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
| var testClient = &ske.APIClient{} | ||
| var testProjectId = uuid.NewString() | ||
| var testClusterName = "cluster" | ||
| func fixtureClusterConfig(mods ...func(clusterConfig *clusterConfig)) *clusterConfig { | ||
| clusterConfig := &clusterConfig{ | ||
| STACKITProjectID: testProjectId, | ||
| ClusterName: testClusterName, | ||
| cacheKey: "", | ||
| } | ||
| for _, mod := range mods { | ||
| mod(clusterConfig) | ||
| } | ||
| return clusterConfig | ||
| } | ||
| func fixtureRequest(mods ...func(request *ske.ApiCreateKubeconfigRequest)) ske.ApiCreateKubeconfigRequest { | ||
| request := testClient.CreateKubeconfig(testCtx, testProjectId, testClusterName) | ||
| request = request.CreateKubeconfigPayload(ske.CreateKubeconfigPayload{}) | ||
| for _, mod := range mods { | ||
| mod(&request) | ||
| } | ||
| return request | ||
| } | ||
| func TestBuildRequest(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| clusterConfig *clusterConfig | ||
| expectedRequest ske.ApiCreateKubeconfigRequest | ||
| }{ | ||
| { | ||
| description: "expiration time", | ||
| clusterConfig: fixtureClusterConfig(), | ||
| expectedRequest: fixtureRequest().CreateKubeconfigPayload(ske.CreateKubeconfigPayload{ | ||
| ExpirationSeconds: utils.Ptr("1800")}), | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request := buildRequest(testCtx, testClient, tt.clusterConfig) | ||
| diff := cmp.Diff(request, tt.expectedRequest, | ||
| cmp.AllowUnexported(tt.expectedRequest), | ||
| cmpopts.EquateComparable(testCtx), | ||
| ) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestParseKubeConfigToExecCredential(t *testing.T) { | ||
| expectedTime, _ := time.Parse(time.RFC3339, "2024-01-01T00:45:00Z") | ||
| tests := []struct { | ||
| description string | ||
| kubeconfig *rest.Config | ||
| expectedExecCredentialRequest *clientauthenticationv1.ExecCredential | ||
| }{ | ||
| { | ||
| description: "expiration time", | ||
| kubeconfig: &rest.Config{ | ||
| TLSClientConfig: rest.TLSClientConfig{ | ||
| CertData: []byte(`-----BEGIN CERTIFICATE----- | ||
| MIIBhTCCASugAwIBAgIIF8+zRM8UalAwCgYIKoZIzj0EAwIwGDEWMBQGA1UEAxMN | ||
| Y2EtY2xpZW50LXh5ejAeFw0yNDAxMDEwMDAwMDBaFw0yNDAxMDEwMTAwMDBaMC8x | ||
| FzAVBgNVBAoTDnN5c3RlbTptYXN0ZXJzMRQwEgYDVQQDEwtza2U6Y2x1c3RlcjBZ | ||
| MBMGByqGSM49AgEGCCqGSM49AwEHA0IABJaxZ8G4wEZ1xf44hMV1pQWsti5SL6PH | ||
| QF0bRniQEJHSOcZMwc0OrVIfuSV1qSMyvYIaFtBj1j9f2v8oPux7V02jSDBGMA4G | ||
| A1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQt | ||
| Pn1pNgfb8xcdRVxVnHDIvb8abzAKBggqhkjOPQQDAgNIADBFAiEA8gG2l0schbMu | ||
| zbRjZmli7cnenEnfnNoFIGbgkbjGXRUCIC5zFtWXFK7kA+B2vDxD0DlLcQodNwi4 | ||
| 2JKP8gT9ol16 | ||
| -----END CERTIFICATE-----`), | ||
| KeyData: []byte("keykeykey"), | ||
| }, | ||
| }, | ||
| expectedExecCredentialRequest: &clientauthenticationv1.ExecCredential{ | ||
| TypeMeta: v1.TypeMeta{ | ||
| APIVersion: clientauthenticationv1.SchemeGroupVersion.String(), | ||
| Kind: "ExecCredential", | ||
| }, | ||
| Status: &clientauthenticationv1.ExecCredentialStatus{ | ||
| ExpirationTimestamp: &v1.Time{Time: expectedTime}, | ||
| ClientCertificateData: `-----BEGIN CERTIFICATE----- | ||
| MIIBhTCCASugAwIBAgIIF8+zRM8UalAwCgYIKoZIzj0EAwIwGDEWMBQGA1UEAxMN | ||
| Y2EtY2xpZW50LXh5ejAeFw0yNDAxMDEwMDAwMDBaFw0yNDAxMDEwMTAwMDBaMC8x | ||
| FzAVBgNVBAoTDnN5c3RlbTptYXN0ZXJzMRQwEgYDVQQDEwtza2U6Y2x1c3RlcjBZ | ||
| MBMGByqGSM49AgEGCCqGSM49AwEHA0IABJaxZ8G4wEZ1xf44hMV1pQWsti5SL6PH | ||
| QF0bRniQEJHSOcZMwc0OrVIfuSV1qSMyvYIaFtBj1j9f2v8oPux7V02jSDBGMA4G | ||
| A1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQt | ||
| Pn1pNgfb8xcdRVxVnHDIvb8abzAKBggqhkjOPQQDAgNIADBFAiEA8gG2l0schbMu | ||
| zbRjZmli7cnenEnfnNoFIGbgkbjGXRUCIC5zFtWXFK7kA+B2vDxD0DlLcQodNwi4 | ||
| 2JKP8gT9ol16 | ||
| -----END CERTIFICATE-----`, | ||
| ClientKeyData: "keykeykey", | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| execCredential, err := parseKubeConfigToExecCredential(tt.kubeconfig) | ||
| if err != nil { | ||
| t.Fatalf("func returned error: %s", err) | ||
| } | ||
| if execCredential == nil { | ||
| t.Fatal("execCredential is nil") | ||
| } | ||
| diff := cmp.Diff(execCredential, tt.expectedExecCredentialRequest) | ||
| if diff != "" { | ||
| t.Fatalf("Data does not match: %s", diff) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package login | ||
| import ( | ||
| "context" | ||
| "crypto/sha256" | ||
| "crypto/x509" | ||
| "encoding/json" | ||
| "encoding/pem" | ||
| "errors" | ||
| "fmt" | ||
| "os" | ||
| "strconv" | ||
| "time" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/cache" | ||
| "k8s.io/client-go/rest" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/services/ske/client" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/ske" | ||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/client-go/kubernetes/scheme" | ||
| clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1" | ||
| "k8s.io/client-go/tools/auth/exec" | ||
| "k8s.io/client-go/tools/clientcmd" | ||
| ) | ||
| const ( | ||
| expirationSeconds = 30 * 60 // 30 min | ||
| refreshBeforeDuration = 15 * time.Minute // 15 min | ||
| ) | ||
| func NewCmd(p *print.Printer) *cobra.Command { | ||
| cmd := &cobra.Command{ | ||
| Use: "login", | ||
| Short: "Login plugin for kubernetes clients", | ||
| Long: fmt.Sprintf("%s\n%s\n%s", | ||
| "Login plugin for kubernetes clients, that creates short-lived credentials to authenticate against a STACKIT Kubernetes Engine (SKE) cluster.", | ||
| "First you need to obtain a kubeconfig for use with the login command (first example).", | ||
| "Secondly you use the kubeconfig with your chosen Kubernetes client (second example), the client will automatically retrieve the credentials via the STACKIT CLI.", | ||
| ), | ||
| Args: args.NoArgs, | ||
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `Get a login kubeconfig for the SKE cluster with name "my-cluster". `+ | ||
| "This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command.", | ||
| "$ stackit ske kubeconfig create my-cluster --login"), | ||
| examples.NewExample( | ||
| "Use the previously saved kubeconfig to authenticate to the SKE cluster, in this case with kubectl.", | ||
| "$ kubectl cluster-info", | ||
| "$ kubectl get pods"), | ||
| ), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := context.Background() | ||
| if err := cache.Init(); err != nil { | ||
| return fmt.Errorf("cache init failed: %w", err) | ||
| } | ||
| env := os.Getenv("KUBERNETES_EXEC_INFO") | ||
| if env == "" { | ||
| return fmt.Errorf("%s\n%s\n%s", "KUBERNETES_EXEC_INFO env var is unset or empty.", | ||
| "The command probably was not called from a Kubernetes client application!", | ||
| "See `stackit ske kubeconfig login --help` for detailed usage instructions.") | ||
| } | ||
| clusterConfig, err := parseClusterConfig() | ||
| if err != nil { | ||
| return fmt.Errorf("parseClusterConfig: %w", err) | ||
| } | ||
| // Configure API client | ||
| apiClient, err := client.ConfigureClient(p) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| cachedKubeconfig := getCachedKubeConfig(clusterConfig.cacheKey) | ||
| if cachedKubeconfig == nil { | ||
| return GetAndOutputKubeconfig(ctx, p, apiClient, clusterConfig, false, nil) | ||
| } | ||
| certPem, _ := pem.Decode(cachedKubeconfig.CertData) | ||
| if certPem == nil { | ||
| _ = cache.DeleteObject(clusterConfig.cacheKey) | ||
| return GetAndOutputKubeconfig(ctx, p, apiClient, clusterConfig, false, nil) | ||
| } | ||
| certificate, err := x509.ParseCertificate(certPem.Bytes) | ||
| if err != nil { | ||
| _ = cache.DeleteObject(clusterConfig.cacheKey) | ||
| return GetAndOutputKubeconfig(ctx, p, apiClient, clusterConfig, false, nil) | ||
| } | ||
| // cert is expired, request new | ||
| if time.Now().After(certificate.NotAfter.UTC()) { | ||
| _ = cache.DeleteObject(clusterConfig.cacheKey) | ||
| return GetAndOutputKubeconfig(ctx, p, apiClient, clusterConfig, false, nil) | ||
| } | ||
| // cert expires within the next 15min, refresh (try to get a new, use cache on failure) | ||
| if time.Now().Add(refreshBeforeDuration).After(certificate.NotAfter.UTC()) { | ||
| return GetAndOutputKubeconfig(ctx, p, apiClient, clusterConfig, true, cachedKubeconfig) | ||
| } | ||
| // cert not expired, nor will it expire in the next 15min; therefore, use the cached kubeconfig | ||
| if err := output(p, clusterConfig.cacheKey, cachedKubeconfig); err != nil { | ||
| return err | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| return cmd | ||
| } | ||
| type clusterConfig struct { | ||
| STACKITProjectID string `json:"stackitProjectId"` | ||
| ClusterName string `json:"clusterName"` | ||
| cacheKey string | ||
| } | ||
| func parseClusterConfig() (*clusterConfig, error) { | ||
| obj, _, err := exec.LoadExecCredentialFromEnv() | ||
| if err != nil { | ||
| return nil, fmt.Errorf("LoadExecCredentialFromEnv: %w", err) | ||
| } | ||
| if err := clientauthenticationv1.AddToScheme(scheme.Scheme); err != nil { | ||
| return nil, err | ||
| } | ||
| obj, err = scheme.Scheme.ConvertToVersion(obj, clientauthenticationv1.SchemeGroupVersion) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("ConvertToVersion: %w", err) | ||
| } | ||
| execCredential, ok := obj.(*clientauthenticationv1.ExecCredential) | ||
| if !ok { | ||
| return nil, fmt.Errorf("conversion to ExecCredential failed") | ||
| } | ||
| if execCredential == nil || execCredential.Spec.Cluster == nil { | ||
| return nil, fmt.Errorf("ExecCredential contains not all needed fields") | ||
| } | ||
| config := &clusterConfig{} | ||
| err = json.Unmarshal(execCredential.Spec.Cluster.Config.Raw, config) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("unmarshal: %w", err) | ||
| } | ||
| config.cacheKey = fmt.Sprintf("ske-login-%x", sha256.Sum256([]byte(execCredential.Spec.Cluster.Server))) | ||
| return config, nil | ||
| } | ||
| func getCachedKubeConfig(key string) *rest.Config { | ||
| cachedKubeconfig, err := cache.GetObject(key) | ||
| if err != nil { | ||
| return nil | ||
| } | ||
| restConfig, err := clientcmd.RESTConfigFromKubeConfig(cachedKubeconfig) | ||
| if err != nil { | ||
| return nil | ||
| } | ||
| return restConfig | ||
| } | ||
| func GetAndOutputKubeconfig(ctx context.Context, p *print.Printer, apiClient *ske.APIClient, clusterConfig *clusterConfig, fallbackToCache bool, cachedKubeconfig *rest.Config) error { | ||
| req := buildRequest(ctx, apiClient, clusterConfig) | ||
| kubeconfigResponse, err := req.Execute() | ||
| if err != nil { | ||
| if fallbackToCache { | ||
| return output(p, clusterConfig.cacheKey, cachedKubeconfig) | ||
| } | ||
| return fmt.Errorf("request kubeconfig: %w", err) | ||
| } | ||
| kubeconfig, err := clientcmd.RESTConfigFromKubeConfig([]byte(*kubeconfigResponse.Kubeconfig)) | ||
| if err != nil { | ||
| if fallbackToCache { | ||
| return output(p, clusterConfig.cacheKey, cachedKubeconfig) | ||
| } | ||
| return fmt.Errorf("parse kubeconfig: %w", err) | ||
| } | ||
| if err = cache.PutObject(clusterConfig.cacheKey, []byte(*kubeconfigResponse.Kubeconfig)); err != nil { | ||
| if fallbackToCache { | ||
| return output(p, clusterConfig.cacheKey, cachedKubeconfig) | ||
| } | ||
| return fmt.Errorf("cache kubeconfig: %w", err) | ||
| } | ||
| return output(p, clusterConfig.cacheKey, kubeconfig) | ||
| } | ||
| func buildRequest(ctx context.Context, apiClient *ske.APIClient, clusterConfig *clusterConfig) ske.ApiCreateKubeconfigRequest { | ||
| req := apiClient.CreateKubeconfig(ctx, clusterConfig.STACKITProjectID, clusterConfig.ClusterName) | ||
| expirationSeconds := strconv.Itoa(expirationSeconds) | ||
| return req.CreateKubeconfigPayload(ske.CreateKubeconfigPayload{ExpirationSeconds: &expirationSeconds}) | ||
| } | ||
| func output(p *print.Printer, cacheKey string, kubeconfig *rest.Config) error { | ||
| if kubeconfig == nil { | ||
| _ = cache.DeleteObject(cacheKey) | ||
| return errors.New("kubeconfig is nil") | ||
| } | ||
| outputExecCredential, err := parseKubeConfigToExecCredential(kubeconfig) | ||
| if err != nil { | ||
| _ = cache.DeleteObject(cacheKey) | ||
| return fmt.Errorf("convert to ExecCredential: %w", err) | ||
| } | ||
| output, err := json.Marshal(outputExecCredential) | ||
| if err != nil { | ||
| _ = cache.DeleteObject(cacheKey) | ||
| return fmt.Errorf("marshal ExecCredential: %w", err) | ||
| } | ||
| p.Outputf(string(output)) | ||
| return nil | ||
| } | ||
| func parseKubeConfigToExecCredential(kubeconfig *rest.Config) (*clientauthenticationv1.ExecCredential, error) { | ||
| certPem, _ := pem.Decode(kubeconfig.CertData) | ||
| if certPem == nil { | ||
| return nil, fmt.Errorf("decoded pem is nil") | ||
| } | ||
| certificate, err := x509.ParseCertificate(certPem.Bytes) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("parse certificate: %w", err) | ||
| } | ||
| outputExecCredential := clientauthenticationv1.ExecCredential{ | ||
| TypeMeta: v1.TypeMeta{ | ||
| APIVersion: clientauthenticationv1.SchemeGroupVersion.String(), | ||
| Kind: "ExecCredential", | ||
| }, | ||
| Status: &clientauthenticationv1.ExecCredentialStatus{ | ||
| ExpirationTimestamp: &v1.Time{Time: certificate.NotAfter.Add(-time.Minute * 15)}, | ||
| ClientCertificateData: string(kubeconfig.CertData), | ||
| ClientKeyData: string(kubeconfig.KeyData), | ||
| }, | ||
| } | ||
| return &outputExecCredential, nil | ||
| } |
| package cache | ||
| import ( | ||
| "errors" | ||
| "os" | ||
| "path/filepath" | ||
| "testing" | ||
| "github.com/google/uuid" | ||
| ) | ||
| func TestGetObject(t *testing.T) { | ||
| if err := Init(); err != nil { | ||
| t.Fatalf("cache init failed: %s", err) | ||
| } | ||
| tests := []struct { | ||
| description string | ||
| identifier string | ||
| expectFile bool | ||
| expectedErr error | ||
| }{ | ||
| { | ||
| description: "identifier exists", | ||
| identifier: "test-cache-get-exists", | ||
| expectFile: true, | ||
| expectedErr: nil, | ||
| }, | ||
| { | ||
| description: "identifier does not exist", | ||
| identifier: "test-cache-get-not-exists", | ||
| expectFile: false, | ||
| expectedErr: os.ErrNotExist, | ||
| }, | ||
| { | ||
| description: "identifier is invalid", | ||
| identifier: "in../../valid", | ||
| expectFile: false, | ||
| expectedErr: ErrorInvalidCacheIdentifier, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| id := tt.identifier + "-" + uuid.NewString() | ||
| // setup | ||
| if tt.expectFile { | ||
| err := createFolderIfNotExists(cacheFolderPath) | ||
| if err != nil { | ||
| t.Fatalf("create cache folder: %s", err.Error()) | ||
| } | ||
| path := filepath.Join(cacheFolderPath, id) | ||
| if err := os.WriteFile(path, []byte("dummy"), 0o600); err != nil { | ||
| t.Fatalf("setup: WriteFile (%s) failed", path) | ||
| } | ||
| } | ||
| // test | ||
| file, err := GetObject(id) | ||
| if !errors.Is(err, tt.expectedErr) { | ||
| t.Fatalf("returned error (%q) does not match %q", err.Error(), tt.expectedErr.Error()) | ||
| } | ||
| if tt.expectFile { | ||
| if len(file) < 1 { | ||
| t.Fatalf("expected a file but byte array is empty (len %d)", len(file)) | ||
| } | ||
| } else { | ||
| if len(file) > 0 { | ||
| t.Fatalf("didn't expect a file, but byte array is not empty (len %d)", len(file)) | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestPutObject(t *testing.T) { | ||
| if err := Init(); err != nil { | ||
| t.Fatalf("cache init failed: %s", err) | ||
| } | ||
| tests := []struct { | ||
| description string | ||
| identifier string | ||
| existingFile bool | ||
| expectFile bool | ||
| expectedErr error | ||
| customPath string | ||
| }{ | ||
| { | ||
| description: "identifier already exists", | ||
| identifier: "test-cache-put-exists", | ||
| existingFile: true, | ||
| expectFile: true, | ||
| expectedErr: nil, | ||
| }, | ||
| { | ||
| description: "identifier does not exist", | ||
| identifier: "test-cache-put-not-exists", | ||
| expectFile: true, | ||
| expectedErr: nil, | ||
| }, | ||
| { | ||
| description: "identifier is invalid", | ||
| identifier: "in../../valid", | ||
| expectFile: false, | ||
| expectedErr: ErrorInvalidCacheIdentifier, | ||
| }, | ||
| { | ||
| description: "directory does not yet exist", | ||
| identifier: "test-cache-put-folder-not-exists", | ||
| expectFile: true, | ||
| expectedErr: nil, | ||
| customPath: "/tmp/stackit-cli-test", | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| id := tt.identifier + "-" + uuid.NewString() | ||
| if tt.customPath != "" { | ||
| cacheFolderPath = tt.customPath | ||
| } else { | ||
| cacheDir, _ := os.UserCacheDir() | ||
| cacheFolderPath = filepath.Join(cacheDir, "stackit") | ||
| } | ||
| path := filepath.Join(cacheFolderPath, id) | ||
| // setup | ||
| if tt.existingFile { | ||
| if err := os.WriteFile(path, []byte("dummy"), 0o600); err != nil { | ||
| t.Fatalf("setup: WriteFile (%s) failed", path) | ||
| } | ||
| } | ||
| // test | ||
| err := PutObject(id, []byte("dummy")) | ||
| if !errors.Is(err, tt.expectedErr) { | ||
| t.Fatalf("returned error (%q) does not match %q", err.Error(), tt.expectedErr.Error()) | ||
| } | ||
| if tt.expectFile { | ||
| if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { | ||
| t.Fatalf("expected file (%q) to exist", path) | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } | ||
| func TestDeleteObject(t *testing.T) { | ||
| if err := Init(); err != nil { | ||
| t.Fatalf("cache init failed: %s", err) | ||
| } | ||
| tests := []struct { | ||
| description string | ||
| identifier string | ||
| existingFile bool | ||
| expectedErr error | ||
| }{ | ||
| { | ||
| description: "identifier exists", | ||
| identifier: "test-cache-delete-exists", | ||
| existingFile: true, | ||
| expectedErr: nil, | ||
| }, | ||
| { | ||
| description: "identifier does not exist", | ||
| identifier: "test-cache-delete-not-exists", | ||
| existingFile: false, | ||
| expectedErr: nil, | ||
| }, | ||
| { | ||
| description: "identifier is invalid", | ||
| identifier: "in../../valid", | ||
| existingFile: false, | ||
| expectedErr: ErrorInvalidCacheIdentifier, | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| id := tt.identifier + "-" + uuid.NewString() | ||
| path := filepath.Join(cacheFolderPath, id) | ||
| // setup | ||
| if tt.existingFile { | ||
| if err := os.WriteFile(path, []byte("dummy"), 0o600); err != nil { | ||
| t.Fatalf("setup: WriteFile (%s) failed", path) | ||
| } | ||
| } | ||
| // test | ||
| err := DeleteObject(id) | ||
| if !errors.Is(err, tt.expectedErr) { | ||
| t.Fatalf("returned error (%q) does not match %q", err.Error(), tt.expectedErr.Error()) | ||
| } | ||
| if tt.existingFile { | ||
| if _, err := os.Stat(path); !errors.Is(err, os.ErrNotExist) { | ||
| t.Fatalf("expected file (%q) to not exist", path) | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } |
| package cache | ||
| import ( | ||
| "errors" | ||
| "fmt" | ||
| "os" | ||
| "path/filepath" | ||
| "regexp" | ||
| ) | ||
| var ( | ||
| cacheFolderPath string | ||
| identifierRegex = regexp.MustCompile("^[a-zA-Z0-9-]+$") | ||
| ErrorInvalidCacheIdentifier = fmt.Errorf("invalid cache identifier") | ||
| ) | ||
| func Init() error { | ||
| cacheDir, err := os.UserCacheDir() | ||
| if err != nil { | ||
| return fmt.Errorf("get user cache dir: %w", err) | ||
| } | ||
| cacheFolderPath = filepath.Join(cacheDir, "stackit") | ||
| return nil | ||
| } | ||
| func GetObject(identifier string) ([]byte, error) { | ||
| if err := validateCacheFolderPath(); err != nil { | ||
| return nil, err | ||
| } | ||
| if !identifierRegex.MatchString(identifier) { | ||
| return nil, ErrorInvalidCacheIdentifier | ||
| } | ||
| return os.ReadFile(filepath.Join(cacheFolderPath, identifier)) | ||
| } | ||
| func PutObject(identifier string, data []byte) error { | ||
| if err := validateCacheFolderPath(); err != nil { | ||
| return err | ||
| } | ||
| if !identifierRegex.MatchString(identifier) { | ||
| return ErrorInvalidCacheIdentifier | ||
| } | ||
| err := createFolderIfNotExists(cacheFolderPath) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| return os.WriteFile(filepath.Join(cacheFolderPath, identifier), data, 0o600) | ||
| } | ||
| func DeleteObject(identifier string) error { | ||
| if err := validateCacheFolderPath(); err != nil { | ||
| return err | ||
| } | ||
| if !identifierRegex.MatchString(identifier) { | ||
| return ErrorInvalidCacheIdentifier | ||
| } | ||
| if err := os.Remove(filepath.Join(cacheFolderPath, identifier)); !errors.Is(err, os.ErrNotExist) { | ||
| return err | ||
| } | ||
| return nil | ||
| } | ||
| func createFolderIfNotExists(folderPath string) error { | ||
| _, err := os.Stat(folderPath) | ||
| if os.IsNotExist(err) { | ||
| err := os.MkdirAll(folderPath, os.ModePerm) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| } else if err != nil { | ||
| return err | ||
| } | ||
| return nil | ||
| } | ||
| func validateCacheFolderPath() error { | ||
| if cacheFolderPath == "" { | ||
| return errors.New("cacheFolderPath not set. Forgot to call Init()?") | ||
| } | ||
| return nil | ||
| } |
+1
-0
@@ -7,4 +7,5 @@ # Binaries | ||
| .vscode | ||
| .idea | ||
| # OS generated files | ||
| .DS_Store |
+7
-0
@@ -176,2 +176,9 @@ # Contribute to the STACKIT CLI | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.Marshal(resources) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal resource list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -178,0 +185,0 @@ table := tables.NewTable() |
@@ -33,3 +33,3 @@ ## stackit argus credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit argus credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit argus credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit argus credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit argus grafana describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit argus grafana public-read-access disable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit argus grafana public-read-access enable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -25,3 +25,3 @@ ## stackit argus grafana public-read-access | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -28,0 +28,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit argus grafana single-sign-on disable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit argus grafana single-sign-on enable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -25,3 +25,3 @@ ## stackit argus grafana single-sign-on | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -28,0 +28,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit argus grafana | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit argus instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit argus instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit argus instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit argus instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit argus instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit argus instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit argus plans | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -47,3 +47,3 @@ ## stackit argus scrape-config create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -50,0 +50,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit argus scrape-config delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit argus scrape-config describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -46,3 +46,3 @@ ## stackit argus scrape-config generate-payload | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -49,0 +49,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit argus scrape-config list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -43,3 +43,3 @@ ## stackit argus scrape-config update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -46,0 +46,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit argus scrape-config | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit argus | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -44,3 +44,3 @@ ## stackit auth activate-service-account | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -47,0 +47,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit auth login | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit auth | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit config list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -57,3 +57,3 @@ ## stackit config set | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -60,0 +60,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -29,3 +29,3 @@ ## stackit config | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -32,0 +32,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -46,3 +46,3 @@ ## stackit curl | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -49,0 +49,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit dns record-set create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit dns record-set delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit dns record-set describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -51,3 +51,3 @@ ## stackit dns record-set list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -54,0 +54,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit dns record-set update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit dns record-set | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -47,3 +47,3 @@ ## stackit dns zone create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -50,0 +50,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit dns zone delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit dns zone describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -47,3 +47,3 @@ ## stackit dns zone list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -50,0 +50,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -41,3 +41,3 @@ ## stackit dns zone update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -44,0 +44,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit dns zone | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit dns | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit load-balancer create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit load-balancer delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit load-balancer describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit load-balancer generate-payload | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit load-balancer list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit load-balancer observability-credentials add | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit load-balancer observability-credentials cleanup | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit load-balancer observability-credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit load-balancer observability-credentials describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -46,3 +46,3 @@ ## stackit load-balancer observability-credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -49,0 +49,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit load-balancer observability-credentials update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit load-balancer observability-credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit load-balancer quota | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit load-balancer target-pool add-target | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit load-balancer target-pool describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit load-balancer target-pool remove-target | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit load-balancer target-pool | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit load-balancer update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit load-balancer | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit logme credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit logme credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit logme credentials describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit logme credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit logme credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -48,3 +48,3 @@ ## stackit logme instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -51,0 +51,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit logme instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit logme instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit logme instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -44,3 +44,3 @@ ## stackit logme instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -47,0 +47,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit logme instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit logme plans | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit logme | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit mariadb credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit mariadb credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit mariadb credentials describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit mariadb credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit mariadb credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -48,3 +48,3 @@ ## stackit mariadb instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -51,0 +51,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit mariadb instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit mariadb instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit mariadb instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -44,3 +44,3 @@ ## stackit mariadb instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -47,0 +47,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit mariadb instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit mariadb plans | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit mariadb | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -47,3 +47,3 @@ ## stackit mongodbflex instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -50,0 +50,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit mongodbflex instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit mongodbflex instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit mongodbflex instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -44,3 +44,3 @@ ## stackit mongodbflex instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -47,0 +47,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit mongodbflex instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit mongodbflex options | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -41,3 +41,3 @@ ## stackit mongodbflex user create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -44,0 +44,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit mongodbflex user delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit mongodbflex user describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit mongodbflex user list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit mongodbflex user reset-password | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit mongodbflex user update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit mongodbflex user | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit mongodbflex | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -33,2 +33,3 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| * [stackit](./stackit.md) - Manage STACKIT resources using the command line | ||
| * [stackit mongodbflex backup](./stackit_mongodbflex_backup.md) - Provides functionality for MongoDB Flex instance backups | ||
| * [stackit mongodbflex instance](./stackit_mongodbflex_instance.md) - Provides functionality for MongoDB Flex instances | ||
@@ -35,0 +36,0 @@ * [stackit mongodbflex options](./stackit_mongodbflex_options.md) - Lists MongoDB Flex options |
@@ -31,3 +31,3 @@ ## stackit object-storage bucket create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit object-storage bucket delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit object-storage bucket describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit object-storage bucket list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit object-storage bucket | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit object-storage credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit object-storage credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit object-storage credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit object-storage credentials-group create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit object-storage credentials-group delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit object-storage credentials-group list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit object-storage credentials-group | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit object-storage credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit object-storage disable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit object-storage enable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit object-storage | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit opensearch credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit opensearch credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit opensearch credentials describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit opensearch credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit opensearch credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -49,3 +49,3 @@ ## stackit opensearch instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -52,0 +52,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit opensearch instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit opensearch instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit opensearch instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -45,3 +45,3 @@ ## stackit opensearch instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -48,0 +48,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit opensearch instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit opensearch plans | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit opensearch | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit organization member add | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -41,3 +41,3 @@ ## stackit organization member list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -44,0 +44,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit organization member remove | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit organization member | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit organization role list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit organization role | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -25,3 +25,3 @@ ## stackit organization | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -28,0 +28,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit postgresflex backup describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit postgresflex backup list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit postgresflex backup update-schedule | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit postgresflex backup | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit postgresflex instance clone | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -47,3 +47,3 @@ ## stackit postgresflex instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -50,0 +50,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit postgresflex instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit postgresflex instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit postgresflex instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -44,3 +44,3 @@ ## stackit postgresflex instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -47,0 +47,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit postgresflex instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit postgresflex options | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit postgresflex user create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit postgresflex user delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit postgresflex user describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit postgresflex user list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit postgresflex user reset-password | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit postgresflex user update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit postgresflex user | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit postgresflex | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit project create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit project delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit project describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -46,3 +46,3 @@ ## stackit project list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -49,0 +49,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit project member add | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit project member list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit project member remove | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit project member | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit project role list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit project role | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit project update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -25,3 +25,3 @@ ## stackit project | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -28,0 +28,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit rabbitmq credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit rabbitmq credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit rabbitmq credentials describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit rabbitmq credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit rabbitmq credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -49,3 +49,3 @@ ## stackit rabbitmq instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -52,0 +52,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit rabbitmq instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit rabbitmq instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit rabbitmq instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -45,3 +45,3 @@ ## stackit rabbitmq instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -48,0 +48,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit rabbitmq instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit rabbitmq plans | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit rabbitmq | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit redis credentials create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit redis credentials delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit redis credentials describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit redis credentials list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit redis credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -48,3 +48,3 @@ ## stackit redis instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -51,0 +51,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit redis instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit redis instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit redis instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -44,3 +44,3 @@ ## stackit redis instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -47,0 +47,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit redis instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit redis plans | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit redis | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -36,3 +36,3 @@ ## stackit secrets-manager instance create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -39,0 +39,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit secrets-manager instance delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit secrets-manager instance describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit secrets-manager instance list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit secrets-manager instance update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit secrets-manager instance | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit secrets-manager user create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -33,3 +33,3 @@ ## stackit secrets-manager user delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -36,0 +36,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -35,3 +35,3 @@ ## stackit secrets-manager user describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -38,0 +38,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit secrets-manager user list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -37,3 +37,3 @@ ## stackit secrets-manager user update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -40,0 +40,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit secrets-manager user | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit secrets-manager | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit service-account create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit service-account delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit service-account get-jwks | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit service-account key create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit service-account key delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit service-account key describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -39,3 +39,3 @@ ## stackit service-account key list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -42,0 +42,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit service-account key update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit service-account key | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -32,3 +32,3 @@ ## stackit service-account list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -35,0 +35,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit service-account token create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -41,3 +41,3 @@ ## stackit service-account token list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -44,0 +44,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit service-account token revoke | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit service-account token | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit service-account | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -45,3 +45,3 @@ ## stackit ske cluster create | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -48,0 +48,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit ske cluster delete | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -34,3 +34,3 @@ ## stackit ske cluster describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -37,0 +37,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -40,3 +40,3 @@ ## stackit ske cluster generate-payload | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -43,0 +43,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -38,3 +38,3 @@ ## stackit ske cluster list | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -41,0 +41,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -42,3 +42,3 @@ ## stackit ske cluster update | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -45,0 +45,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit ske cluster | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -46,3 +46,3 @@ ## stackit ske credentials complete-rotation | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -49,0 +49,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -50,3 +50,3 @@ ## stackit ske credentials start-rotation | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -53,0 +53,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit ske credentials | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit ske describe | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit ske disable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -31,3 +31,3 @@ ## stackit ske enable | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,0 +34,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,2 +24,5 @@ ## stackit ske kubeconfig create | ||
| Get a login kubeconfig for the SKE cluster with name "my-cluster". This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command. | ||
| $ stackit ske kubeconfig create my-cluster --login | ||
| Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days | ||
@@ -41,2 +44,3 @@ $ stackit ske kubeconfig create my-cluster --expiration 30d | ||
| -h, --help Help for "stackit ske kubeconfig create" | ||
| -l, --login Create a login kubeconfig that obtains valid credentials via the STACKIT CLI. This flag is mutually exclusive with the expiration flag. | ||
| ``` | ||
@@ -49,3 +53,3 @@ | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -52,0 +56,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit ske kubeconfig | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -34,2 +34,3 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") | ||
| * [stackit ske kubeconfig create](./stackit_ske_kubeconfig_create.md) - Creates a kubeconfig for an SKE cluster | ||
| * [stackit ske kubeconfig login](./stackit_ske_kubeconfig_login.md) - Login plugin for kubernetes clients | ||
@@ -43,3 +43,3 @@ ## stackit ske options | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -46,0 +46,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
@@ -24,3 +24,3 @@ ## stackit ske | ||
| --async If set, runs the command asynchronously | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -27,0 +27,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
+1
-1
@@ -21,3 +21,3 @@ ## stackit | ||
| -h, --help Help for "stackit" | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none"] | ||
| -o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"] | ||
| -p, --project-id string Project ID | ||
@@ -24,0 +24,0 @@ --verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info") |
+36
-11
@@ -6,2 +6,3 @@ module github.com/stackitcloud/stackit-cli | ||
| require ( | ||
| github.com/goccy/go-yaml v1.11.3 | ||
| github.com/golang-jwt/jwt/v5 v5.2.1 | ||
@@ -20,4 +21,4 @@ github.com/google/go-cmp v0.6.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/dns v0.9.1 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.12.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.13.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.13.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.14.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.13.0 | ||
@@ -27,3 +28,3 @@ github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.8.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.4.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.14.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.15.0 | ||
| github.com/zalando/go-keyring v0.2.4 | ||
@@ -34,21 +35,39 @@ golang.org/x/mod v0.17.0 | ||
| golang.org/x/text v0.15.0 | ||
| k8s.io/apimachinery v0.29.2 | ||
| k8s.io/client-go v0.29.2 | ||
| ) | ||
| require github.com/mattn/go-isatty v0.0.17 // indirect | ||
| require ( | ||
| golang.org/x/net v0.23.0 // indirect | ||
| golang.org/x/time v0.5.0 // indirect | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
| ) | ||
| require ( | ||
| github.com/fatih/color v1.14.1 // indirect | ||
| github.com/mattn/go-isatty v0.0.17 // indirect | ||
| golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect | ||
| ) | ||
| require ( | ||
| github.com/alessio/shellescape v1.4.2 // indirect | ||
| github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect | ||
| github.com/danieljoos/wincred v1.2.1 // indirect | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
| github.com/fsnotify/fsnotify v1.7.0 // indirect | ||
| github.com/go-logr/logr v1.3.0 // indirect | ||
| github.com/godbus/dbus/v5 v5.1.0 // indirect | ||
| github.com/gogo/protobuf v1.3.2 // indirect | ||
| github.com/google/gofuzz v1.2.0 // indirect | ||
| github.com/hashicorp/hcl v1.0.0 // indirect | ||
| github.com/imdario/mergo v0.3.6 // indirect | ||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/json-iterator/go v1.1.12 // indirect | ||
| github.com/magiconair/properties v1.8.7 // indirect | ||
| github.com/mattn/go-runewidth v0.0.15 // indirect | ||
| github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
| github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
| github.com/modern-go/reflect2 v1.0.2 // indirect | ||
| github.com/pelletier/go-toml/v2 v2.1.1 // indirect | ||
| github.com/rivo/uniseg v0.4.4 // indirect | ||
| github.com/rogpeppe/go-internal v1.10.0 // indirect | ||
| github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
@@ -62,7 +81,7 @@ github.com/sagikazarmark/locafero v0.4.0 // indirect | ||
| github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.12.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.13.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.13.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.14.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.14.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.9.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.13.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.13.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.14.0 | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.14.0 | ||
| github.com/subosito/gotenv v1.6.0 // indirect | ||
@@ -72,5 +91,11 @@ go.uber.org/multierr v1.11.0 // indirect | ||
| golang.org/x/sys v0.20.0 // indirect | ||
| gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect | ||
| gopkg.in/ini.v1 v1.67.0 // indirect | ||
| gopkg.in/yaml.v2 v2.4.0 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| k8s.io/api v0.29.2 // indirect | ||
| k8s.io/klog/v2 v2.110.1 // indirect | ||
| k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect | ||
| sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect | ||
| sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect | ||
| sigs.k8s.io/yaml v1.3.0 // indirect | ||
| ) |
+126
-20
@@ -11,2 +11,6 @@ github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
| github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= | ||
| github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= | ||
| github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= | ||
| github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= | ||
| github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= | ||
@@ -16,8 +20,34 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= | ||
| github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= | ||
| github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= | ||
| github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= | ||
| github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= | ||
| github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= | ||
| github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= | ||
| github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= | ||
| github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= | ||
| github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= | ||
| github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= | ||
| github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= | ||
| github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= | ||
| github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= | ||
| github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= | ||
| github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= | ||
| github.com/goccy/go-yaml v1.11.3 h1:B3W9IdWbvrUu2OYQGwvU1nZtvMQJPBKgBUuweJjLj6I= | ||
| github.com/goccy/go-yaml v1.11.3/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= | ||
| github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= | ||
| github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= | ||
| github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= | ||
| github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= | ||
| github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= | ||
| github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= | ||
| github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= | ||
| github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= | ||
| github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= | ||
| github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= | ||
| github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= | ||
| github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= | ||
| github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= | ||
| github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= | ||
| github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= | ||
| github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= | ||
| github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= | ||
@@ -27,2 +57,4 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
| github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= | ||
| github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= | ||
| github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= | ||
| github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= | ||
@@ -34,8 +66,14 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= | ||
| github.com/jedib0t/go-pretty/v6 v6.5.9/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= | ||
| github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= | ||
| github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= | ||
| github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= | ||
| github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= | ||
| github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= | ||
| github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | ||
| github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= | ||
| github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= | ||
| github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= | ||
| github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= | ||
| github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= | ||
| github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= | ||
| github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= | ||
| github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= | ||
| github.com/lmittmann/tint v1.0.4 h1:LeYihpJ9hyGvE0w+K2okPTGUdVLfng1+nDNVR4vWISc= | ||
@@ -45,2 +83,4 @@ github.com/lmittmann/tint v1.0.4/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= | ||
| github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= | ||
| github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= | ||
| github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= | ||
| github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= | ||
@@ -55,4 +95,9 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= | ||
| github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= | ||
| github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= | ||
| github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= | ||
| github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= | ||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | ||
| github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= | ||
| github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= | ||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= | ||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= | ||
| github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= | ||
@@ -96,18 +141,18 @@ github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= | ||
| github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v0.12.0/go.mod h1:wsO3+vXe1XiKLeCIctWAptaHQZ07Un7kmLTQ+drbj7w= | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.13.0 h1:/wqs+pfHSjFWTakJVQGD/KwArxmFN8qdYrJDUgA1Gxw= | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.13.0/go.mod h1:bj9cn1treNSxKTRCEmESwqfENN8vCYn60HUnEA0P83c= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.13.0 h1:qioXHNeQ2xdwT5iGOk0c3hQIpct7zlAYzLRqXvsJ7CA= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.13.0/go.mod h1:kPetkX9hNm9HkRyiKQL/tlgdi8frZdMP8afg0mEvQ9s= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.12.0 h1:/m6N/CdsFxomexsowU7PwT1S4UTmI39PnEvvWGsDh1s= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.12.0/go.mod h1:iFerEzGmkg6R13ldFUyHUWHm0ac9cS4ftTDLhP0k/dU= | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.14.0 h1:vvQFCN5sKZA9tdzrbDnAVMsaTijX8lvTYnPaKQHmkoI= | ||
| github.com/stackitcloud/stackit-sdk-go/services/logme v0.14.0/go.mod h1:bj9cn1treNSxKTRCEmESwqfENN8vCYn60HUnEA0P83c= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.14.0 h1:tK6imWrbZ5TgQJbukWCUz7yDgcvvFMX8wamxkPTLuDo= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.14.0/go.mod h1:kPetkX9hNm9HkRyiKQL/tlgdi8frZdMP8afg0mEvQ9s= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.13.0 h1:Dhanx9aV5VRfpHg22Li07661FbRT5FR9/M6FowN08a8= | ||
| github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v0.13.0/go.mod h1:iFerEzGmkg6R13ldFUyHUWHm0ac9cS4ftTDLhP0k/dU= | ||
| github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.9.0 h1:rWgy4/eCIgyA2dUuc4a30pldmS6taQDwiLqoeZmyeP8= | ||
| github.com/stackitcloud/stackit-sdk-go/services/objectstorage v0.9.0/go.mod h1:dkVMJI88eJ3Xs0ZV15r4tUpgitUGJXcvrX3RL4Zq2bQ= | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.13.0 h1:dzt2wd1QkFVctKPQDBlyMCsHEJV4Bf2bRkZTUFFCZhs= | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.13.0/go.mod h1:ZecMIf9oYj2DGZqWh93l97WdVaRdLl+tW5Fq3YKGwBM= | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.14.0 h1:zkhm0r0OZ5NbHJFrm+7B+h11QL0bNLC53nzXhqCaLWo= | ||
| github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.14.0/go.mod h1:ZecMIf9oYj2DGZqWh93l97WdVaRdLl+tW5Fq3YKGwBM= | ||
| github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.13.0 h1:PGLjBZxWM7NIrH1+W1+f+/4kZEgwv9DGnXcUzOqM0M8= | ||
| github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.13.0/go.mod h1:SdrqGLCkilL6wl1+jcxmLtks2IocgIg+bsyeyYUIzR4= | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.13.0 h1:bdmZhVAuyPiaAeJnBRLMVtVix6DYzNYbpdPiq/Z3XCI= | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.13.0/go.mod h1:eSgnPBknTJh7t+jVKN+xzeAh+Cg1USOlH3QCyfvG20g= | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.13.0 h1:MlREN/9zDntk90kahS0aJa/gPGAoUV4NLNnrTLs9CLc= | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.13.0/go.mod h1:3LhiTR/DMbKR2HuleTzlFHltR1MT1KD0DeW46X6K2GE= | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.14.0 h1:wJ+LSMrRol4wlm/ML4wvVPGwIw51VHMFwMCOtwluvKQ= | ||
| github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.14.0/go.mod h1:eSgnPBknTJh7t+jVKN+xzeAh+Cg1USOlH3QCyfvG20g= | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.14.0 h1:wcfA/3mTI7UmTFmKX09EKIVsEqflfkiuEoWL/j5cMvg= | ||
| github.com/stackitcloud/stackit-sdk-go/services/redis v0.14.0/go.mod h1:3LhiTR/DMbKR2HuleTzlFHltR1MT1KD0DeW46X6K2GE= | ||
| github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.8.0 h1:7AIvLkB7JZ5lYKtYLwI0rgJ0185hwQC1PFiUrjcinDM= | ||
@@ -119,4 +164,4 @@ github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.8.0/go.mod h1:p16qz/pAW8b1gEhqMpIgJfutRPeDPqQLlbVGyCo3f8o= | ||
| github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.4.0/go.mod h1:Ni9RBJvcaXRIrDIuQBpJcuQvCQSj27crQSyc+WM4p0c= | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.14.0 h1:GH67aTvjXiXC2XmYhgmqNXfG13JHKB3wsk5JlTErsjg= | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.14.0/go.mod h1:0fFs4R7kg+gU7FNAIzzFvlCZJz6gyZ8CFhbK3eSrAwQ= | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.15.0 h1:7iTzdiglvJmKMaHlr4JUPvNOmA730rAniry74cnZ8zI= | ||
| github.com/stackitcloud/stackit-sdk-go/services/ske v0.15.0/go.mod h1:0fFs4R7kg+gU7FNAIzzFvlCZJz6gyZ8CFhbK3eSrAwQ= | ||
| github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
@@ -126,2 +171,3 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= | ||
| github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= | ||
| github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
| github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
@@ -133,2 +179,4 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= | ||
| github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= | ||
| github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | ||
| github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | ||
| github.com/zalando/go-keyring v0.2.4 h1:wi2xxTqdiwMKbM6TWwi+uJCG/Tum2UV0jqaQhCa9/68= | ||
@@ -138,8 +186,27 @@ github.com/zalando/go-keyring v0.2.4/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= | ||
| go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= | ||
| golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||
| golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||
| golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= | ||
| golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= | ||
| golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= | ||
| golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= | ||
| golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= | ||
| golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= | ||
| golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= | ||
| golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= | ||
| golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= | ||
| golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||
| golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||
| golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= | ||
| golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= | ||
| golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= | ||
| golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= | ||
| golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= | ||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
| golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
| golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
| golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
| golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
| golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
| golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
@@ -150,11 +217,50 @@ golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= | ||
| golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= | ||
| golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||
| golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||
| golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= | ||
| golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= | ||
| golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= | ||
| golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= | ||
| golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||
| golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||
| golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= | ||
| golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= | ||
| golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
| golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
| golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
| golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||
| golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= | ||
| golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= | ||
| google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= | ||
| google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= | ||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
| gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= | ||
| gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
| gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= | ||
| gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= | ||
| gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= | ||
| gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= | ||
| gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= | ||
| gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= | ||
| gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
| gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= | ||
| gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= | ||
| gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
| gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
| gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
| k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= | ||
| k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= | ||
| k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= | ||
| k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= | ||
| k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= | ||
| k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= | ||
| k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= | ||
| k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= | ||
| k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= | ||
| k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= | ||
| k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= | ||
| k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= | ||
| sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= | ||
| sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= | ||
| sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= | ||
| sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= | ||
| sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= | ||
| sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -136,2 +137,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Argus credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -138,0 +147,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -137,2 +138,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(grafanaConfigs, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Grafana configs: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -139,0 +148,0 @@ initialAdminPassword := *instance.Instance.GrafanaAdminPassword |
@@ -9,2 +9,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -212,2 +213,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Argus instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -214,0 +223,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -110,2 +111,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Argus instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -112,0 +121,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Argus instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package plans | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Argus plans: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(config, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal scrape configuration: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -114,0 +123,0 @@ saml2Enabled := "Enabled" |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -139,2 +140,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(configs, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal scrape configurations list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -141,0 +150,0 @@ table := tables.NewTable() |
@@ -12,2 +12,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -77,2 +78,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/config" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(configData, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal config list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -79,0 +88,0 @@ // Sort the config options by key |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -179,2 +180,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal DNS record-set: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -181,0 +190,0 @@ operationState := "Created" |
@@ -9,2 +9,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -126,2 +127,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(recordSet, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal DNS record set: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -128,0 +137,0 @@ recordsData := make([]string, 0, len(*recordSet.Records)) |
@@ -9,2 +9,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -247,2 +248,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(recordSets, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal DNS record set list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -249,0 +258,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -208,2 +209,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal DNS zone: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -210,0 +219,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -111,2 +112,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(zone, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal DNS zone: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -113,0 +122,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -236,2 +237,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(zones, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal DNS zone list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -238,0 +247,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -110,2 +111,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(loadBalancer, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal load balancer: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -167,2 +176,3 @@ return outputResultAsTable(p, loadBalancer) | ||
| table := tables.NewTable() | ||
| table.SetTitle("Load Balancer") | ||
| table.AddRow("NAME", *loadBalancer.Name) | ||
@@ -188,3 +198,4 @@ table.AddSeparator() | ||
| table := tables.NewTable() | ||
| table.SetHeader("LISTENER NAME", "PORT", "PROTOCOL", "TARGET POOL") | ||
| table.SetTitle("Listeners") | ||
| table.SetHeader("NAME", "PORT", "PROTOCOL", "TARGET POOL") | ||
| for i := range listeners { | ||
@@ -199,3 +210,4 @@ listener := listeners[i] | ||
| table := tables.NewTable() | ||
| table.SetHeader("TARGET POOL NAME", "PORT", "TARGETS") | ||
| table.SetTitle("Target Pools") | ||
| table.SetHeader("NAME", "PORT", "TARGETS") | ||
| for _, targetPool := range targetPools { | ||
@@ -202,0 +214,0 @@ table.AddRow(*targetPool.Name, *targetPool.TargetPort, len(*targetPool.Targets)) |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -143,2 +144,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(loadBalancers, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal load balancer list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -145,0 +154,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package add | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/google/uuid" | ||
@@ -161,2 +162,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Load Balancer observability credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -163,0 +172,0 @@ p.Outputf("Added Load Balancer observability credentials on project %q. Credentials reference: %q\n", projectLabel, *resp.Credential.CredentialsRef) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -107,2 +108,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Load Balancer observability credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -109,0 +118,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -179,2 +180,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Load Balancer observability credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -181,0 +190,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package quota | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -100,2 +101,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(quota, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal quota: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -102,0 +111,0 @@ details, err := json.MarshalIndent(quota, "", " ") |
@@ -10,2 +10,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -123,11 +124,12 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| func outputResult(p *print.Printer, outputFormat string, targetPool loadbalancer.TargetPool, listener *loadbalancer.Listener) error { | ||
| output := struct { | ||
| *loadbalancer.TargetPool | ||
| Listener *loadbalancer.Listener `json:"attached_listener"` | ||
| }{ | ||
| &targetPool, | ||
| listener, | ||
| } | ||
| switch outputFormat { | ||
| case print.JSONOutputFormat: | ||
| output := struct { | ||
| *loadbalancer.TargetPool | ||
| Listener *loadbalancer.Listener `json:"attached_listener"` | ||
| }{ | ||
| &targetPool, | ||
| listener, | ||
| } | ||
| details, err := json.MarshalIndent(output, "", " ") | ||
@@ -140,2 +142,10 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal load balancer: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -142,0 +152,0 @@ return outputResultAsTable(p, targetPool, listener) |
@@ -8,2 +8,4 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -18,4 +20,2 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/logme" | ||
@@ -128,7 +128,7 @@ ) | ||
| func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *logme.CredentialsResponse) error { | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| switch model.OutputFormat { | ||
| case print.JSONOutputFormat: | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| details, err := json.MarshalIndent(resp, "", " ") | ||
@@ -141,2 +141,10 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -143,0 +151,0 @@ p.Outputf("Created credentials for instance %q. Credentials ID: %s\n\n", instanceLabel, *resp.Id) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -124,2 +125,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -126,0 +135,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -147,2 +148,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -149,0 +158,0 @@ table := tables.NewTable() |
@@ -10,2 +10,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -264,2 +265,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -266,0 +275,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -114,0 +123,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package plans | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal LogMe plans: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -127,7 +128,7 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *mariadb.CredentialsResponse) error { | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| switch model.OutputFormat { | ||
| case print.JSONOutputFormat: | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| details, err := json.MarshalIndent(resp, "", " ") | ||
@@ -140,2 +141,10 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Argus credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -142,0 +151,0 @@ p.Outputf("Created credentials for instance %q. Credentials ID: %s\n\n", instanceLabel, *resp.Id) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -124,2 +125,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MariaDB credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -126,0 +135,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -147,2 +148,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MariaDB credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -149,0 +158,0 @@ table := tables.NewTable() |
@@ -10,2 +10,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -264,2 +265,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MariaDB instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -266,0 +275,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MariaDB instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -114,0 +123,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MariaDB instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package plans | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MariaDB plans: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -286,2 +287,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDBFlex instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -288,0 +297,0 @@ operationState := "Created" |
@@ -9,2 +9,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -146,2 +155,4 @@ aclsArray := *instance.Acl.Items | ||
| table.AddSeparator() | ||
| table.AddRow("BACKUP SCHEDULE", *instance.BackupSchedule) | ||
| table.AddSeparator() | ||
| err = table.Display(p) | ||
@@ -148,0 +159,0 @@ if err != nil { |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package update | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -320,2 +321,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal update MongoDBFlex instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -322,0 +331,0 @@ operationState := "Updated" |
| package mongodbflex | ||
| import ( | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance" | ||
@@ -30,2 +31,3 @@ "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/options" | ||
| cmd.AddCommand(options.NewCmd(p)) | ||
| cmd.AddCommand(backup.NewCmd(p)) | ||
| } |
@@ -8,2 +8,3 @@ package options | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -195,2 +196,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex options: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -227,2 +236,3 @@ return outputResultAsTable(p, model, options) | ||
| table := tables.NewTable() | ||
| table.SetTitle("Flavors") | ||
| table.SetHeader("ID", "CPU", "MEMORY", "DESCRIPTION", "VALID INSTANCE TYPES") | ||
@@ -242,2 +252,3 @@ for i := range flavors { | ||
| table := tables.NewTable() | ||
| table.SetTitle("Versions") | ||
| table.SetHeader("VERSION") | ||
@@ -258,3 +269,4 @@ for i := range versions { | ||
| table := tables.NewTable() | ||
| table.SetHeader("MIN STORAGE", "MAX STORAGE", "STORAGE CLASS") | ||
| table.SetTitle("Storages") | ||
| table.SetHeader("MINIMUM", "MAXIMUM", "STORAGE CLASS") | ||
| for i := range storageClasses { | ||
@@ -261,0 +273,0 @@ sc := storageClasses[i] |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/spf13/cobra" | ||
@@ -161,2 +162,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -163,0 +172,0 @@ p.Outputf("Created user for instance %q. User ID: %s\n\n", instanceLabel, *user.Id) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -130,2 +131,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -132,0 +141,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -150,2 +151,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex user list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -152,0 +161,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package resetpassword | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -146,2 +147,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal MongoDB Flex reset password: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -148,0 +157,0 @@ p.Outputf("Reset password for user %q of instance %q\n\n", userLabel, instanceLabel) |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -127,2 +128,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage bucket: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -129,0 +138,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -109,2 +110,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(bucket, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage bucket: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -111,0 +120,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(buckets, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage bucket list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -125,2 +126,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage credentials group: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -127,0 +136,0 @@ p.Outputf("Created credentials group %q. Credentials group ID: %s\n\n", *resp.CredentialsGroup.DisplayName, *resp.CredentialsGroup.CredentialsGroupId) |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -134,2 +135,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentialsGroups, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage credentials group list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -136,0 +145,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| objectStorageUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/object-storage/utils" | ||
@@ -150,2 +151,10 @@ | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -152,0 +161,0 @@ expireDate := "Never" |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| objectStorageUtils "github.com/stackitcloud/stackit-cli/internal/pkg/services/object-storage/utils" | ||
@@ -150,2 +151,10 @@ | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Object Storage credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -152,0 +161,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -127,7 +128,7 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *opensearch.CredentialsResponse) error { | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| switch model.OutputFormat { | ||
| case print.JSONOutputFormat: | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| details, err := json.MarshalIndent(resp, "", " ") | ||
@@ -140,2 +141,10 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -142,0 +151,0 @@ p.Outputf("Created credentials for instance %q. Credentials ID: %s\n\n", instanceLabel, *resp.Id) // The username field cannot be set by the user so we only display it if it's not returned empty |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -124,2 +125,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -126,0 +135,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -147,2 +148,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -149,0 +158,0 @@ table := tables.NewTable() |
@@ -10,2 +10,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -269,2 +270,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -271,0 +280,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -114,0 +123,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package plans | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal OpenSearch plans: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -169,2 +170,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal members: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -171,0 +180,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal roles: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -10,2 +10,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/inhies/go-bytesize" | ||
@@ -126,2 +127,10 @@ "github.com/spf13/cobra" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(backup, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal backup for PostgreSQL Flex backup: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -128,0 +137,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/inhies/go-bytesize" | ||
@@ -141,3 +142,3 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex instance list: %w", err) | ||
| return fmt.Errorf("marshal PostgreSQL Flex backup list: %w", err) | ||
| } | ||
@@ -147,2 +148,10 @@ p.Outputln(string(details)) | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(backups, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex backup list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -149,0 +158,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package clone | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -218,2 +219,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgresFlex instance clone: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -220,0 +229,0 @@ operationState := "Cloned" |
@@ -9,2 +9,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -286,2 +287,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgresFlex instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -288,0 +297,0 @@ operationState := "Created" |
@@ -9,2 +9,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -114,2 +115,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -116,0 +125,0 @@ aclsArray := *instance.Acl.Items |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -144,2 +145,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -146,0 +155,0 @@ caser := cases.Title(language.English) |
@@ -9,2 +9,3 @@ package update | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -320,2 +321,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgresFlex instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -322,0 +331,0 @@ operationState := "Updated" |
@@ -8,2 +8,3 @@ package options | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -195,2 +196,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex options: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -227,2 +236,3 @@ return outputResultAsTable(p, model, options) | ||
| table := tables.NewTable() | ||
| table.SetTitle("Flavors") | ||
| table.SetHeader("ID", "CPU", "MEMORY", "DESCRIPTION") | ||
@@ -242,2 +252,3 @@ for i := range flavors { | ||
| table := tables.NewTable() | ||
| table.SetTitle("Versions") | ||
| table.SetHeader("VERSION") | ||
@@ -258,3 +269,4 @@ for i := range versions { | ||
| table := tables.NewTable() | ||
| table.SetHeader("MIN STORAGE", "MAX STORAGE", "STORAGE CLASS") | ||
| table.SetTitle("Storages") | ||
| table.SetHeader("MINIMUM", "MAXIMUM", "STORAGE CLASS") | ||
| for i := range storageClasses { | ||
@@ -261,0 +273,0 @@ sc := storageClasses[i] |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -156,2 +157,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgresFlex user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -158,0 +167,0 @@ user := resp.Item |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -129,2 +130,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -131,0 +140,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -150,2 +151,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgreSQL Flex user list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -152,0 +161,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package resetpassword | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -145,2 +146,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal PostgresFlex user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -147,0 +156,0 @@ p.Outputf("Reset password for user %q of instance %q\n\n", userLabel, instanceLabel) |
@@ -9,2 +9,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -202,2 +203,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/auth" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal project: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -204,0 +213,0 @@ p.Outputf("Created project under the parent with ID %q. Project ID: %s\n", *model.ParentId, *resp.ProjectId) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -131,2 +132,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal project details: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -133,0 +142,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -232,2 +233,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/auth" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(projects, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal projects list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -234,0 +243,0 @@ table := tables.NewTable() |
@@ -9,2 +9,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -171,2 +172,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(members, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal members: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -173,0 +182,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -144,2 +145,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(roles, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal roles: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -146,0 +155,0 @@ table := tables.NewTable() |
@@ -8,2 +8,4 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -18,4 +20,2 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/utils" | ||
| "github.com/spf13/cobra" | ||
| "github.com/stackitcloud/stackit-sdk-go/services/rabbitmq" | ||
@@ -128,7 +128,7 @@ ) | ||
| func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *rabbitmq.CredentialsResponse) error { | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| switch model.OutputFormat { | ||
| case print.JSONOutputFormat: | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| details, err := json.MarshalIndent(resp, "", " ") | ||
@@ -141,2 +141,10 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -143,0 +151,0 @@ p.Outputf("Created credentials for instance %q. Credentials ID: %s\n\n", instanceLabel, *resp.Id) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -124,2 +125,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -126,0 +135,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -147,2 +148,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -149,0 +158,0 @@ table := tables.NewTable() |
@@ -10,2 +10,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -269,2 +270,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -271,0 +280,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -114,0 +123,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package plans | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal RabbitMQ plans: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -127,7 +128,8 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| func outputResult(p *print.Printer, model *inputModel, instanceLabel string, resp *redis.CredentialsResponse) error { | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| switch model.OutputFormat { | ||
| case print.JSONOutputFormat: | ||
| if !model.ShowPassword { | ||
| resp.Raw.Credentials.Password = utils.Ptr("hidden") | ||
| } | ||
| details, err := json.MarshalIndent(resp, "", " ") | ||
@@ -140,5 +142,13 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
| p.Outputf("Created credentials for instance %q. Credentials ID: %s\n\n", instanceLabel, *resp.Id) | ||
| // The username field cannot be set by the user so we only display it if it's not returned empty | ||
| // The username field cannot be set by the user, so we only display it if it's not returned empty | ||
| username := *resp.Raw.Credentials.Username | ||
@@ -145,0 +155,0 @@ if username != "" { |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -124,2 +125,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -126,0 +135,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -147,2 +148,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis credentials list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -149,0 +158,0 @@ table := tables.NewTable() |
@@ -10,2 +10,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -264,2 +265,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -266,0 +275,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -112,2 +113,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instance, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -114,0 +123,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package plans | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -142,2 +143,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(plans, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Redis plans: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -144,0 +153,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -170,2 +171,10 @@ cliErr "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Secrets Manager instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -172,0 +181,0 @@ p.Outputf("Created instance for project %q. Instance ID: %s\n", projectLabel, instanceId) |
@@ -9,2 +9,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -114,9 +115,9 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| func outputResult(p *print.Printer, outputFormat string, instance *secretsmanager.Instance, aclList *secretsmanager.AclList) error { | ||
| output := struct { | ||
| *secretsmanager.Instance | ||
| *secretsmanager.AclList | ||
| }{instance, aclList} | ||
| switch outputFormat { | ||
| case print.JSONOutputFormat: | ||
| output := struct { | ||
| *secretsmanager.Instance | ||
| *secretsmanager.AclList | ||
| }{instance, aclList} | ||
| details, err := json.MarshalIndent(output, "", " ") | ||
@@ -129,2 +130,10 @@ if err != nil { | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(output, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Secrets Manager instance: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -131,0 +140,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -143,2 +144,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(instances, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Secrets Manager instance list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -145,0 +154,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -150,2 +151,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Secrets Manager user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -152,0 +161,0 @@ p.Outputf("Created user for instance %q. User ID: %s\n\n", instanceLabel, *resp.Id) |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -126,2 +127,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(user, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Secrets Manager user: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -128,0 +137,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -150,2 +151,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(users, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal Secrets Manager user list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -152,0 +161,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -131,2 +132,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(serviceAccount, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal service account: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -133,0 +142,0 @@ p.Outputf("Created service account for project %q. Email: %s\n", projectLabel, *serviceAccount.Email) |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -152,2 +153,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(keys, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal keys metadata: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -154,0 +163,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -134,2 +135,8 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| p.Outputln(string(details)) | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(serviceAccounts, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal service accounts list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| default: | ||
@@ -136,0 +143,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -155,2 +156,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(token, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal service account access token: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -157,0 +166,0 @@ p.Outputf("Created access token for service account %s. Token ID: %s\n\n", model.ServiceAccountEmail, *token.Id) |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -156,2 +157,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(tokensMetadata, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal tokens metadata: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -158,0 +167,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -200,2 +201,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE cluster: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -202,0 +211,0 @@ operationState := "Created" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -109,2 +110,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(cluster, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE cluster: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -111,0 +120,0 @@ acl := []string{} |
@@ -8,2 +8,3 @@ package list | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -152,2 +153,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(clusters, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE cluster list: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -154,0 +163,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package update | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -172,2 +173,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(resp, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE cluster: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -174,0 +183,0 @@ operationState := "Updated" |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -126,2 +127,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(credentials, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE credentials: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -128,0 +137,0 @@ table := tables.NewTable() |
@@ -8,2 +8,3 @@ package describe | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -98,2 +99,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(project, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE project details: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -100,0 +109,0 @@ table := tables.NewTable() |
@@ -95,4 +95,14 @@ package create | ||
| }, | ||
| { | ||
| description: "login", | ||
| argValues: fixtureArgValues(), | ||
| flagValues: fixtureFlagValues(func(flagValues map[string]string) { | ||
| flagValues["login"] = "true" | ||
| }), | ||
| isValid: true, | ||
| expectedModel: fixtureInputModel(func(model *inputModel) { | ||
| model.Login = true | ||
| }), | ||
| }, | ||
| { | ||
| description: "custom filepath", | ||
@@ -206,3 +216,3 @@ argValues: fixtureArgValues(), | ||
| func TestBuildRequest(t *testing.T) { | ||
| func TestBuildRequestCreate(t *testing.T) { | ||
| tests := []struct { | ||
@@ -230,3 +240,3 @@ description string | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| request, _ := buildRequest(testCtx, tt.model, testClient) | ||
| request, _ := buildRequestCreate(testCtx, tt.model, testClient) | ||
@@ -233,0 +243,0 @@ diff := cmp.Diff(request, tt.expectedRequest, |
@@ -8,2 +8,3 @@ package create | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -25,2 +26,3 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/errors" | ||
| loginFlag = "login" | ||
| expirationFlag = "expiration" | ||
@@ -35,2 +37,3 @@ filepathFlag = "filepath" | ||
| ExpirationTime *string | ||
| Login bool | ||
| } | ||
@@ -54,2 +57,6 @@ | ||
| examples.NewExample( | ||
| `Get a login kubeconfig for the SKE cluster with name "my-cluster". `+ | ||
| "This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command.", | ||
| "$ stackit ske kubeconfig create my-cluster --login"), | ||
| examples.NewExample( | ||
| `Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days`, | ||
@@ -86,16 +93,37 @@ "$ stackit ske kubeconfig create my-cluster --expiration 30d"), | ||
| // Call API | ||
| req, err := buildRequest(ctx, model, apiClient) | ||
| if err != nil { | ||
| return fmt.Errorf("build kubeconfig create request: %w", err) | ||
| var ( | ||
| kubeconfig string | ||
| respKubeconfig *ske.Kubeconfig | ||
| respLogin *ske.V1LoginKubeconfig | ||
| ) | ||
| if !model.Login { | ||
| req, err := buildRequestCreate(ctx, model, apiClient) | ||
| if err != nil { | ||
| return fmt.Errorf("build kubeconfig create request: %w", err) | ||
| } | ||
| respKubeconfig, err = req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("create kubeconfig for SKE cluster: %w", err) | ||
| } | ||
| if respKubeconfig.Kubeconfig == nil { | ||
| return fmt.Errorf("no kubeconfig returned from the API") | ||
| } | ||
| kubeconfig = *respKubeconfig.Kubeconfig | ||
| } else { | ||
| req, err := buildRequestLogin(ctx, model, apiClient) | ||
| if err != nil { | ||
| return fmt.Errorf("build login kubeconfig create request: %w", err) | ||
| } | ||
| respLogin, err = req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("create login kubeconfig for SKE cluster: %w", err) | ||
| } | ||
| if respLogin.Kubeconfig == nil { | ||
| return fmt.Errorf("no login kubeconfig returned from the API") | ||
| } | ||
| kubeconfig = *respLogin.Kubeconfig | ||
| } | ||
| resp, err := req.Execute() | ||
| if err != nil { | ||
| return fmt.Errorf("create kubeconfig for SKE cluster: %w", err) | ||
| } | ||
| // Create the config file | ||
| if resp.Kubeconfig == nil { | ||
| return fmt.Errorf("no kubeconfig returned from the API") | ||
| } | ||
| var kubeconfigPath string | ||
@@ -111,8 +139,10 @@ if model.Filepath == nil { | ||
| err = skeUtils.WriteConfigFile(kubeconfigPath, *resp.Kubeconfig) | ||
| if err != nil { | ||
| return fmt.Errorf("write kubeconfig file: %w", err) | ||
| if model.OutputFormat != print.JSONOutputFormat { | ||
| err = skeUtils.WriteConfigFile(kubeconfigPath, kubeconfig) | ||
| if err != nil { | ||
| return fmt.Errorf("write kubeconfig file: %w", err) | ||
| } | ||
| } | ||
| return outputResult(p, model, kubeconfigPath, resp) | ||
| return outputResult(p, model, kubeconfigPath, respKubeconfig, respLogin) | ||
| }, | ||
@@ -125,4 +155,7 @@ } | ||
| func configureFlags(cmd *cobra.Command) { | ||
| cmd.Flags().BoolP(loginFlag, "l", false, "Create a login kubeconfig that obtains valid credentials via the STACKIT CLI. This flag is mutually exclusive with the expiration flag.") | ||
| cmd.Flags().StringP(expirationFlag, "e", "", "Expiration time for the kubeconfig in seconds(s), minutes(m), hours(h), days(d) or months(M). Example: 30d. By default, expiration time is 1h") | ||
| cmd.Flags().String(filepathFlag, "", "Path to create the kubeconfig file. By default, the kubeconfig is created as 'config' in the .kube folder, in the user's home directory.") | ||
| cmd.MarkFlagsMutuallyExclusive(loginFlag, expirationFlag) | ||
| } | ||
@@ -156,2 +189,3 @@ | ||
| ExpirationTime: expTime, | ||
| Login: flags.FlagToBoolValue(p, cmd, loginFlag), | ||
| } | ||
@@ -171,3 +205,3 @@ | ||
| func buildRequest(ctx context.Context, model *inputModel, apiClient *ske.APIClient) (ske.ApiCreateKubeconfigRequest, error) { | ||
| func buildRequestCreate(ctx context.Context, model *inputModel, apiClient *ske.APIClient) (ske.ApiCreateKubeconfigRequest, error) { | ||
| req := apiClient.CreateKubeconfig(ctx, model.ProjectId, model.ClusterName) | ||
@@ -184,6 +218,16 @@ | ||
| func outputResult(p *print.Printer, model *inputModel, kubeconfigPath string, resp *ske.Kubeconfig) error { | ||
| func buildRequestLogin(ctx context.Context, model *inputModel, apiClient *ske.APIClient) (ske.ApiGetLoginKubeconfigRequest, error) { | ||
| return apiClient.GetLoginKubeconfig(ctx, model.ProjectId, model.ClusterName), nil | ||
| } | ||
| func outputResult(p *print.Printer, model *inputModel, kubeconfigPath string, respKubeconfig *ske.Kubeconfig, respLogin *ske.V1LoginKubeconfig) error { | ||
| switch model.OutputFormat { | ||
| case print.JSONOutputFormat: | ||
| details, err := json.MarshalIndent(resp, "", " ") | ||
| var err error | ||
| var details []byte | ||
| if respKubeconfig != nil { | ||
| details, err = json.MarshalIndent(respKubeconfig, "", " ") | ||
| } else if respLogin != nil { | ||
| details, err = json.MarshalIndent(respLogin, "", " ") | ||
| } | ||
| if err != nil { | ||
@@ -195,4 +239,22 @@ return fmt.Errorf("marshal SKE Kubeconfig: %w", err) | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| var err error | ||
| var details []byte | ||
| if respKubeconfig != nil { | ||
| details, err = yaml.MarshalWithOptions(respKubeconfig, yaml.IndentSequence(true)) | ||
| } else if respLogin != nil { | ||
| details, err = yaml.MarshalWithOptions(respLogin, yaml.IndentSequence(true)) | ||
| } | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE Kubeconfig: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
| p.Outputf("Created kubeconfig file for cluster %s in %q, with expiration date %v (UTC)\n", model.ClusterName, kubeconfigPath, *resp.ExpirationTimestamp) | ||
| var expiration string | ||
| if respKubeconfig != nil { | ||
| expiration = fmt.Sprintf(", with expiration date %v (UTC)", *respKubeconfig.ExpirationTimestamp) | ||
| } | ||
| p.Outputf("Created kubeconfig file for cluster %s in %q%s\n", model.ClusterName, kubeconfigPath, expiration) | ||
@@ -199,0 +261,0 @@ return nil |
@@ -5,2 +5,3 @@ package kubeconfig | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/create" | ||
| "github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/login" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -27,2 +28,3 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/print" | ||
| cmd.AddCommand(create.NewCmd(p)) | ||
| cmd.AddCommand(login.NewCmd(p)) | ||
| } |
@@ -9,2 +9,3 @@ package options | ||
| "github.com/goccy/go-yaml" | ||
| "github.com/stackitcloud/stackit-cli/internal/pkg/args" | ||
@@ -146,2 +147,10 @@ "github.com/stackitcloud/stackit-cli/internal/pkg/examples" | ||
| return nil | ||
| case print.YAMLOutputFormat: | ||
| details, err := yaml.MarshalWithOptions(options, yaml.IndentSequence(true)) | ||
| if err != nil { | ||
| return fmt.Errorf("marshal SKE options: %w", err) | ||
| } | ||
| p.Outputln(string(details)) | ||
| return nil | ||
| default: | ||
@@ -186,3 +195,4 @@ return outputResultAsTable(p, model, options) | ||
| table := tables.NewTable() | ||
| table.SetHeader("AVAILABILITY ZONES") | ||
| table.SetTitle("Availability Zones") | ||
| table.SetHeader("ZONE") | ||
| for i := range zones { | ||
@@ -199,3 +209,4 @@ z := zones[i] | ||
| table := tables.NewTable() | ||
| table.SetHeader("KUBERNETES VERSION", "STATE", "EXPIRATION DATE", "FEATURE GATES") | ||
| table.SetTitle("Kubernetes Versions") | ||
| table.SetHeader("VERSION", "STATE", "EXPIRATION DATE", "FEATURE GATES") | ||
| for i := range versions { | ||
@@ -220,3 +231,4 @@ v := versions[i] | ||
| table := tables.NewTable() | ||
| table.SetHeader("MACHINE IMAGE NAME", "VERSION", "STATE", "EXPIRATION DATE", "SUPPORTED CRI") | ||
| table.SetTitle("Machine Images") | ||
| table.SetHeader("NAME", "VERSION", "STATE", "EXPIRATION DATE", "SUPPORTED CRI") | ||
| for i := range images { | ||
@@ -249,3 +261,4 @@ image := images[i] | ||
| table := tables.NewTable() | ||
| table.SetHeader("MACHINE TYPE", "CPU", "MEMORY") | ||
| table.SetTitle("Machine Types") | ||
| table.SetHeader("TYPE", "CPU", "MEMORY") | ||
| for i := range types { | ||
@@ -262,3 +275,4 @@ t := types[i] | ||
| table := tables.NewTable() | ||
| table.SetHeader("VOLUME TYPE") | ||
| table.SetTitle("Volume Types") | ||
| table.SetHeader("TYPE") | ||
| for i := range types { | ||
@@ -265,0 +279,0 @@ z := types[i] |
@@ -25,2 +25,4 @@ package errors | ||
| REQUIRED_MUTUALLY_EXCLUSIVE_FLAGS = `the following flags are mutually exclusive and at least one of them is required: %s` | ||
| FAILED_AUTH = `you are not authenticated. | ||
@@ -241,2 +243,10 @@ | ||
| type RequiredMutuallyExclusiveFlagsError struct { | ||
| Flags []string | ||
| } | ||
| func (e *RequiredMutuallyExclusiveFlagsError) Error() string { | ||
| return fmt.Sprintf(REQUIRED_MUTUALLY_EXCLUSIVE_FLAGS, strings.Join(e.Flags, ", ")) | ||
| } | ||
| type ArgValidationError struct { | ||
@@ -243,0 +253,0 @@ Arg string |
@@ -30,3 +30,3 @@ package globalflags | ||
| var outputFormatFlagOptions = []string{print.JSONOutputFormat, print.PrettyOutputFormat, print.NoneOutputFormat} | ||
| var outputFormatFlagOptions = []string{print.JSONOutputFormat, print.PrettyOutputFormat, print.NoneOutputFormat, print.YAMLOutputFormat} | ||
| var verbosityFlagOptions = []string{DebugVerbosity, InfoVerbosity, WarningVerbosity, ErrorVerbosity} | ||
@@ -33,0 +33,0 @@ |
@@ -33,2 +33,3 @@ package print | ||
| NoneOutputFormat = "none" | ||
| YAMLOutputFormat = "yaml" | ||
| ) | ||
@@ -175,7 +176,19 @@ | ||
| } | ||
| pagerCmd := exec.Command("less", "-F", "-S", "-w") | ||
| // less arguments | ||
| // -F: exits if the entire file fits on the first screen | ||
| // -S: disables line wrapping | ||
| // -w: highlight the first line after moving one full page down | ||
| // -R: interprets ANSI color and style sequences | ||
| pagerCmd := exec.Command("less", "-F", "-S", "-w", "-R") | ||
| pager, pagerExists := os.LookupEnv("PAGER") | ||
| if pagerExists && pager != "nil" && pager != "" { | ||
| pagerCmd = exec.Command(pager) // #nosec G204 | ||
| } | ||
| pagerCmd.Stdin = strings.NewReader(content) | ||
| pagerCmd.Stdout = p.Cmd.OutOrStdout() | ||
| p.Debug(DebugLevel, "using pager: %s", pagerCmd.Args[0]) | ||
| err := pagerCmd.Run() | ||
@@ -182,0 +195,0 @@ if err != nil { |
@@ -19,2 +19,3 @@ package utils | ||
| testUserId = uuid.NewString() | ||
| testBackupId = uuid.NewString() | ||
| ) | ||
@@ -28,8 +29,10 @@ | ||
| type mongoDBFlexClientMocked struct { | ||
| listVersionsFails bool | ||
| listVersionsResp *mongodbflex.ListVersionsResponse | ||
| getInstanceFails bool | ||
| getInstanceResp *mongodbflex.GetInstanceResponse | ||
| getUserFails bool | ||
| getUserResp *mongodbflex.GetUserResponse | ||
| listVersionsFails bool | ||
| listVersionsResp *mongodbflex.ListVersionsResponse | ||
| getInstanceFails bool | ||
| getInstanceResp *mongodbflex.GetInstanceResponse | ||
| getUserFails bool | ||
| getUserResp *mongodbflex.GetUserResponse | ||
| listRestoreJobsFails bool | ||
| listRestoreJobsResp *mongodbflex.ListRestoreJobsResponse | ||
| } | ||
@@ -44,2 +47,9 @@ | ||
| func (m *mongoDBFlexClientMocked) ListRestoreJobsExecute(_ context.Context, _, _ string) (*mongodbflex.ListRestoreJobsResponse, error) { | ||
| if m.listRestoreJobsFails { | ||
| return nil, fmt.Errorf("could not list versions") | ||
| } | ||
| return m.listRestoreJobsResp, nil | ||
| } | ||
| func (m *mongoDBFlexClientMocked) GetInstanceExecute(_ context.Context, _, _ string) (*mongodbflex.GetInstanceResponse, error) { | ||
@@ -370,3 +380,3 @@ if m.getInstanceFails { | ||
| func TestGetLatestPostgreSQLVersion(t *testing.T) { | ||
| func TestGetLatestMongoDBFlexVersion(t *testing.T) { | ||
| tests := []struct { | ||
@@ -525,1 +535,117 @@ description string | ||
| } | ||
| func TestGetRestoreStatus(t *testing.T) { | ||
| tests := []struct { | ||
| description string | ||
| listRestoreJobsResp *mongodbflex.ListRestoreJobsResponse | ||
| expectedOutput string | ||
| }{ | ||
| { | ||
| description: "base", | ||
| listRestoreJobsResp: &mongodbflex.ListRestoreJobsResponse{ | ||
| Items: &[]mongodbflex.RestoreInstanceStatus{ | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2024-05-14T12:01:11Z"), | ||
| Status: utils.Ptr("state"), | ||
| }, | ||
| { | ||
| BackupID: utils.Ptr("bar"), | ||
| Date: utils.Ptr("2024-05-14T12:01:11Z"), | ||
| Status: utils.Ptr("state 2"), | ||
| }, | ||
| }, | ||
| }, | ||
| expectedOutput: "state", | ||
| }, | ||
| { | ||
| description: "get latest restore, ordered array", | ||
| listRestoreJobsResp: &mongodbflex.ListRestoreJobsResponse{ | ||
| Items: &[]mongodbflex.RestoreInstanceStatus{ | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2024-05-14T12:01:11Z"), | ||
| Status: utils.Ptr("in progress"), | ||
| }, | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2024-05-13T12:01:11Z"), | ||
| Status: utils.Ptr("finished"), | ||
| }, | ||
| }, | ||
| }, | ||
| expectedOutput: "in progress", | ||
| }, | ||
| { | ||
| description: "get latest restore, unordered array", | ||
| listRestoreJobsResp: &mongodbflex.ListRestoreJobsResponse{ | ||
| Items: &[]mongodbflex.RestoreInstanceStatus{ | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2024-05-13T12:01:11Z"), | ||
| Status: utils.Ptr("finished"), | ||
| }, | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2024-05-14T12:01:11Z"), | ||
| Status: utils.Ptr("in progress"), | ||
| }, | ||
| }, | ||
| }, | ||
| expectedOutput: "in progress", | ||
| }, | ||
| { | ||
| description: "get latest restore, another date format", | ||
| listRestoreJobsResp: &mongodbflex.ListRestoreJobsResponse{ | ||
| Items: &[]mongodbflex.RestoreInstanceStatus{ | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2009-11-10 23:00:00 +0000 UTC m=+0.000000001"), | ||
| Status: utils.Ptr("finished"), | ||
| }, | ||
| { | ||
| BackupID: utils.Ptr(testBackupId), | ||
| Date: utils.Ptr("2009-11-11 23:00:00 +0000 UTC m=+0.000000001"), | ||
| Status: utils.Ptr("in progress"), | ||
| }, | ||
| }, | ||
| }, | ||
| expectedOutput: "in progress", | ||
| }, | ||
| { | ||
| description: "no restore job for that backup", | ||
| listRestoreJobsResp: &mongodbflex.ListRestoreJobsResponse{ | ||
| Items: &[]mongodbflex.RestoreInstanceStatus{ | ||
| { | ||
| BackupID: utils.Ptr("bar"), | ||
| Date: utils.Ptr("2024-05-13T12:01:11Z"), | ||
| Status: utils.Ptr("in progress"), | ||
| }, | ||
| { | ||
| BackupID: utils.Ptr("bar"), | ||
| Date: utils.Ptr("2024-05-13T12:01:11Z"), | ||
| Status: utils.Ptr("finished"), | ||
| }, | ||
| }, | ||
| }, | ||
| expectedOutput: "-", | ||
| }, | ||
| { | ||
| description: "no restore jobs", | ||
| listRestoreJobsResp: &mongodbflex.ListRestoreJobsResponse{ | ||
| Items: nil, | ||
| }, | ||
| expectedOutput: "-", | ||
| }, | ||
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.description, func(t *testing.T) { | ||
| output := GetRestoreStatus(testBackupId, tt.listRestoreJobsResp) | ||
| if output != tt.expectedOutput { | ||
| t.Errorf("expected output to be %s, got %s", tt.expectedOutput, output) | ||
| } | ||
| }) | ||
| } | ||
| } |
| package utils | ||
| import ( | ||
| "cmp" | ||
| "context" | ||
@@ -121,2 +122,3 @@ "fmt" | ||
| GetUserExecute(ctx context.Context, projectId, instanceId, userId string) (*mongodbflex.GetUserResponse, error) | ||
| ListRestoreJobsExecute(ctx context.Context, projectId string, instanceId string) (*mongodbflex.ListRestoreJobsResponse, error) | ||
| } | ||
@@ -161,1 +163,24 @@ | ||
| } | ||
| func GetRestoreStatus(backupId string, restoreJobs *mongodbflex.ListRestoreJobsResponse) string { | ||
| state := "-" | ||
| if restoreJobs.Items == nil { | ||
| return state | ||
| } | ||
| restoreJobsSlice := *restoreJobs.Items | ||
| // sort array by descending date | ||
| slices.SortFunc(restoreJobsSlice, func(i, j mongodbflex.RestoreInstanceStatus) int { | ||
| // swap elements to sort by descending order | ||
| return cmp.Compare(*j.Date, *i.Date) | ||
| }) | ||
| for _, restoreJob := range *restoreJobs.Items { | ||
| if *restoreJob.BackupID == backupId { | ||
| state = *restoreJob.Status | ||
| break | ||
| } | ||
| } | ||
| return state | ||
| } |
@@ -9,2 +9,3 @@ package tables | ||
| "github.com/jedib0t/go-pretty/v6/table" | ||
| "github.com/jedib0t/go-pretty/v6/text" | ||
| ) | ||
@@ -24,2 +25,16 @@ | ||
| // Sets the title of the table | ||
| func (t *Table) SetTitle(title string) { | ||
| t.table.SetTitle(title) | ||
| // prevent title wrapping by setting the width of the first column to the length of the title | ||
| // this is a workaround for a bug in the tables pkg, see https://github.com/jedib0t/go-pretty/issues/135 | ||
| t.table.SetColumnConfigs([]table.ColumnConfig{ | ||
| { | ||
| Number: 1, | ||
| WidthMin: len(title), | ||
| }, | ||
| }) | ||
| } | ||
| // Sets the header of the table | ||
@@ -52,2 +67,6 @@ func (t *Table) SetHeader(header ...interface{}) { | ||
| t.table.SetStyle(table.StyleLight) | ||
| t.table.Style().Title = table.TitleOptionsBlackOnCyan | ||
| t.table.Style().Title.Align = text.AlignCenter | ||
| t.table.Style().Options.DrawBorder = false | ||
@@ -54,0 +73,0 @@ t.table.Style().Options.SeparateRows = false |
+27
-0
@@ -133,2 +133,29 @@ [](https://goreportcard.com/report/github.com/stackitcloud/stackit-cli)  [](https://www.apache.org/licenses/LICENSE-2.0) | ||
| ## Customization | ||
| ### Pager | ||
| To specify a custom pager, use the `PAGER` environment variable. | ||
| If the variable is not set, STACKIT CLI uses the `less` as default pager. | ||
| When using `less` as a pager, STACKIT CLI will automatically pass following options | ||
| - -F, --quit-if-one-screen - Less will automatically exit if the entire file can be displayed on the first screen. | ||
| - -S, --chop-long-lines - Lines longer than the screen width will be chopped rather than being folded. | ||
| - -w, --hilite-unread - Temporarily highlights the first "new" line after a forward movement of a full page. | ||
| - -R, --RAW-CONTROL-CHARS - ANSI color and style sequences will be interpreted. | ||
| > These options will not be added automatically if a custom pager is defined. | ||
| > | ||
| > In that case, users can define the parameters by using the specific environment variable required by the `PAGER` (if supported). | ||
| > | ||
| > For example, if user sets the `PAGER` environment variable to `less` and would like to pass some arguments, `LESS` environment variable must be used as following: | ||
| > | ||
| > export PAGER="less" | ||
| > | ||
| > export LESS="-R" | ||
| ## Autocompletion | ||
@@ -135,0 +162,0 @@ |