From f3f8169842bc15f64e892361b992535e5f0fb859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jules=20Cast=C3=A9ran?= Date: Wed, 14 Sep 2022 17:45:09 +0200 Subject: [PATCH] fix(instance): set server type to required (#2502) --- .../test-all-usage-instance-server-create-usage.golden | 2 +- docs/commands/instance.md | 2 +- internal/namespaces/instance/v1/custom_server_create.go | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/scw/testdata/test-all-usage-instance-server-create-usage.golden b/cmd/scw/testdata/test-all-usage-instance-server-create-usage.golden index f64ab866bc..a4229455f6 100644 --- a/cmd/scw/testdata/test-all-usage-instance-server-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-instance-server-create-usage.golden @@ -24,7 +24,7 @@ EXAMPLES: ARGS: image=ubuntu_jammy Image ID or label of the server - [type=DEV1-S] Server commercial type (GP1-XS | GP1-S | GP1-M | GP1-L | GP1-XL | DEV1-S | DEV1-M | DEV1-L | DEV1-XL | RENDER-S | STARDUST1-S | ENT1-S | ENT1-M | ENT1-L | ENT1-XL | ENT1-2XL | PRO2-XXS | PRO2-XS | PRO2-S | PRO2-M | PRO2-L | PLAY2-PICO | PLAY2-NANO | PLAY2-MICRO | GPU-3070-S) + type=DEV1-S Server commercial type (GP1-XS | GP1-S | GP1-M | GP1-L | GP1-XL | DEV1-S | DEV1-M | DEV1-L | DEV1-XL | RENDER-S | STARDUST1-S | ENT1-S | ENT1-M | ENT1-L | ENT1-XL | ENT1-2XL | PRO2-XXS | PRO2-XS | PRO2-S | PRO2-M | PRO2-L | PLAY2-PICO | PLAY2-NANO | PLAY2-MICRO | GPU-3070-S) [name=] Server name [root-volume] Local root volume of the server [additional-volumes.{index}] Additional local and block volumes attached to your server diff --git a/docs/commands/instance.md b/docs/commands/instance.md index 7394574f44..27b07d588e 100644 --- a/docs/commands/instance.md +++ b/docs/commands/instance.md @@ -1308,7 +1308,7 @@ scw instance server create [arg=value ...] | Name | | Description | |------|---|-------------| | image | Required
Default: `ubuntu_jammy` | Image ID or label of the server | -| type | Default: `DEV1-S`
One of: `GP1-XS`, `GP1-S`, `GP1-M`, `GP1-L`, `GP1-XL`, `DEV1-S`, `DEV1-M`, `DEV1-L`, `DEV1-XL`, `RENDER-S`, `STARDUST1-S`, `ENT1-S`, `ENT1-M`, `ENT1-L`, `ENT1-XL`, `ENT1-2XL`, `PRO2-XXS`, `PRO2-XS`, `PRO2-S`, `PRO2-M`, `PRO2-L`, `PLAY2-PICO`, `PLAY2-NANO`, `PLAY2-MICRO`, `GPU-3070-S` | Server commercial type | +| type | Required
Default: `DEV1-S`
One of: `GP1-XS`, `GP1-S`, `GP1-M`, `GP1-L`, `GP1-XL`, `DEV1-S`, `DEV1-M`, `DEV1-L`, `DEV1-XL`, `RENDER-S`, `STARDUST1-S`, `ENT1-S`, `ENT1-M`, `ENT1-L`, `ENT1-XL`, `ENT1-2XL`, `PRO2-XXS`, `PRO2-XS`, `PRO2-S`, `PRO2-M`, `PRO2-L`, `PLAY2-PICO`, `PLAY2-NANO`, `PLAY2-MICRO`, `GPU-3070-S` | Server commercial type | | name | Default: `` | Server name | | root-volume | | Local root volume of the server | | additional-volumes.{index} | | Additional local and block volumes attached to your server | diff --git a/internal/namespaces/instance/v1/custom_server_create.go b/internal/namespaces/instance/v1/custom_server_create.go index e127a994fb..389e7fd86c 100644 --- a/internal/namespaces/instance/v1/custom_server_create.go +++ b/internal/namespaces/instance/v1/custom_server_create.go @@ -57,9 +57,10 @@ func serverCreateCommand() *core.Command { AutoCompleteFunc: instanceServerCreateImageAutoCompleteFunc, }, { - Name: "type", - Short: "Server commercial type", - Default: core.DefaultValueSetter("DEV1-S"), + Name: "type", + Short: "Server commercial type", + Default: core.DefaultValueSetter("DEV1-S"), + Required: true, EnumValues: []string{ "GP1-XS", "GP1-S",