diff --git a/docs/stackit.md b/docs/stackit.md index ff6fb11f5..2bdf961b6 100644 --- a/docs/stackit.md +++ b/docs/stackit.md @@ -53,7 +53,6 @@ stackit [flags] * [stackit public-ip](./stackit_public-ip.md) - Provides functionality for public IPs * [stackit quota](./stackit_quota.md) - Manage server quotas * [stackit rabbitmq](./stackit_rabbitmq.md) - Provides functionality for RabbitMQ -* [stackit redis](./stackit_redis.md) - Provides functionality for Redis * [stackit secrets-manager](./stackit_secrets-manager.md) - Provides functionality for Secrets Manager * [stackit security-group](./stackit_security-group.md) - Manage security groups * [stackit server](./stackit_server.md) - Provides functionality for servers diff --git a/docs/stackit_redis.md b/docs/stackit_redis.md deleted file mode 100644 index 1afc75205..000000000 --- a/docs/stackit_redis.md +++ /dev/null @@ -1,36 +0,0 @@ -## stackit redis - -Provides functionality for Redis - -### Synopsis - -Provides functionality for Redis. - -``` -stackit redis [flags] -``` - -### Options - -``` - -h, --help Help for "stackit redis" -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit](./stackit.md) - Manage STACKIT resources using the command line -* [stackit redis credentials](./stackit_redis_credentials.md) - Provides functionality for Redis credentials -* [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances -* [stackit redis plans](./stackit_redis_plans.md) - Lists all Redis service plans - diff --git a/docs/stackit_redis_credentials.md b/docs/stackit_redis_credentials.md deleted file mode 100644 index 5002442de..000000000 --- a/docs/stackit_redis_credentials.md +++ /dev/null @@ -1,37 +0,0 @@ -## stackit redis credentials - -Provides functionality for Redis credentials - -### Synopsis - -Provides functionality for Redis credentials. - -``` -stackit redis credentials [flags] -``` - -### Options - -``` - -h, --help Help for "stackit redis credentials" -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis](./stackit_redis.md) - Provides functionality for Redis -* [stackit redis credentials create](./stackit_redis_credentials_create.md) - Creates credentials for a Redis instance -* [stackit redis credentials delete](./stackit_redis_credentials_delete.md) - Deletes credentials of a Redis instance -* [stackit redis credentials describe](./stackit_redis_credentials_describe.md) - Shows details of credentials of a Redis instance -* [stackit redis credentials list](./stackit_redis_credentials_list.md) - Lists all credentials' IDs for a Redis instance - diff --git a/docs/stackit_redis_credentials_create.md b/docs/stackit_redis_credentials_create.md deleted file mode 100644 index 949cb2163..000000000 --- a/docs/stackit_redis_credentials_create.md +++ /dev/null @@ -1,45 +0,0 @@ -## stackit redis credentials create - -Creates credentials for a Redis instance - -### Synopsis - -Creates credentials (username and password) for a Redis instance. - -``` -stackit redis credentials create [flags] -``` - -### Examples - -``` - Create credentials for a Redis instance - $ stackit redis credentials create --instance-id xxx - - Create credentials for a Redis instance and show the password in the output - $ stackit redis credentials create --instance-id xxx --show-password -``` - -### Options - -``` - -h, --help Help for "stackit redis credentials create" - --instance-id string Instance ID - -s, --show-password Show password in output -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis credentials](./stackit_redis_credentials.md) - Provides functionality for Redis credentials - diff --git a/docs/stackit_redis_credentials_delete.md b/docs/stackit_redis_credentials_delete.md deleted file mode 100644 index 702f80e1c..000000000 --- a/docs/stackit_redis_credentials_delete.md +++ /dev/null @@ -1,41 +0,0 @@ -## stackit redis credentials delete - -Deletes credentials of a Redis instance - -### Synopsis - -Deletes credentials of a Redis instance. - -``` -stackit redis credentials delete CREDENTIALS_ID [flags] -``` - -### Examples - -``` - Delete credentials with ID "xxx" of Redis instance with ID "yyy" - $ stackit redis credentials delete xxx --instance-id yyy -``` - -### Options - -``` - -h, --help Help for "stackit redis credentials delete" - --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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis credentials](./stackit_redis_credentials.md) - Provides functionality for Redis credentials - diff --git a/docs/stackit_redis_credentials_describe.md b/docs/stackit_redis_credentials_describe.md deleted file mode 100644 index 06a8a7cef..000000000 --- a/docs/stackit_redis_credentials_describe.md +++ /dev/null @@ -1,44 +0,0 @@ -## stackit redis credentials describe - -Shows details of credentials of a Redis instance - -### Synopsis - -Shows details of credentials of a Redis instance. The password will be shown in plain text in the output. - -``` -stackit redis credentials describe CREDENTIALS_ID [flags] -``` - -### Examples - -``` - Get details of credentials with ID "xxx" from instance with ID "yyy" - $ stackit redis credentials describe xxx --instance-id yyy - - Get details of credentials with ID "xxx" from instance with ID "yyy" in JSON format - $ stackit redis credentials describe xxx --instance-id yyy --output-format json -``` - -### Options - -``` - -h, --help Help for "stackit redis credentials 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis credentials](./stackit_redis_credentials.md) - Provides functionality for Redis credentials - diff --git a/docs/stackit_redis_credentials_list.md b/docs/stackit_redis_credentials_list.md deleted file mode 100644 index 4eefcd466..000000000 --- a/docs/stackit_redis_credentials_list.md +++ /dev/null @@ -1,48 +0,0 @@ -## stackit redis credentials list - -Lists all credentials' IDs for a Redis instance - -### Synopsis - -Lists all credentials' IDs for a Redis instance. - -``` -stackit redis credentials list [flags] -``` - -### Examples - -``` - List all credentials' IDs for a Redis instance - $ stackit redis credentials list --instance-id xxx - - List all credentials' IDs for a Redis instance in JSON format - $ stackit redis credentials list --instance-id xxx --output-format json - - List up to 10 credentials' IDs for a Redis instance - $ stackit redis credentials list --instance-id xxx --limit 10 -``` - -### Options - -``` - -h, --help Help for "stackit redis credentials 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis credentials](./stackit_redis_credentials.md) - Provides functionality for Redis credentials - diff --git a/docs/stackit_redis_instance.md b/docs/stackit_redis_instance.md deleted file mode 100644 index 03c044a49..000000000 --- a/docs/stackit_redis_instance.md +++ /dev/null @@ -1,38 +0,0 @@ -## stackit redis instance - -Provides functionality for Redis instances - -### Synopsis - -Provides functionality for Redis instances. - -``` -stackit redis instance [flags] -``` - -### Options - -``` - -h, --help Help for "stackit redis instance" -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis](./stackit_redis.md) - Provides functionality for Redis -* [stackit redis instance create](./stackit_redis_instance_create.md) - Creates a Redis instance -* [stackit redis instance delete](./stackit_redis_instance_delete.md) - Deletes a Redis instance -* [stackit redis instance describe](./stackit_redis_instance_describe.md) - Shows details of a Redis instance -* [stackit redis instance list](./stackit_redis_instance_list.md) - Lists all Redis instances -* [stackit redis instance update](./stackit_redis_instance_update.md) - Updates a Redis instance - diff --git a/docs/stackit_redis_instance_create.md b/docs/stackit_redis_instance_create.md deleted file mode 100644 index 8ef7f5345..000000000 --- a/docs/stackit_redis_instance_create.md +++ /dev/null @@ -1,52 +0,0 @@ -## stackit redis instance create - -Creates a Redis instance - -### Synopsis - -Creates a Redis instance. - -``` -stackit redis instance create [flags] -``` - -### Examples - -``` - Create a Redis instance with name "my-instance" and specify plan by ID - $ stackit redis instance create --name my-instance --plan-id xxx - - Create a Redis instance with name "my-instance" and specify IP range which is allowed to access it - $ stackit redis instance create --name my-instance --plan-id xxx --acl 1.2.3.0/24 -``` - -### Options - -``` - --acl strings List of IP networks in CIDR notation which are allowed to access this instance (default []) - --enable-monitoring Enable monitoring - --graphite string Graphite host - -h, --help Help for "stackit redis instance create" - --metrics-frequency int32 Metrics frequency - --metrics-prefix string Metrics prefix - --monitoring-instance-id string Monitoring instance ID - -n, --name string Instance name - --plan-id string Plan ID - --syslog strings Syslog -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances - diff --git a/docs/stackit_redis_instance_delete.md b/docs/stackit_redis_instance_delete.md deleted file mode 100644 index 02383d8b8..000000000 --- a/docs/stackit_redis_instance_delete.md +++ /dev/null @@ -1,40 +0,0 @@ -## stackit redis instance delete - -Deletes a Redis instance - -### Synopsis - -Deletes a Redis instance. - -``` -stackit redis instance delete INSTANCE_ID [flags] -``` - -### Examples - -``` - Delete a Redis instance with ID "xxx" - $ stackit redis instance delete xxx -``` - -### Options - -``` - -h, --help Help for "stackit redis instance delete" -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances - diff --git a/docs/stackit_redis_instance_describe.md b/docs/stackit_redis_instance_describe.md deleted file mode 100644 index 426c10631..000000000 --- a/docs/stackit_redis_instance_describe.md +++ /dev/null @@ -1,43 +0,0 @@ -## stackit redis instance describe - -Shows details of a Redis instance - -### Synopsis - -Shows details of a Redis instance. - -``` -stackit redis instance describe INSTANCE_ID [flags] -``` - -### Examples - -``` - Get details of a Redis instance with ID "xxx" - $ stackit redis instance describe xxx - - Get details of a Redis instance with ID "xxx" in JSON format - $ stackit redis instance describe xxx --output-format json -``` - -### Options - -``` - -h, --help Help for "stackit redis instance describe" -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances - diff --git a/docs/stackit_redis_instance_list.md b/docs/stackit_redis_instance_list.md deleted file mode 100644 index aeb5a0963..000000000 --- a/docs/stackit_redis_instance_list.md +++ /dev/null @@ -1,47 +0,0 @@ -## stackit redis instance list - -Lists all Redis instances - -### Synopsis - -Lists all Redis instances. - -``` -stackit redis instance list [flags] -``` - -### Examples - -``` - List all Redis instances - $ stackit redis instance list - - List all Redis instances in JSON format - $ stackit redis instance list --output-format json - - List up to 10 Redis instances - $ stackit redis instance list --limit 10 -``` - -### Options - -``` - -h, --help Help for "stackit redis instance list" - --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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances - diff --git a/docs/stackit_redis_instance_update.md b/docs/stackit_redis_instance_update.md deleted file mode 100644 index 96215ae7c..000000000 --- a/docs/stackit_redis_instance_update.md +++ /dev/null @@ -1,51 +0,0 @@ -## stackit redis instance update - -Updates a Redis instance - -### Synopsis - -Updates a Redis instance. - -``` -stackit redis instance update INSTANCE_ID [flags] -``` - -### Examples - -``` - Update the plan of a Redis instance with ID "xxx" - $ stackit redis instance update xxx --plan-id yyy - - Update the range of IPs allowed to access a Redis instance with ID "xxx" - $ stackit redis instance update xxx --acl 1.2.3.0/24 -``` - -### Options - -``` - --acl strings List of IP networks in CIDR notation which are allowed to access this instance (default []) - --enable-monitoring Enable monitoring - --graphite string Graphite host - -h, --help Help for "stackit redis instance update" - --metrics-frequency int32 Metrics frequency - --metrics-prefix string Metrics prefix - --monitoring-instance-id string Monitoring instance ID - --plan-id string Plan ID - --syslog strings Syslog -``` - -### 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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis instance](./stackit_redis_instance.md) - Provides functionality for Redis instances - diff --git a/docs/stackit_redis_plans.md b/docs/stackit_redis_plans.md deleted file mode 100644 index 1a88287b3..000000000 --- a/docs/stackit_redis_plans.md +++ /dev/null @@ -1,47 +0,0 @@ -## stackit redis plans - -Lists all Redis service plans - -### Synopsis - -Lists all Redis service plans. - -``` -stackit redis plans [flags] -``` - -### Examples - -``` - List all Redis service plans - $ stackit redis plans - - List all Redis service plans in JSON format - $ stackit redis plans --output-format json - - List up to 10 Redis service plans - $ stackit redis plans --limit 10 -``` - -### Options - -``` - -h, --help Help for "stackit redis plans" - --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 - --region string Target region for region-specific requests - --verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info") -``` - -### SEE ALSO - -* [stackit redis](./stackit_redis.md) - Provides functionality for Redis - diff --git a/internal/cmd/config/set/set.go b/internal/cmd/config/set/set.go index 1733f9db2..5401e4aa6 100644 --- a/internal/cmd/config/set/set.go +++ b/internal/cmd/config/set/set.go @@ -212,7 +212,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) err = viper.BindPFlag(config.RabbitMQCustomEndpointKey, cmd.Flags().Lookup(rabbitMQCustomEndpointFlag)) cobra.CheckErr(err) - err = viper.BindPFlag(config.RedisCustomEndpointKey, cmd.Flags().Lookup(redisCustomEndpointFlag)) + err = viper.BindPFlag(config.RedisCustomEndpointKey, cmd.Flags().Lookup(redisCustomEndpointFlag)) //nolint:staticcheck // deprecated but still supported until 2027-08-31 cobra.CheckErr(err) err = viper.BindPFlag(config.ResourceManagerEndpointKey, cmd.Flags().Lookup(resourceManagerCustomEndpointFlag)) cobra.CheckErr(err) diff --git a/internal/cmd/config/unset/unset.go b/internal/cmd/config/unset/unset.go index 522d4a29b..110204f64 100644 --- a/internal/cmd/config/unset/unset.go +++ b/internal/cmd/config/unset/unset.go @@ -203,7 +203,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { viper.Set(config.RabbitMQCustomEndpointKey, "") } if model.RedisCustomEndpoint { - viper.Set(config.RedisCustomEndpointKey, "") + viper.Set(config.RedisCustomEndpointKey, "") //nolint:staticcheck // deprecated but still supported until 2027-08-31 } if model.ResourceManagerCustomEndpoint { viper.Set(config.ResourceManagerEndpointKey, "") diff --git a/internal/cmd/redis/credentials/create/create.go b/internal/cmd/redis/credentials/create/create.go index 99738fd25..4d7a1cd66 100644 --- a/internal/cmd/redis/credentials/create/create.go +++ b/internal/cmd/redis/credentials/create/create.go @@ -21,22 +21,27 @@ import ( ) const ( - instanceIdFlag = "instance-id" + // Deprecated: Will be removed after 2027-08-31. + instanceIdFlag = "instance-id" + // Deprecated: Will be removed after 2027-08-31. showPasswordFlag = "show-password" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string ShowPassword bool } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "create", - Short: "Creates credentials for a Redis instance", - Long: "Creates credentials (username and password) for a Redis instance.", - Args: args.NoArgs, + Use: "create", + Short: "Creates credentials for a Redis instance", + Long: "Creates credentials (username and password) for a Redis instance.", + Deprecated: "\nCommand `stackit redis credentials create` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey credentials create` instead.", + Args: args.NoArgs, Example: examples.Build( examples.NewExample( `Create credentials for a Redis instance`, @@ -84,6 +89,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") cmd.Flags().BoolP(showPasswordFlag, "s", false, "Show password in output") @@ -92,6 +98,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) { globalFlags := globalflags.Parse(p, cmd) if globalFlags.ProjectId == "" { @@ -108,11 +115,13 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiCreateCredentialsRequest { req := apiClient.DefaultAPI.CreateCredentials(ctx, model.ProjectId, model.Region, model.InstanceId) return req } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, model inputModel, instanceLabel string, resp *redis.CredentialsResponse) error { if model.GlobalFlagModel == nil { return fmt.Errorf("no global flags defined") diff --git a/internal/cmd/redis/credentials/credentials.go b/internal/cmd/redis/credentials/credentials.go index 41a7b4f92..ff6192af2 100644 --- a/internal/cmd/redis/credentials/credentials.go +++ b/internal/cmd/redis/credentials/credentials.go @@ -12,18 +12,21 @@ import ( "github.com/spf13/cobra" ) +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "credentials", - Short: "Provides functionality for Redis credentials", - Long: "Provides functionality for Redis credentials.", - Args: args.NoArgs, - Run: utils.CmdHelp, + Use: "credentials", + Short: "Provides functionality for Redis credentials", + Long: "Provides functionality for Redis credentials.", + Deprecated: "\nCommand `stackit redis credentials` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey credentials` instead.", + Args: args.NoArgs, + Run: utils.CmdHelp, } addSubcommands(cmd, params) return cmd } +// Deprecated: Will be removed after 2027-08-31. func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { cmd.AddCommand(create.NewCmd(params)) cmd.AddCommand(delete.NewCmd(params)) diff --git a/internal/cmd/redis/credentials/delete/delete.go b/internal/cmd/redis/credentials/delete/delete.go index 90bcb67b4..fade60995 100644 --- a/internal/cmd/redis/credentials/delete/delete.go +++ b/internal/cmd/redis/credentials/delete/delete.go @@ -21,23 +21,28 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. credentialsIdArg = "CREDENTIALS_ID" //nolint:gosec // linter false positive + // Deprecated: Will be removed after 2027-08-31. instanceIdFlag = "instance-id" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string CredentialsId string } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: fmt.Sprintf("delete %s", credentialsIdArg), - Short: "Deletes credentials of a Redis instance", - Long: "Deletes credentials of a Redis instance.", - Args: args.SingleArg(credentialsIdArg, utils.ValidateUUID), + Use: fmt.Sprintf("delete %s", credentialsIdArg), + Short: "Deletes credentials of a Redis instance", + Long: "Deletes credentials of a Redis instance.", + Deprecated: "\nCommand `stackit redis credentials delete` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey credentials delete` instead.", + Args: args.SingleArg(credentialsIdArg, utils.ValidateUUID), Example: examples.Build( examples.NewExample( `Delete credentials with ID "xxx" of Redis instance with ID "yyy"`, @@ -89,6 +94,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") @@ -96,6 +102,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { credentialsId := inputArgs[0] @@ -114,6 +121,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiDeleteCredentialsRequest { req := apiClient.DefaultAPI.DeleteCredentials(ctx, model.ProjectId, model.Region, model.InstanceId, model.CredentialsId) return req diff --git a/internal/cmd/redis/credentials/describe/describe.go b/internal/cmd/redis/credentials/describe/describe.go index 359e0f86e..329d0c241 100644 --- a/internal/cmd/redis/credentials/describe/describe.go +++ b/internal/cmd/redis/credentials/describe/describe.go @@ -21,23 +21,28 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. credentialsIdArg = "CREDENTIALS_ID" //nolint:gosec // linter false positive + // Deprecated: Will be removed after 2027-08-31. instanceIdFlag = "instance-id" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string CredentialsId string } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: fmt.Sprintf("describe %s", credentialsIdArg), - Short: "Shows details of credentials of a Redis instance", - Long: "Shows details of credentials of a Redis instance. The password will be shown in plain text in the output.", - Args: args.SingleArg(credentialsIdArg, utils.ValidateUUID), + Use: fmt.Sprintf("describe %s", credentialsIdArg), + Short: "Shows details of credentials of a Redis instance", + Long: "Shows details of credentials of a Redis instance. The password will be shown in plain text in the output.", + Deprecated: "\nCommand `stackit redis credentials describe` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey credentials describe` instead.", + Args: args.SingleArg(credentialsIdArg, utils.ValidateUUID), Example: examples.Build( examples.NewExample( `Get details of credentials with ID "xxx" from instance with ID "yyy"`, @@ -73,6 +78,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") @@ -80,6 +86,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { credentialsId := inputArgs[0] @@ -98,11 +105,13 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiGetCredentialsRequest { req := apiClient.DefaultAPI.GetCredentials(ctx, model.ProjectId, model.Region, model.InstanceId, model.CredentialsId) return req } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, outputFormat string, credentials *redis.CredentialsResponse) error { if credentials == nil { return fmt.Errorf("no credentials passed") diff --git a/internal/cmd/redis/credentials/list/list.go b/internal/cmd/redis/credentials/list/list.go index 948e57522..73ef170cb 100644 --- a/internal/cmd/redis/credentials/list/list.go +++ b/internal/cmd/redis/credentials/list/list.go @@ -21,22 +21,27 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. instanceIdFlag = "instance-id" - limitFlag = "limit" + // Deprecated: Will be removed after 2027-08-31. + limitFlag = "limit" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string Limit *int64 } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "list", - Short: "Lists all credentials' IDs for a Redis instance", - Long: "Lists all credentials' IDs for a Redis instance.", - Args: args.NoArgs, + Use: "list", + Short: "Lists all credentials' IDs for a Redis instance", + Long: "Lists all credentials' IDs for a Redis instance.", + Deprecated: "\nCommand `stackit redis credentials list` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey credentials list` instead.", + Args: args.NoArgs, Example: examples.Build( examples.NewExample( `List all credentials' IDs for a Redis instance`, @@ -89,6 +94,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "Instance ID") cmd.Flags().Int64(limitFlag, 0, "Maximum number of entries to list") @@ -97,6 +103,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) { globalFlags := globalflags.Parse(p, cmd) if globalFlags.ProjectId == "" { @@ -121,11 +128,13 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiListCredentialsRequest { req := apiClient.DefaultAPI.ListCredentials(ctx, model.ProjectId, model.Region, model.InstanceId) return req } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, outputFormat, instanceLabel string, credentials []redis.CredentialsListItem) error { return p.OutputResult(outputFormat, credentials, func() error { if len(credentials) == 0 { diff --git a/internal/cmd/redis/instance/create/create.go b/internal/cmd/redis/instance/create/create.go index 30c7f7bee..900f23e45 100644 --- a/internal/cmd/redis/instance/create/create.go +++ b/internal/cmd/redis/instance/create/create.go @@ -26,19 +26,29 @@ import ( ) const ( - instanceNameFlag = "name" - enableMonitoringFlag = "enable-monitoring" - graphiteFlag = "graphite" - metricsFrequencyFlag = "metrics-frequency" - metricsPrefixFlag = "metrics-prefix" + // Deprecated: Will be removed after 2027-08-31. + instanceNameFlag = "name" + // Deprecated: Will be removed after 2027-08-31. + enableMonitoringFlag = "enable-monitoring" + // Deprecated: Will be removed after 2027-08-31. + graphiteFlag = "graphite" + // Deprecated: Will be removed after 2027-08-31. + metricsFrequencyFlag = "metrics-frequency" + // Deprecated: Will be removed after 2027-08-31. + metricsPrefixFlag = "metrics-prefix" + // Deprecated: Will be removed after 2027-08-31. monitoringInstanceIdFlag = "monitoring-instance-id" - sgwAclFlag = "acl" - syslogFlag = "syslog" - planIdFlag = "plan-id" - planNameFlag = "plan-name" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. - versionFlag = "version" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. + // Deprecated: Will be removed after 2027-08-31. + sgwAclFlag = "acl" + // Deprecated: Will be removed after 2027-08-31. + syslogFlag = "syslog" + // Deprecated: Will be removed after 2027-08-31. + planIdFlag = "plan-id" + planNameFlag = "plan-name" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. + versionFlag = "version" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel PlanName string @@ -55,12 +65,14 @@ type inputModel struct { PlanId *string } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "create", - Short: "Creates a Redis instance", - Long: "Creates a Redis instance.", - Args: args.NoArgs, + Use: "create", + Short: "Creates a Redis instance", + Long: "Creates a Redis instance.", + Deprecated: "\nCommand `stackit redis instance create` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey instance create` instead.", + Args: args.NoArgs, Example: examples.Build( examples.NewExample( `Create a Redis instance with name "my-instance" and specify plan by ID`, @@ -127,6 +139,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().StringP(instanceNameFlag, "n", "", "Instance name") cmd.Flags().Bool(enableMonitoringFlag, false, "Enable monitoring") @@ -149,6 +162,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) { globalFlags := globalflags.Parse(p, cmd) if globalFlags.ProjectId == "" { @@ -189,6 +203,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient redis.DefaultAPI) (redis.ApiCreateInstanceRequest, error) { req := apiClient.CreateInstance(ctx, model.ProjectId, model.Region) @@ -234,6 +249,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient redis.Defaul return req, nil } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, model *inputModel, projectLabel, instanceId string, resp *redis.CreateInstanceResponse) error { if model == nil { return fmt.Errorf("no model passed") diff --git a/internal/cmd/redis/instance/delete/delete.go b/internal/cmd/redis/instance/delete/delete.go index df23695e1..67113f88c 100644 --- a/internal/cmd/redis/instance/delete/delete.go +++ b/internal/cmd/redis/instance/delete/delete.go @@ -22,20 +22,24 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. instanceIdArg = "INSTANCE_ID" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: fmt.Sprintf("delete %s", instanceIdArg), - Short: "Deletes a Redis instance", - Long: "Deletes a Redis instance.", - Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), + Use: fmt.Sprintf("delete %s", instanceIdArg), + Short: "Deletes a Redis instance", + Long: "Deletes a Redis instance.", + Deprecated: "\nCommand `stackit redis instance delete` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey instance delete` instead.", + Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), Example: examples.Build( examples.NewExample( `Delete a Redis instance with ID "xxx"`, @@ -95,6 +99,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { instanceId := inputArgs[0] @@ -112,6 +117,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiDeleteInstanceRequest { req := apiClient.DefaultAPI.DeleteInstance(ctx, model.ProjectId, model.Region, model.InstanceId) return req diff --git a/internal/cmd/redis/instance/describe/describe.go b/internal/cmd/redis/instance/describe/describe.go index 6b5f395d7..23b10fe55 100644 --- a/internal/cmd/redis/instance/describe/describe.go +++ b/internal/cmd/redis/instance/describe/describe.go @@ -20,22 +20,26 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. instanceIdArg = "INSTANCE_ID" - + // Deprecated: Will be removed after 2027-08-31. aclParameterKey = "sgw_acl" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: fmt.Sprintf("describe %s", instanceIdArg), - Short: "Shows details of a Redis instance", - Long: "Shows details of a Redis instance.", - Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), + Use: fmt.Sprintf("describe %s", instanceIdArg), + Short: "Shows details of a Redis instance", + Long: "Shows details of a Redis instance.", + Deprecated: "\nCommand `stackit redis instance describe` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey instance describe` instead.", + Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), Example: examples.Build( examples.NewExample( `Get details of a Redis instance with ID "xxx"`, @@ -69,6 +73,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { instanceId := inputArgs[0] @@ -86,11 +91,13 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiGetInstanceRequest { req := apiClient.DefaultAPI.GetInstance(ctx, model.ProjectId, model.Region, model.InstanceId) return req } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, outputFormat string, instance *redis.Instance) error { if instance == nil { return fmt.Errorf("no instance passed") diff --git a/internal/cmd/redis/instance/instance.go b/internal/cmd/redis/instance/instance.go index 82cbe63cd..3b5eaddc1 100644 --- a/internal/cmd/redis/instance/instance.go +++ b/internal/cmd/redis/instance/instance.go @@ -13,18 +13,21 @@ import ( "github.com/spf13/cobra" ) +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "instance", - Short: "Provides functionality for Redis instances", - Long: "Provides functionality for Redis instances.", - Args: args.NoArgs, - Run: utils.CmdHelp, + Use: "instance", + Short: "Provides functionality for Redis instances", + Long: "Provides functionality for Redis instances.", + Deprecated: "\nCommand `stackit redis instance` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey instance` instead.", + Args: args.NoArgs, + Run: utils.CmdHelp, } addSubcommands(cmd, params) return cmd } +// Deprecated: Will be removed after 2027-08-31. func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { cmd.AddCommand(create.NewCmd(params)) cmd.AddCommand(delete.NewCmd(params)) diff --git a/internal/cmd/redis/instance/list/list.go b/internal/cmd/redis/instance/list/list.go index 9d9de28b7..b8aaa3a32 100644 --- a/internal/cmd/redis/instance/list/list.go +++ b/internal/cmd/redis/instance/list/list.go @@ -22,20 +22,24 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. limitFlag = "limit" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel Limit *int64 } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "list", - Short: "Lists all Redis instances", - Long: "Lists all Redis instances.", - Args: args.NoArgs, + Use: "list", + Short: "Lists all Redis instances", + Long: "Lists all Redis instances.", + Deprecated: "\nCommand `stackit redis instance list` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey instance list` instead.", + Args: args.NoArgs, Example: examples.Build( examples.NewExample( `List all Redis instances`, @@ -89,10 +93,12 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Int64(limitFlag, 0, "Maximum number of entries to list") } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) { globalFlags := globalflags.Parse(p, cmd) if globalFlags.ProjectId == "" { @@ -116,11 +122,13 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiListInstancesRequest { req := apiClient.DefaultAPI.ListInstances(ctx, model.ProjectId, model.Region) return req } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, outputFormat, projectLabel string, instances []redis.Instance) error { return p.OutputResult(outputFormat, instances, func() error { if len(instances) == 0 { diff --git a/internal/cmd/redis/instance/update/update.go b/internal/cmd/redis/instance/update/update.go index f71ddd848..d4a2d5ca1 100644 --- a/internal/cmd/redis/instance/update/update.go +++ b/internal/cmd/redis/instance/update/update.go @@ -25,20 +25,30 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. instanceIdArg = "INSTANCE_ID" - enableMonitoringFlag = "enable-monitoring" - graphiteFlag = "graphite" - metricsFrequencyFlag = "metrics-frequency" - metricsPrefixFlag = "metrics-prefix" + // Deprecated: Will be removed after 2027-08-31. + enableMonitoringFlag = "enable-monitoring" + // Deprecated: Will be removed after 2027-08-31. + graphiteFlag = "graphite" + // Deprecated: Will be removed after 2027-08-31. + metricsFrequencyFlag = "metrics-frequency" + // Deprecated: Will be removed after 2027-08-31. + metricsPrefixFlag = "metrics-prefix" + // Deprecated: Will be removed after 2027-08-31. monitoringInstanceIdFlag = "monitoring-instance-id" - sgwAclFlag = "acl" - syslogFlag = "syslog" - planIdFlag = "plan-id" - planNameFlag = "plan-name" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. - versionFlag = "version" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. + // Deprecated: Will be removed after 2027-08-31. + sgwAclFlag = "acl" + // Deprecated: Will be removed after 2027-08-31. + syslogFlag = "syslog" + // Deprecated: Will be removed after 2027-08-31. + planIdFlag = "plan-id" + planNameFlag = "plan-name" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. + versionFlag = "version" // Deprecated: Will be removed after 2027-02-28. Use --plan-id instead. ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel InstanceId string @@ -55,12 +65,14 @@ type inputModel struct { PlanId *string } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: fmt.Sprintf("update %s", instanceIdArg), - Short: "Updates a Redis instance", - Long: "Updates a Redis instance.", - Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), + Use: fmt.Sprintf("update %s", instanceIdArg), + Short: "Updates a Redis instance", + Long: "Updates a Redis instance.", + Deprecated: "\nCommand `stackit redis instance update` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey instance update` instead.", + Args: args.SingleArg(instanceIdArg, utils.ValidateUUID), Example: examples.Build( examples.NewExample( `Update the plan of a Redis instance with ID "xxx"`, @@ -132,6 +144,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Bool(enableMonitoringFlag, false, "Enable monitoring") cmd.Flags().String(graphiteFlag, "", "Graphite host") @@ -150,6 +163,7 @@ func configureFlags(cmd *cobra.Command) { cobra.CheckErr(err) } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) { instanceId := inputArgs[0] @@ -202,6 +216,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient redis.DefaultAPI) (redis.ApiPartialUpdateInstanceRequest, error) { req := apiClient.PartialUpdateInstance(ctx, model.ProjectId, model.Region, model.InstanceId) diff --git a/internal/cmd/redis/plans/plans.go b/internal/cmd/redis/plans/plans.go index ede5f2a76..2d73a204a 100644 --- a/internal/cmd/redis/plans/plans.go +++ b/internal/cmd/redis/plans/plans.go @@ -21,20 +21,24 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. limitFlag = "limit" ) +// Deprecated: Will be removed after 2027-08-31. type inputModel struct { *globalflags.GlobalFlagModel Limit *int64 } +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "plans", - Short: "Lists all Redis service plans", - Long: "Lists all Redis service plans.", - Args: args.NoArgs, + Use: "plans", + Deprecated: "\nCommand `stackit redis plans` is deprecated and will be removed after 2027-08-31. Please use `stackit valkey plans` instead.", + Short: "Lists all Redis service plans", + Long: "Lists all Redis service plans.", + Args: args.NoArgs, Example: examples.Build( examples.NewExample( `List all Redis service plans`, @@ -89,10 +93,12 @@ func NewCmd(params *types.CmdParams) *cobra.Command { return cmd } +// Deprecated: Will be removed after 2027-08-31. func configureFlags(cmd *cobra.Command) { cmd.Flags().Int64(limitFlag, 0, "Maximum number of entries to list") } +// Deprecated: Will be removed after 2027-08-31. func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) { globalFlags := globalflags.Parse(p, cmd) if globalFlags.ProjectId == "" { @@ -116,11 +122,13 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, return &model, nil } +// Deprecated: Will be removed after 2027-08-31. func buildRequest(ctx context.Context, model *inputModel, apiClient *redis.APIClient) redis.ApiListOfferingsRequest { req := apiClient.DefaultAPI.ListOfferings(ctx, model.ProjectId, model.Region) return req } +// Deprecated: Will be removed after 2027-08-31. func outputResult(p *print.Printer, outputFormat string, plans []redis.Offering) error { return p.OutputResult(outputFormat, plans, func() error { table := tables.NewTable() diff --git a/internal/cmd/redis/redis.go b/internal/cmd/redis/redis.go index e0716339b..c1f5191b0 100644 --- a/internal/cmd/redis/redis.go +++ b/internal/cmd/redis/redis.go @@ -11,18 +11,21 @@ import ( "github.com/spf13/cobra" ) +// Deprecated: Will be removed after 2027-08-31. func NewCmd(params *types.CmdParams) *cobra.Command { cmd := &cobra.Command{ - Use: "redis", - Short: "Provides functionality for Redis", - Long: "Provides functionality for Redis.", - Args: args.NoArgs, - Run: utils.CmdHelp, + Use: "redis", + Deprecated: "\nRedis commands `stackit redis` have been deprecated and will be removed after 31.08.2027. Please use valkey (Key Value Store) commands `stackit valkey` instead.", + Short: "Provides functionality for Redis", + Long: "Provides functionality for Redis.", + Args: args.NoArgs, + Run: utils.CmdHelp, } addSubcommands(cmd, params) return cmd } +// Deprecated: Will be removed after 2027-08-31. func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { cmd.AddCommand(instance.NewCmd(params)) cmd.AddCommand(plans.NewCmd(params)) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 45118444a..c6fbe901f 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -187,7 +187,7 @@ func addSubcommands(cmd *cobra.Command, params *types.CmdParams) { cmd.AddCommand(postgresflex.NewCmd(params)) cmd.AddCommand(project.NewCmd(params)) cmd.AddCommand(rabbitmq.NewCmd(params)) - cmd.AddCommand(redis.NewCmd(params)) + cmd.AddCommand(redis.NewCmd(params)) //nolint:staticcheck // deprecated but still supported until 2027-08-31 cmd.AddCommand(secretsmanager.NewCmd(params)) cmd.AddCommand(serviceaccount.NewCmd(params)) cmd.AddCommand(ske.NewCmd(params)) diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index b1aebe6f5..bf3223c4d 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -23,20 +23,21 @@ const ( IdentityProviderCustomClientIdKey = "identity_provider_custom_client_id" AllowedUrlDomainKey = "allowed_url_domain" - AuthorizationCustomEndpointKey = "authorization_custom_endpoint" - AlbCustomEndpoint = "alb_custom _endpoint" - AlbWafCustomEndpointKey = "alb_waf_custom_endpoint" - DNSCustomEndpointKey = "dns_custom_endpoint" - EdgeCustomEndpointKey = "edge_custom_endpoint" - LoadBalancerCustomEndpointKey = "load_balancer_custom_endpoint" - LogMeCustomEndpointKey = "logme_custom_endpoint" - MariaDBCustomEndpointKey = "mariadb_custom_endpoint" - MongoDBFlexCustomEndpointKey = "mongodbflex_custom_endpoint" - ObjectStorageCustomEndpointKey = "object_storage_custom_endpoint" - ObservabilityCustomEndpointKey = "observability_custom_endpoint" - OpenSearchCustomEndpointKey = "opensearch_custom_endpoint" - PostgresFlexCustomEndpointKey = "postgresflex_custom_endpoint" - RabbitMQCustomEndpointKey = "rabbitmq_custom_endpoint" + AuthorizationCustomEndpointKey = "authorization_custom_endpoint" + AlbCustomEndpoint = "alb_custom _endpoint" + AlbWafCustomEndpointKey = "alb_waf_custom_endpoint" + DNSCustomEndpointKey = "dns_custom_endpoint" + EdgeCustomEndpointKey = "edge_custom_endpoint" + LoadBalancerCustomEndpointKey = "load_balancer_custom_endpoint" + LogMeCustomEndpointKey = "logme_custom_endpoint" + MariaDBCustomEndpointKey = "mariadb_custom_endpoint" + MongoDBFlexCustomEndpointKey = "mongodbflex_custom_endpoint" + ObjectStorageCustomEndpointKey = "object_storage_custom_endpoint" + ObservabilityCustomEndpointKey = "observability_custom_endpoint" + OpenSearchCustomEndpointKey = "opensearch_custom_endpoint" + PostgresFlexCustomEndpointKey = "postgresflex_custom_endpoint" + RabbitMQCustomEndpointKey = "rabbitmq_custom_endpoint" + // Deprecated: Will be removed after 2027-08-31. RedisCustomEndpointKey = "redis_custom_endpoint" ResourceManagerEndpointKey = "resource_manager_custom_endpoint" SecretsManagerCustomEndpointKey = "secrets_manager_custom_endpoint" diff --git a/internal/pkg/services/redis/client/client.go b/internal/pkg/services/redis/client/client.go index c26718153..dcdf7dcaf 100644 --- a/internal/pkg/services/redis/client/client.go +++ b/internal/pkg/services/redis/client/client.go @@ -9,6 +9,7 @@ import ( redis "github.com/stackitcloud/stackit-sdk-go/services/redis/v2api" ) +// Deprecated: Will be removed after 2027-08-31. func ConfigureClient(p *print.Printer, cliVersion string) (*redis.APIClient, error) { return genericclient.ConfigureClientGeneric(p, cliVersion, viper.GetString(config.RedisCustomEndpointKey), false, genericclient.CreateApiClient[*redis.APIClient](redis.NewAPIClient)) } diff --git a/internal/pkg/services/redis/utils/utils.go b/internal/pkg/services/redis/utils/utils.go index a4c05eeb0..5e1b549e1 100644 --- a/internal/pkg/services/redis/utils/utils.go +++ b/internal/pkg/services/redis/utils/utils.go @@ -11,6 +11,7 @@ import ( ) const ( + // Deprecated: Will be removed after 2027-08-31. service = "redis" ) @@ -48,6 +49,7 @@ func LoadPlanId(planName, version string, offerings *redis.ListOfferingsResponse } } +// Deprecated: Will be removed after 2027-08-31. func GetInstanceName(ctx context.Context, apiClient redis.DefaultAPI, projectId, instanceId, region string) (string, error) { resp, err := apiClient.GetInstance(ctx, projectId, region, instanceId).Execute() if err != nil { @@ -56,6 +58,7 @@ func GetInstanceName(ctx context.Context, apiClient redis.DefaultAPI, projectId, return resp.Name, nil } +// Deprecated: Will be removed after 2027-08-31. func GetCredentialsUsername(ctx context.Context, apiClient redis.DefaultAPI, projectId, instanceId, credentialsId, region string) (string, error) { resp, err := apiClient.GetCredentials(ctx, projectId, region, instanceId, credentialsId).Execute() if err != nil {