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 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 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 diff --git a/internal/namespaces/rdb/v1/custom.go b/internal/namespaces/rdb/v1/custom.go index ece0383302..6727dfd2d5 100644 --- a/internal/namespaces/rdb/v1/custom.go +++ b/internal/namespaces/rdb/v1/custom.go @@ -27,11 +27,15 @@ func GetCommands() *core.Commands { cmds.Merge(core.NewCommands( instanceWaitCommand(), instanceConnectCommand(), + 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) 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.go b/internal/namespaces/rdb/v1/custom_backup.go new file mode 100644 index 0000000000..42d23c2784 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_backup.go @@ -0,0 +1,100 @@ +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"}`, + }, + }, + } +} + +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: respI.(*rdb.DatabaseBackup).ID, + Region: respI.(*rdb.DatabaseBackup).Region, + Timeout: &timeout, + RetryInterval: core.DefaultRetryInterval, + }) + } + + 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 new file mode 100644 index 0000000000..de7f2a80c4 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_backup_test.go @@ -0,0 +1,83 @@ +package rdb + +import ( + "testing" + "time" + + "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +func Test_CreateBackup(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + 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. + 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(), + DefaultRegion: scw.RegionNlAms, + })) +} + +func Test_RestoreBackup(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + 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. + 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", + ), + ), + Cmd: "scw rdb backup restore {{ .Backup.ID }} instance-id={{ .Instance.ID }} --wait", + Check: core.TestCheckCombine( + core.TestCheckGolden(), + core.TestCheckExitCode(0), + ), + AfterFunc: deleteInstance(), + DefaultRegion: scw.RegionNlAms, + })) +} + +func Test_ExportBackup(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + 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. + 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", + ), + ), + Cmd: "scw rdb backup export {{ .Backup.ID }} --wait", + Check: core.TestCheckCombine( + core.TestCheckGolden(), + core.TestCheckExitCode(0), + ), + AfterFunc: deleteInstance(), + 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 new file mode 100644 index 0000000000..80d8fafa36 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.cassette.yaml @@ -0,0 +1,647 @@ +--- +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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:46: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: + - be9a918a-b86a-4e45-8f7f-477d76df2302 + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:46: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: + - 616bfb56-7317-411d-a699-738a2a17537b + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:46: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: + - 53ea404c-02fd-490c-8456-591f4d758a38 + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:46: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: + - d5b00c7e-90be-4602-a3a4-632a7ce958b2 + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:47: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: + - ac311665-4020-459a-bd5d-24feac8be7ea + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:47: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: + - 0ca24f8a-29e7-427a-a550-dcbd30a41b51 + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:47: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: + - 2d327985-144b-40b8-9556-b93432329e7e + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:47: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: + - 1739006e-2e4b-4193-a273-ba2203ccddc1 + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:48: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: + - 1b7bd8b6-9da8-4578-b1fe-c0b58366aeae + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:48: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: + - 130ce9dd-82d0-452f-b821-f81fd3a4cd4b + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:48: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: + - 8716c19d-a0f0-43a1-ba3e-84a23e09521c + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:48:49 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 468e37ca-babd-4650-8d60-bc4a22f011aa + 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 13 Jul 2020 13:49: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: + - a707b14b-85cc-4df7-b3d4-86381f7f30ba + 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":"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" + 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:49:34 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1a817d82-b558-42f5-b8e9-98d45149a3fd + status: 200 OK + code: 200 + duration: "" +- request: + 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: + - 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":"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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - 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: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 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 new file mode 100644 index 0000000000..9c5c1b7f5e --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-create-backup-simple.golden @@ -0,0 +1,30 @@ +🎲🎲🎲 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 🟩🟩🟩 +{ + "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" +}