Skip to content

Commit 3a13150

Browse files
authored
feat(block): add organization_id filter in listings (#377)
1 parent 57256ac commit 3a13150

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

scaleway-async/scaleway_async/block/v1alpha1/api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ async def list_volumes(
130130
zone: Optional[Zone] = None,
131131
order_by: ListVolumesRequestOrderBy = ListVolumesRequestOrderBy.CREATED_AT_ASC,
132132
project_id: Optional[str] = None,
133+
organization_id: Optional[str] = None,
133134
page: Optional[int] = None,
134135
page_size: Optional[int] = None,
135136
name: Optional[str] = None,
@@ -141,6 +142,7 @@ async def list_volumes(
141142
:param zone: Zone to target. If none is passed will use default zone from the config.
142143
:param order_by: Criteria to use when ordering the list.
143144
:param project_id: Filter by Project ID.
145+
:param organization_id: Filter by Organization ID.
144146
:param page: Page number.
145147
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
146148
:param name: Filter the return volumes by their names.
@@ -161,6 +163,8 @@ async def list_volumes(
161163
params={
162164
"name": name,
163165
"order_by": order_by,
166+
"organization_id": organization_id
167+
or self.client.default_organization_id,
164168
"page": page,
165169
"page_size": page_size or self.client.default_page_size,
166170
"product_resource_id": product_resource_id,
@@ -177,6 +181,7 @@ async def list_volumes_all(
177181
zone: Optional[Zone] = None,
178182
order_by: Optional[ListVolumesRequestOrderBy] = None,
179183
project_id: Optional[str] = None,
184+
organization_id: Optional[str] = None,
180185
page: Optional[int] = None,
181186
page_size: Optional[int] = None,
182187
name: Optional[str] = None,
@@ -188,6 +193,7 @@ async def list_volumes_all(
188193
:param zone: Zone to target. If none is passed will use default zone from the config.
189194
:param order_by: Criteria to use when ordering the list.
190195
:param project_id: Filter by Project ID.
196+
:param organization_id: Filter by Organization ID.
191197
:param page: Page number.
192198
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
193199
:param name: Filter the return volumes by their names.
@@ -208,6 +214,7 @@ async def list_volumes_all(
208214
"zone": zone,
209215
"order_by": order_by,
210216
"project_id": project_id,
217+
"organization_id": organization_id,
211218
"page": page,
212219
"page_size": page_size,
213220
"name": name,
@@ -426,6 +433,7 @@ async def list_snapshots(
426433
zone: Optional[Zone] = None,
427434
order_by: ListSnapshotsRequestOrderBy = ListSnapshotsRequestOrderBy.CREATED_AT_ASC,
428435
project_id: Optional[str] = None,
436+
organization_id: Optional[str] = None,
429437
page: Optional[int] = None,
430438
page_size: Optional[int] = None,
431439
volume_id: Optional[str] = None,
@@ -437,6 +445,7 @@ async def list_snapshots(
437445
:param zone: Zone to target. If none is passed will use default zone from the config.
438446
:param order_by: Criteria to use when ordering the list.
439447
:param project_id: Filter by Project ID.
448+
:param organization_id: Filter by Organization ID.
440449
:param page: Page number.
441450
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
442451
:param volume_id: Filter snapshots by the ID of the original volume.
@@ -457,6 +466,8 @@ async def list_snapshots(
457466
params={
458467
"name": name,
459468
"order_by": order_by,
469+
"organization_id": organization_id
470+
or self.client.default_organization_id,
460471
"page": page,
461472
"page_size": page_size or self.client.default_page_size,
462473
"project_id": project_id or self.client.default_project_id,
@@ -473,6 +484,7 @@ async def list_snapshots_all(
473484
zone: Optional[Zone] = None,
474485
order_by: Optional[ListSnapshotsRequestOrderBy] = None,
475486
project_id: Optional[str] = None,
487+
organization_id: Optional[str] = None,
476488
page: Optional[int] = None,
477489
page_size: Optional[int] = None,
478490
volume_id: Optional[str] = None,
@@ -484,6 +496,7 @@ async def list_snapshots_all(
484496
:param zone: Zone to target. If none is passed will use default zone from the config.
485497
:param order_by: Criteria to use when ordering the list.
486498
:param project_id: Filter by Project ID.
499+
:param organization_id: Filter by Organization ID.
487500
:param page: Page number.
488501
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
489502
:param volume_id: Filter snapshots by the ID of the original volume.
@@ -504,6 +517,7 @@ async def list_snapshots_all(
504517
"zone": zone,
505518
"order_by": order_by,
506519
"project_id": project_id,
520+
"organization_id": organization_id,
507521
"page": page,
508522
"page_size": page_size,
509523
"volume_id": volume_id,

scaleway-async/scaleway_async/block/v1alpha1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,11 @@ class ListVolumesRequest:
533533
Filter by Project ID.
534534
"""
535535

536+
organization_id: Optional[str]
537+
"""
538+
Filter by Organization ID.
539+
"""
540+
536541
page: Optional[int]
537542
"""
538543
Page number.
@@ -677,6 +682,11 @@ class ListSnapshotsRequest:
677682
Filter by Project ID.
678683
"""
679684

685+
organization_id: Optional[str]
686+
"""
687+
Filter by Organization ID.
688+
"""
689+
680690
page: Optional[int]
681691
"""
682692
Page number.

scaleway/scaleway/block/v1alpha1/api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def list_volumes(
130130
zone: Optional[Zone] = None,
131131
order_by: ListVolumesRequestOrderBy = ListVolumesRequestOrderBy.CREATED_AT_ASC,
132132
project_id: Optional[str] = None,
133+
organization_id: Optional[str] = None,
133134
page: Optional[int] = None,
134135
page_size: Optional[int] = None,
135136
name: Optional[str] = None,
@@ -141,6 +142,7 @@ def list_volumes(
141142
:param zone: Zone to target. If none is passed will use default zone from the config.
142143
:param order_by: Criteria to use when ordering the list.
143144
:param project_id: Filter by Project ID.
145+
:param organization_id: Filter by Organization ID.
144146
:param page: Page number.
145147
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
146148
:param name: Filter the return volumes by their names.
@@ -161,6 +163,8 @@ def list_volumes(
161163
params={
162164
"name": name,
163165
"order_by": order_by,
166+
"organization_id": organization_id
167+
or self.client.default_organization_id,
164168
"page": page,
165169
"page_size": page_size or self.client.default_page_size,
166170
"product_resource_id": product_resource_id,
@@ -177,6 +181,7 @@ def list_volumes_all(
177181
zone: Optional[Zone] = None,
178182
order_by: Optional[ListVolumesRequestOrderBy] = None,
179183
project_id: Optional[str] = None,
184+
organization_id: Optional[str] = None,
180185
page: Optional[int] = None,
181186
page_size: Optional[int] = None,
182187
name: Optional[str] = None,
@@ -188,6 +193,7 @@ def list_volumes_all(
188193
:param zone: Zone to target. If none is passed will use default zone from the config.
189194
:param order_by: Criteria to use when ordering the list.
190195
:param project_id: Filter by Project ID.
196+
:param organization_id: Filter by Organization ID.
191197
:param page: Page number.
192198
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
193199
:param name: Filter the return volumes by their names.
@@ -208,6 +214,7 @@ def list_volumes_all(
208214
"zone": zone,
209215
"order_by": order_by,
210216
"project_id": project_id,
217+
"organization_id": organization_id,
211218
"page": page,
212219
"page_size": page_size,
213220
"name": name,
@@ -426,6 +433,7 @@ def list_snapshots(
426433
zone: Optional[Zone] = None,
427434
order_by: ListSnapshotsRequestOrderBy = ListSnapshotsRequestOrderBy.CREATED_AT_ASC,
428435
project_id: Optional[str] = None,
436+
organization_id: Optional[str] = None,
429437
page: Optional[int] = None,
430438
page_size: Optional[int] = None,
431439
volume_id: Optional[str] = None,
@@ -437,6 +445,7 @@ def list_snapshots(
437445
:param zone: Zone to target. If none is passed will use default zone from the config.
438446
:param order_by: Criteria to use when ordering the list.
439447
:param project_id: Filter by Project ID.
448+
:param organization_id: Filter by Organization ID.
440449
:param page: Page number.
441450
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
442451
:param volume_id: Filter snapshots by the ID of the original volume.
@@ -457,6 +466,8 @@ def list_snapshots(
457466
params={
458467
"name": name,
459468
"order_by": order_by,
469+
"organization_id": organization_id
470+
or self.client.default_organization_id,
460471
"page": page,
461472
"page_size": page_size or self.client.default_page_size,
462473
"project_id": project_id or self.client.default_project_id,
@@ -473,6 +484,7 @@ def list_snapshots_all(
473484
zone: Optional[Zone] = None,
474485
order_by: Optional[ListSnapshotsRequestOrderBy] = None,
475486
project_id: Optional[str] = None,
487+
organization_id: Optional[str] = None,
476488
page: Optional[int] = None,
477489
page_size: Optional[int] = None,
478490
volume_id: Optional[str] = None,
@@ -484,6 +496,7 @@ def list_snapshots_all(
484496
:param zone: Zone to target. If none is passed will use default zone from the config.
485497
:param order_by: Criteria to use when ordering the list.
486498
:param project_id: Filter by Project ID.
499+
:param organization_id: Filter by Organization ID.
487500
:param page: Page number.
488501
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
489502
:param volume_id: Filter snapshots by the ID of the original volume.
@@ -504,6 +517,7 @@ def list_snapshots_all(
504517
"zone": zone,
505518
"order_by": order_by,
506519
"project_id": project_id,
520+
"organization_id": organization_id,
507521
"page": page,
508522
"page_size": page_size,
509523
"volume_id": volume_id,

scaleway/scaleway/block/v1alpha1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,11 @@ class ListVolumesRequest:
533533
Filter by Project ID.
534534
"""
535535

536+
organization_id: Optional[str]
537+
"""
538+
Filter by Organization ID.
539+
"""
540+
536541
page: Optional[int]
537542
"""
538543
Page number.
@@ -677,6 +682,11 @@ class ListSnapshotsRequest:
677682
Filter by Project ID.
678683
"""
679684

685+
organization_id: Optional[str]
686+
"""
687+
Filter by Organization ID.
688+
"""
689+
680690
page: Optional[int]
681691
"""
682692
Page number.

0 commit comments

Comments
 (0)