From 78a771d941dde6f04995b3fc81147d25dd187a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 7 Jul 2020 17:08:14 +0200 Subject: [PATCH 01/14] rdb: add support for wait on backup resource --- internal/namespaces/rdb/v1/custom.go | 1 + internal/namespaces/rdb/v1/custom_backup.go | 55 +++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 internal/namespaces/rdb/v1/custom_backup.go diff --git a/internal/namespaces/rdb/v1/custom.go b/internal/namespaces/rdb/v1/custom.go index ece0383302..41467a19ff 100644 --- a/internal/namespaces/rdb/v1/custom.go +++ b/internal/namespaces/rdb/v1/custom.go @@ -27,6 +27,7 @@ func GetCommands() *core.Commands { cmds.Merge(core.NewCommands( instanceWaitCommand(), instanceConnectCommand(), + backupWaitCommand(), )) cmds.MustFind("rdb", "instance", "create").Override(instanceCreateBuilder) cmds.MustFind("rdb", "instance", "clone").Override(instanceCloneBuilder) diff --git a/internal/namespaces/rdb/v1/custom_backup.go b/internal/namespaces/rdb/v1/custom_backup.go new file mode 100644 index 0000000000..4523a0eaa6 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_backup.go @@ -0,0 +1,55 @@ +package rdb + +import ( + "context" + "reflect" + "time" + + "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-sdk-go/api/rdb/v1" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +const ( + backupActionTimeout = 20 * time.Minute +) + +type backupWaitRequest struct { + DatabaseBackupID string + Region scw.Region +} + +func backupWaitCommand() *core.Command { + return &core.Command{ + Short: `Wait for a backup to reach a stable state`, + Long: `Wait for a backup to reach a stable state. This is similar to using --wait flag.`, + Namespace: "rdb", + Resource: "backup", + Verb: "wait", + ArgsType: reflect.TypeOf(backupWaitRequest{}), + Run: func(ctx context.Context, argsI interface{}) (i interface{}, err error) { + api := rdb.NewAPI(core.ExtractClient(ctx)) + return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ + DatabaseBackupID: argsI.(*backupWaitRequest).DatabaseBackupID, + Region: argsI.(*backupWaitRequest).Region, + Timeout: scw.TimeDurationPtr(backupActionTimeout), + RetryInterval: core.DefaultRetryInterval, + }) + }, + ArgSpecs: core.ArgSpecs{ + { + Name: "backup-id", + Short: `ID of the backup you want to wait for.`, + Required: true, + Positional: true, + }, + core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms), + }, + Examples: []*core.Example{ + { + Short: "Wait for a backup to reach a stable state", + ArgsJSON: `{"backup_id": "11111111-1111-1111-1111-111111111111"}`, + }, + }, + } +} From 6197b63152f549befe7031c209fd0a8059275a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 7 Jul 2020 17:10:53 +0200 Subject: [PATCH 02/14] Fix --- .../test-all-usage-rdb-backup-usage.golden | 1 + ...est-all-usage-rdb-backup-wait-usage.golden | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 cmd/scw/testdata/test-all-usage-rdb-backup-wait-usage.golden diff --git a/cmd/scw/testdata/test-all-usage-rdb-backup-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-backup-usage.golden index 4640a4a3c2..6c610b707a 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-backup-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-backup-usage.golden @@ -13,6 +13,7 @@ AVAILABLE COMMANDS: list List database backups restore Restore a database backup update Update a database backup + wait Wait for a backup to reach a stable state FLAGS: -h, --help help for backup diff --git a/cmd/scw/testdata/test-all-usage-rdb-backup-wait-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-backup-wait-usage.golden new file mode 100644 index 0000000000..5dbe8b75d2 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-rdb-backup-wait-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Wait for a backup to reach a stable state. This is similar to using --wait flag. + +USAGE: + scw rdb backup wait [arg=value ...] + +EXAMPLES: + Wait for a backup to reach a stable state + scw rdb backup wait + +ARGS: + backup-id ID of the backup you want to wait for. + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams) + +FLAGS: + -h, --help help for wait + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use From 87411a78d642ecf1035aa29f7d003172106e083d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 7 Jul 2020 17:24:03 +0200 Subject: [PATCH 03/14] Fix --- internal/namespaces/rdb/v1/custom.go | 3 ++- .../namespaces/rdb/v1/custom_backup_create.go | 23 ++++++++++++++++++ .../rdb/v1/custom_backup_create_test.go | 24 +++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 internal/namespaces/rdb/v1/custom_backup_create.go create mode 100644 internal/namespaces/rdb/v1/custom_backup_create_test.go diff --git a/internal/namespaces/rdb/v1/custom.go b/internal/namespaces/rdb/v1/custom.go index 41467a19ff..70012129f6 100644 --- a/internal/namespaces/rdb/v1/custom.go +++ b/internal/namespaces/rdb/v1/custom.go @@ -29,10 +29,11 @@ func GetCommands() *core.Commands { instanceConnectCommand(), backupWaitCommand(), )) + cmds.MustFind("rdb", "backup", "create").Override(backupCreateBuilder) + cmds.MustFind("rdb", "instance", "create").Override(instanceCreateBuilder) cmds.MustFind("rdb", "instance", "clone").Override(instanceCloneBuilder) cmds.MustFind("rdb", "instance", "create").Override(instanceCreateBuilder) - cmds.MustFind("rdb", "instance", "upgrade").Override(instanceUpgradeBuilder) cmds.MustFind("rdb", "engine", "list").Override(engineListBuilder) diff --git a/internal/namespaces/rdb/v1/custom_backup_create.go b/internal/namespaces/rdb/v1/custom_backup_create.go new file mode 100644 index 0000000000..6779699915 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_backup_create.go @@ -0,0 +1,23 @@ +package rdb + +import ( + "context" + + "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-sdk-go/api/rdb/v1" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +func backupCreateBuilder(c *core.Command) *core.Command { + c.WaitFunc = func(ctx context.Context, argsI, respI interface{}) (interface{}, error) { + api := rdb.NewAPI(core.ExtractClient(ctx)) + return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ + DatabaseBackupID: argsI.(*rdb.WaitForDatabaseBackupRequest).DatabaseBackupID, + Region: respI.(*rdb.WaitForDatabaseBackupRequest).Region, + Timeout: scw.TimeDurationPtr(backupActionTimeout), + RetryInterval: core.DefaultRetryInterval, + }) + } + + return c +} diff --git a/internal/namespaces/rdb/v1/custom_backup_create_test.go b/internal/namespaces/rdb/v1/custom_backup_create_test.go new file mode 100644 index 0000000000..6143790f00 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_backup_create_test.go @@ -0,0 +1,24 @@ +package rdb + +import ( + "fmt" + "testing" + + "github.com/scaleway/scaleway-cli/internal/core" +) + +func Test_CreateBackup(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + BeforeFunc: core.ExecStoreBeforeCmd( + "Instance", + fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), + ), + Cmd: "scw rdb backup create instance-id={{ .Instance.ID }} --wait", + Check: core.TestCheckGolden(), + AfterFunc: core.AfterFuncCombine( + core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), + core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), + ), + })) +} From 9087812b7c5c9eb7625cc379c216dc7e58b0af7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 7 Jul 2020 17:57:26 +0200 Subject: [PATCH 04/14] Fix --- .../rdb/v1/custom_backup_create_test.go | 2 +- .../test-create-backup-simple.cassette.yaml | 521 ++++++++++++++++++ .../testdata/test-create-backup-simple.golden | 31 ++ 3 files changed, 553 insertions(+), 1 deletion(-) create mode 100644 internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml create mode 100644 internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden diff --git a/internal/namespaces/rdb/v1/custom_backup_create_test.go b/internal/namespaces/rdb/v1/custom_backup_create_test.go index 6143790f00..f8eba9a7be 100644 --- a/internal/namespaces/rdb/v1/custom_backup_create_test.go +++ b/internal/namespaces/rdb/v1/custom_backup_create_test.go @@ -14,7 +14,7 @@ func Test_CreateBackup(t *testing.T) { "Instance", fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), ), - Cmd: "scw rdb backup create instance-id={{ .Instance.ID }} --wait", + Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} --wait", Check: core.TestCheckGolden(), AfterFunc: core.AfterFuncCombine( core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml new file mode 100644 index 0000000000..88aa9058de --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml @@ -0,0 +1,521 @@ +--- +version: 1 +interactions: +- request: + body: '{"organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-test","engine":"PostgreSQL-12","user_name":"foobar","password":"{4xdl*#QOoP+\u00263XRkGA)]","node_type":"db-dev-s","is_ha_cluster":false,"disable_backup":false,"tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances + method: POST + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:42:02 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1adc18ee-e014-4e0a-a0b7-67aba274eff9 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:42:02 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a04ca80d-f4db-4a8f-93b4-e898b727d862 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:42:17 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e0fe4dca-7e12-4346-8a99-fa097f901a96 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:42:32 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bcb114cf-9923-4080-b703-bc3b9673b44a + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:42:47 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7926a67b-43aa-4723-971d-171c7151927f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:43:02 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 569dd671-cf92-4210-81d2-b2d1efaae582 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:43:17 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 10655bec-dd63-4a89-aa74-6d429912c504 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:43:32 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1c18a54b-4436-4e79-bdd6-35fc32c2a2c5 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:43:47 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d5b952f7-f68b-4eef-9555-5a5bca1f699b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:44:03 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 224b9a39-4e15-4fd9-89d7-403912e31d90 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:44:18 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - deec88bc-afc6-42d2-b494-e061b7e15146 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:44:33 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d8deb9b7-52ea-4ecf-865f-0383d6d893fd + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:44:48 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 68bc3ab5-5898-494d-8ebf-74a4656fdb84 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: GET + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.159.26.223","port":22400,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "743" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:45:03 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f02d4c97-67a3-4ca0-9151-0c11522cbaeb + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"instance_id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","database_name":"","name":"","expires_at":"0001-01-01T00:00:00Z"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/backups + method: POST + response: + body: '{"details":[{"argument_name":"name","help_message":"length must be at least: + 1","reason":"constraint"},{"argument_name":"expires_at.seconds","help_message":"must + be a valid timestamp","reason":"unknown"}],"message":"invalid argument(s)","type":"invalid_arguments"}' + headers: + Content-Length: + - "264" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:45:04 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0eea4fce-09cd-482b-bf4e-05c7d7e3faf4 + status: 400 Bad Request + code: 400 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + method: DELETE + response: + body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.159.26.223","port":22400,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + headers: + Content-Length: + - "745" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 07 Jul 2020 15:45:04 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c2bcd506-3ad3-4fe2-9aac-6a1e783e0206 + status: 200 OK + code: 200 + duration: "" diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden new file mode 100644 index 0000000000..76086b7629 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden @@ -0,0 +1,31 @@ +🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Invalid arguments 'name', 'expires_at.seconds' + +Details: +- 'name' does not respect constraints +- 'expires_at.seconds' is invalid for unexpected reasons + +Hint: +Length must be at least: 1 +must be a valid timestamp +πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯ +{ + "message": "invalid arguments 'name', 'expires_at.seconds'", + "error": { + "details": [ + { + "argument_name": "name", + "reason": "constraint", + "help_message": "length must be at least: 1" + }, + { + "argument_name": "expires_at.seconds", + "reason": "unknown", + "help_message": "must be a valid timestamp" + } + ] + }, + "details": "- 'name' does not respect constraints\n- 'expires_at.seconds' is invalid for unexpected reasons", + "hint": "length must be at least: 1\nmust be a valid timestamp" +} From 40de62f00d35a0e3a5092d695ac15085f845729a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 10 Jul 2020 14:54:05 +0200 Subject: [PATCH 05/14] FIx --- cmd/scw/testdata/test-all-usage-rdb-backup-create-usage.golden | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/scw/testdata/test-all-usage-rdb-backup-create-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-backup-create-usage.golden index 64b3d3e07e..5f2c0f7cef 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-backup-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-backup-create-usage.golden @@ -14,6 +14,7 @@ ARGS: FLAGS: -h, --help help for create + -w, --wait wait until the backup is ready GLOBAL FLAGS: -c, --config string The path to the config file From cad2500099daae6241fefa95383c38623e8ed4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 10 Jul 2020 15:15:18 +0200 Subject: [PATCH 06/14] FIx --- .../rdb/v1/custom_backup_create_test.go | 54 ++++ .../test-create-backup-simple.cassette.yaml | 300 +++++++++++++----- .../testdata/test-create-backup-simple.golden | 33 +- 3 files changed, 290 insertions(+), 97 deletions(-) diff --git a/internal/namespaces/rdb/v1/custom_backup_create_test.go b/internal/namespaces/rdb/v1/custom_backup_create_test.go index f8eba9a7be..623508151f 100644 --- a/internal/namespaces/rdb/v1/custom_backup_create_test.go +++ b/internal/namespaces/rdb/v1/custom_backup_create_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-sdk-go/scw" ) func Test_CreateBackup(t *testing.T) { @@ -20,5 +21,58 @@ func Test_CreateBackup(t *testing.T) { core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), ), + DefaultRegion: scw.RegionNlAms, + })) +} + +func Test_RestoreBackup(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + BeforeFunc: core.BeforeFuncCombine( + core.ExecStoreBeforeCmd( + "Instance", + fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), + ), + core.ExecStoreBeforeCmd( + "Backup", + "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} --wait", + ), + ), + Cmd: "scw rdb backup restore ={{ .Instance.ID }} --wait", + Check: core.TestCheckCombine( + core.TestCheckGolden(), + core.TestCheckExitCode(0), + ), + AfterFunc: core.AfterFuncCombine( + core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), + core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), + ), + DefaultRegion: scw.RegionNlAms, + })) +} + +func Test_ExportBackup(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + BeforeFunc: core.BeforeFuncCombine( + core.ExecStoreBeforeCmd( + "Instance", + fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), + ), + core.ExecStoreBeforeCmd( + "Backup", + "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} --wait", + ), + ), + Cmd: "scw rdb backup export ={{ .Instance.ID }} --wait", + Check: core.TestCheckCombine( + core.TestCheckGolden(), + core.TestCheckExitCode(0), + ), + AfterFunc: core.AfterFuncCombine( + core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), + core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), + ), + DefaultRegion: scw.RegionNlAms, })) } diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml index 88aa9058de..31426600ef 100644 --- a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml @@ -9,10 +9,10 @@ interactions: - application/json User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances method: POST response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -21,7 +21,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:42:02 GMT + - Fri, 10 Jul 2020 13:06:28 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -31,7 +31,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1adc18ee-e014-4e0a-a0b7-67aba274eff9 + - fa9c713d-c9fb-4b2a-832a-cfe20896282b status: 200 OK code: 200 duration: "" @@ -41,10 +41,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -53,7 +53,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:42:02 GMT + - Fri, 10 Jul 2020 13:06:28 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -63,7 +63,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a04ca80d-f4db-4a8f-93b4-e898b727d862 + - 516077af-546c-433a-a2bf-8cf96afcec75 status: 200 OK code: 200 duration: "" @@ -73,10 +73,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -85,7 +85,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:42:17 GMT + - Fri, 10 Jul 2020 13:06:43 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -95,7 +95,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e0fe4dca-7e12-4346-8a99-fa097f901a96 + - dcd8963a-d8e2-4b0e-ba4b-e65675c4af58 status: 200 OK code: 200 duration: "" @@ -105,10 +105,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -117,7 +117,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:42:32 GMT + - Fri, 10 Jul 2020 13:06:58 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -127,7 +127,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - bcb114cf-9923-4080-b703-bc3b9673b44a + - f48b1629-16b1-404c-8891-1d18e6ce6849 status: 200 OK code: 200 duration: "" @@ -137,10 +137,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -149,7 +149,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:42:47 GMT + - Fri, 10 Jul 2020 13:07:13 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -159,7 +159,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 7926a67b-43aa-4723-971d-171c7151927f + - a99f6b2e-19f5-491c-87b5-5a9e570ec707 status: 200 OK code: 200 duration: "" @@ -169,10 +169,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -181,7 +181,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:43:02 GMT + - Fri, 10 Jul 2020 13:07:28 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -191,7 +191,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 569dd671-cf92-4210-81d2-b2d1efaae582 + - 932d2f4e-d957-4d5f-b3e4-eae78e89c68c status: 200 OK code: 200 duration: "" @@ -201,10 +201,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -213,7 +213,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:43:17 GMT + - Fri, 10 Jul 2020 13:07:44 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -223,7 +223,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 10655bec-dd63-4a89-aa74-6d429912c504 + - 808d204b-1502-4a2c-bb0a-649d0596c3db status: 200 OK code: 200 duration: "" @@ -233,10 +233,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -245,7 +245,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:43:32 GMT + - Fri, 10 Jul 2020 13:07:58 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -255,7 +255,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1c18a54b-4436-4e79-bdd6-35fc32c2a2c5 + - f1809aa5-944f-4734-93ec-2514051b2891 status: 200 OK code: 200 duration: "" @@ -265,10 +265,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -277,7 +277,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:43:47 GMT + - Fri, 10 Jul 2020 13:08:13 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -287,7 +287,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - d5b952f7-f68b-4eef-9555-5a5bca1f699b + - 90f73472-9920-4f6d-8d06-bf04bdac0622 status: 200 OK code: 200 duration: "" @@ -297,10 +297,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -309,7 +309,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:44:03 GMT + - Fri, 10 Jul 2020 13:08:29 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -319,7 +319,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 224b9a39-4e15-4fd9-89d7-403912e31d90 + - 2b4dae24-4de8-4300-a922-9aa7d781f888 status: 200 OK code: 200 duration: "" @@ -329,10 +329,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -341,7 +341,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:44:18 GMT + - Fri, 10 Jul 2020 13:08:44 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -351,7 +351,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - deec88bc-afc6-42d2-b494-e061b7e15146 + - fbc964fc-97fd-4aaf-b3d6-c53fd4bb356e status: 200 OK code: 200 duration: "" @@ -361,10 +361,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -373,7 +373,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:44:33 GMT + - Fri, 10 Jul 2020 13:08:59 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -383,7 +383,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - d8deb9b7-52ea-4ecf-865f-0383d6d893fd + - a18d1934-40f8-482d-9e86-9ed99e5d05e0 status: 200 OK code: 200 duration: "" @@ -393,10 +393,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -405,7 +405,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:44:48 GMT + - Fri, 10 Jul 2020 13:09:14 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -415,7 +415,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 68bc3ab5-5898-494d-8ebf-74a4656fdb84 + - aafedc1e-48d5-4b85-a313-a3addf828b2f status: 200 OK code: 200 duration: "" @@ -425,19 +425,19 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: GET response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.159.26.223","port":22400,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - - "743" + - "443" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:45:03 GMT + - Fri, 10 Jul 2020 13:09:29 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -447,33 +447,125 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f02d4c97-67a3-4ca0-9151-0c11522cbaeb + - aeaa9cbe-6977-461b-8240-21baf1c28859 status: 200 OK code: 200 duration: "" - request: - body: '{"instance_id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","database_name":"","name":"","expires_at":"0001-01-01T00:00:00Z"}' + body: "" form: {} headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + method: GET + response: + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json + Date: + - Fri, 10 Jul 2020 13:09:45 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1b88b757-2f92-4abf-95b3-e10c6b6bb811 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/backups - method: POST + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + method: GET + response: + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 10 Jul 2020 13:10:00 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 990e3cf4-df55-47c9-b21b-dee6405e0cbd + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + method: GET + response: + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 10 Jul 2020 13:10:15 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b82d54b6-35d8-49a4-943a-8f15c82d70fb + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + method: GET response: - body: '{"details":[{"argument_name":"name","help_message":"length must be at least: - 1","reason":"constraint"},{"argument_name":"expires_at.seconds","help_message":"must - be a valid timestamp","reason":"unknown"}],"message":"invalid argument(s)","type":"invalid_arguments"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - - "264" + - "443" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:45:04 GMT + - Fri, 10 Jul 2020 13:10:30 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -483,9 +575,73 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0eea4fce-09cd-482b-bf4e-05c7d7e3faf4 - status: 400 Bad Request - code: 400 + - 295ded68-a016-44b7-8a59-40bec7c7e4d4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + method: GET + response: + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 10 Jul 2020 13:10:45 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0101a0f8-e6a4-4d8c-8812-26163b986987 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + method: GET + response: + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.131.36","port":46746,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + headers: + Content-Length: + - "743" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 10 Jul 2020 13:11:00 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c21af3d5-543e-4f88-9772-2964caebbfbc + status: 200 OK + code: 200 duration: "" - request: body: "" @@ -493,10 +649,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/fr-par/instances/af23257f-1ee8-45b9-a20c-0f2bc8a806be + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 method: DELETE response: - body: '{"id":"af23257f-1ee8-45b9-a20c-0f2bc8a806be","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.159.26.223","port":22400,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-07T15:42:01.777836Z","region":"fr-par"}' + body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.131.36","port":46746,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' headers: Content-Length: - "745" @@ -505,7 +661,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 07 Jul 2020 15:45:04 GMT + - Fri, 10 Jul 2020 13:11:01 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -515,7 +671,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - c2bcd506-3ad3-4fe2-9aac-6a1e783e0206 + - 6aa424d6-bd1a-4754-8c60-ced101b146e8 status: 200 OK code: 200 duration: "" diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden index 76086b7629..2c705eb43e 100644 --- a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden @@ -1,31 +1,14 @@ 🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Invalid arguments 'name', 'expires_at.seconds' - -Details: -- 'name' does not respect constraints -- 'expires_at.seconds' is invalid for unexpected reasons - -Hint: -Length must be at least: 1 -must be a valid timestamp +Cannot unmarshal arg 'expires-at=2999-01-02T15:04:05-0700': missing field name for type time.Time πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯ { - "message": "invalid arguments 'name', 'expires_at.seconds'", + "message": "cannot unmarshal arg 'expires-at=2999-01-02T15:04:05-0700': missing field name for type time.Time", "error": { - "details": [ - { - "argument_name": "name", - "reason": "constraint", - "help_message": "length must be at least: 1" - }, - { - "argument_name": "expires_at.seconds", - "reason": "unknown", - "help_message": "must be a valid timestamp" - } - ] - }, - "details": "- 'name' does not respect constraints\n- 'expires_at.seconds' is invalid for unexpected reasons", - "hint": "length must be at least: 1\nmust be a valid timestamp" + "ArgName": "expires-at", + "ArgValue": "2999-01-02T15:04:05-0700", + "Err": { + "Dest": "0001-01-01T00:00:00Z" + } + } } From 6c18417a461755c391aca33f1204eb62a17233d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 10 Jul 2020 15:16:28 +0200 Subject: [PATCH 07/14] Fix --- .../v1/{custom_backup_create_test.go => custom_backup_test.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename internal/namespaces/rdb/v1/{custom_backup_create_test.go => custom_backup_test.go} (100%) diff --git a/internal/namespaces/rdb/v1/custom_backup_create_test.go b/internal/namespaces/rdb/v1/custom_backup_test.go similarity index 100% rename from internal/namespaces/rdb/v1/custom_backup_create_test.go rename to internal/namespaces/rdb/v1/custom_backup_test.go From b878c83a981cc251585bdcf62748b4b5d1eb1280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 10 Jul 2020 15:27:48 +0200 Subject: [PATCH 08/14] Fix --- internal/namespaces/rdb/v1/custom_backup.go | 14 +++++++++++ .../namespaces/rdb/v1/custom_backup_create.go | 23 ------------------- 2 files changed, 14 insertions(+), 23 deletions(-) delete mode 100644 internal/namespaces/rdb/v1/custom_backup_create.go diff --git a/internal/namespaces/rdb/v1/custom_backup.go b/internal/namespaces/rdb/v1/custom_backup.go index 4523a0eaa6..849a4302ae 100644 --- a/internal/namespaces/rdb/v1/custom_backup.go +++ b/internal/namespaces/rdb/v1/custom_backup.go @@ -53,3 +53,17 @@ func backupWaitCommand() *core.Command { }, } } + +func backupCreateBuilder(c *core.Command) *core.Command { + c.WaitFunc = func(ctx context.Context, argsI, respI interface{}) (interface{}, error) { + api := rdb.NewAPI(core.ExtractClient(ctx)) + return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ + DatabaseBackupID: argsI.(*rdb.WaitForDatabaseBackupRequest).DatabaseBackupID, + Region: respI.(*rdb.WaitForDatabaseBackupRequest).Region, + Timeout: scw.TimeDurationPtr(backupActionTimeout), + RetryInterval: core.DefaultRetryInterval, + }) + } + + return c +} diff --git a/internal/namespaces/rdb/v1/custom_backup_create.go b/internal/namespaces/rdb/v1/custom_backup_create.go deleted file mode 100644 index 6779699915..0000000000 --- a/internal/namespaces/rdb/v1/custom_backup_create.go +++ /dev/null @@ -1,23 +0,0 @@ -package rdb - -import ( - "context" - - "github.com/scaleway/scaleway-cli/internal/core" - "github.com/scaleway/scaleway-sdk-go/api/rdb/v1" - "github.com/scaleway/scaleway-sdk-go/scw" -) - -func backupCreateBuilder(c *core.Command) *core.Command { - c.WaitFunc = func(ctx context.Context, argsI, respI interface{}) (interface{}, error) { - api := rdb.NewAPI(core.ExtractClient(ctx)) - return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ - DatabaseBackupID: argsI.(*rdb.WaitForDatabaseBackupRequest).DatabaseBackupID, - Region: respI.(*rdb.WaitForDatabaseBackupRequest).Region, - Timeout: scw.TimeDurationPtr(backupActionTimeout), - RetryInterval: core.DefaultRetryInterval, - }) - } - - return c -} From 0026e8ac7fdacbd2d2e3fa75c6b30b0c050268d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 13 Jul 2020 15:29:59 +0200 Subject: [PATCH 09/14] Fix --- internal/namespaces/rdb/v1/custom_backup.go | 7 +- .../namespaces/rdb/v1/custom_backup_test.go | 6 +- .../test-create-backup-simple.cassette.yaml | 316 ++++-------------- 3 files changed, 70 insertions(+), 259 deletions(-) diff --git a/internal/namespaces/rdb/v1/custom_backup.go b/internal/namespaces/rdb/v1/custom_backup.go index 849a4302ae..9d8c17ec18 100644 --- a/internal/namespaces/rdb/v1/custom_backup.go +++ b/internal/namespaces/rdb/v1/custom_backup.go @@ -55,12 +55,13 @@ func backupWaitCommand() *core.Command { } func backupCreateBuilder(c *core.Command) *core.Command { + timeout := backupActionTimeout c.WaitFunc = func(ctx context.Context, argsI, respI interface{}) (interface{}, error) { api := rdb.NewAPI(core.ExtractClient(ctx)) return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ - DatabaseBackupID: argsI.(*rdb.WaitForDatabaseBackupRequest).DatabaseBackupID, - Region: respI.(*rdb.WaitForDatabaseBackupRequest).Region, - Timeout: scw.TimeDurationPtr(backupActionTimeout), + DatabaseBackupID: respI.(*rdb.DatabaseBackup).ID, + Region: respI.(*rdb.DatabaseBackup).Region, + Timeout: &timeout, RetryInterval: core.DefaultRetryInterval, }) } diff --git a/internal/namespaces/rdb/v1/custom_backup_test.go b/internal/namespaces/rdb/v1/custom_backup_test.go index 623508151f..bf1a22fb5b 100644 --- a/internal/namespaces/rdb/v1/custom_backup_test.go +++ b/internal/namespaces/rdb/v1/custom_backup_test.go @@ -15,7 +15,7 @@ func Test_CreateBackup(t *testing.T) { "Instance", fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), ), - Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} --wait", + Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", Check: core.TestCheckGolden(), AfterFunc: core.AfterFuncCombine( core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), @@ -35,7 +35,7 @@ func Test_RestoreBackup(t *testing.T) { ), core.ExecStoreBeforeCmd( "Backup", - "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} --wait", + "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} database-name=rdb --wait", ), ), Cmd: "scw rdb backup restore ={{ .Instance.ID }} --wait", @@ -61,7 +61,7 @@ func Test_ExportBackup(t *testing.T) { ), core.ExecStoreBeforeCmd( "Backup", - "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} --wait", + "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} database-name=rdb --wait", ), ), Cmd: "scw rdb backup export ={{ .Instance.ID }} --wait", diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml index 31426600ef..c3a1ed6090 100644 --- a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml @@ -12,7 +12,7 @@ interactions: url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances method: POST response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -21,7 +21,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:06:28 GMT + - Mon, 13 Jul 2020 13:12:56 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -31,7 +31,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - fa9c713d-c9fb-4b2a-832a-cfe20896282b + - 8eab0fbd-bc7c-481a-8c2e-790509cf63a5 status: 200 OK code: 200 duration: "" @@ -41,10 +41,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -53,7 +53,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:06:28 GMT + - Mon, 13 Jul 2020 13:12:56 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -63,7 +63,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 516077af-546c-433a-a2bf-8cf96afcec75 + - b94461c6-c6c3-4aa5-9654-ca01bd884991 status: 200 OK code: 200 duration: "" @@ -73,10 +73,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -85,7 +85,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:06:43 GMT + - Mon, 13 Jul 2020 13:13:11 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -95,7 +95,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - dcd8963a-d8e2-4b0e-ba4b-e65675c4af58 + - d7f372a3-76c7-4611-8d58-6f352d1f5919 status: 200 OK code: 200 duration: "" @@ -105,10 +105,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -117,7 +117,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:06:58 GMT + - Mon, 13 Jul 2020 13:13:26 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -127,7 +127,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f48b1629-16b1-404c-8891-1d18e6ce6849 + - 777c576c-d57b-4e4d-8c9c-0c306b3d4c78 status: 200 OK code: 200 duration: "" @@ -137,10 +137,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -149,7 +149,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:07:13 GMT + - Mon, 13 Jul 2020 13:13:42 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -159,7 +159,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a99f6b2e-19f5-491c-87b5-5a9e570ec707 + - b568ce6f-9c86-4e88-9685-29e573b93707 status: 200 OK code: 200 duration: "" @@ -169,10 +169,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -181,7 +181,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:07:28 GMT + - Mon, 13 Jul 2020 13:13:57 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -191,7 +191,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 932d2f4e-d957-4d5f-b3e4-eae78e89c68c + - 1056a0b3-0dec-48f9-bbf9-844d8871e5eb status: 200 OK code: 200 duration: "" @@ -201,10 +201,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -213,7 +213,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:07:44 GMT + - Mon, 13 Jul 2020 13:14:12 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -223,7 +223,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 808d204b-1502-4a2c-bb0a-649d0596c3db + - a48f453a-d498-4142-9508-7b4335b4a603 status: 200 OK code: 200 duration: "" @@ -233,10 +233,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -245,7 +245,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:07:58 GMT + - Mon, 13 Jul 2020 13:14:27 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -255,7 +255,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f1809aa5-944f-4734-93ec-2514051b2891 + - 537944ba-5cc5-495d-91bd-6c4889153393 status: 200 OK code: 200 duration: "" @@ -265,10 +265,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -277,7 +277,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:08:13 GMT + - Mon, 13 Jul 2020 13:14:42 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -287,7 +287,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 90f73472-9920-4f6d-8d06-bf04bdac0622 + - a16b8a13-3b83-4114-a0b9-8ca56e2158e7 status: 200 OK code: 200 duration: "" @@ -297,10 +297,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -309,7 +309,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:08:29 GMT + - Mon, 13 Jul 2020 13:14:57 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -319,7 +319,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 2b4dae24-4de8-4300-a922-9aa7d781f888 + - c73221b9-00c9-4f70-b2aa-ad9df590dc45 status: 200 OK code: 200 duration: "" @@ -329,10 +329,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -341,7 +341,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:08:44 GMT + - Mon, 13 Jul 2020 13:15:12 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -351,7 +351,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - fbc964fc-97fd-4aaf-b3d6-c53fd4bb356e + - 9f34ad0e-bc66-445c-b0f0-84920870d0d0 status: 200 OK code: 200 duration: "" @@ -361,10 +361,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -373,7 +373,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:08:59 GMT + - Mon, 13 Jul 2020 13:15:27 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -383,7 +383,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a18d1934-40f8-482d-9e86-9ed99e5d05e0 + - 95ebe288-e8fc-4b91-8dd9-10220d022cef status: 200 OK code: 200 duration: "" @@ -393,10 +393,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -405,7 +405,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:09:14 GMT + - Mon, 13 Jul 2020 13:15:42 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -415,7 +415,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - aafedc1e-48d5-4b85-a313-a3addf828b2f + - ad728217-1d7d-401c-be17-43dd0cf361a7 status: 200 OK code: 200 duration: "" @@ -425,179 +425,19 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 method: GET response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.128.5","port":41951,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' headers: Content-Length: - - "443" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Fri, 10 Jul 2020 13:09:29 GMT - Server: - - agw_listener_public_vip - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - aeaa9cbe-6977-461b-8240-21baf1c28859 - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: GET - response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' - headers: - Content-Length: - - "443" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Fri, 10 Jul 2020 13:09:45 GMT - Server: - - agw_listener_public_vip - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 1b88b757-2f92-4abf-95b3-e10c6b6bb811 - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: GET - response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' - headers: - Content-Length: - - "443" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Fri, 10 Jul 2020 13:10:00 GMT - Server: - - agw_listener_public_vip - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 990e3cf4-df55-47c9-b21b-dee6405e0cbd - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: GET - response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' - headers: - Content-Length: - - "443" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Fri, 10 Jul 2020 13:10:15 GMT - Server: - - agw_listener_public_vip - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - b82d54b6-35d8-49a4-943a-8f15c82d70fb - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: GET - response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' - headers: - Content-Length: - - "443" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Fri, 10 Jul 2020 13:10:30 GMT - Server: - - agw_listener_public_vip - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 295ded68-a016-44b7-8a59-40bec7c7e4d4 - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: GET - response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' - headers: - Content-Length: - - "443" + - "742" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:10:45 GMT + - Mon, 13 Jul 2020 13:15:58 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -607,61 +447,31 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0101a0f8-e6a4-4d8c-8812-26163b986987 + - fbe09208-b565-493f-926b-be45a4bc273b status: 200 OK code: 200 duration: "" - request: - body: "" + body: '{"instance_id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","database_name":"rdb","name":"foobar","expires_at":"2999-01-02T15:04:05-07:00"}' form: {} headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: GET - response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.131.36","port":46746,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' - headers: - Content-Length: - - "743" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json - Date: - - Fri, 10 Jul 2020 13:11:00 GMT - Server: - - agw_listener_public_vip - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - c21af3d5-543e-4f88-9772-2964caebbfbc - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/ea500aad-424b-4f84-8bf9-5426d33157c5 - method: DELETE + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups + method: POST response: - body: '{"id":"ea500aad-424b-4f84-8bf9-5426d33157c5","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.131.36","port":46746,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-10T13:06:27.780427Z","region":"nl-ams"}' + body: '{"id":"05d79124-9a77-4721-8e77-6ca8c4c5bbc2","instance_id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T13:15:59.393873Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' headers: Content-Length: - - "745" + - "361" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Fri, 10 Jul 2020 13:11:01 GMT + - Mon, 13 Jul 2020 13:15:59 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -671,7 +481,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6aa424d6-bd1a-4754-8c60-ced101b146e8 + - 95bcd98c-94c5-4aff-98e3-0a9a4c16cf33 status: 200 OK code: 200 duration: "" From c9dbfb693eaebc31b2dbc8917f356adb9a5dc87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 13 Jul 2020 16:30:49 +0200 Subject: [PATCH 10/14] FIx --- internal/namespaces/rdb/v1/custom.go | 2 + internal/namespaces/rdb/v1/custom_backup.go | 30 + .../namespaces/rdb/v1/custom_backup_test.go | 33 +- .../test-create-backup-simple.cassette.yaml | 280 +++++-- .../testdata/test-create-backup-simple.golden | 40 +- .../test-export-backup-simple.cassette.yaml | 649 +++++++++++++++ .../testdata/test-export-backup-simple.golden | 31 + .../test-restore-backup-simple.cassette.yaml | 777 ++++++++++++++++++ .../test-restore-backup-simple.golden | 30 + 9 files changed, 1792 insertions(+), 80 deletions(-) create mode 100644 internal/namespaces/rdb/v1/testdata/test-export-backup-simple.cassette.yaml create mode 100644 internal/namespaces/rdb/v1/testdata/test-export-backup-simple.golden create mode 100644 internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.cassette.yaml create mode 100644 internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.golden diff --git a/internal/namespaces/rdb/v1/custom.go b/internal/namespaces/rdb/v1/custom.go index 70012129f6..6727dfd2d5 100644 --- a/internal/namespaces/rdb/v1/custom.go +++ b/internal/namespaces/rdb/v1/custom.go @@ -30,6 +30,8 @@ func GetCommands() *core.Commands { backupWaitCommand(), )) cmds.MustFind("rdb", "backup", "create").Override(backupCreateBuilder) + cmds.MustFind("rdb", "backup", "export").Override(backupExportBuilder) + cmds.MustFind("rdb", "backup", "restore").Override(backupRestoreBuilder) cmds.MustFind("rdb", "instance", "create").Override(instanceCreateBuilder) cmds.MustFind("rdb", "instance", "clone").Override(instanceCloneBuilder) diff --git a/internal/namespaces/rdb/v1/custom_backup.go b/internal/namespaces/rdb/v1/custom_backup.go index 9d8c17ec18..42d23c2784 100644 --- a/internal/namespaces/rdb/v1/custom_backup.go +++ b/internal/namespaces/rdb/v1/custom_backup.go @@ -68,3 +68,33 @@ func backupCreateBuilder(c *core.Command) *core.Command { return c } + +func backupExportBuilder(c *core.Command) *core.Command { + timeout := backupActionTimeout + c.WaitFunc = func(ctx context.Context, argsI, respI interface{}) (interface{}, error) { + api := rdb.NewAPI(core.ExtractClient(ctx)) + return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ + DatabaseBackupID: respI.(*rdb.DatabaseBackup).ID, + Region: respI.(*rdb.DatabaseBackup).Region, + Timeout: &timeout, + RetryInterval: core.DefaultRetryInterval, + }) + } + + return c +} + +func backupRestoreBuilder(c *core.Command) *core.Command { + timeout := backupActionTimeout + c.WaitFunc = func(ctx context.Context, argsI, respI interface{}) (interface{}, error) { + api := rdb.NewAPI(core.ExtractClient(ctx)) + return api.WaitForDatabaseBackup(&rdb.WaitForDatabaseBackupRequest{ + DatabaseBackupID: respI.(*rdb.DatabaseBackup).ID, + Region: respI.(*rdb.DatabaseBackup).Region, + Timeout: &timeout, + RetryInterval: core.DefaultRetryInterval, + }) + } + + return c +} diff --git a/internal/namespaces/rdb/v1/custom_backup_test.go b/internal/namespaces/rdb/v1/custom_backup_test.go index bf1a22fb5b..6c6cc14bbf 100644 --- a/internal/namespaces/rdb/v1/custom_backup_test.go +++ b/internal/namespaces/rdb/v1/custom_backup_test.go @@ -3,6 +3,7 @@ package rdb import ( "fmt" "testing" + "time" "github.com/scaleway/scaleway-cli/internal/core" "github.com/scaleway/scaleway-sdk-go/scw" @@ -11,10 +12,16 @@ import ( func Test_CreateBackup(t *testing.T) { t.Run("Simple", core.Test(&core.TestConfig{ Commands: GetCommands(), - BeforeFunc: core.ExecStoreBeforeCmd( - "Instance", - fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), - ), + BeforeFunc: core.BeforeFuncCombine( + core.ExecStoreBeforeCmd( + "Instance", + fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), + ), + // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. + func(ctx *core.BeforeFuncCtx) error { + time.Sleep(1 * time.Minute) + return nil + }), Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", Check: core.TestCheckGolden(), AfterFunc: core.AfterFuncCombine( @@ -33,12 +40,17 @@ func Test_RestoreBackup(t *testing.T) { "Instance", fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), ), + // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. + func(ctx *core.BeforeFuncCtx) error { + time.Sleep(1 * time.Minute) + return nil + }, core.ExecStoreBeforeCmd( "Backup", - "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} database-name=rdb --wait", + "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", ), ), - Cmd: "scw rdb backup restore ={{ .Instance.ID }} --wait", + Cmd: "scw rdb backup restore {{ .Backup.ID }} instance-id={{ .Instance.ID }} --wait", Check: core.TestCheckCombine( core.TestCheckGolden(), core.TestCheckExitCode(0), @@ -59,12 +71,17 @@ func Test_ExportBackup(t *testing.T) { "Instance", fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), ), + // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. + func(ctx *core.BeforeFuncCtx) error { + time.Sleep(1 * time.Minute) + return nil + }, core.ExecStoreBeforeCmd( "Backup", - "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-0700 instance-id={{ .Instance.ID }} database-name=rdb --wait", + "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", ), ), - Cmd: "scw rdb backup export ={{ .Instance.ID }} --wait", + Cmd: "scw rdb backup export {{ .Backup.ID }} --wait", Check: core.TestCheckCombine( core.TestCheckGolden(), core.TestCheckExitCode(0), diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml index c3a1ed6090..80d8fafa36 100644 --- a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml @@ -12,7 +12,7 @@ interactions: url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances method: POST response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -21,7 +21,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:12:56 GMT + - Mon, 13 Jul 2020 13:46:17 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -31,7 +31,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 8eab0fbd-bc7c-481a-8c2e-790509cf63a5 + - be9a918a-b86a-4e45-8f7f-477d76df2302 status: 200 OK code: 200 duration: "" @@ -41,10 +41,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -53,7 +53,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:12:56 GMT + - Mon, 13 Jul 2020 13:46:17 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -63,7 +63,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b94461c6-c6c3-4aa5-9654-ca01bd884991 + - 616bfb56-7317-411d-a699-738a2a17537b status: 200 OK code: 200 duration: "" @@ -73,10 +73,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -85,7 +85,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:13:11 GMT + - Mon, 13 Jul 2020 13:46:32 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -95,7 +95,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - d7f372a3-76c7-4611-8d58-6f352d1f5919 + - 53ea404c-02fd-490c-8456-591f4d758a38 status: 200 OK code: 200 duration: "" @@ -105,10 +105,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -117,7 +117,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:13:26 GMT + - Mon, 13 Jul 2020 13:46:48 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -127,7 +127,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 777c576c-d57b-4e4d-8c9c-0c306b3d4c78 + - d5b00c7e-90be-4602-a3a4-632a7ce958b2 status: 200 OK code: 200 duration: "" @@ -137,10 +137,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -149,7 +149,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:13:42 GMT + - Mon, 13 Jul 2020 13:47:03 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -159,7 +159,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b568ce6f-9c86-4e88-9685-29e573b93707 + - ac311665-4020-459a-bd5d-24feac8be7ea status: 200 OK code: 200 duration: "" @@ -169,10 +169,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -181,7 +181,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:13:57 GMT + - Mon, 13 Jul 2020 13:47:18 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -191,7 +191,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1056a0b3-0dec-48f9-bbf9-844d8871e5eb + - 0ca24f8a-29e7-427a-a550-dcbd30a41b51 status: 200 OK code: 200 duration: "" @@ -201,10 +201,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -213,7 +213,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:14:12 GMT + - Mon, 13 Jul 2020 13:47:33 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -223,7 +223,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a48f453a-d498-4142-9508-7b4335b4a603 + - 2d327985-144b-40b8-9556-b93432329e7e status: 200 OK code: 200 duration: "" @@ -233,10 +233,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -245,7 +245,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:14:27 GMT + - Mon, 13 Jul 2020 13:47:48 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -255,7 +255,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 537944ba-5cc5-495d-91bd-6c4889153393 + - 1739006e-2e4b-4193-a273-ba2203ccddc1 status: 200 OK code: 200 duration: "" @@ -265,10 +265,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -277,7 +277,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:14:42 GMT + - Mon, 13 Jul 2020 13:48:03 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -287,7 +287,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a16b8a13-3b83-4114-a0b9-8ca56e2158e7 + - 1b7bd8b6-9da8-4578-b1fe-c0b58366aeae status: 200 OK code: 200 duration: "" @@ -297,10 +297,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -309,7 +309,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:14:57 GMT + - Mon, 13 Jul 2020 13:48:18 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -319,7 +319,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - c73221b9-00c9-4f70-b2aa-ad9df590dc45 + - 130ce9dd-82d0-452f-b821-f81fd3a4cd4b status: 200 OK code: 200 duration: "" @@ -329,10 +329,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -341,7 +341,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:15:12 GMT + - Mon, 13 Jul 2020 13:48:33 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -351,7 +351,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 9f34ad0e-bc66-445c-b0f0-84920870d0d0 + - 8716c19d-a0f0-43a1-ba3e-84a23e09521c status: 200 OK code: 200 duration: "" @@ -361,10 +361,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -373,7 +373,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:15:27 GMT + - Mon, 13 Jul 2020 13:48:49 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -383,7 +383,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 95ebe288-e8fc-4b91-8dd9-10220d022cef + - 468e37ca-babd-4650-8d60-bc4a22f011aa status: 200 OK code: 200 duration: "" @@ -393,10 +393,10 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - "443" @@ -405,7 +405,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:15:42 GMT + - Mon, 13 Jul 2020 13:49:04 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -415,7 +415,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - ad728217-1d7d-401c-be17-43dd0cf361a7 + - a707b14b-85cc-4df7-b3d4-86381f7f30ba status: 200 OK code: 200 duration: "" @@ -425,19 +425,51 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test - url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/00a97151-9ecc-4b60-bbcf-da6a4f821590 + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee method: GET response: - body: '{"id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.128.5","port":41951,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:12:55.983025Z","region":"nl-ams"}' + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' headers: Content-Length: - - "742" + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:49:19 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9aa2e341-9516-4b1d-8ed3-f7a343fdd6a4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee + method: GET + response: + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.131.36","port":56328,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' + headers: + Content-Length: + - "743" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:15:58 GMT + - Mon, 13 Jul 2020 13:49:34 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -447,12 +479,12 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - fbe09208-b565-493f-926b-be45a4bc273b + - 1a817d82-b558-42f5-b8e9-98d45149a3fd status: 200 OK code: 200 duration: "" - request: - body: '{"instance_id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","database_name":"rdb","name":"foobar","expires_at":"2999-01-02T15:04:05-07:00"}' + body: '{"instance_id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","database_name":"rdb","name":"foobar","expires_at":"2999-01-02T15:04:05-07:00"}' form: {} headers: Content-Type: @@ -462,7 +494,39 @@ interactions: url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups method: POST response: - body: '{"id":"05d79124-9a77-4721-8e77-6ca8c4c5bbc2","instance_id":"00a97151-9ecc-4b60-bbcf-da6a4f821590","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T13:15:59.393873Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + body: '{"id":"85e874e1-0f45-44de-af05-77db5a2fce50","instance_id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T13:50:35.919508Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "361" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:50:35 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 43692750-4a01-4f55-aa47-d8cc29567b48 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/85e874e1-0f45-44de-af05-77db5a2fce50 + method: GET + response: + body: '{"id":"85e874e1-0f45-44de-af05-77db5a2fce50","instance_id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T13:50:35.919508Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' headers: Content-Length: - "361" @@ -471,7 +535,103 @@ interactions: Content-Type: - application/json Date: - - Mon, 13 Jul 2020 13:15:59 GMT + - Mon, 13 Jul 2020 13:50:36 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1c19600e-8005-49a9-848a-a5ee391e5326 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/85e874e1-0f45-44de-af05-77db5a2fce50 + method: GET + response: + body: '{"id":"85e874e1-0f45-44de-af05-77db5a2fce50","instance_id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","database_name":"rdb","name":"foobar","status":"ready","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T13:50:35.919508Z","updated_at":"2020-07-13T13:50:40.314383Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "383" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:50:51 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 36b53c21-9e2e-4fe0-b8ad-ed0b7c816bdd + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/d3cfe447-5956-4342-9cdb-fcabe07252ee + method: DELETE + response: + body: '{"id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.131.36","port":56328,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T13:46:17.448222Z","region":"nl-ams"}' + headers: + Content-Length: + - "745" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:50:52 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 89d8c65d-0b9a-4c1c-b1fe-75f2c338192a + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/85e874e1-0f45-44de-af05-77db5a2fce50 + method: DELETE + response: + body: '{"id":"85e874e1-0f45-44de-af05-77db5a2fce50","instance_id":"d3cfe447-5956-4342-9cdb-fcabe07252ee","database_name":"rdb","name":"foobar","status":"deleting","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T13:50:35.919508Z","updated_at":"2020-07-13T13:50:40.314383Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "386" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:50:52 GMT Server: - agw_listener_public_vip Strict-Transport-Security: @@ -481,7 +641,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 95bcd98c-94c5-4aff-98e3-0a9a4c16cf33 + - 531ba316-72ac-431c-a68d-de3dd00c7de9 status: 200 OK code: 200 duration: "" diff --git a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden index 2c705eb43e..9c5c1b7f5e 100644 --- a/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden @@ -1,14 +1,30 @@ -🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Cannot unmarshal arg 'expires-at=2999-01-02T15:04:05-0700': missing field name for type time.Time -πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +🟩🟩🟩 STDOUT️ 🟩🟩🟩️ +ID 85e874e1-0f45-44de-af05-77db5a2fce50 +InstanceID d3cfe447-5956-4342-9cdb-fcabe07252ee +DatabaseName rdb +Name foobar +Status ready +Size 2547 +ExpiresAt few seconds ago +CreatedAt few seconds ago +UpdatedAt few seconds ago +InstanceName cli-test +DownloadURLExpiresAt few seconds ago +Region nl-ams +🟩🟩🟩 JSON STDOUT 🟩🟩🟩 { - "message": "cannot unmarshal arg 'expires-at=2999-01-02T15:04:05-0700': missing field name for type time.Time", - "error": { - "ArgName": "expires-at", - "ArgValue": "2999-01-02T15:04:05-0700", - "Err": { - "Dest": "0001-01-01T00:00:00Z" - } - } + "id": "85e874e1-0f45-44de-af05-77db5a2fce50", + "instance_id": "d3cfe447-5956-4342-9cdb-fcabe07252ee", + "database_name": "rdb", + "name": "foobar", + "status": "ready", + "size": 2547, + "expires_at": "2999-01-02T22:04:05Z", + "created_at": "1970-01-01T00:00:00.0Z", + "updated_at": "1970-01-01T00:00:00.0Z", + "instance_name": "cli-test", + "download_url": null, + "download_url_expires_at": "0001-01-01T00:00:00Z", + "region": "nl-ams" } diff --git a/internal/namespaces/rdb/v1/testdata/test-export-backup-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-export-backup-simple.cassette.yaml new file mode 100644 index 0000000000..b8f2971dc3 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-export-backup-simple.cassette.yaml @@ -0,0 +1,649 @@ +--- +version: 1 +interactions: +- request: + body: '{"organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-test","engine":"PostgreSQL-12","user_name":"foobar","password":"{4xdl*#QOoP+\u00263XRkGA)]","node_type":"db-dev-s","is_ha_cluster":false,"disable_backup":false,"tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances + method: POST + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:23 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d0aee2bb-76c8-440e-bd14-6c928fe62b3b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:23 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3feaef12-4e50-4883-b765-4883303f82cc + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:38 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1c499a46-b761-44f9-830e-befc5124050c + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:53 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a90b57b6-b0a9-4206-91cf-c5f1fc1e41c1 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:08 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1b160685-7cac-454b-a717-34c95053c7f8 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:24 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ba4d07c1-8bfb-4c21-8858-961df0fbb399 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:39 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - decc12c8-1108-41dd-b7ed-2d94aa27a563 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:54 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fd52af0e-21d7-49fe-bed0-a7daa70e22a9 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:09 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 761bf449-138e-42e2-8848-229ed212efc7 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:24 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f8ca051a-cf90-49c7-b8be-db81347baf2e + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:39 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3408a484-2262-4aa8-9cd4-60dda5d3bf9f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: GET + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.128.67","port":33321,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "743" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:54 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - db6cdafd-590b-4e8e-8d9a-21bdc69325e7 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","expires_at":"2999-01-02T15:04:05-07:00"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups + method: POST + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "361" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:28:55 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 74cd85b1-4401-441a-bb4f-bdeff51f5de3 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/78908a16-b963-4dd0-a1d8-4d8cc6036161 + method: GET + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "361" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:28:55 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bf61f1ca-c5c8-4b93-902d-1aaaaaf6b525 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/78908a16-b963-4dd0-a1d8-4d8cc6036161 + method: GET + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"ready","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":"2020-07-13T14:28:59.351061Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "383" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:29:10 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - df309ba3-b8c7-44a9-bfeb-e1768bd82dc8 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/78908a16-b963-4dd0-a1d8-4d8cc6036161/export + method: POST + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"exporting","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":"2020-07-13T14:28:59.351061Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "387" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:29:11 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c43ce8e1-0cf0-46d7-b13e-d13b4d56159f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/78908a16-b963-4dd0-a1d8-4d8cc6036161 + method: GET + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"exporting","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":"2020-07-13T14:28:59.351061Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "387" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:29:11 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b57dd286-b4ee-4329-9814-7497cefd5acd + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/78908a16-b963-4dd0-a1d8-4d8cc6036161 + method: GET + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"ready","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":"2020-07-13T14:28:59.351061Z","instance_name":"cli-test","download_url":"http://s3.fr-par.scw.cloud/9f261887-ece6-41b4-8f7a-167ab9c4349f/b740f91b-4c49-41d1-80a7-3be92814e42a/78908a16-b963-4dd0-a1d8-4d8cc6036161.custom?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=SCWG20TH0QXNPZCEZDFH%2F20200713%2Ffr-par%2Fs3%2Faws4_request\u0026X-Amz-Date=20200713T142912Z\u0026X-Amz-Expires=86400\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=e7978f82b922ca470df19e14bc57623f89627fa32ae3d63ce867efaf57ed8bd7","download_url_expires_at":"2020-07-14T14:29:12.711178Z","region":"nl-ams"}' + headers: + Content-Length: + - "840" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:29:27 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2addd503-07b3-4318-8a62-61eee29dbd6e + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/b740f91b-4c49-41d1-80a7-3be92814e42a + method: DELETE + response: + body: '{"id":"b740f91b-4c49-41d1-80a7-3be92814e42a","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.128.67","port":33321,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:22.946902Z","region":"nl-ams"}' + headers: + Content-Length: + - "745" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:29:27 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - dca26d98-e8db-4f49-a257-2d6060abb4ef + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/78908a16-b963-4dd0-a1d8-4d8cc6036161 + method: DELETE + response: + body: '{"id":"78908a16-b963-4dd0-a1d8-4d8cc6036161","instance_id":"b740f91b-4c49-41d1-80a7-3be92814e42a","database_name":"rdb","name":"foobar","status":"deleting","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:28:55.761039Z","updated_at":"2020-07-13T14:28:59.351061Z","instance_name":"cli-test","download_url":"http://s3.fr-par.scw.cloud/9f261887-ece6-41b4-8f7a-167ab9c4349f/b740f91b-4c49-41d1-80a7-3be92814e42a/78908a16-b963-4dd0-a1d8-4d8cc6036161.custom?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=SCWG20TH0QXNPZCEZDFH%2F20200713%2Ffr-par%2Fs3%2Faws4_request\u0026X-Amz-Date=20200713T142912Z\u0026X-Amz-Expires=86400\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=e7978f82b922ca470df19e14bc57623f89627fa32ae3d63ce867efaf57ed8bd7","download_url_expires_at":"2020-07-14T14:29:12.711178Z","region":"nl-ams"}' + headers: + Content-Length: + - "843" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:29:28 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 192156ae-5f3d-4964-a397-3b041002d4fe + status: 200 OK + code: 200 + duration: "" diff --git a/internal/namespaces/rdb/v1/testdata/test-export-backup-simple.golden b/internal/namespaces/rdb/v1/testdata/test-export-backup-simple.golden new file mode 100644 index 0000000000..e441f12c63 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-export-backup-simple.golden @@ -0,0 +1,31 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +🟩🟩🟩 STDOUT️ 🟩🟩🟩️ +ID 78908a16-b963-4dd0-a1d8-4d8cc6036161 +InstanceID b740f91b-4c49-41d1-80a7-3be92814e42a +DatabaseName rdb +Name foobar +Status ready +Size 2547 +ExpiresAt few seconds ago +CreatedAt few seconds ago +UpdatedAt few seconds ago +InstanceName cli-test +DownloadURL http://s3.fr-par.scw.cloud/9f261887-ece6-41b4-8f7a-167ab9c4349f/b740f91b-4c49-41d1-80a7-3be92814e42a/78908a16-b963-4dd0-a1d8-4d8cc6036161.custom?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=SCWG20TH0QXNPZCEZDFH%2F20200713%2Ffr-par%2Fs3%2Faws4_request&X-Amz-Date=20200713T142912Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=e7978f82b922ca470df19e14bc57623f89627fa32ae3d63ce867efaf57ed8bd7 +DownloadURLExpiresAt few seconds ago +Region nl-ams +🟩🟩🟩 JSON STDOUT 🟩🟩🟩 +{ + "id": "78908a16-b963-4dd0-a1d8-4d8cc6036161", + "instance_id": "b740f91b-4c49-41d1-80a7-3be92814e42a", + "database_name": "rdb", + "name": "foobar", + "status": "ready", + "size": 2547, + "expires_at": "2999-01-02T22:04:05Z", + "created_at": "1970-01-01T00:00:00.0Z", + "updated_at": "1970-01-01T00:00:00.0Z", + "instance_name": "cli-test", + "download_url": "http://s3.fr-par.scw.cloud/9f261887-ece6-41b4-8f7a-167ab9c4349f/b740f91b-4c49-41d1-80a7-3be92814e42a/78908a16-b963-4dd0-a1d8-4d8cc6036161.custom?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=SCWG20TH0QXNPZCEZDFH%2F20200713%2Ffr-par%2Fs3%2Faws4_request\u0026X-Amz-Date=20200713T142912Z\u0026X-Amz-Expires=86400\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=e7978f82b922ca470df19e14bc57623f89627fa32ae3d63ce867efaf57ed8bd7", + "download_url_expires_at": "1970-01-01T00:00:00.0Z", + "region": "nl-ams" +} diff --git a/internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.cassette.yaml new file mode 100644 index 0000000000..451a3f8adc --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.cassette.yaml @@ -0,0 +1,777 @@ +--- +version: 1 +interactions: +- request: + body: '{"organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"cli-test","engine":"PostgreSQL-12","user_name":"foobar","password":"{4xdl*#QOoP+\u00263XRkGA)]","node_type":"db-dev-s","is_ha_cluster":false,"disable_backup":false,"tags":null}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances + method: POST + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:27 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ec096fbd-c3cb-4833-a54e-8b6f60b98bc9 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:27 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6a7eb6b2-b324-4720-9371-9032a6fc44cd + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:42 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cdd0f317-5441-49af-98e5-d899a616ef6e + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:25:57 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9df61464-83ac-4377-93e8-7699e2310c2b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"provisioning","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:12 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 400e0396-826c-4422-8a1b-6c737d9cd24c + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:28 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cae27882-3cbb-43e8-95e5-3c4ce51f8da2 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:43 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c976348e-6309-44b2-80f1-b0a0d8ee666b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:26:58 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f7302d94-e420-43b5-a755-cf4cd3bb3294 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:13 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 45d381ae-5a0d-47a7-b7d5-ee015242784d + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:28 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f0bb2444-d79e-4021-a3b1-23877359114e + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:43 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 07528abc-658e-41cc-91a6-9fcc103494dd + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:27:58 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 76406a5b-35a0-4af2-9c27-b5aa19b1b30e + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:28:13 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ccfeb98e-785d-4272-9e38-b088bfce341d + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:28:28 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1587c403-c52d-42e0-b574-7bc127858ed9 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"initializing","engine":"PostgreSQL-12","endpoint":null,"tags":[],"settings":[],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "443" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:28:44 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 92ed7a4c-6658-4ba5-820b-dce8a6dadb79 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: GET + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"ready","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.128.67","port":45405,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":false},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "743" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:28:59 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 363f1c85-c8cb-44c0-b7a4-2cd7ae0d561d + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","expires_at":"2999-01-02T15:04:05-07:00"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups + method: POST + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "361" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:01 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ce87255f-a7df-4313-98de-2eb29f0b48f8 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/a179ed84-e149-4339-a044-9a3098bf286e + method: GET + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"creating","size":null,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":null,"instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "361" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:01 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d59df9cf-dfbc-4878-9b59-2a8f9f727ed4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/a179ed84-e149-4339-a044-9a3098bf286e + method: GET + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"ready","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":"2020-07-13T14:30:07.244974Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "383" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:16 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d92bea6c-2da6-43f5-89ec-74a7013696ee + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"database_name":null,"instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/a179ed84-e149-4339-a044-9a3098bf286e/restore + method: POST + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"restoring","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":"2020-07-13T14:30:07.244974Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "387" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:16 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b8142878-13f7-4575-92cd-3328331e93c2 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/a179ed84-e149-4339-a044-9a3098bf286e + method: GET + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"restoring","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":"2020-07-13T14:30:07.244974Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "387" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:16 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0c8efb23-0f87-43e9-bc53-c8a2b097c9eb + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/a179ed84-e149-4339-a044-9a3098bf286e + method: GET + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"ready","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":"2020-07-13T14:30:21.553720Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "383" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:32 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c14d28c1-0715-4693-9681-c7e37bd6b76f + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/instances/740e36cd-f1ce-45bc-aba0-263b4bb65136 + method: DELETE + response: + body: '{"id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","name":"cli-test","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","status":"deleting","engine":"PostgreSQL-12","endpoint":{"ip":"51.158.128.67","port":45405,"name":null},"tags":[],"settings":[{"name":"work_mem","value":"4"},{"name":"max_connections","value":"100"},{"name":"effective_cache_size","value":"1300"},{"name":"maintenance_work_mem","value":"150"},{"name":"max_parallel_workers","value":"0"},{"name":"max_parallel_workers_per_gather","value":"0"}],"backup_schedule":{"frequency":24,"retention":7,"disabled":true},"is_ha_cluster":false,"read_replicas":[],"node_type":"db-dev-s","volume":{"type":"lssd","size":5000000000},"created_at":"2020-07-13T14:25:27.137999Z","region":"nl-ams"}' + headers: + Content-Length: + - "745" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:32 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1c17e328-78e6-4d8c-a886-ccc11a121f67 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/nl-ams/backups/a179ed84-e149-4339-a044-9a3098bf286e + method: DELETE + response: + body: '{"id":"a179ed84-e149-4339-a044-9a3098bf286e","instance_id":"740e36cd-f1ce-45bc-aba0-263b4bb65136","database_name":"rdb","name":"foobar","status":"deleting","size":2547,"expires_at":"2999-01-02T22:04:05Z","created_at":"2020-07-13T14:30:01.014532Z","updated_at":"2020-07-13T14:30:21.553720Z","instance_name":"cli-test","download_url":null,"download_url_expires_at":null,"region":"nl-ams"}' + headers: + Content-Length: + - "386" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 14:30:33 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 17ee98f9-0d87-4568-82d5-7fdb032fdcc5 + status: 200 OK + code: 200 + duration: "" diff --git a/internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.golden b/internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.golden new file mode 100644 index 0000000000..1f04a51c28 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-restore-backup-simple.golden @@ -0,0 +1,30 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +🟩🟩🟩 STDOUT️ 🟩🟩🟩️ +ID a179ed84-e149-4339-a044-9a3098bf286e +InstanceID 740e36cd-f1ce-45bc-aba0-263b4bb65136 +DatabaseName rdb +Name foobar +Status ready +Size 2547 +ExpiresAt few seconds ago +CreatedAt few seconds ago +UpdatedAt few seconds ago +InstanceName cli-test +DownloadURLExpiresAt few seconds ago +Region nl-ams +🟩🟩🟩 JSON STDOUT 🟩🟩🟩 +{ + "id": "a179ed84-e149-4339-a044-9a3098bf286e", + "instance_id": "740e36cd-f1ce-45bc-aba0-263b4bb65136", + "database_name": "rdb", + "name": "foobar", + "status": "ready", + "size": 2547, + "expires_at": "2999-01-02T22:04:05Z", + "created_at": "1970-01-01T00:00:00.0Z", + "updated_at": "1970-01-01T00:00:00.0Z", + "instance_name": "cli-test", + "download_url": null, + "download_url_expires_at": "0001-01-01T00:00:00Z", + "region": "nl-ams" +} From 8a37929b85971834015edbebffb2f871244a6bd3 Mon Sep 17 00:00:00 2001 From: Jerome Quere Date: Mon, 13 Jul 2020 15:31:29 +0200 Subject: [PATCH 11/14] chore: update sdk (#1212) --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index aac7f5466b..8bb6aebbae 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/mattn/go-colorable v0.1.4 github.com/mattn/go-isatty v0.0.11 github.com/pkg/errors v0.9.1 // indirect - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200710161155-10382899255f + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200713125201-82e19f805d12 github.com/sergi/go-diff v1.0.0 // indirect github.com/spf13/cobra v0.0.5 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index acdd6cf031..cd30035ce2 100644 --- a/go.sum +++ b/go.sum @@ -77,6 +77,8 @@ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200707130522-abc4aeb2a4e6 github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200707130522-abc4aeb2a4e6/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200710161155-10382899255f h1:FHSh2peVlKEecLqHX/8uevrWqeua68LbVBOzIhC0HBw= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200710161155-10382899255f/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200713125201-82e19f805d12 h1:JqiinsAqmg65byKaTYomB48jf/7bOq9zs+5TprjnKvI= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200713125201-82e19f805d12/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= From 31ad5f15fce357b2908c89c5376d05469a66096e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 13 Jul 2020 16:46:48 +0200 Subject: [PATCH 12/14] Fix --- cmd/scw/testdata/test-all-usage-rdb-backup-export-usage.golden | 1 + cmd/scw/testdata/test-all-usage-rdb-backup-restore-usage.golden | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/scw/testdata/test-all-usage-rdb-backup-export-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-backup-export-usage.golden index 69cd51ca21..e9d9e8e3ff 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-backup-export-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-backup-export-usage.golden @@ -11,6 +11,7 @@ ARGS: FLAGS: -h, --help help for export + -w, --wait wait until the backup is ready GLOBAL FLAGS: -c, --config string The path to the config file diff --git a/cmd/scw/testdata/test-all-usage-rdb-backup-restore-usage.golden b/cmd/scw/testdata/test-all-usage-rdb-backup-restore-usage.golden index cedd494d9e..efb689225b 100644 --- a/cmd/scw/testdata/test-all-usage-rdb-backup-restore-usage.golden +++ b/cmd/scw/testdata/test-all-usage-rdb-backup-restore-usage.golden @@ -13,6 +13,7 @@ ARGS: FLAGS: -h, --help help for restore + -w, --wait wait until the backup is ready GLOBAL FLAGS: -c, --config string The path to the config file From ca629e5db19ed318e7754b492d309cacb56a5ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 13 Jul 2020 16:55:38 +0200 Subject: [PATCH 13/14] Fix --- .../namespaces/rdb/v1/custom_backup_test.go | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/internal/namespaces/rdb/v1/custom_backup_test.go b/internal/namespaces/rdb/v1/custom_backup_test.go index 6c6cc14bbf..ff6fe2466f 100644 --- a/internal/namespaces/rdb/v1/custom_backup_test.go +++ b/internal/namespaces/rdb/v1/custom_backup_test.go @@ -1,7 +1,6 @@ package rdb import ( - "fmt" "testing" "time" @@ -13,21 +12,15 @@ func Test_CreateBackup(t *testing.T) { t.Run("Simple", core.Test(&core.TestConfig{ Commands: GetCommands(), BeforeFunc: core.BeforeFuncCombine( - core.ExecStoreBeforeCmd( - "Instance", - fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), - ), + createInstance(engine), // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. func(ctx *core.BeforeFuncCtx) error { time.Sleep(1 * time.Minute) return nil }), - Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", - Check: core.TestCheckGolden(), - AfterFunc: core.AfterFuncCombine( - core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), - core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), - ), + Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", + Check: core.TestCheckGolden(), + AfterFunc: deleteInstance(), DefaultRegion: scw.RegionNlAms, })) } @@ -36,10 +29,7 @@ func Test_RestoreBackup(t *testing.T) { t.Run("Simple", core.Test(&core.TestConfig{ Commands: GetCommands(), BeforeFunc: core.BeforeFuncCombine( - core.ExecStoreBeforeCmd( - "Instance", - fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), - ), + createInstance(engine), // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. func(ctx *core.BeforeFuncCtx) error { time.Sleep(1 * time.Minute) @@ -55,10 +45,7 @@ func Test_RestoreBackup(t *testing.T) { core.TestCheckGolden(), core.TestCheckExitCode(0), ), - AfterFunc: core.AfterFuncCombine( - core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), - core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), - ), + AfterFunc: deleteInstance(), DefaultRegion: scw.RegionNlAms, })) } @@ -67,10 +54,7 @@ func Test_ExportBackup(t *testing.T) { t.Run("Simple", core.Test(&core.TestConfig{ Commands: GetCommands(), BeforeFunc: core.BeforeFuncCombine( - core.ExecStoreBeforeCmd( - "Instance", - fmt.Sprintf("scw rdb instance create node-type=DB-DEV-S is-ha-cluster=false name=%s engine=%s user-name=%s password=%s --wait", name, engine, user, password), - ), + createInstance(engine), // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. func(ctx *core.BeforeFuncCtx) error { time.Sleep(1 * time.Minute) @@ -86,10 +70,7 @@ func Test_ExportBackup(t *testing.T) { core.TestCheckGolden(), core.TestCheckExitCode(0), ), - AfterFunc: core.AfterFuncCombine( - core.ExecAfterCmd("scw rdb instance delete {{ .Instance.ID }}"), - core.ExecAfterCmd("scw rdb backup delete {{ .CmdResult.ID }}"), - ), + AfterFunc: deleteInstance(), DefaultRegion: scw.RegionNlAms, })) } From 9542e1d7bd02250e2fe492d83ee9da5cd1c177d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 13 Jul 2020 17:03:24 +0200 Subject: [PATCH 14/14] FIx --- .../namespaces/rdb/v1/custom_backup_test.go | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/internal/namespaces/rdb/v1/custom_backup_test.go b/internal/namespaces/rdb/v1/custom_backup_test.go index ff6fe2466f..de7f2a80c4 100644 --- a/internal/namespaces/rdb/v1/custom_backup_test.go +++ b/internal/namespaces/rdb/v1/custom_backup_test.go @@ -14,10 +14,13 @@ func Test_CreateBackup(t *testing.T) { BeforeFunc: core.BeforeFuncCombine( createInstance(engine), // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. - func(ctx *core.BeforeFuncCtx) error { - time.Sleep(1 * time.Minute) - return nil - }), + core.BeforeFuncWhenUpdatingCassette( + func(ctx *core.BeforeFuncCtx) error { + time.Sleep(1 * time.Minute) + return nil + }, + ), + ), Cmd: "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", Check: core.TestCheckGolden(), AfterFunc: deleteInstance(), @@ -31,10 +34,12 @@ func Test_RestoreBackup(t *testing.T) { BeforeFunc: core.BeforeFuncCombine( createInstance(engine), // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. - func(ctx *core.BeforeFuncCtx) error { - time.Sleep(1 * time.Minute) - return nil - }, + core.BeforeFuncWhenUpdatingCassette( + func(ctx *core.BeforeFuncCtx) error { + time.Sleep(1 * time.Minute) + return nil + }, + ), core.ExecStoreBeforeCmd( "Backup", "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait", @@ -56,10 +61,12 @@ func Test_ExportBackup(t *testing.T) { BeforeFunc: core.BeforeFuncCombine( createInstance(engine), // We opened an internal issue about the fact that the instance is considered ready even if rdb is not yet available. - func(ctx *core.BeforeFuncCtx) error { - time.Sleep(1 * time.Minute) - return nil - }, + core.BeforeFuncWhenUpdatingCassette( + func(ctx *core.BeforeFuncCtx) error { + time.Sleep(1 * time.Minute) + return nil + }, + ), core.ExecStoreBeforeCmd( "Backup", "scw rdb backup create name=foobar expires-at=2999-01-02T15:04:05-07:00 instance-id={{ .Instance.ID }} database-name=rdb --wait",