Skip to content

Commit 5c5dc75

Browse files
feat(block): add organization_id filter in listings (#3506)
Co-authored-by: Jules Castéran <[email protected]>
1 parent 3598507 commit 5c5dc75

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

cmd/scw/testdata/test-all-usage-block-snapshot-list-usage.golden

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ USAGE:
66
scw block snapshot list [arg=value ...]
77

88
ARGS:
9-
[order-by] Criteria to use when ordering the list (created_at_asc | created_at_desc | name_asc | name_desc)
10-
[project-id] Filter by Project ID
11-
[volume-id] Filter snapshots by the ID of the original volume
12-
[name] Filter snapshots by their names
13-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3 | all)
9+
[order-by] Criteria to use when ordering the list (created_at_asc | created_at_desc | name_asc | name_desc)
10+
[project-id] Filter by Project ID
11+
[volume-id] Filter snapshots by the ID of the original volume
12+
[name] Filter snapshots by their names
13+
[organization-id] Filter by Organization ID
14+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3 | all)
1415

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

cmd/scw/testdata/test-all-usage-block-volume-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARGS:
1010
[project-id] Filter by Project ID
1111
[name] Filter the return volumes by their names
1212
[product-resource-id] Filter by a product resource ID linked to this volume (such as an Instance ID)
13+
[organization-id] Filter by Organization ID
1314
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | pl-waw-3 | all)
1415

1516
FLAGS:

docs/commands/block.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ scw block snapshot list [arg=value ...]
106106
| project-id | | Filter by Project ID |
107107
| volume-id | | Filter snapshots by the ID of the original volume |
108108
| name | | Filter snapshots by their names |
109+
| organization-id | | Filter by Organization ID |
109110
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `pl-waw-3`, `all` | Zone to target. If none is passed will use default zone from the config |
110111

111112

@@ -223,6 +224,7 @@ scw block volume list [arg=value ...]
223224
| project-id | | Filter by Project ID |
224225
| name | | Filter the return volumes by their names |
225226
| product-resource-id | | Filter by a product resource ID linked to this volume (such as an Instance ID) |
227+
| organization-id | | Filter by Organization ID |
226228
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `pl-waw-3`, `all` | Zone to target. If none is passed will use default zone from the config |
227229

228230

internal/namespaces/block/v1alpha1/block_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ func blockVolumeList() *core.Command {
142142
Deprecated: false,
143143
Positional: false,
144144
},
145+
{
146+
Name: "organization-id",
147+
Short: `Filter by Organization ID`,
148+
Required: false,
149+
Deprecated: false,
150+
Positional: false,
151+
},
145152
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZonePlWaw3, scw.Zone(core.AllLocalities)),
146153
},
147154
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -395,6 +402,13 @@ func blockSnapshotList() *core.Command {
395402
Deprecated: false,
396403
Positional: false,
397404
},
405+
{
406+
Name: "organization-id",
407+
Short: `Filter by Organization ID`,
408+
Required: false,
409+
Deprecated: false,
410+
Positional: false,
411+
},
398412
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZonePlWaw3, scw.Zone(core.AllLocalities)),
399413
},
400414
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)