From 7173e8063ad5e710a9f3ecc3358387e676c0135a Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Thu, 31 Mar 2016 18:09:56 +0200 Subject: [PATCH 1/3] api: switch to VC1S --- pkg/api/api.go | 4 ++-- pkg/cli/cmd_create.go | 2 +- pkg/cli/cmd_run.go | 2 +- pkg/commands/create_test.go | 2 +- pkg/commands/run_test.go | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 3730e44e05..28182fb2b0 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -511,7 +511,7 @@ type ScalewayServer struct { // Organization is the owner of the server Organization string `json:"organization,omitempty"` - // CommercialType is the commercial type of the server (i.e: C1, C2[SML], VC1) + // CommercialType is the commercial type of the server (i.e: C1, C2[SML], VC1S) CommercialType string `json:"commercial_type,omitempty"` // Location of the server @@ -568,7 +568,7 @@ type ScalewayServerDefinition struct { // Organization is the owner of the server Organization string `json:"organization"` - // CommercialType is the commercial type of the server (i.e: C1, C2[SML], VC1) + // CommercialType is the commercial type of the server (i.e: C1, C2[SML], VC1S) CommercialType string `json:"commercial_type"` PublicIP string `json:"public_ip,omitempty"` diff --git a/pkg/cli/cmd_create.go b/pkg/cli/cmd_create.go index a3fc766eb3..07bc0bf27e 100644 --- a/pkg/cli/cmd_create.go +++ b/pkg/cli/cmd_create.go @@ -31,7 +31,7 @@ func init() { cmdCreate.Flag.StringVar(&createEnv, []string{"e", "-env"}, "", "Provide metadata tags passed to initrd (i.e., boot=resue INITRD_DEBUG=1)") cmdCreate.Flag.StringVar(&createVolume, []string{"v", "-volume"}, "", "Attach additional volume (i.e., 50G)") cmdCreate.Flag.StringVar(&createIPAddress, []string{"-ip-address"}, "dynamic", "Assign a reserved public IP, a 'dynamic' one or 'none'") - cmdCreate.Flag.StringVar(&createCommercialType, []string{"-commercial-type"}, "VC1", "Create a server with specific commercial-type C1, VC1, C2[S|M|L]") + cmdCreate.Flag.StringVar(&createCommercialType, []string{"-commercial-type"}, "VC1S", "Create a server with specific commercial-type C1, VC1S, C2[S|M|L]") cmdCreate.Flag.BoolVar(&createHelp, []string{"h", "-help"}, false, "Print usage") cmdCreate.Flag.BoolVar(&createTmpSSHKey, []string{"-tmp-ssh-key"}, false, "Access your server without uploading your SSH key to your account") } diff --git a/pkg/cli/cmd_run.go b/pkg/cli/cmd_run.go index ad0bd90936..9c05a8f23b 100644 --- a/pkg/cli/cmd_run.go +++ b/pkg/cli/cmd_run.go @@ -45,7 +45,7 @@ func init() { cmdRun.Flag.BoolVar(&runDetachFlag, []string{"d", "-detach"}, false, "Run server in background and print server ID") cmdRun.Flag.StringVar(&runGateway, []string{"g", "-gateway"}, "", "Use a SSH gateway") cmdRun.Flag.StringVar(&runUserdatas, []string{"u", "-userdata"}, "", "Start a server with userdata predefined") - cmdRun.Flag.StringVar(&runCommercialType, []string{"-commercial-type"}, "VC1", "Start a server with specific commercial-type C1, VC1, C2[SML]") + cmdRun.Flag.StringVar(&runCommercialType, []string{"-commercial-type"}, "VC1S", "Start a server with specific commercial-type C1, VC1S, C2[SML]") cmdRun.Flag.BoolVar(&runAutoRemove, []string{"-rm"}, false, "Automatically remove the server when it exits") cmdRun.Flag.BoolVar(&runTmpSSHKey, []string{"-tmp-ssh-key"}, false, "Access your server without uploading your SSH key to your account") cmdRun.Flag.BoolVar(&runShowBoot, []string{"-show-boot"}, false, "Allows to show the boot") diff --git a/pkg/commands/create_test.go b/pkg/commands/create_test.go index 25d6c88b3a..edfb723ff5 100644 --- a/pkg/commands/create_test.go +++ b/pkg/commands/create_test.go @@ -63,7 +63,7 @@ func TestRunCreate_realAPI(t *testing.T) { args := CreateArgs{ Name: "unittest-create-standard", Image: "ubuntu-wily", - CommercialType: "VC1", + CommercialType: "VC1S", } scopedCtx, scopedStdout, scopedStderr := getScopedCtx(ctx) diff --git a/pkg/commands/run_test.go b/pkg/commands/run_test.go index e9e1bb1b0e..df328f717c 100644 --- a/pkg/commands/run_test.go +++ b/pkg/commands/run_test.go @@ -8,7 +8,7 @@ func ExampleRun() { ctx := testCommandContext() args := RunArgs{ Image: "ubuntu-trusty", - CommercialType: "VC1", + CommercialType: "VC1S", } Run(ctx, args) } @@ -23,7 +23,7 @@ func ExampleRun_complex() { Gateway: "my-gateway", Image: "ubuntu-trusty", Name: "my-test-server", - CommercialType: "VC1", + CommercialType: "VC1S", Tags: []string{"testing", "fake"}, Volumes: []string{"50G", "1G"}, } From d8ac58f1ffab2dfec33e50c500d06f4787f8e473 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Thu, 31 Mar 2016 18:10:18 +0200 Subject: [PATCH 2/3] create-image-from-http: use VC1S by default --- examples/create-image-from-http.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/create-image-from-http.sh b/examples/create-image-from-http.sh index aebf5524ae..c589db97c0 100755 --- a/examples/create-image-from-http.sh +++ b/examples/create-image-from-http.sh @@ -17,7 +17,7 @@ NAME=$(basename "${URL}") SNAPSHOT_NAME=${NAME%.*}-$(date +%Y-%m-%d_%H:%M) IMAGE_NAME=${IMAGE_NAME:-$SNAPSHOT_NAME} IMAGE_BOOTSCRIPT=${IMAGE_BOOTSCRIPT:stable} -SCW_COMMERCIAL_TYPE=${SCW_COMMERCIAL_TYPE:-VC1} +SCW_COMMERCIAL_TYPE=${SCW_COMMERCIAL_TYPE:-VC1S} VOLUME_SIZE=${VOLUME_SIZE:-50GB} SCW_TARGET_ARCH=x86_64 if [ "$SCW_COMMERCIAL_TYPE" = "C1" ]; then From 14e4b6024eb97f8fd698a567c80831537e25eb33 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Thu, 31 Mar 2016 18:10:35 +0200 Subject: [PATCH 3/3] README.md: update --- README.md | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 5f691f452b..d3a619f9aa 100644 --- a/README.md +++ b/README.md @@ -316,14 +316,14 @@ Create a new server but do not start it. Options: - --bootscript="" Assign a bootscript - --commercial-type=VC1 Create a server with specific commercial-type C1, VC1, C2[S|M|L] - -e, --env="" Provide metadata tags passed to initrd (i.e., boot=resue INITRD_DEBUG=1) - -h, --help=false Print usage - --ip-address=dynamic Assign a reserved public IP, a 'dynamic' one or 'none' - --name="" Assign a name - --tmp-ssh-key=false Access your server without uploading your SSH key to your account - -v, --volume="" Attach additional volume (i.e., 50G) + --bootscript="" Assign a bootscript + --commercial-type=VC1S Create a server with specific commercial-type C1, VC1S, C2[S|M|L] + -e, --env="" Provide metadata tags passed to initrd (i.e., boot=resue INITRD_DEBUG=1) + -h, --help=false Print usage + --ip-address=dynamic Assign a reserved public IP, a 'dynamic' one or 'none' + --name="" Assign a name + --tmp-ssh-key=false Access your server without uploading your SSH key to your account + -v, --volume="" Attach additional volume (i.e., 50G) Examples: @@ -691,21 +691,21 @@ Run a command in a new server. Options: - -a, --attach=false Attach to serial console - --bootscript="" Assign a bootscript - --commercial-type=VC1 Start a server with specific commercial-type C1, VC1, C2[SML] - -d, --detach=false Run server in background and print server ID - -e, --env="" Provide metadata tags passed to initrd (i.e., boot=rescue INITRD_DEBUG=1) - -g, --gateway="" Use a SSH gateway - -h, --help=false Print usage - --ip-address="" Assign a reserved public IP, a 'dynamic' one or 'none' (default to 'none' if gateway specified, 'dynamic' otherwise) - --name="" Assign a name - --rm=false Automatically remove the server when it exits - --show-boot=false Allows to show the boot - -T, --timeout=0 Set timeout value to seconds - --tmp-ssh-key=false Access your server without uploading your SSH key to your account - -u, --userdata="" Start a server with userdata predefined - -v, --volume="" Attach additional volume (i.e., 50G) + -a, --attach=false Attach to serial console + --bootscript="" Assign a bootscript + --commercial-type=VC1S Start a server with specific commercial-type C1, VC1S, C2[SML] + -d, --detach=false Run server in background and print server ID + -e, --env="" Provide metadata tags passed to initrd (i.e., boot=rescue INITRD_DEBUG=1) + -g, --gateway="" Use a SSH gateway + -h, --help=false Print usage + --ip-address="" Assign a reserved public IP, a 'dynamic' one or 'none' (default to 'none' if gateway specified, 'dynamic' otherwise) + --name="" Assign a name + --rm=false Automatically remove the server when it exits + --show-boot=false Allows to show the boot + -T, --timeout=0 Set timeout value to seconds + --tmp-ssh-key=false Access your server without uploading your SSH key to your account + -u, --userdata="" Start a server with userdata predefined + -v, --volume="" Attach additional volume (i.e., 50G) Examples: @@ -1184,6 +1184,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address' ### master (unreleased) * Fix bug when using SCW_COMMERCIAL_TYPE variable +* Switch to VC1S View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.8.1...master)