Skip to content

Commit f96e6ef

Browse files
authored
feat(rdb): add skip_size_retrieval option to ListDatabases endpoint (#5035)
1 parent 68b2944 commit f96e6ef

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

cmd/scw/testdata/test-all-usage-rdb-database-list-usage.golden

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ USAGE:
66
scw rdb database list [arg=value ...]
77

88
ARGS:
9-
[name] Name of the database
10-
[managed] Defines whether or not the database is managed
11-
[owner] User that owns this database
12-
[order-by] Criteria to use when ordering database listing (name_asc | name_desc | size_asc | size_desc)
13-
instance-id UUID of the Database Instance to list the databases of
14-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
9+
[name] Name of the database
10+
[managed] Defines whether or not the database is managed
11+
[owner] User that owns this database
12+
[order-by] Criteria to use when ordering database listing (name_asc | name_desc | size_asc | size_desc)
13+
instance-id UUID of the Database Instance to list the databases of
14+
[skip-size-retrieval] Whether to skip the retrieval of each database size. If true, the size of each returned database will be set to 0
15+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1516

1617
FLAGS:
1718
-h, --help help for list

docs/commands/rdb.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ scw rdb database list [arg=value ...]
501501
| owner | | User that owns this database |
502502
| order-by | One of: `name_asc`, `name_desc`, `size_asc`, `size_desc` | Criteria to use when ordering database listing |
503503
| instance-id | Required | UUID of the Database Instance to list the databases of |
504+
| skip-size-retrieval | | Whether to skip the retrieval of each database size. If true, the size of each returned database will be set to 0 |
504505
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
505506

506507

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.25.0
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002152609-65aa212380b7
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002202252-ab1363c81acf
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.10.1
2929
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
462462
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
463463
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
464464
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
465-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002152609-65aa212380b7 h1:K7bf9NGVVEFqEUn7QEmHNUN0MGz+W4aAi4OSsXj7boE=
466-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002152609-65aa212380b7/go.mod h1:DVB9HV7nK7TdTRqlpdxw6T0Wxg+aB9xPBEpO3aM2iqQ=
465+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002202252-ab1363c81acf h1:mz7af7+CKpRvbZMilDwowLtNOQ0sZOYdTAjdkG9lRho=
466+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002202252-ab1363c81acf/go.mod h1:DVB9HV7nK7TdTRqlpdxw6T0Wxg+aB9xPBEpO3aM2iqQ=
467467
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
468468
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
469469
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/rdb/v1/rdb_cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,13 @@ func rdbDatabaseList() *core.Command {
24182418
Deprecated: false,
24192419
Positional: false,
24202420
},
2421+
{
2422+
Name: "skip-size-retrieval",
2423+
Short: `Whether to skip the retrieval of each database size. If true, the size of each returned database will be set to 0`,
2424+
Required: false,
2425+
Deprecated: false,
2426+
Positional: false,
2427+
},
24212428
core.RegionArgSpec(
24222429
scw.RegionFrPar,
24232430
scw.RegionNlAms,

0 commit comments

Comments
 (0)