Skip to content

Commit 4f19fec

Browse files
authored
feat(block): add tags filter in list snapshots (#865)
1 parent c49ff44 commit 4f19fec

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ async def list_snapshots(
447447
page_size: Optional[int] = None,
448448
volume_id: Optional[str] = None,
449449
name: Optional[str] = None,
450+
tags: Optional[List[str]] = None,
450451
) -> ListSnapshotsResponse:
451452
"""
452453
List all snapshots.
@@ -459,6 +460,7 @@ async def list_snapshots(
459460
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
460461
:param volume_id: Filter snapshots by the ID of the original volume.
461462
:param name: Filter snapshots by their names.
463+
:param tags: Filter by tags. Only snapshots with one or more matching tags will be returned.
462464
:return: :class:`ListSnapshotsResponse <ListSnapshotsResponse>`
463465
464466
Usage:
@@ -480,6 +482,7 @@ async def list_snapshots(
480482
"page": page,
481483
"page_size": page_size or self.client.default_page_size,
482484
"project_id": project_id or self.client.default_project_id,
485+
"tags": tags,
483486
"volume_id": volume_id,
484487
},
485488
)
@@ -498,6 +501,7 @@ async def list_snapshots_all(
498501
page_size: Optional[int] = None,
499502
volume_id: Optional[str] = None,
500503
name: Optional[str] = None,
504+
tags: Optional[List[str]] = None,
501505
) -> List[Snapshot]:
502506
"""
503507
List all snapshots.
@@ -510,6 +514,7 @@ async def list_snapshots_all(
510514
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
511515
:param volume_id: Filter snapshots by the ID of the original volume.
512516
:param name: Filter snapshots by their names.
517+
:param tags: Filter by tags. Only snapshots with one or more matching tags will be returned.
513518
:return: :class:`List[Snapshot] <List[Snapshot]>`
514519
515520
Usage:
@@ -531,6 +536,7 @@ async def list_snapshots_all(
531536
"page_size": page_size,
532537
"volume_id": volume_id,
533538
"name": name,
539+
"tags": tags,
534540
},
535541
)
536542

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,11 @@ class ListSnapshotsRequest:
601601
Filter snapshots by their names.
602602
"""
603603

604+
tags: Optional[List[str]]
605+
"""
606+
Filter by tags. Only snapshots with one or more matching tags will be returned.
607+
"""
608+
604609

605610
@dataclass
606611
class ListSnapshotsResponse:

scaleway/scaleway/block/v1alpha1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ def list_snapshots(
447447
page_size: Optional[int] = None,
448448
volume_id: Optional[str] = None,
449449
name: Optional[str] = None,
450+
tags: Optional[List[str]] = None,
450451
) -> ListSnapshotsResponse:
451452
"""
452453
List all snapshots.
@@ -459,6 +460,7 @@ def list_snapshots(
459460
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
460461
:param volume_id: Filter snapshots by the ID of the original volume.
461462
:param name: Filter snapshots by their names.
463+
:param tags: Filter by tags. Only snapshots with one or more matching tags will be returned.
462464
:return: :class:`ListSnapshotsResponse <ListSnapshotsResponse>`
463465
464466
Usage:
@@ -480,6 +482,7 @@ def list_snapshots(
480482
"page": page,
481483
"page_size": page_size or self.client.default_page_size,
482484
"project_id": project_id or self.client.default_project_id,
485+
"tags": tags,
483486
"volume_id": volume_id,
484487
},
485488
)
@@ -498,6 +501,7 @@ def list_snapshots_all(
498501
page_size: Optional[int] = None,
499502
volume_id: Optional[str] = None,
500503
name: Optional[str] = None,
504+
tags: Optional[List[str]] = None,
501505
) -> List[Snapshot]:
502506
"""
503507
List all snapshots.
@@ -510,6 +514,7 @@ def list_snapshots_all(
510514
:param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100.
511515
:param volume_id: Filter snapshots by the ID of the original volume.
512516
:param name: Filter snapshots by their names.
517+
:param tags: Filter by tags. Only snapshots with one or more matching tags will be returned.
513518
:return: :class:`List[Snapshot] <List[Snapshot]>`
514519
515520
Usage:
@@ -531,6 +536,7 @@ def list_snapshots_all(
531536
"page_size": page_size,
532537
"volume_id": volume_id,
533538
"name": name,
539+
"tags": tags,
534540
},
535541
)
536542

scaleway/scaleway/block/v1alpha1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,11 @@ class ListSnapshotsRequest:
601601
Filter snapshots by their names.
602602
"""
603603

604+
tags: Optional[List[str]]
605+
"""
606+
Filter by tags. Only snapshots with one or more matching tags will be returned.
607+
"""
608+
604609

605610
@dataclass
606611
class ListSnapshotsResponse:

0 commit comments

Comments
 (0)