Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Mar 19, 2020
1 parent 45f378a commit 02eb4f1
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 111 deletions.
3 changes: 1 addition & 2 deletions internal/namespaces/baremetal/v1alpha1/custom_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/scaleway/scaleway-cli/internal/core"
baremetal "github.com/scaleway/scaleway-sdk-go/api/baremetal/v1alpha1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

const (
Expand All @@ -22,7 +21,7 @@ func waitForServerFunc(action int) core.WaitFunc {
server, err := baremetal.NewAPI(core.ExtractClient(ctx)).WaitForServer(&baremetal.WaitForServerRequest{
ServerID: respI.(*baremetal.Server).ID,
Zone: respI.(*baremetal.Server).Zone,
Timeout: scw.DurationPtr(serverActionTimeout),
Timeout: serverActionTimeout,
})
switch action {
case serverActionReboot:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Test_CreateServer(t *testing.T) {
core.TestCheckExitCode(0),
),
DefaultZone: scw.ZoneFrPar2,
//AfterFunc: deleteServerAfterFunc,
//AfterFunc: deleteServerAfterFunc,
}))

t.Run("Tags", core.Test(&core.TestConfig{
Expand All @@ -54,12 +54,12 @@ func Test_CreateServer(t *testing.T) {
core.TestCheckExitCode(0),
),
DefaultZone: scw.ZoneFrPar2,
//AfterFunc: deleteServerAfterFunc,
//AfterFunc: deleteServerAfterFunc,
}))

//t.Run("HC-BM1-L", core.Test(&core.TestConfig{
// Commands: GetCommands(),
// Cmd: "scw baremetal server create type=HC-BM1-L zone=fr-par-2",
// Cmd: "scw baremetal server create type=HC-BM1-L zone=fr-par-2 --wait",
// Check: core.TestCheckCombine(
// func(t *testing.T, ctx *core.CheckFuncCtx) {
// assert.Equal(t, "HC-BM1-L", ctx.Result.(*baremetal.Server).CommercialType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ interactions:
url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/offers?page=1
method: GET
response:
body: '{"total_count":6,"offers":[{"id":"3ab0dc29-2fd4-486e-88bf-d08fbf49214b","name":"HC-BM1-L","stock":"available","bandwidth":1000,"commercial_range":"high_cpu","price_by_minute":{"currency_code":"EUR","units":1,"nanos":499900000},"price_by_month":{"currency_code":"EUR","units":749,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"Intel
body: '{"total_count":6,"offers":[{"id":"3ab0dc29-2fd4-486e-88bf-d08fbf49214b","name":"HC-BM1-L","stock":"empty","bandwidth":1000,"commercial_range":"high_cpu","price_by_minute":{"currency_code":"EUR","units":1,"nanos":499900000},"price_by_month":{"currency_code":"EUR","units":749,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"Intel
Xeon Gold 5120","cores":28,"threads":56,"frequency":2200},{"name":"Intel Xeon
Gold 5120","cores":28,"threads":56,"frequency":2200}],"memory":[{"capacity":384,"type":"DDR4","frequency":2133,"ecc":true}],"quota_name":"bmaas_high","price_per_sixty_minutes":{"currency_code":"EUR","units":1,"nanos":499900000},"price_per_month":{"currency_code":"EUR","units":749,"nanos":990000000}},{"id":"5363865f-2266-40f9-a43f-4f3aba251524","name":"HM-BM1-XL","stock":"available","bandwidth":1000,"commercial_range":"high_memory","price_by_minute":{"currency_code":"EUR","units":2,"nanos":599900000},"price_by_month":{"currency_code":"EUR","units":1299,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"Intel
Gold 5120","cores":28,"threads":56,"frequency":2200}],"memory":[{"capacity":384,"type":"DDR4","frequency":2133,"ecc":true}],"quota_name":"bmaas_high","price_per_sixty_minutes":{"currency_code":"EUR","units":1,"nanos":499900000},"price_per_month":{"currency_code":"EUR","units":749,"nanos":990000000}},{"id":"5363865f-2266-40f9-a43f-4f3aba251524","name":"HM-BM1-XL","stock":"empty","bandwidth":1000,"commercial_range":"high_memory","price_by_minute":{"currency_code":"EUR","units":2,"nanos":599900000},"price_by_month":{"currency_code":"EUR","units":1299,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"Intel
Xeon Gold 6140","cores":36,"threads":72,"frequency":2300},{"name":"Intel Xeon
Gold 6140","cores":36,"threads":72,"frequency":2300}],"memory":[{"capacity":768,"type":"DDR4","frequency":2133,"ecc":true}],"quota_name":"bmaas_high","price_per_sixty_minutes":{"currency_code":"EUR","units":2,"nanos":599900000},"price_per_month":{"currency_code":"EUR","units":1299,"nanos":990000000}},{"id":"737f18c8-febc-4408-b69e-776bca0a3f48","name":"HC-BM1-S","stock":"available","bandwidth":1000,"commercial_range":"high_cpu","price_by_minute":{"currency_code":"EUR","units":0,"nanos":659900000},"price_by_month":{"currency_code":"EUR","units":329,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"Intel
Xeon Silver 4114","cores":10,"threads":20,"frequency":2200},{"name":"Intel Xeon
Silver 4114","cores":10,"threads":20,"frequency":2200}],"memory":[{"capacity":128,"type":"DDR4","frequency":2400,"ecc":true}],"quota_name":"bmaas_high","price_per_sixty_minutes":{"currency_code":"EUR","units":0,"nanos":659900000},"price_per_month":{"currency_code":"EUR","units":329,"nanos":990000000}},{"id":"8090d302-3545-4905-9cf3-bcb77a299f47","name":"GP-BM1-L","stock":"available","bandwidth":750,"commercial_range":"general_purpose","price_by_minute":{"currency_code":"EUR","units":0,"nanos":499900000},"price_by_month":{"currency_code":"EUR","units":249,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"AMD
Silver 4114","cores":10,"threads":20,"frequency":2200}],"memory":[{"capacity":128,"type":"DDR4","frequency":2400,"ecc":true}],"quota_name":"bmaas_high","price_per_sixty_minutes":{"currency_code":"EUR","units":0,"nanos":659900000},"price_per_month":{"currency_code":"EUR","units":329,"nanos":990000000}},{"id":"8090d302-3545-4905-9cf3-bcb77a299f47","name":"GP-BM1-L","stock":"empty","bandwidth":750,"commercial_range":"general_purpose","price_by_minute":{"currency_code":"EUR","units":0,"nanos":499900000},"price_by_month":{"currency_code":"EUR","units":249,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"AMD
EPYC 7281","cores":16,"threads":32,"frequency":2100}],"memory":[{"capacity":96,"type":"DDR4","frequency":2133,"ecc":true}],"quota_name":"bmaas_gp","price_per_sixty_minutes":{"currency_code":"EUR","units":0,"nanos":499900000},"price_per_month":{"currency_code":"EUR","units":249,"nanos":990000000}},{"id":"964f9b38-577e-470f-a220-7d762f9e8672","name":"GP-BM1-M","stock":"available","bandwidth":500,"commercial_range":"general_purpose","price_by_minute":{"currency_code":"EUR","units":0,"nanos":399900000},"price_by_month":{"currency_code":"EUR","units":199,"nanos":990000000},"disk":[{"capacity":1024,"type":"SSD"},{"capacity":1024,"type":"SSD"},{"capacity":1024,"type":"SSD"}],"enable":true,"cpu":[{"name":"Intel
Xeon E3 1240v6","cores":4,"threads":8,"frequency":3700}],"memory":[{"capacity":64,"type":"DDR4","frequency":2133,"ecc":true}],"quota_name":"bmaas_gp","price_per_sixty_minutes":{"currency_code":"EUR","units":0,"nanos":399900000},"price_per_month":{"currency_code":"EUR","units":199,"nanos":990000000}},{"id":"c452f76a-2cda-4a1b-9658-a16952dc5ff0","name":"HM-BM1-M","stock":"available","bandwidth":1000,"commercial_range":"high_memory","price_by_minute":{"currency_code":"EUR","units":0,"nanos":799900000},"price_by_month":{"currency_code":"EUR","units":399,"nanos":990000000},"disk":[{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"},{"capacity":1024,"type":"NVMe"}],"enable":true,"cpu":[{"name":"AMD
EPYC 7401P","cores":24,"threads":48,"frequency":2000}],"memory":[{"capacity":256,"type":"DDR4","frequency":2133,"ecc":true}],"quota_name":"bmaas_high","price_per_sixty_minutes":{"currency_code":"EUR","units":0,"nanos":799900000},"price_per_month":{"currency_code":"EUR","units":399,"nanos":990000000}}]}'
Expand All @@ -26,7 +26,7 @@ interactions:
Content-Type:
- application/json
Date:
- Tue, 17 Mar 2020 15:00:14 GMT
- Thu, 19 Mar 2020 11:22:48 GMT
Server:
- scaleway_api
Strict-Transport-Security:
Expand All @@ -36,12 +36,12 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 8ff5663b-c7e8-4b5f-8d67-a8b0b33ef4a2
- fcb5a084-d5fc-42aa-815c-1d1a4e4cca29
status: 200 OK
code: 200
duration: ""
- request:
body: '{"offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-mystifying-shannon","description":"","tags":null}'
body: '{"offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-wizardly-bell","description":"","tags":null}'
form: {}
headers:
Content-Type:
Expand All @@ -51,16 +51,16 @@ interactions:
url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers
method: POST
response:
body: '{"id":"2bc82be8-aeb4-4cf3-a474-954c5abf7d3b","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-mystifying-shannon","description":"","updated_at":"2020-03-17T15:00:15.123704001Z","created_at":"2020-03-17T15:00:15.123704001Z","status":"undelivered","offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","install":null,"tags":[],"ips":[],"domain":"","boot_type":"normal","zone":"fr-par-2"}'
body: '{"id":"24cf0a23-978a-47c0-9a1d-07fcfefef270","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-wizardly-bell","description":"","updated_at":"2020-03-19T11:22:48.464487164Z","created_at":"2020-03-19T11:22:48.464487164Z","status":"undelivered","offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","install":null,"tags":[],"ips":[],"domain":"","boot_type":"normal","zone":"fr-par-2"}'
headers:
Content-Length:
- "404"
- "399"
Content-Security-Policy:
- default-src 'none'; frame-ancestors 'none'
Content-Type:
- application/json
Date:
- Tue, 17 Mar 2020 15:00:14 GMT
- Thu, 19 Mar 2020 11:22:48 GMT
Server:
- scaleway_api
Strict-Transport-Security:
Expand All @@ -70,7 +70,7 @@ interactions:
X-Frame-Options:
- DENY
X-Request-Id:
- 08cd5b27-ee60-44fd-94c9-45c7a7f3b501
- 42e211d3-42ab-4597-b08b-2bc606821637
status: 200 OK
code: 200
duration: ""

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id 2bc82be8-aeb4-4cf3-a474-954c5abf7d3b
id 24cf0a23-978a-47c0-9a1d-07fcfefef270
organization-id 951df375-e094-4d26-97c1-ba548eeb9c42
name cli-bm-mystifying-shannon
name cli-bm-wizardly-bell
description -
updated-at few seconds ago
created-at few seconds ago
Expand Down
Loading

0 comments on commit 02eb4f1

Please sign in to comment.