Skip to content

Commit f27e279

Browse files
scaleway-botQuentin Brosse
andauthored
feat(rdb): add project_id to resources (#1456)
Co-authored-by: Quentin Brosse <[email protected]>
1 parent bd27abf commit f27e279

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARGS:
99
[name] Name of the database backups
1010
[order-by] Criteria to use when ordering database backups listing (created_at_asc | created_at_desc | name_asc | name_desc | status_asc | status_desc)
1111
[instance-id] UUID of the instance
12+
[project-id] Project ID the database backups belongs to
1213
[organization-id] Organization ID the database backups belongs to
1314
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
1415

cmd/scw/testdata/test-all-usage-rdb-instance-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USAGE:
66
scw rdb instance create [arg=value ...]
77

88
ARGS:
9+
[project-id] Project ID to use. If none is passed the default project ID will be used
910
[name=<generated>] Name of the instance
1011
engine Database engine of the database (PostgreSQL, MySQL, ...)
1112
user-name Name of the user created when the instance is created

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ ARGS:
99
[tags.{index}] List instance that have a given tags
1010
[name] List instance that match a given name pattern
1111
[order-by] Criteria to use when ordering instance listing (created_at_asc | created_at_desc | name_asc | name_desc | region | status_asc | status_desc)
12-
[organization-id] Organization ID to list the instance of
12+
[project-id] Project ID to list the instance of
13+
[organization-id] Please use `project_id` instead
1314
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
1415

1516
FLAGS:

internal/namespaces/rdb/v1/rdb_cli.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ func rdbBackupList() *core.Command {
192192
Deprecated: false,
193193
Positional: false,
194194
},
195+
{
196+
Name: "project-id",
197+
Short: `Project ID the database backups belongs to`,
198+
Required: false,
199+
Deprecated: false,
200+
Positional: false,
201+
},
195202
{
196203
Name: "organization-id",
197204
Short: `Organization ID the database backups belongs to`,
@@ -593,9 +600,16 @@ func rdbInstanceList() *core.Command {
593600
Positional: false,
594601
EnumValues: []string{"created_at_asc", "created_at_desc", "name_asc", "name_desc", "region", "status_asc", "status_desc"},
595602
},
603+
{
604+
Name: "project-id",
605+
Short: `Project ID to list the instance of`,
606+
Required: false,
607+
Deprecated: false,
608+
Positional: false,
609+
},
596610
{
597611
Name: "organization-id",
598-
Short: `Organization ID to list the instance of`,
612+
Short: `Please use ` + "`" + `project_id` + "`" + ` instead`,
599613
Required: false,
600614
Deprecated: false,
601615
Positional: false,
@@ -689,6 +703,7 @@ func rdbInstanceCreate() *core.Command {
689703
// Deprecated: false,
690704
ArgsType: reflect.TypeOf(rdb.CreateInstanceRequest{}),
691705
ArgSpecs: core.ArgSpecs{
706+
core.ProjectIDArgSpec(),
692707
{
693708
Name: "name",
694709
Short: `Name of the instance`,

0 commit comments

Comments
 (0)