From d44599900df0b2a5d2e82c4b6ff8b7dda851ea7a Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 4 Feb 2021 19:42:04 +0000 Subject: [PATCH 1/3] feat: update generated cli --- .../applesilicon/v1alpha1/applesilicon_cli.go | 6 ++++-- internal/namespaces/lb/v1/lb_cli.go | 14 ++++++++++++++ internal/namespaces/rdb/v1/rdb_cli.go | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go b/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go index 4004d0de30..bc14638ae8 100644 --- a/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go +++ b/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go @@ -1,14 +1,14 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -package applesilicon +package apple_silicon import ( "context" "reflect" "github.com/scaleway/scaleway-cli/internal/core" - applesilicon "github.com/scaleway/scaleway-sdk-go/api/applesilicon/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/api/applesilicon/v1alpha1" "github.com/scaleway/scaleway-sdk-go/scw" ) @@ -148,6 +148,7 @@ func appleSiliconServerCreate() *core.Command { Required: false, Deprecated: false, Positional: false, + Default: core.RandomValueGenerator("as"), }, core.ProjectIDArgSpec(), { @@ -156,6 +157,7 @@ func appleSiliconServerCreate() *core.Command { Required: false, Deprecated: false, Positional: false, + Default: core.DefaultValueSetter("M1-M"), }, }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { diff --git a/internal/namespaces/lb/v1/lb_cli.go b/internal/namespaces/lb/v1/lb_cli.go index 1bd81aa189..581b7e340d 100644 --- a/internal/namespaces/lb/v1/lb_cli.go +++ b/internal/namespaces/lb/v1/lb_cli.go @@ -790,6 +790,13 @@ func lbBackendCreate() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "health-check.check-send-proxy", + Short: `It defines whether the healthcheck should be done considering the proxy protocol`, + Required: false, + Deprecated: false, + Positional: false, + }, { Name: "lb-id", Short: `Load balancer ID`, @@ -1237,6 +1244,13 @@ func lbBackendUpdateHealthcheck() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "check-send-proxy", + Short: `It defines whether the healthcheck should be done considering the proxy protocol`, + Required: false, + Deprecated: false, + Positional: false, + }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { diff --git a/internal/namespaces/rdb/v1/rdb_cli.go b/internal/namespaces/rdb/v1/rdb_cli.go index fad9691132..486a412b47 100644 --- a/internal/namespaces/rdb/v1/rdb_cli.go +++ b/internal/namespaces/rdb/v1/rdb_cli.go @@ -29,6 +29,7 @@ func GetGeneratedCommands() *core.Commands { rdbDatabase(), rdbNodeType(), rdbLog(), + rdbSnapshot(), rdbEngineList(), rdbNodeTypeList(), rdbBackupList(), @@ -160,6 +161,16 @@ func rdbLog() *core.Command { } } +func rdbSnapshot() *core.Command { + return &core.Command{ + Short: `Block snapshot management`, + Long: `Create, restore and manage block snapshot +`, + Namespace: "rdb", + Resource: "snapshot", + } +} + func rdbEngineList() *core.Command { return &core.Command{ Short: `List available database engines`, @@ -545,6 +556,13 @@ func rdbInstanceUpgrade() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "volume-size", + Short: `Increase your block storage volume size`, + Required: false, + Deprecated: false, + Positional: false, + }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { From 73b1741b61e30c327c7914a1e3e6698cd423c30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 4 Feb 2021 22:27:37 +0100 Subject: [PATCH 2/3] Fix --- .../applesilicon/v1alpha1/applesilicon_cli.go | 4 ++-- internal/namespaces/lb/v1/lb_cli.go | 14 -------------- internal/namespaces/rdb/v1/rdb_cli.go | 18 ------------------ 3 files changed, 2 insertions(+), 34 deletions(-) diff --git a/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go b/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go index bc14638ae8..92cf57a827 100644 --- a/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go +++ b/internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go @@ -1,14 +1,14 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -package apple_silicon +package applesilicon import ( "context" "reflect" "github.com/scaleway/scaleway-cli/internal/core" - "github.com/scaleway/scaleway-sdk-go/api/applesilicon/v1alpha1" + applesilicon "github.com/scaleway/scaleway-sdk-go/api/applesilicon/v1alpha1" "github.com/scaleway/scaleway-sdk-go/scw" ) diff --git a/internal/namespaces/lb/v1/lb_cli.go b/internal/namespaces/lb/v1/lb_cli.go index 581b7e340d..1bd81aa189 100644 --- a/internal/namespaces/lb/v1/lb_cli.go +++ b/internal/namespaces/lb/v1/lb_cli.go @@ -790,13 +790,6 @@ func lbBackendCreate() *core.Command { Deprecated: false, Positional: false, }, - { - Name: "health-check.check-send-proxy", - Short: `It defines whether the healthcheck should be done considering the proxy protocol`, - Required: false, - Deprecated: false, - Positional: false, - }, { Name: "lb-id", Short: `Load balancer ID`, @@ -1244,13 +1237,6 @@ func lbBackendUpdateHealthcheck() *core.Command { Deprecated: false, Positional: false, }, - { - Name: "check-send-proxy", - Short: `It defines whether the healthcheck should be done considering the proxy protocol`, - Required: false, - Deprecated: false, - Positional: false, - }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { diff --git a/internal/namespaces/rdb/v1/rdb_cli.go b/internal/namespaces/rdb/v1/rdb_cli.go index 486a412b47..fad9691132 100644 --- a/internal/namespaces/rdb/v1/rdb_cli.go +++ b/internal/namespaces/rdb/v1/rdb_cli.go @@ -29,7 +29,6 @@ func GetGeneratedCommands() *core.Commands { rdbDatabase(), rdbNodeType(), rdbLog(), - rdbSnapshot(), rdbEngineList(), rdbNodeTypeList(), rdbBackupList(), @@ -161,16 +160,6 @@ func rdbLog() *core.Command { } } -func rdbSnapshot() *core.Command { - return &core.Command{ - Short: `Block snapshot management`, - Long: `Create, restore and manage block snapshot -`, - Namespace: "rdb", - Resource: "snapshot", - } -} - func rdbEngineList() *core.Command { return &core.Command{ Short: `List available database engines`, @@ -556,13 +545,6 @@ func rdbInstanceUpgrade() *core.Command { Deprecated: false, Positional: false, }, - { - Name: "volume-size", - Short: `Increase your block storage volume size`, - Required: false, - Deprecated: false, - Positional: false, - }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { From 2a94f6bca74e52f719b7d95c440fad9de2883a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 4 Feb 2021 22:28:59 +0100 Subject: [PATCH 3/3] Fix --- .../test-all-usage-apple-silicon-server-create-usage.golden | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-apple-silicon-server-create-usage.golden b/cmd/scw/testdata/test-all-usage-apple-silicon-server-create-usage.golden index 9450c5f956..0389429109 100644 --- a/cmd/scw/testdata/test-all-usage-apple-silicon-server-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-apple-silicon-server-create-usage.golden @@ -6,9 +6,9 @@ USAGE: scw apple-silicon server create [arg=value ...] ARGS: - [name] Create a server with this given name - [project-id] Project ID to use. If none is passed the default project ID will be used - [type] Create a server of the given type + [name=] Create a server with this given name + [project-id] Project ID to use. If none is passed the default project ID will be used + [type=M1-M] Create a server of the given type FLAGS: -h, --help help for create