diff --git a/internal/namespaces/baremetal/v1alpha1/custom_server_create_test.go b/internal/namespaces/baremetal/v1alpha1/custom_server_create_test.go index 1a538549fb..2c1edcc10e 100644 --- a/internal/namespaces/baremetal/v1alpha1/custom_server_create_test.go +++ b/internal/namespaces/baremetal/v1alpha1/custom_server_create_test.go @@ -21,12 +21,12 @@ func Test_CreateServer(t *testing.T) { t.Run("Simple", func(t *testing.T) { t.Run("Default", core.Test(&core.TestConfig{ Commands: GetCommands(), - Cmd: "scw baremetal server create", + Cmd: "scw baremetal server create zone=fr-par-2", Check: core.TestCheckCombine( core.TestCheckGolden(), core.TestCheckExitCode(0), ), - AfterFunc: deleteServerAfterFunc, + //AfterFunc: deleteServerAfterFunc, DefaultZone: scw.ZoneFrPar2, })) @@ -39,12 +39,13 @@ func Test_CreateServer(t *testing.T) { }, core.TestCheckExitCode(0), ), - AfterFunc: deleteServerAfterFunc, + DefaultZone: scw.ZoneFrPar2, + //AfterFunc: deleteServerAfterFunc, })) t.Run("Tags", core.Test(&core.TestConfig{ Commands: GetCommands(), - Cmd: "scw baremetal server create tags.0=prod tags.1=blue", + Cmd: "scw baremetal server create tags.0=prod tags.1=blue zone=fr-par-2", Check: core.TestCheckCombine( func(t *testing.T, ctx *core.CheckFuncCtx) { assert.Equal(t, "prod", ctx.Result.(*baremetal.Server).Tags[0]) @@ -52,12 +53,13 @@ func Test_CreateServer(t *testing.T) { }, core.TestCheckExitCode(0), ), - AfterFunc: deleteServerAfterFunc, + DefaultZone: scw.ZoneFrPar2, + //AfterFunc: deleteServerAfterFunc, })) //t.Run("HC-BM1-L", core.Test(&core.TestConfig{ // Commands: GetCommands(), - // Cmd: "scw baremetal server create type=HC-BM1-L", + // Cmd: "scw baremetal server create type=HC-BM1-L zone=fr-par-2", // Check: core.TestCheckCombine( // func(t *testing.T, ctx *core.CheckFuncCtx) { // assert.Equal(t, "HC-BM1-L", ctx.Result.(*baremetal.Server).CommercialType) diff --git a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-errors-error-invalid-instance-type.stderr.golden b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-errors-error-invalid-instance-type.stderr.golden new file mode 100644 index 0000000000..93b20472e6 --- /dev/null +++ b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-errors-error-invalid-instance-type.stderr.golden @@ -0,0 +1 @@ +Unknown command "instance" for "scw" diff --git a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.cassette.yaml b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.cassette.yaml index 8843396c11..685ccbadda 100644 --- a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.cassette.yaml +++ b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.cassette.yaml @@ -12,11 +12,11 @@ interactions: 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 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":"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 + 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 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":1000,"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":"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 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}}]}' @@ -26,7 +26,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 16 Mar 2020 15:02:43 GMT + - Tue, 17 Mar 2020 15:00:14 GMT Server: - scaleway_api Strict-Transport-Security: @@ -36,12 +36,12 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 5439d8ff-9e6b-4d35-b4bc-9804ab319959 + - 8ff5663b-c7e8-4b5f-8d67-a8b0b33ef4a2 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-adoring-burnell","description":"","tags":null}' + body: '{"offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-mystifying-shannon","description":"","tags":null}' form: {} headers: Content-Type: @@ -51,16 +51,16 @@ interactions: url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers method: POST response: - body: '{"id":"56443f14-77a3-47f9-9468-972be70d20fa","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-adoring-burnell","description":"","updated_at":"2020-03-16T15:02:44.095279868Z","created_at":"2020-03-16T15:02:44.095279868Z","status":"undelivered","offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","install":null,"tags":[],"ips":[],"domain":"","boot_type":"normal","zone":"fr-par-2"}' + 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"}' headers: Content-Length: - - "401" + - "404" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Mon, 16 Mar 2020 15:02:43 GMT + - Tue, 17 Mar 2020 15:00:14 GMT Server: - scaleway_api Strict-Transport-Security: @@ -70,39 +70,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0cdd8d80-4368-453b-9134-e7ce105fd41f + - 08cd5b27-ee60-44fd-94c9-45c7a7f3b501 status: 200 OK code: 200 duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers/56443f14-77a3-47f9-9468-972be70d20fa - method: DELETE - response: - body: '{"message":"Server is not delivered"}' - headers: - Content-Length: - - "37" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Mon, 16 Mar 2020 15:02:43 GMT - Server: - - scaleway_api - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 11f38363-ebdc-46a9-acd9-8f04c50fed03 - status: 400 Bad Request - code: 400 - duration: "" diff --git a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stderr.golden b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stderr.golden new file mode 100644 index 0000000000..f7cbc69ec3 --- /dev/null +++ b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stderr.golden @@ -0,0 +1,60 @@ +DEBUG: 2019/12/09 16:04:07 creating GET request on https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/offers?page=1 +DEBUG: 2019/12/09 16:04:07 +--------------- Scaleway SDK REQUEST 1 : --------------- +GET /baremetal/v1alpha1/zones/fr-par-2/offers?page=1 HTTP/1.1 +Host: api.scaleway.com +User-Agent: scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14; darwin; amd64) cli-e2e-test +X-Auth-Token: 148499e0-xxxx-xxxx-xxxx-xxxxxxxxxxxx +Accept-Encoding: gzip + + +--------------------------------------------------------- +DEBUG: 2019/12/09 16:04:07 +--------------- Scaleway SDK RESPONSE 1 : --------------- +HTTP/1.0 200 OK +Connection: close +Content-Length: 4684 +Content-Security-Policy: default-src 'none'; frame-ancestors 'none' +Content-Type: application/json +Date: Tue, 17 Mar 2020 15:00:14 GMT +Server: scaleway_api +Strict-Transport-Security: max-age=63072000 +X-Content-Type-Options: nosniff +X-Frame-Options: DENY +X-Request-Id: 8ff5663b-c7e8-4b5f-8d67-a8b0b33ef4a2 + +{"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 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 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 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}}]} +---------------------------------------------------------- +DEBUG: 2019/12/09 16:04:07 creating POST request on https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers +DEBUG: 2019/12/09 16:04:07 +--------------- Scaleway SDK REQUEST 2 : --------------- +POST /baremetal/v1alpha1/zones/fr-par-2/servers HTTP/1.1 +Host: api.scaleway.com +User-Agent: scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14; darwin; amd64) cli-e2e-test +Content-Length: 172 +Content-Type: application/json +X-Auth-Token: 148499e0-xxxx-xxxx-xxxx-xxxxxxxxxxxx +Accept-Encoding: gzip + +{"offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-mystifying-shannon","description":"","tags":null} +--------------------------------------------------------- +DEBUG: 2019/12/09 16:04:07 +--------------- Scaleway SDK RESPONSE 2 : --------------- +HTTP/1.0 200 OK +Connection: close +Content-Length: 404 +Content-Security-Policy: default-src 'none'; frame-ancestors 'none' +Content-Type: application/json +Date: Tue, 17 Mar 2020 15:00:14 GMT +Server: scaleway_api +Strict-Transport-Security: max-age=63072000 +X-Content-Type-Options: nosniff +X-Frame-Options: DENY +X-Request-Id: 08cd5b27-ee60-44fd-94c9-45c7a7f3b501 + +{"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"} +---------------------------------------------------------- +DEBUG: 2019/12/09 16:04:07 marshalling type '*baremetal.Server' +DEBUG: 2019/12/09 16:04:07 marshalling type 'baremetal.Server' +DEBUG: 2019/12/09 16:04:07 skipping check version +DEBUG: 2019/12/09 16:04:07 skipping telemetry report diff --git a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stdout.golden b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stdout.golden index ac0437d60b..de92873d72 100644 --- a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stdout.golden +++ b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-default.stdout.golden @@ -1,6 +1,6 @@ -id 56443f14-77a3-47f9-9468-972be70d20fa +id 2bc82be8-aeb4-4cf3-a474-954c5abf7d3b organization-id 951df375-e094-4d26-97c1-ba548eeb9c42 -name cli-bm-adoring-burnell +name cli-bm-mystifying-shannon description - updated-at few seconds ago created-at few seconds ago diff --git a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-tags.cassette.yaml b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-tags.cassette.yaml index 1cf7f6a6c4..4c01bb9e95 100644 --- a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-tags.cassette.yaml +++ b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-tags.cassette.yaml @@ -7,19 +7,60 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-1/offers?page=1 + url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/offers?page=1 method: GET response: - body: '{"message":"unknown service"}' + 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 + 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 + 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 + 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}}]}' + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 17 Mar 2020 15:00:15 GMT + Server: + - scaleway_api + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9f8be67d-a95b-4b40-86e6-1b1fb8bf98dc + 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-vibrant-wilbur","description":"","tags":["prod","blue"]}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers + method: POST + response: + body: '{"id":"f207f39a-0866-4ac6-a670-8aa29332887b","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-bm-vibrant-wilbur","description":"","updated_at":"2020-03-17T15:00:15.507239650Z","created_at":"2020-03-17T15:00:15.507239650Z","status":"undelivered","offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","install":null,"tags":["prod","blue"],"ips":[],"domain":"","boot_type":"normal","zone":"fr-par-2"}' headers: Content-Length: - - "29" + - "413" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Mon, 16 Mar 2020 15:02:44 GMT + - Tue, 17 Mar 2020 15:00:15 GMT Server: - scaleway_api Strict-Transport-Security: @@ -29,7 +70,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 981b4050-4f98-4fd4-ab5e-a8a4e78ed537 - status: 501 Not Implemented - code: 501 + - b6caf81f-45f6-4ce1-ab3a-757a53b7d02d + status: 200 OK + code: 200 duration: "" diff --git a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-with-name.cassette.yaml b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-with-name.cassette.yaml index c3b7e1745f..d476931808 100644 --- a/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-with-name.cassette.yaml +++ b/internal/namespaces/baremetal/v1alpha1/testdata/test-create-server-simple-with-name.cassette.yaml @@ -12,11 +12,11 @@ interactions: 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 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":"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 + 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 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":1000,"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":"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 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}}]}' @@ -26,7 +26,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 16 Mar 2020 15:02:43 GMT + - Tue, 17 Mar 2020 15:00:15 GMT Server: - scaleway_api Strict-Transport-Security: @@ -36,7 +36,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 055b219b-3a58-4644-8ada-c52a45860409 + - 30ad351b-2bb8-46ee-9b31-3d7315c6856d status: 200 OK code: 200 duration: "" @@ -51,7 +51,7 @@ interactions: url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers method: POST response: - body: '{"id":"6efbd781-c0af-49f7-a8e3-0c7902c9d240","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"yo","description":"","updated_at":"2020-03-16T15:02:44.329274421Z","created_at":"2020-03-16T15:02:44.329274421Z","status":"undelivered","offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","install":null,"tags":[],"ips":[],"domain":"","boot_type":"normal","zone":"fr-par-2"}' + body: '{"id":"db39db88-86d6-46ca-b2bc-d16e0253746b","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"yo","description":"","updated_at":"2020-03-17T15:00:15.346636913Z","created_at":"2020-03-17T15:00:15.346636913Z","status":"undelivered","offer_id":"964f9b38-577e-470f-a220-7d762f9e8672","install":null,"tags":[],"ips":[],"domain":"","boot_type":"normal","zone":"fr-par-2"}' headers: Content-Length: - "381" @@ -60,7 +60,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 16 Mar 2020 15:02:44 GMT + - Tue, 17 Mar 2020 15:00:15 GMT Server: - scaleway_api Strict-Transport-Security: @@ -70,39 +70,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 7c17bdc6-79cf-4d07-8bdf-3d1c3157c93d + - a5d4450f-b8d3-4182-a3a5-6a3f17a29172 status: 200 OK code: 200 duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-1/servers/6efbd781-c0af-49f7-a8e3-0c7902c9d240 - method: DELETE - response: - body: '{"message":"unknown service"}' - headers: - Content-Length: - - "29" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Mon, 16 Mar 2020 15:02:44 GMT - Server: - - scaleway_api - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - dd0b5704-47ba-480e-97ca-a75729625c66 - status: 501 Not Implemented - code: 501 - duration: ""