From 05ae32c4aea3baf57326f171dcd158b41ea55284 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 16 Jul 2020 07:41:42 +0000 Subject: [PATCH] feat(rdb): remove settings from the CLI --- .../testdata/test-all-usage-rdb-usage.golden | 1 - internal/namespaces/rdb/v1/rdb_cli.go | 85 ------------------- 2 files changed, 86 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-rdb-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-usage.golden index c7cdb0d659..9719360f63 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-usage.golden @@ -14,7 +14,6 @@ AVAILABLE COMMANDS: log Instance logs management commands node-type Node types management commands privilege User privileges management commands - settings Settings management commands user User management commands FLAGS: diff --git a/internal/namespaces/rdb/v1/rdb_cli.go b/internal/namespaces/rdb/v1/rdb_cli.go index 62f6eb5121..7a426e8d8d 100644 --- a/internal/namespaces/rdb/v1/rdb_cli.go +++ b/internal/namespaces/rdb/v1/rdb_cli.go @@ -24,7 +24,6 @@ func GetGeneratedCommands() *core.Commands { rdbEngine(), rdbInstance(), rdbACL(), - rdbSettings(), rdbPrivilege(), rdbUser(), rdbDatabase(), @@ -49,8 +48,6 @@ func GetGeneratedCommands() *core.Commands { rdbLogPrepare(), rdbLogList(), rdbLogGet(), - rdbSettingsAdd(), - rdbSettingsDelete(), rdbACLList(), rdbACLAdd(), rdbACLDelete(), @@ -114,16 +111,6 @@ func rdbACL() *core.Command { } } -func rdbSettings() *core.Command { - return &core.Command{ - Short: `Settings management commands`, - Long: `Instance Settings are tunables of Database Engines. Available settings depend on the database engine and its version. -`, - Namespace: "rdb", - Resource: "settings", - } -} - func rdbPrivilege() *core.Command { return &core.Command{ Short: `User privileges management commands`, @@ -939,78 +926,6 @@ func rdbLogGet() *core.Command { } } -func rdbSettingsAdd() *core.Command { - return &core.Command{ - Short: `Add an instance setting`, - Long: `Add an instance setting.`, - Namespace: "rdb", - Resource: "settings", - Verb: "add", - ArgsType: reflect.TypeOf(rdb.AddInstanceSettingsRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "instance-id", - Short: `UUID of the instance you want to add settings to`, - Required: true, - Positional: false, - }, - { - Name: "settings.{index}.name", - Required: false, - Positional: false, - }, - { - Name: "settings.{index}.value", - Required: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*rdb.AddInstanceSettingsRequest) - - client := core.ExtractClient(ctx) - api := rdb.NewAPI(client) - return api.AddInstanceSettings(request) - - }, - } -} - -func rdbSettingsDelete() *core.Command { - return &core.Command{ - Short: `Delete an instance setting`, - Long: `Delete an instance setting.`, - Namespace: "rdb", - Resource: "settings", - Verb: "delete", - ArgsType: reflect.TypeOf(rdb.DeleteInstanceSettingsRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "instance-id", - Short: `UUID of the instance to delete settings from`, - Required: true, - Positional: false, - }, - { - Name: "setting-names.{index}", - Short: `Settings names to delete`, - Required: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*rdb.DeleteInstanceSettingsRequest) - - client := core.ExtractClient(ctx) - api := rdb.NewAPI(client) - return api.DeleteInstanceSettings(request) - - }, - } -} - func rdbACLList() *core.Command { return &core.Command{ Short: `List ACL rules of a given instance`,