Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions scaleway-async/scaleway_async/block/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ async def list_volume_types_all(
async def list_volumes(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListVolumesRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -139,6 +140,7 @@ async def list_volumes(
"""
List volumes.
List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted volumes not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -153,7 +155,9 @@ async def list_volumes(
Usage:
::

result = await api.list_volumes()
result = await api.list_volumes(
include_deleted=False,
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
Expand All @@ -162,6 +166,7 @@ async def list_volumes(
"GET",
f"/block/v1/zones/{param_zone}/volumes",
params={
"include_deleted": include_deleted,
"name": name,
"order_by": order_by,
"organization_id": organization_id
Expand All @@ -180,6 +185,7 @@ async def list_volumes(
async def list_volumes_all(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListVolumesRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -193,6 +199,7 @@ async def list_volumes_all(
"""
List volumes.
List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted volumes not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -207,14 +214,17 @@ async def list_volumes_all(
Usage:
::

result = await api.list_volumes_all()
result = await api.list_volumes_all(
include_deleted=False,
)
"""

return await fetch_all_pages_async(
type=ListVolumesResponse,
key="volumes",
fetcher=self.list_volumes,
args={
"include_deleted": include_deleted,
"zone": zone,
"order_by": order_by,
"project_id": project_id,
Expand Down Expand Up @@ -437,6 +447,7 @@ async def update_volume(
async def list_snapshots(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListSnapshotsRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -450,6 +461,7 @@ async def list_snapshots(
"""
List all snapshots.
List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted snapshots not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -464,7 +476,9 @@ async def list_snapshots(
Usage:
::

result = await api.list_snapshots()
result = await api.list_snapshots(
include_deleted=False,
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
Expand All @@ -473,6 +487,7 @@ async def list_snapshots(
"GET",
f"/block/v1/zones/{param_zone}/snapshots",
params={
"include_deleted": include_deleted,
"name": name,
"order_by": order_by,
"organization_id": organization_id
Expand All @@ -491,6 +506,7 @@ async def list_snapshots(
async def list_snapshots_all(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListSnapshotsRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -504,6 +520,7 @@ async def list_snapshots_all(
"""
List all snapshots.
List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted snapshots not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -518,14 +535,17 @@ async def list_snapshots_all(
Usage:
::

result = await api.list_snapshots_all()
result = await api.list_snapshots_all(
include_deleted=False,
)
"""

return await fetch_all_pages_async(
type=ListSnapshotsResponse,
key="snapshots",
fetcher=self.list_snapshots,
args={
"include_deleted": include_deleted,
"zone": zone,
"order_by": order_by,
"project_id": project_id,
Expand Down
10 changes: 10 additions & 0 deletions scaleway-async/scaleway_async/block/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ class ImportSnapshotFromObjectStorageRequest:

@dataclass
class ListSnapshotsRequest:
include_deleted: bool
"""
Display deleted snapshots not erased yet.
"""

zone: Optional[ScwZone]
"""
Zone to target. If none is passed will use default zone from the config.
Expand Down Expand Up @@ -615,6 +620,11 @@ class ListVolumeTypesResponse:

@dataclass
class ListVolumesRequest:
include_deleted: bool
"""
Display deleted volumes not erased yet.
"""

zone: Optional[ScwZone]
"""
Zone to target. If none is passed will use default zone from the config.
Expand Down
28 changes: 24 additions & 4 deletions scaleway/scaleway/block/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def list_volume_types_all(
def list_volumes(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListVolumesRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -139,6 +140,7 @@ def list_volumes(
"""
List volumes.
List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted volumes not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -153,7 +155,9 @@ def list_volumes(
Usage:
::

result = api.list_volumes()
result = api.list_volumes(
include_deleted=False,
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
Expand All @@ -162,6 +166,7 @@ def list_volumes(
"GET",
f"/block/v1/zones/{param_zone}/volumes",
params={
"include_deleted": include_deleted,
"name": name,
"order_by": order_by,
"organization_id": organization_id
Expand All @@ -180,6 +185,7 @@ def list_volumes(
def list_volumes_all(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListVolumesRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -193,6 +199,7 @@ def list_volumes_all(
"""
List volumes.
List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted volumes not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -207,14 +214,17 @@ def list_volumes_all(
Usage:
::

result = api.list_volumes_all()
result = api.list_volumes_all(
include_deleted=False,
)
"""

return fetch_all_pages(
type=ListVolumesResponse,
key="volumes",
fetcher=self.list_volumes,
args={
"include_deleted": include_deleted,
"zone": zone,
"order_by": order_by,
"project_id": project_id,
Expand Down Expand Up @@ -437,6 +447,7 @@ def update_volume(
def list_snapshots(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListSnapshotsRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -450,6 +461,7 @@ def list_snapshots(
"""
List all snapshots.
List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted snapshots not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -464,7 +476,9 @@ def list_snapshots(
Usage:
::

result = api.list_snapshots()
result = api.list_snapshots(
include_deleted=False,
)
"""

param_zone = validate_path_param("zone", zone or self.client.default_zone)
Expand All @@ -473,6 +487,7 @@ def list_snapshots(
"GET",
f"/block/v1/zones/{param_zone}/snapshots",
params={
"include_deleted": include_deleted,
"name": name,
"order_by": order_by,
"organization_id": organization_id
Expand All @@ -491,6 +506,7 @@ def list_snapshots(
def list_snapshots_all(
self,
*,
include_deleted: bool,
zone: Optional[ScwZone] = None,
order_by: Optional[ListSnapshotsRequestOrderBy] = None,
project_id: Optional[str] = None,
Expand All @@ -504,6 +520,7 @@ def list_snapshots_all(
"""
List all snapshots.
List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
:param include_deleted: Display deleted snapshots not erased yet.
:param zone: Zone to target. If none is passed will use default zone from the config.
:param order_by: Criteria to use when ordering the list.
:param project_id: Filter by Project ID.
Expand All @@ -518,14 +535,17 @@ def list_snapshots_all(
Usage:
::

result = api.list_snapshots_all()
result = api.list_snapshots_all(
include_deleted=False,
)
"""

return fetch_all_pages(
type=ListSnapshotsResponse,
key="snapshots",
fetcher=self.list_snapshots,
args={
"include_deleted": include_deleted,
"zone": zone,
"order_by": order_by,
"project_id": project_id,
Expand Down
10 changes: 10 additions & 0 deletions scaleway/scaleway/block/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,11 @@ class ImportSnapshotFromObjectStorageRequest:

@dataclass
class ListSnapshotsRequest:
include_deleted: bool
"""
Display deleted snapshots not erased yet.
"""

zone: Optional[ScwZone]
"""
Zone to target. If none is passed will use default zone from the config.
Expand Down Expand Up @@ -615,6 +620,11 @@ class ListVolumeTypesResponse:

@dataclass
class ListVolumesRequest:
include_deleted: bool
"""
Display deleted volumes not erased yet.
"""

zone: Optional[ScwZone]
"""
Zone to target. If none is passed will use default zone from the config.
Expand Down
Loading