diff --git a/internal/namespaces/rdb/v1/custom.go b/internal/namespaces/rdb/v1/custom.go index b9556d8ad6..9ae5d1d462 100644 --- a/internal/namespaces/rdb/v1/custom.go +++ b/internal/namespaces/rdb/v1/custom.go @@ -26,5 +26,7 @@ func GetCommands() *core.Commands { cmds.MustFind("rdb", "instance", "upgrade").Override(instanceUpgradeBuilder) + cmds.MustFind("rdb", "engine", "list").Override(engineListBuilder) + return cmds } diff --git a/internal/namespaces/rdb/v1/custom_engine_list.go b/internal/namespaces/rdb/v1/custom_engine_list.go new file mode 100644 index 0000000000..fc34222305 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_engine_list.go @@ -0,0 +1,56 @@ +package rdb + +import ( + "context" + "time" + + "github.com/scaleway/scaleway-cli/internal/core" + "github.com/scaleway/scaleway-sdk-go/api/rdb/v1" +) + +func engineListBuilder(c *core.Command) *core.Command { + type customEngine struct { + Name string `json:"name"` + EngineType string `json:"engine_type"` + EndOfLife time.Time `json:"end_of_life"` + } + + c.View = &core.View{ + Fields: []*core.ViewField{ + { + Label: "Name", + FieldName: "Name", + }, + { + Label: "Engine Type", + FieldName: "EngineType", + }, + { + Label: "End of Life", + FieldName: "EndOfLife", + }, + }, + } + + c.AddInterceptors(func(ctx context.Context, argsI interface{}, runner core.CommandRunner) (i interface{}, err error) { + listEngineResp, err := runner(ctx, argsI) + if err != nil { + return listEngineResp, err + } + engineList := listEngineResp.([]*rdb.DatabaseEngine) + var res []customEngine + for _, engine := range engineList { + for _, version := range engine.Versions { + res = append(res, customEngine{ + Name: version.Name, + EngineType: engine.Name, + EndOfLife: version.EndOfLife, + }) + } + } + + return res, nil + }) + + return c +} diff --git a/internal/namespaces/rdb/v1/custom_engine_list_test.go b/internal/namespaces/rdb/v1/custom_engine_list_test.go new file mode 100644 index 0000000000..4b0c7e7b56 --- /dev/null +++ b/internal/namespaces/rdb/v1/custom_engine_list_test.go @@ -0,0 +1,15 @@ +package rdb + +import ( + "testing" + + "github.com/scaleway/scaleway-cli/internal/core" +) + +func Test_EngineList(t *testing.T) { + t.Run("Simple", core.Test(&core.TestConfig{ + Commands: GetCommands(), + Cmd: "scw rdb engine list", + Check: core.TestCheckGolden(), + })) +} diff --git a/internal/namespaces/rdb/v1/testdata/test-engine-list-simple.cassette.yaml b/internal/namespaces/rdb/v1/testdata/test-engine-list-simple.cassette.yaml new file mode 100644 index 0000000000..a5c82728f3 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-engine-list-simple.cassette.yaml @@ -0,0 +1,159 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.6+dev (go1.14.4; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/rdb/v1/regions/fr-par/database-engines?page=1 + method: GET + response: + body: '{"engines":[{"name":"PostgreSQL","logo_url":"https://s3.nl-ams.scw.cloud/scw-rdb-logos/postgresql.svg","versions":[{"version":"12","name":"PostgreSQL-12","end_of_life":"2024-11-14T00:00:00Z","available_settings":[{"name":"max_locks_per_transaction","default_value":"64","hot_configurable":false,"description":"Sets + the maximum number of locks per transaction.","property_type":"INT","unit":null,"string_constraint":null,"int_min":10,"int_max":2147483647},{"name":"tcp_keepalives_idle","default_value":"0","hot_configurable":true,"description":"Time + between issuing TCP keepalives.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"statement_timeout","default_value":"86400000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any statement. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":30000,"int_max":2147483647},{"name":"default_statistics_target","default_value":"100","hot_configurable":true,"description":"Sets + the default statistics target.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"lock_timeout","default_value":"0","hot_configurable":false,"description":"Sets + the maximum allowed duration of any wait for a lock.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"work_mem","default_value":"4","hot_configurable":true,"description":"Sets + the maximum memory to be used for query workspaces.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"temp_buffers","default_value":"8192","hot_configurable":true,"description":"Sets + the maximum number of temporary buffers used by each session.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":800,"int_max":1073741824},{"name":"idle_in_transaction_session_timeout","default_value":"3600000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any idling transaction. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"max_connections","default_value":"100","hot_configurable":false,"description":"Sets + the maximum number of concurrent connections.","property_type":"INT","unit":null,"string_constraint":null,"int_min":50,"int_max":10000},{"name":"maintenance_work_mem","default_value":"64","hot_configurable":true,"description":"Sets + the maximum memory to be used for maintenance operations.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"default_transaction_deferrable","default_value":"off","hot_configurable":true,"description":"Sets + the default deferrable status of new transactions.","property_type":"BOOLEAN","unit":null,"string_constraint":null,"int_min":null,"int_max":null},{"name":"tcp_keepalives_interval","default_value":"0","hot_configurable":true,"description":"Time + between TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"commit_delay","default_value":"0","hot_configurable":true,"description":"Sets + the delay in microseconds between transaction commit and flushing WAL to disk.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":100000},{"name":"tcp_keepalives_count","default_value":"0","hot_configurable":true,"description":"Maximum + number of TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"temp_file_limit","default_value":"-1","hot_configurable":false,"description":"Limits + the total size of all temporary files used by each session.","property_type":"INT","unit":null,"string_constraint":null,"int_min":-1,"int_max":2147483647},{"name":"max_parallel_workers","default_value":"8","hot_configurable":true,"description":"Sets + the maximum number of parallel workers that can be active at one time.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"effective_cache_size","default_value":"4096","hot_configurable":true,"description":"Sets + the planner s assumption about the size of the data cache.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":64,"int_max":1048576},{"name":"max_parallel_workers_per_gather","default_value":"2","hot_configurable":true,"description":"Sets + the maximum number of parallel processes per executor node.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"vacuum_cost_delay","default_value":"0","hot_configurable":true,"description":"Vacuum + cost delay in milliseconds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":100},{"name":"vacuum_cost_page_hit","default_value":"1","hot_configurable":true,"description":"Vacuum + cost for a page found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_miss","default_value":"10","hot_configurable":true,"description":"Vacuum + cost for a page not found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_dirty","default_value":"20","hot_configurable":true,"description":"Vacuum + cost for a page dirtied by vacuum.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_limit","default_value":"200","hot_configurable":true,"description":"Vacuum + cost amount available before napping.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"bgwriter_delay","default_value":"200","hot_configurable":true,"description":"Background + writer sleep time between rounds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":10,"int_max":10000},{"name":"bgwriter_lru_maxpages","default_value":"100","hot_configurable":true,"description":"Background + writer maximum number of LRU pages to flush per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1073741823},{"name":"bgwriter_lru_multiplier","default_value":"2","hot_configurable":true,"description":"Multiple + of the average buffer usage to free per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10},{"name":"bgwriter_flush_after","default_value":"512","hot_configurable":true,"description":"Number + of pages after which previously performed writes are flushed to disk.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":0,"int_max":2048},{"name":"deadlock_timeout","default_value":"1000","hot_configurable":true,"description":"Sets + the time to wait on a lock before checking for deadlock.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":100,"int_max":60000}],"disabled":false,"beta":false},{"version":"11","name":"PostgreSQL-11","end_of_life":"2023-11-09T00:00:00Z","available_settings":[{"name":"max_locks_per_transaction","default_value":"64","hot_configurable":false,"description":"Sets + the maximum number of locks per transaction.","property_type":"INT","unit":null,"string_constraint":null,"int_min":10,"int_max":2147483647},{"name":"tcp_keepalives_idle","default_value":"0","hot_configurable":true,"description":"Time + between issuing TCP keepalives.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"statement_timeout","default_value":"86400000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any statement. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":30000,"int_max":2147483647},{"name":"default_statistics_target","default_value":"100","hot_configurable":true,"description":"Sets + the default statistics target.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"lock_timeout","default_value":"0","hot_configurable":false,"description":"Sets + the maximum allowed duration of any wait for a lock.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"work_mem","default_value":"4","hot_configurable":true,"description":"Sets + the maximum memory to be used for query workspaces.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"temp_buffers","default_value":"8192","hot_configurable":true,"description":"Sets + the maximum number of temporary buffers used by each session.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":800,"int_max":1073741824},{"name":"idle_in_transaction_session_timeout","default_value":"3600000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any idling transaction. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"max_connections","default_value":"100","hot_configurable":false,"description":"Sets + the maximum number of concurrent connections.","property_type":"INT","unit":null,"string_constraint":null,"int_min":50,"int_max":10000},{"name":"maintenance_work_mem","default_value":"64","hot_configurable":true,"description":"Sets + the maximum memory to be used for maintenance operations.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"default_transaction_deferrable","default_value":"off","hot_configurable":true,"description":"Sets + the default deferrable status of new transactions.","property_type":"BOOLEAN","unit":null,"string_constraint":null,"int_min":null,"int_max":null},{"name":"tcp_keepalives_interval","default_value":"0","hot_configurable":true,"description":"Time + between TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"commit_delay","default_value":"0","hot_configurable":true,"description":"Sets + the delay in microseconds between transaction commit and flushing WAL to disk.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":100000},{"name":"tcp_keepalives_count","default_value":"0","hot_configurable":true,"description":"Maximum + number of TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"temp_file_limit","default_value":"-1","hot_configurable":false,"description":"Limits + the total size of all temporary files used by each session.","property_type":"INT","unit":null,"string_constraint":null,"int_min":-1,"int_max":2147483647},{"name":"deadlock_timeout","default_value":"1000","hot_configurable":true,"description":"Sets + the time to wait on a lock before checking for deadlock.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":100,"int_max":60000},{"name":"max_parallel_workers","default_value":"8","hot_configurable":true,"description":"Sets + the maximum number of parallel workers that can be active at one time.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"effective_cache_size","default_value":"4096","hot_configurable":true,"description":"Sets + the planner s assumption about the size of the data cache.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":64,"int_max":1048576},{"name":"max_parallel_workers_per_gather","default_value":"2","hot_configurable":true,"description":"Sets + the maximum number of parallel processes per executor node.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"vacuum_cost_delay","default_value":"0","hot_configurable":true,"description":"Vacuum + cost delay in milliseconds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":100},{"name":"vacuum_cost_page_hit","default_value":"1","hot_configurable":true,"description":"Vacuum + cost for a page found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_miss","default_value":"10","hot_configurable":true,"description":"Vacuum + cost for a page not found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_dirty","default_value":"20","hot_configurable":true,"description":"Vacuum + cost for a page dirtied by vacuum.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_limit","default_value":"200","hot_configurable":true,"description":"Vacuum + cost amount available before napping.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"bgwriter_delay","default_value":"200","hot_configurable":true,"description":"Background + writer sleep time between rounds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":10,"int_max":10000},{"name":"bgwriter_lru_maxpages","default_value":"100","hot_configurable":true,"description":"Background + writer maximum number of LRU pages to flush per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1073741823},{"name":"bgwriter_lru_multiplier","default_value":"2","hot_configurable":true,"description":"Multiple + of the average buffer usage to free per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10},{"name":"bgwriter_flush_after","default_value":"512","hot_configurable":true,"description":"Number + of pages after which previously performed writes are flushed to disk.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":0,"int_max":2048}],"disabled":false,"beta":false},{"version":"10","name":"PostgreSQL-10","end_of_life":"2022-11-10T00:00:00Z","available_settings":[{"name":"commit_delay","default_value":"0","hot_configurable":true,"description":"Sets + the delay in microseconds between transaction commit and flushing WAL to disk.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":100000},{"name":"tcp_keepalives_interval","default_value":"0","hot_configurable":true,"description":"Time + between TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"lock_timeout","default_value":"0","hot_configurable":false,"description":"Sets + the maximum allowed duration of any wait for a lock.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"default_statistics_target","default_value":"100","hot_configurable":true,"description":"Sets + the default statistics target.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"max_locks_per_transaction","default_value":"64","hot_configurable":false,"description":"Sets + the maximum number of locks per transaction.","property_type":"INT","unit":null,"string_constraint":null,"int_min":10,"int_max":2147483647},{"name":"temp_buffers","default_value":"8192","hot_configurable":true,"description":"Sets + the maximum number of temporary buffers used by each session.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":800,"int_max":1073741824},{"name":"idle_in_transaction_session_timeout","default_value":"3600000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any idling transaction. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"maintenance_work_mem","default_value":"64","hot_configurable":true,"description":"Sets + the maximum memory to be used for maintenance operations.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"max_connections","default_value":"100","hot_configurable":false,"description":"Sets + the maximum number of concurrent connections.","property_type":"INT","unit":null,"string_constraint":null,"int_min":50,"int_max":10000},{"name":"default_transaction_deferrable","default_value":"off","hot_configurable":true,"description":"Sets + the default deferrable status of new transactions.","property_type":"BOOLEAN","unit":null,"string_constraint":null,"int_min":null,"int_max":null},{"name":"work_mem","default_value":"4","hot_configurable":true,"description":"Sets + the maximum memory to be used for query workspaces.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"statement_timeout","default_value":"86400000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any statement. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":30000,"int_max":2147483647},{"name":"tcp_keepalives_count","default_value":"0","hot_configurable":true,"description":"Maximum + number of TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"tcp_keepalives_idle","default_value":"0","hot_configurable":true,"description":"Time + between issuing TCP keepalives.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"deadlock_timeout","default_value":"1000","hot_configurable":true,"description":"Sets + the time to wait on a lock before checking for deadlock.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":100,"int_max":60000},{"name":"max_parallel_workers","default_value":"8","hot_configurable":true,"description":"Sets + the maximum number of parallel workers that can be active at one time.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"effective_cache_size","default_value":"4096","hot_configurable":true,"description":"Sets + the planner s assumption about the size of the data cache.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":64,"int_max":1048576},{"name":"max_parallel_workers_per_gather","default_value":"2","hot_configurable":true,"description":"Sets + the maximum number of parallel processes per executor node.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"vacuum_cost_delay","default_value":"0","hot_configurable":true,"description":"Vacuum + cost delay in milliseconds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":100},{"name":"vacuum_cost_page_hit","default_value":"1","hot_configurable":true,"description":"Vacuum + cost for a page found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_miss","default_value":"10","hot_configurable":true,"description":"Vacuum + cost for a page not found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_dirty","default_value":"20","hot_configurable":true,"description":"Vacuum + cost for a page dirtied by vacuum.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_limit","default_value":"200","hot_configurable":true,"description":"Vacuum + cost amount available before napping.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"bgwriter_delay","default_value":"200","hot_configurable":true,"description":"Background + writer sleep time between rounds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":10,"int_max":10000},{"name":"bgwriter_lru_maxpages","default_value":"100","hot_configurable":true,"description":"Background + writer maximum number of LRU pages to flush per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1073741823},{"name":"bgwriter_lru_multiplier","default_value":"2","hot_configurable":true,"description":"Multiple + of the average buffer usage to free per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10},{"name":"bgwriter_flush_after","default_value":"512","hot_configurable":true,"description":"Number + of pages after which previously performed writes are flushed to disk.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":0,"int_max":2048},{"name":"temp_file_limit","default_value":"-1","hot_configurable":false,"description":"Limits + the total size of all temporary files used by each session.","property_type":"INT","unit":null,"string_constraint":null,"int_min":-1,"int_max":2147483647}],"disabled":false,"beta":false},{"version":"9.6","name":"PostgreSQL-9.6","end_of_life":"2021-11-11T00:00:00Z","available_settings":[{"name":"vacuum_cost_page_dirty","default_value":"20","hot_configurable":true,"description":"Vacuum + cost for a page dirtied by vacuum.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_limit","default_value":"200","hot_configurable":true,"description":"Vacuum + cost amount available before napping.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"bgwriter_delay","default_value":"200","hot_configurable":true,"description":"Background + writer sleep time between rounds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":10,"int_max":10000},{"name":"bgwriter_lru_maxpages","default_value":"100","hot_configurable":true,"description":"Background + writer maximum number of LRU pages to flush per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1073741823},{"name":"bgwriter_lru_multiplier","default_value":"2","hot_configurable":true,"description":"Multiple + of the average buffer usage to free per round.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10},{"name":"bgwriter_flush_after","default_value":"512","hot_configurable":true,"description":"Number + of pages after which previously performed writes are flushed to disk.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":0,"int_max":2048},{"name":"max_locks_per_transaction","default_value":"64","hot_configurable":false,"description":"Sets + the maximum number of locks per transaction.","property_type":"INT","unit":null,"string_constraint":null,"int_min":10,"int_max":2147483647},{"name":"idle_in_transaction_session_timeout","default_value":"3600000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any idling transaction. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"tcp_keepalives_interval","default_value":"0","hot_configurable":true,"description":"Time + between TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"lock_timeout","default_value":"0","hot_configurable":false,"description":"Sets + the maximum allowed duration of any wait for a lock.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"maintenance_work_mem","default_value":"64","hot_configurable":true,"description":"Sets + the maximum memory to be used for maintenance operations.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"default_transaction_deferrable","default_value":"off","hot_configurable":true,"description":"Sets + the default deferrable status of new transactions.","property_type":"BOOLEAN","unit":null,"string_constraint":null,"int_min":null,"int_max":null},{"name":"temp_file_limit","default_value":"-1","hot_configurable":false,"description":"Limits + the total size of all temporary files used by each session.","property_type":"INT","unit":null,"string_constraint":null,"int_min":-1,"int_max":2147483647},{"name":"tcp_keepalives_idle","default_value":"0","hot_configurable":true,"description":"Time + between issuing TCP keepalives.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"max_connections","default_value":"100","hot_configurable":false,"description":"Sets + the maximum number of concurrent connections.","property_type":"INT","unit":null,"string_constraint":null,"int_min":50,"int_max":10000},{"name":"work_mem","default_value":"4","hot_configurable":true,"description":"Sets + the maximum memory to be used for query workspaces.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":1,"int_max":2097151},{"name":"commit_delay","default_value":"0","hot_configurable":true,"description":"Sets + the delay in microseconds between transaction commit and flushing WAL to disk.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":100000},{"name":"tcp_keepalives_count","default_value":"0","hot_configurable":true,"description":"Maximum + number of TCP keepalive retransmits.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":2147483647},{"name":"statement_timeout","default_value":"86400000","hot_configurable":true,"description":"Sets + the maximum allowed duration of any statement. Value in ms","property_type":"INT","unit":"ms","string_constraint":null,"int_min":30000,"int_max":2147483647},{"name":"deadlock_timeout","default_value":"1000","hot_configurable":true,"description":"Sets + the time to wait on a lock before checking for deadlock.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":100,"int_max":60000},{"name":"effective_cache_size","default_value":"4096","hot_configurable":true,"description":"Sets + the planner s assumption about the size of the data cache.","property_type":"INT","unit":"MB","string_constraint":null,"int_min":64,"int_max":1048576},{"name":"max_parallel_workers_per_gather","default_value":"2","hot_configurable":true,"description":"Sets + the maximum number of parallel processes per executor node.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":1024},{"name":"vacuum_cost_delay","default_value":"0","hot_configurable":true,"description":"Vacuum + cost delay in milliseconds.","property_type":"INT","unit":"ms","string_constraint":null,"int_min":0,"int_max":100},{"name":"vacuum_cost_page_hit","default_value":"1","hot_configurable":true,"description":"Vacuum + cost for a page found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"vacuum_cost_page_miss","default_value":"10","hot_configurable":true,"description":"Vacuum + cost for a page not found in the buffer cache.","property_type":"INT","unit":null,"string_constraint":null,"int_min":0,"int_max":10000},{"name":"default_statistics_target","default_value":"100","hot_configurable":true,"description":"Sets + the default statistics target.","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":10000},{"name":"temp_buffers","default_value":"8192","hot_configurable":true,"description":"Sets + the maximum number of temporary buffers used by each session.","property_type":"INT","unit":"kB","string_constraint":null,"int_min":800,"int_max":1073741824}],"disabled":false,"beta":false}],"region":"fr-par"},{"name":"MySQL","logo_url":"https://s3.nl-ams.scw.cloud/scw-rdb-logos/mysql.svg","versions":[{"version":"8","name":"MySQL-8","end_of_life":"2026-04-01T00:00:00Z","available_settings":[{"name":"default_authentication_plugin","default_value":"mysql_native_password","hot_configurable":false,"description":"The + default authentication plugin at the user creation","property_type":"STRING","unit":null,"string_constraint":"^(mysql_native_password|caching_sha2_password)$","int_min":null,"int_max":null},{"name":"innodb_lock_wait_timeout","default_value":"50","hot_configurable":true,"description":"The + length of time in seconds an InnoDB transaction waits for a row lock before + giving up","property_type":"INT","unit":null,"string_constraint":null,"int_min":1,"int_max":600},{"name":"lock_wait_timeout","default_value":"31536000","hot_configurable":true,"description":"This + variable specifies the timeout in seconds for attempts to acquire metadata locks","property_type":"INT","unit":null,"string_constraint":null,"int_min":60,"int_max":31536000},{"name":"log_bin_trust_function_creators","default_value":"OFF","hot_configurable":true,"description":"This + variable controls whether stored function creators can be trusted","property_type":"BOOLEAN","unit":null,"string_constraint":null,"int_min":null,"int_max":null},{"name":"innodb_stats_persistent_sample_pages","default_value":"200","hot_configurable":true,"description":"The + number of index pages to sample when estimating cardinality and other statistics + for an indexed column","property_type":"INT","unit":null,"string_constraint":null,"int_min":20,"int_max":1000},{"name":"interactive_timeout","default_value":"21600","hot_configurable":true,"description":"The + number of seconds the server waits for activity on an interactive connection + before closing it","property_type":"INT","unit":null,"string_constraint":null,"int_min":60,"int_max":21600},{"name":"max_allowed_packet","default_value":"64","hot_configurable":true,"description":"The + maximum size (MB) of one packet or any generated/intermediate string, or any + parameter sent by the mysql_stmt_send_long_data() C API function","property_type":"INT","unit":"M","string_constraint":null,"int_min":4,"int_max":1024},{"name":"max_connections","default_value":"100","hot_configurable":true,"description":"The + maximum permitted number of simultaneous client connections","property_type":"INT","unit":null,"string_constraint":null,"int_min":50,"int_max":5000},{"name":"sql_mode","default_value":"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION","hot_configurable":true,"description":"Modes + affect the SQL syntax MySQL supports and the data validation checks it performs","property_type":"STRING","unit":null,"string_constraint":"^((ONLY_FULL_GROUP_BY|STRICT_TRANS_TABLES|NO_ZERO_IN_DATE|NO_ZERO_DATE|ERROR_FOR_DIVISION_BY_ZERO|NO_ENGINE_SUBSTITUTION)(,(ONLY_FULL_GROUP_BY|STRICT_TRANS_TABLES|NO_ZERO_IN_DATE|NO_ZERO_DATE|ERROR_FOR_DIVISION_BY_ZERO|NO_ENGINE_SUBSTITUTION))*)?$","int_min":null,"int_max":null},{"name":"table_open_cache","default_value":"10000","hot_configurable":true,"description":"table_open_cache","property_type":"INT","unit":null,"string_constraint":null,"int_min":1000,"int_max":20000},{"name":"wait_timeout","default_value":"21600","hot_configurable":false,"description":"The + number of seconds the server waits for activity on a noninteractive connection + before closing it","property_type":"INT","unit":null,"string_constraint":null,"int_min":60,"int_max":21600}],"disabled":false,"beta":false}],"region":"fr-par"}],"total_count":2}' + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Mon, 06 Jul 2020 09:47:46 GMT + Server: + - agw_listener_public_vip + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 300bf3fa-7acf-4b57-bf83-0d4bb2719e9b + status: 200 OK + code: 200 + duration: "" diff --git a/internal/namespaces/rdb/v1/testdata/test-engine-list-simple.golden b/internal/namespaces/rdb/v1/testdata/test-engine-list-simple.golden new file mode 100644 index 0000000000..6c833fc2e1 --- /dev/null +++ b/internal/namespaces/rdb/v1/testdata/test-engine-list-simple.golden @@ -0,0 +1,36 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +🟩🟩🟩 STDOUT️ 🟩🟩🟩️ +Name Engine Type End of Life +PostgreSQL-12 PostgreSQL few seconds ago +PostgreSQL-11 PostgreSQL few seconds ago +PostgreSQL-10 PostgreSQL few seconds ago +PostgreSQL-9.6 PostgreSQL few seconds ago +MySQL-8 MySQL few seconds ago +🟩🟩🟩 JSON STDOUT 🟩🟩🟩 +[ + { + "name": "PostgreSQL-12", + "engine_type": "PostgreSQL", + "end_of_life": "2024-11-14T00:00:00Z" + }, + { + "name": "PostgreSQL-11", + "engine_type": "PostgreSQL", + "end_of_life": "2023-11-09T00:00:00Z" + }, + { + "name": "PostgreSQL-10", + "engine_type": "PostgreSQL", + "end_of_life": "2022-11-10T00:00:00Z" + }, + { + "name": "PostgreSQL-9.6", + "engine_type": "PostgreSQL", + "end_of_life": "2021-11-11T00:00:00Z" + }, + { + "name": "MySQL-8", + "engine_type": "MySQL", + "end_of_life": "2026-04-01T00:00:00Z" + } +]