scaleway.block.v1 package

Submodules

scaleway.block.v1.api module

class scaleway.block.v1.api.BlockV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Block Storage volumes.

create_snapshot(*, volume_id: str, zone: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None) Snapshot

Create a snapshot of a volume. To create a snapshot, the volume must be in the in_use or the available status. If your volume is in a transient state, you need to wait until the end of the current operation. :param volume_id: UUID of the volume to snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: Name of the snapshot. :param project_id: UUID of the project to which the volume and the snapshot belong. :param tags: List of tags assigned to the snapshot. :return: Snapshot

Usage:

result = api.create_snapshot(
    volume_id="example",
)
create_volume(*, zone: Optional[str] = None, name: Optional[str] = None, perf_iops: Optional[int] = None, project_id: Optional[str] = None, from_empty: Optional[CreateVolumeRequestFromEmpty] = None, from_snapshot: Optional[CreateVolumeRequestFromSnapshot] = None, tags: Optional[List[str]] = None) Volume

Create a volume. To create a new volume from scratch, you must specify from_empty and the size. To create a volume from an existing snapshot, specify from_snapshot and the snapshot_id in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: Name of the volume. :param perf_iops: The maximum IO/s expected, according to the different options available in stock (5000 | 15000). One-Of (‘requirements’): at most one of ‘perf_iops’ could be set. :param project_id: UUID of the project the volume belongs to. :param from_empty: Specify the size of the new volume if creating a new one from scratch. One-Of (‘from’): at most one of ‘from_empty’, ‘from_snapshot’ could be set. :param from_snapshot: Specify the snapshot ID of the original snapshot. One-Of (‘from’): at most one of ‘from_empty’, ‘from_snapshot’ could be set. :param tags: List of tags assigned to the volume. :return: Volume

Usage:

result = api.create_volume()
delete_snapshot(*, snapshot_id: str, zone: Optional[str] = None) None

Delete a snapshot. You must specify the snapshot_id of the snapshot you want to delete. The snapshot must not be in use. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config.

Usage:

result = api.delete_snapshot(
    snapshot_id="example",
)
delete_volume(*, volume_id: str, zone: Optional[str] = None) None

Delete a detached volume. You must specify the volume_id of the volume you want to delete. The volume must not be in the in_use status. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config.

Usage:

result = api.delete_volume(
    volume_id="example",
)
export_snapshot_to_object_storage(*, snapshot_id: str, bucket: str, key: str, zone: Optional[str] = None) Snapshot

Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format. The snapshot must not be in transient state. :param snapshot_id: UUID of the snapshot. :param bucket: Scaleway Object Storage bucket where the object is stored. :param key: The object key inside the given bucket. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Snapshot

Usage:

result = api.export_snapshot_to_object_storage(
    snapshot_id="example",
    bucket="example",
    key="example",
)
get_snapshot(*, snapshot_id: str, zone: Optional[str] = None) Snapshot

Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
get_volume(*, volume_id: str, zone: Optional[str] = None) Volume

Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Volume

Usage:

result = api.get_volume(
    volume_id="example",
)
import_snapshot_from_object_storage(*, bucket: str, key: str, name: str, zone: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None, size: Optional[int] = None) Snapshot

Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket. :param bucket: Scaleway Object Storage bucket where the object is stored. :param key: The object key inside the given bucket. :param name: Name of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param project_id: UUID of the Project to which the volume and the snapshot belong. :param tags: List of tags assigned to the snapshot. :param size: Size of the snapshot. :return: Snapshot

Usage:

result = api.import_snapshot_from_object_storage(
    bucket="example",
    key="example",
    name="example",
)
list_snapshots(*, zone: Optional[str] = None, order_by: Optional[ListSnapshotsRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, volume_id: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) ListSnapshotsResponse

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param volume_id: Filter snapshots by the ID of the original volume. :param name: Filter snapshots by their names. :param tags: Filter by tags. Only snapshots with one or more matching tags will be returned. :return: ListSnapshotsResponse

Usage:

result = api.list_snapshots()
list_snapshots_all(*, zone: Optional[str] = None, order_by: Optional[ListSnapshotsRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, volume_id: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) List[Snapshot]

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param volume_id: Filter snapshots by the ID of the original volume. :param name: Filter snapshots by their names. :param tags: Filter by tags. Only snapshots with one or more matching tags will be returned. :return: List[Snapshot]

Usage:

result = api.list_snapshots_all()
list_volume_types(*, zone: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None) ListVolumeTypesResponse

List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order. :param zone: Zone to target. If none is passed will use default zone from the config. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :return: ListVolumeTypesResponse

Usage:

result = api.list_volume_types()
list_volume_types_all(*, zone: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None) List[VolumeType]

List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order. :param zone: Zone to target. If none is passed will use default zone from the config. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :return: List[VolumeType]

Usage:

result = api.list_volume_types_all()
list_volumes(*, zone: Optional[str] = None, order_by: Optional[ListVolumesRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, product_resource_id: Optional[str] = None, tags: Optional[List[str]] = None) ListVolumesResponse

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param name: Filter the return volumes by their names. :param product_resource_id: Filter by a product resource ID linked to this volume (such as an Instance ID). :param tags: Filter by tags. Only volumes with one or more matching tags will be returned. :return: ListVolumesResponse

Usage:

result = api.list_volumes()
list_volumes_all(*, zone: Optional[str] = None, order_by: Optional[ListVolumesRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, product_resource_id: Optional[str] = None, tags: Optional[List[str]] = None) List[Volume]

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param name: Filter the return volumes by their names. :param product_resource_id: Filter by a product resource ID linked to this volume (such as an Instance ID). :param tags: Filter by tags. Only volumes with one or more matching tags will be returned. :return: List[Volume]

Usage:

result = api.list_volumes_all()
update_snapshot(*, snapshot_id: str, zone: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) Snapshot

Update a snapshot. Update the name or tags of the snapshot. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: When defined, is the name of the snapshot. :param tags: List of tags assigned to the snapshot. :return: Snapshot

Usage:

result = api.update_snapshot(
    snapshot_id="example",
)
update_volume(*, volume_id: str, zone: Optional[str] = None, name: Optional[str] = None, size: Optional[int] = None, tags: Optional[List[str]] = None, perf_iops: Optional[int] = None) Volume

Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and volume_type (within the same Block Storage class). You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: When defined, is the new name of the volume. :param size: Size in bytes of the volume, with a granularity of 1 GB (10^9 bytes). Must be compliant with the minimum (1GB) and maximum (10TB) allowed size. :param tags: List of tags assigned to the volume. :param perf_iops: The selected value must be available for the volume’s current storage class. :return: Volume

Usage:

result = api.update_volume(
    volume_id="example",
)
wait_for_snapshot(*, snapshot_id: str, zone: Optional[str] = None, options: Optional[WaitForOptions[Snapshot, bool]] = None) Snapshot

Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
wait_for_volume(*, volume_id: str, zone: Optional[str] = None, options: Optional[WaitForOptions[Volume, bool]] = None) Volume

Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Volume

Usage:

result = api.get_volume(
    volume_id="example",
)

scaleway.block.v1.content module

scaleway.block.v1.content.REFERENCE_TRANSIENT_STATUSES: List[ReferenceStatus] = [<ReferenceStatus.ATTACHING: 'attaching'>, <ReferenceStatus.DETACHING: 'detaching'>, <ReferenceStatus.CREATING: 'creating'>]

Lists transient statutes of the enum ReferenceStatus.

scaleway.block.v1.content.SNAPSHOT_TRANSIENT_STATUSES: List[SnapshotStatus] = [<SnapshotStatus.CREATING: 'creating'>, <SnapshotStatus.DELETING: 'deleting'>, <SnapshotStatus.EXPORTING: 'exporting'>]

Lists transient statutes of the enum SnapshotStatus.

scaleway.block.v1.content.VOLUME_TRANSIENT_STATUSES: List[VolumeStatus] = [<VolumeStatus.CREATING: 'creating'>, <VolumeStatus.DELETING: 'deleting'>, <VolumeStatus.RESIZING: 'resizing'>, <VolumeStatus.SNAPSHOTTING: 'snapshotting'>, <VolumeStatus.UPDATING: 'updating'>]

Lists transient statutes of the enum VolumeStatus.

scaleway.block.v1.marshalling module

scaleway.block.v1.marshalling.marshal_CreateSnapshotRequest(request: CreateSnapshotRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_CreateVolumeRequest(request: CreateVolumeRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_CreateVolumeRequestFromEmpty(request: CreateVolumeRequestFromEmpty, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_CreateVolumeRequestFromSnapshot(request: CreateVolumeRequestFromSnapshot, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_ExportSnapshotToObjectStorageRequest(request: ExportSnapshotToObjectStorageRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_ImportSnapshotFromObjectStorageRequest(request: ImportSnapshotFromObjectStorageRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_UpdateSnapshotRequest(request: UpdateSnapshotRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.marshal_UpdateVolumeRequest(request: UpdateVolumeRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.block.v1.marshalling.unmarshal_ListSnapshotsResponse(data: Any) ListSnapshotsResponse
scaleway.block.v1.marshalling.unmarshal_ListVolumeTypesResponse(data: Any) ListVolumeTypesResponse
scaleway.block.v1.marshalling.unmarshal_ListVolumesResponse(data: Any) ListVolumesResponse
scaleway.block.v1.marshalling.unmarshal_Reference(data: Any) Reference
scaleway.block.v1.marshalling.unmarshal_Snapshot(data: Any) Snapshot
scaleway.block.v1.marshalling.unmarshal_SnapshotParentVolume(data: Any) SnapshotParentVolume
scaleway.block.v1.marshalling.unmarshal_Volume(data: Any) Volume
scaleway.block.v1.marshalling.unmarshal_VolumeSpecifications(data: Any) VolumeSpecifications
scaleway.block.v1.marshalling.unmarshal_VolumeType(data: Any) VolumeType

scaleway.block.v1.types module

class scaleway.block.v1.types.CreateSnapshotRequest(volume_id: 'str', zone: 'Optional[ScwZone]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name of the snapshot.

project_id: Optional[str]

UUID of the project to which the volume and the snapshot belong.

tags: Optional[List[str]]

List of tags assigned to the snapshot.

volume_id: str

UUID of the volume to snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.CreateVolumeRequest(zone: 'Optional[ScwZone]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', from_empty: 'Optional[CreateVolumeRequestFromEmpty]', from_snapshot: 'Optional[CreateVolumeRequestFromSnapshot]', perf_iops: 'Optional[int]')

Bases: object

from_empty: Optional[CreateVolumeRequestFromEmpty]
from_snapshot: Optional[CreateVolumeRequestFromSnapshot]
name: Optional[str]

Name of the volume.

perf_iops: Optional[int]
project_id: Optional[str]

UUID of the project the volume belongs to.

tags: Optional[List[str]]

List of tags assigned to the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.CreateVolumeRequestFromEmpty(size: 'int')

Bases: object

size: int

Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.

class scaleway.block.v1.types.CreateVolumeRequestFromSnapshot(snapshot_id: 'str', size: 'Optional[int]')

Bases: object

size: Optional[int]

Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.

Size is optional and is used only if a resize of the volume is requested, otherwise original snapshot size will be used.

snapshot_id: str

Source snapshot from which volume will be created.

class scaleway.block.v1.types.DeleteSnapshotRequest(snapshot_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

snapshot_id: str

UUID of the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.DeleteVolumeRequest(volume_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

volume_id: str

UUID of the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.ExportSnapshotToObjectStorageRequest(snapshot_id: 'str', bucket: 'str', key: 'str', zone: 'Optional[ScwZone]')

Bases: object

bucket: str

Scaleway Object Storage bucket where the object is stored.

key: str

The object key inside the given bucket.

snapshot_id: str

UUID of the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.GetSnapshotRequest(snapshot_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

snapshot_id: str

UUID of the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.GetVolumeRequest(volume_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

volume_id: str

UUID of the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.ImportSnapshotFromObjectStorageRequest(bucket: 'str', key: 'str', name: 'str', zone: 'Optional[ScwZone]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', size: 'Optional[int]')

Bases: object

bucket: str

Scaleway Object Storage bucket where the object is stored.

key: str

The object key inside the given bucket.

name: str

Name of the snapshot.

project_id: Optional[str]

UUID of the Project to which the volume and the snapshot belong.

size: Optional[int]

Size of the snapshot.

tags: Optional[List[str]]

List of tags assigned to the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.ListSnapshotsRequest(zone: 'Optional[ScwZone]', order_by: 'Optional[ListSnapshotsRequestOrderBy]', project_id: 'Optional[str]', organization_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', volume_id: 'Optional[str]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Filter snapshots by their names.

order_by: Optional[ListSnapshotsRequestOrderBy]

Criteria to use when ordering the list.

organization_id: Optional[str]

Filter by Organization ID.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size, defines how many entries are returned in one page, must be lower or equal to 100.

project_id: Optional[str]

Filter by Project ID.

tags: Optional[List[str]]

Filter by tags. Only snapshots with one or more matching tags will be returned.

volume_id: Optional[str]

Filter snapshots by the ID of the original volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.ListSnapshotsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.block.v1.types.ListSnapshotsResponse(snapshots: 'List[Snapshot]', total_count: 'int')

Bases: object

snapshots: List[Snapshot]

Paginated returned list of snapshots.

total_count: int

Total number of snpashots in the project.

class scaleway.block.v1.types.ListVolumeTypesRequest(zone: 'Optional[ScwZone]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

page: Optional[int]

Page number.

page_size: Optional[int]

Page size, defines how many entries are returned in one page, must be lower or equal to 100.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.ListVolumeTypesResponse(volume_types: 'List[VolumeType]', total_count: 'int')

Bases: object

total_count: int

Total number of volume-types currently available in stock.

volume_types: List[VolumeType]

Returns paginated list of volume-types.

class scaleway.block.v1.types.ListVolumesRequest(zone: 'Optional[ScwZone]', order_by: 'Optional[ListVolumesRequestOrderBy]', project_id: 'Optional[str]', organization_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', product_resource_id: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Filter the return volumes by their names.

order_by: Optional[ListVolumesRequestOrderBy]

Criteria to use when ordering the list.

organization_id: Optional[str]

Filter by Organization ID.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size, defines how many entries are returned in one page, must be lower or equal to 100.

product_resource_id: Optional[str]

Filter by a product resource ID linked to this volume (such as an Instance ID).

project_id: Optional[str]

Filter by Project ID.

tags: Optional[List[str]]

Filter by tags. Only volumes with one or more matching tags will be returned.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.ListVolumesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.block.v1.types.ListVolumesResponse(volumes: 'List[Volume]', total_count: 'int')

Bases: object

total_count: int

Total number of volumes in the project.

volumes: List[Volume]

Paginated returned list of volumes.

class scaleway.block.v1.types.Reference(id: 'str', product_resource_type: 'str', product_resource_id: 'str', type_: 'ReferenceType', status: 'ReferenceStatus', created_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Creation date of the reference.

id: str

UUID of the reference.

product_resource_id: str

UUID of the product resource it refers to (according to the product_resource_type).

product_resource_type: str

Type of resource to which the reference is associated.

status: ReferenceStatus

Status of the reference. Statuses include attaching, attached, and detaching.

type_: ReferenceType

Type of reference (link, exclusive, read_only).

class scaleway.block.v1.types.ReferenceStatus(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

ATTACHED = 'attached'
ATTACHING = 'attaching'
CREATING = 'creating'
DETACHED = 'detached'
DETACHING = 'detaching'
ERROR = 'error'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.block.v1.types.ReferenceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

EXCLUSIVE = 'exclusive'
READ_ONLY = 'read_only'
UNKNOWN_TYPE = 'unknown_type'
class scaleway.block.v1.types.Snapshot(id: 'str', name: 'str', size: 'int', project_id: 'str', references: 'List[Reference]', status: 'SnapshotStatus', tags: 'List[str]', zone: 'ScwZone', class_: 'StorageClass', parent_volume: 'Optional[SnapshotParentVolume]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

class_: StorageClass

Storage class of the snapshot.

created_at: Optional[datetime]

Creation date of the snapshot.

id: str

UUID of the snapshot.

name: str

Name of the snapshot.

parent_volume: Optional[SnapshotParentVolume]

If the parent volume was deleted, value is null.

project_id: str

UUID of the project the snapshot belongs to.

references: List[Reference]

List of the references to the snapshot.

size: int

Size in bytes of the snapshot.

status: SnapshotStatus

Current status of the snapshot (available, in_use, …).

tags: List[str]

List of tags assigned to the volume.

updated_at: Optional[datetime]

Last modification date of the properties of a snapshot.

zone: str

Snapshot zone.

class scaleway.block.v1.types.SnapshotParentVolume(id: 'str', name: 'str', type_: 'str', status: 'VolumeStatus')

Bases: object

id: str

Parent volume UUID (volume from which the snapshot originates).

name: str

Name of the parent volume.

status: VolumeStatus

Current status the parent volume.

type_: str

Volume type of the parent volume.

class scaleway.block.v1.types.SnapshotStatus(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

AVAILABLE = 'available'
CREATING = 'creating'
DELETED = 'deleted'
DELETING = 'deleting'
ERROR = 'error'
EXPORTING = 'exporting'
IN_USE = 'in_use'
LOCKED = 'locked'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.block.v1.types.StorageClass(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

BSSD = 'bssd'
SBS = 'sbs'
UNKNOWN_STORAGE_CLASS = 'unknown_storage_class'
UNSPECIFIED = 'unspecified'
class scaleway.block.v1.types.UpdateSnapshotRequest(snapshot_id: 'str', zone: 'Optional[ScwZone]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

When defined, is the name of the snapshot.

snapshot_id: str

UUID of the snapshot.

tags: Optional[List[str]]

List of tags assigned to the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.UpdateVolumeRequest(volume_id: 'str', zone: 'Optional[ScwZone]', name: 'Optional[str]', size: 'Optional[int]', tags: 'Optional[List[str]]', perf_iops: 'Optional[int]')

Bases: object

name: Optional[str]

When defined, is the new name of the volume.

perf_iops: Optional[int]

The selected value must be available for the volume’s current storage class.

size: Optional[int]

Size in bytes of the volume, with a granularity of 1 GB (10^9 bytes).

Must be compliant with the minimum (1GB) and maximum (10TB) allowed size.

tags: Optional[List[str]]

List of tags assigned to the volume.

volume_id: str

UUID of the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.types.Volume(id: 'str', name: 'str', type_: 'str', size: 'int', project_id: 'str', references: 'List[Reference]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]', parent_snapshot_id: 'Optional[str]', status: 'VolumeStatus', tags: 'List[str]', zone: 'ScwZone', specs: 'Optional[VolumeSpecifications]', last_detached_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Creation date of the volume.

id: str

UUID of the volume.

last_detached_at: Optional[datetime]

Last time the volume was detached.

name: str

Name of the volume.

parent_snapshot_id: Optional[str]

When a volume is created from a snapshot, is the UUID of the snapshot from which the volume has been created.

project_id: str

UUID of the project to which the volume belongs.

references: List[Reference]

List of the references to the volume.

size: int

Volume size in bytes.

specs: Optional[VolumeSpecifications]

Specifications of the volume.

status: VolumeStatus

Current status of the volume (available, in_use, …).

tags: List[str]

List of tags assigned to the volume.

type_: str

Volume type.

updated_at: Optional[datetime]

Last update of the properties of a volume.

zone: str

Volume zone.

class scaleway.block.v1.types.VolumeSpecifications(class_: 'StorageClass', perf_iops: 'Optional[int]')

Bases: object

class_: StorageClass

The storage class of the volume.

perf_iops: Optional[int]

The maximum IO/s expected, according to the different options available in stock (5000 | 15000).

class scaleway.block.v1.types.VolumeStatus(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

AVAILABLE = 'available'
CREATING = 'creating'
DELETED = 'deleted'
DELETING = 'deleting'
ERROR = 'error'
IN_USE = 'in_use'
LOCKED = 'locked'
RESIZING = 'resizing'
SNAPSHOTTING = 'snapshotting'
UNKNOWN_STATUS = 'unknown_status'
UPDATING = 'updating'
class scaleway.block.v1.types.VolumeType(type_: 'str', pricing: 'Optional[Money]', snapshot_pricing: 'Optional[Money]', specs: 'Optional[VolumeSpecifications]')

Bases: object

pricing: Optional[Money]

Price of the volume billed in GB/hour.

snapshot_pricing: Optional[Money]

Price of the snapshot billed in GB/hour.

specs: Optional[VolumeSpecifications]

Volume specifications of the volume type.

type_: str

Volume type.

Module contents

class scaleway.block.v1.BlockV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Block Storage volumes.

create_snapshot(*, volume_id: str, zone: Optional[str] = None, name: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None) Snapshot

Create a snapshot of a volume. To create a snapshot, the volume must be in the in_use or the available status. If your volume is in a transient state, you need to wait until the end of the current operation. :param volume_id: UUID of the volume to snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: Name of the snapshot. :param project_id: UUID of the project to which the volume and the snapshot belong. :param tags: List of tags assigned to the snapshot. :return: Snapshot

Usage:

result = api.create_snapshot(
    volume_id="example",
)
create_volume(*, zone: Optional[str] = None, name: Optional[str] = None, perf_iops: Optional[int] = None, project_id: Optional[str] = None, from_empty: Optional[CreateVolumeRequestFromEmpty] = None, from_snapshot: Optional[CreateVolumeRequestFromSnapshot] = None, tags: Optional[List[str]] = None) Volume

Create a volume. To create a new volume from scratch, you must specify from_empty and the size. To create a volume from an existing snapshot, specify from_snapshot and the snapshot_id in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: Name of the volume. :param perf_iops: The maximum IO/s expected, according to the different options available in stock (5000 | 15000). One-Of (‘requirements’): at most one of ‘perf_iops’ could be set. :param project_id: UUID of the project the volume belongs to. :param from_empty: Specify the size of the new volume if creating a new one from scratch. One-Of (‘from’): at most one of ‘from_empty’, ‘from_snapshot’ could be set. :param from_snapshot: Specify the snapshot ID of the original snapshot. One-Of (‘from’): at most one of ‘from_empty’, ‘from_snapshot’ could be set. :param tags: List of tags assigned to the volume. :return: Volume

Usage:

result = api.create_volume()
delete_snapshot(*, snapshot_id: str, zone: Optional[str] = None) None

Delete a snapshot. You must specify the snapshot_id of the snapshot you want to delete. The snapshot must not be in use. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config.

Usage:

result = api.delete_snapshot(
    snapshot_id="example",
)
delete_volume(*, volume_id: str, zone: Optional[str] = None) None

Delete a detached volume. You must specify the volume_id of the volume you want to delete. The volume must not be in the in_use status. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config.

Usage:

result = api.delete_volume(
    volume_id="example",
)
export_snapshot_to_object_storage(*, snapshot_id: str, bucket: str, key: str, zone: Optional[str] = None) Snapshot

Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format. The snapshot must not be in transient state. :param snapshot_id: UUID of the snapshot. :param bucket: Scaleway Object Storage bucket where the object is stored. :param key: The object key inside the given bucket. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Snapshot

Usage:

result = api.export_snapshot_to_object_storage(
    snapshot_id="example",
    bucket="example",
    key="example",
)
get_snapshot(*, snapshot_id: str, zone: Optional[str] = None) Snapshot

Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
get_volume(*, volume_id: str, zone: Optional[str] = None) Volume

Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Volume

Usage:

result = api.get_volume(
    volume_id="example",
)
import_snapshot_from_object_storage(*, bucket: str, key: str, name: str, zone: Optional[str] = None, project_id: Optional[str] = None, tags: Optional[List[str]] = None, size: Optional[int] = None) Snapshot

Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket. :param bucket: Scaleway Object Storage bucket where the object is stored. :param key: The object key inside the given bucket. :param name: Name of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param project_id: UUID of the Project to which the volume and the snapshot belong. :param tags: List of tags assigned to the snapshot. :param size: Size of the snapshot. :return: Snapshot

Usage:

result = api.import_snapshot_from_object_storage(
    bucket="example",
    key="example",
    name="example",
)
list_snapshots(*, zone: Optional[str] = None, order_by: Optional[ListSnapshotsRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, volume_id: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) ListSnapshotsResponse

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param volume_id: Filter snapshots by the ID of the original volume. :param name: Filter snapshots by their names. :param tags: Filter by tags. Only snapshots with one or more matching tags will be returned. :return: ListSnapshotsResponse

Usage:

result = api.list_snapshots()
list_snapshots_all(*, zone: Optional[str] = None, order_by: Optional[ListSnapshotsRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, volume_id: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) List[Snapshot]

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param volume_id: Filter snapshots by the ID of the original volume. :param name: Filter snapshots by their names. :param tags: Filter by tags. Only snapshots with one or more matching tags will be returned. :return: List[Snapshot]

Usage:

result = api.list_snapshots_all()
list_volume_types(*, zone: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None) ListVolumeTypesResponse

List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order. :param zone: Zone to target. If none is passed will use default zone from the config. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :return: ListVolumeTypesResponse

Usage:

result = api.list_volume_types()
list_volume_types_all(*, zone: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None) List[VolumeType]

List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order. :param zone: Zone to target. If none is passed will use default zone from the config. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :return: List[VolumeType]

Usage:

result = api.list_volume_types_all()
list_volumes(*, zone: Optional[str] = None, order_by: Optional[ListVolumesRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, product_resource_id: Optional[str] = None, tags: Optional[List[str]] = None) ListVolumesResponse

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param name: Filter the return volumes by their names. :param product_resource_id: Filter by a product resource ID linked to this volume (such as an Instance ID). :param tags: Filter by tags. Only volumes with one or more matching tags will be returned. :return: ListVolumesResponse

Usage:

result = api.list_volumes()
list_volumes_all(*, zone: Optional[str] = None, order_by: Optional[ListVolumesRequestOrderBy] = None, project_id: Optional[str] = None, organization_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, name: Optional[str] = None, product_resource_id: Optional[str] = None, tags: Optional[List[str]] = None) List[Volume]

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 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. :param organization_id: Filter by Organization ID. :param page: Page number. :param page_size: Page size, defines how many entries are returned in one page, must be lower or equal to 100. :param name: Filter the return volumes by their names. :param product_resource_id: Filter by a product resource ID linked to this volume (such as an Instance ID). :param tags: Filter by tags. Only volumes with one or more matching tags will be returned. :return: List[Volume]

Usage:

result = api.list_volumes_all()
update_snapshot(*, snapshot_id: str, zone: Optional[str] = None, name: Optional[str] = None, tags: Optional[List[str]] = None) Snapshot

Update a snapshot. Update the name or tags of the snapshot. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: When defined, is the name of the snapshot. :param tags: List of tags assigned to the snapshot. :return: Snapshot

Usage:

result = api.update_snapshot(
    snapshot_id="example",
)
update_volume(*, volume_id: str, zone: Optional[str] = None, name: Optional[str] = None, size: Optional[int] = None, tags: Optional[List[str]] = None, perf_iops: Optional[int] = None) Volume

Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and volume_type (within the same Block Storage class). You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config. :param name: When defined, is the new name of the volume. :param size: Size in bytes of the volume, with a granularity of 1 GB (10^9 bytes). Must be compliant with the minimum (1GB) and maximum (10TB) allowed size. :param tags: List of tags assigned to the volume. :param perf_iops: The selected value must be available for the volume’s current storage class. :return: Volume

Usage:

result = api.update_volume(
    volume_id="example",
)
wait_for_snapshot(*, snapshot_id: str, zone: Optional[str] = None, options: Optional[WaitForOptions[Snapshot, bool]] = None) Snapshot

Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response. :param snapshot_id: UUID of the snapshot. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
wait_for_volume(*, volume_id: str, zone: Optional[str] = None, options: Optional[WaitForOptions[Volume, bool]] = None) Volume

Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response. :param volume_id: UUID of the volume. :param zone: Zone to target. If none is passed will use default zone from the config. :return: Volume

Usage:

result = api.get_volume(
    volume_id="example",
)
class scaleway.block.v1.CreateSnapshotRequest(volume_id: 'str', zone: 'Optional[ScwZone]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Name of the snapshot.

project_id: Optional[str]

UUID of the project to which the volume and the snapshot belong.

tags: Optional[List[str]]

List of tags assigned to the snapshot.

volume_id: str

UUID of the volume to snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.CreateVolumeRequest(zone: 'Optional[ScwZone]', name: 'Optional[str]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', from_empty: 'Optional[CreateVolumeRequestFromEmpty]', from_snapshot: 'Optional[CreateVolumeRequestFromSnapshot]', perf_iops: 'Optional[int]')

Bases: object

from_empty: Optional[CreateVolumeRequestFromEmpty]
from_snapshot: Optional[CreateVolumeRequestFromSnapshot]
name: Optional[str]

Name of the volume.

perf_iops: Optional[int]
project_id: Optional[str]

UUID of the project the volume belongs to.

tags: Optional[List[str]]

List of tags assigned to the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.CreateVolumeRequestFromEmpty(size: 'int')

Bases: object

size: int

Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.

class scaleway.block.v1.CreateVolumeRequestFromSnapshot(snapshot_id: 'str', size: 'Optional[int]')

Bases: object

size: Optional[int]

Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.

Size is optional and is used only if a resize of the volume is requested, otherwise original snapshot size will be used.

snapshot_id: str

Source snapshot from which volume will be created.

class scaleway.block.v1.DeleteSnapshotRequest(snapshot_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

snapshot_id: str

UUID of the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.DeleteVolumeRequest(volume_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

volume_id: str

UUID of the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.ExportSnapshotToObjectStorageRequest(snapshot_id: 'str', bucket: 'str', key: 'str', zone: 'Optional[ScwZone]')

Bases: object

bucket: str

Scaleway Object Storage bucket where the object is stored.

key: str

The object key inside the given bucket.

snapshot_id: str

UUID of the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.GetSnapshotRequest(snapshot_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

snapshot_id: str

UUID of the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.GetVolumeRequest(volume_id: 'str', zone: 'Optional[ScwZone]')

Bases: object

volume_id: str

UUID of the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.ImportSnapshotFromObjectStorageRequest(bucket: 'str', key: 'str', name: 'str', zone: 'Optional[ScwZone]', project_id: 'Optional[str]', tags: 'Optional[List[str]]', size: 'Optional[int]')

Bases: object

bucket: str

Scaleway Object Storage bucket where the object is stored.

key: str

The object key inside the given bucket.

name: str

Name of the snapshot.

project_id: Optional[str]

UUID of the Project to which the volume and the snapshot belong.

size: Optional[int]

Size of the snapshot.

tags: Optional[List[str]]

List of tags assigned to the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.ListSnapshotsRequest(zone: 'Optional[ScwZone]', order_by: 'Optional[ListSnapshotsRequestOrderBy]', project_id: 'Optional[str]', organization_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', volume_id: 'Optional[str]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Filter snapshots by their names.

order_by: Optional[ListSnapshotsRequestOrderBy]

Criteria to use when ordering the list.

organization_id: Optional[str]

Filter by Organization ID.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size, defines how many entries are returned in one page, must be lower or equal to 100.

project_id: Optional[str]

Filter by Project ID.

tags: Optional[List[str]]

Filter by tags. Only snapshots with one or more matching tags will be returned.

volume_id: Optional[str]

Filter snapshots by the ID of the original volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.ListSnapshotsRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.block.v1.ListSnapshotsResponse(snapshots: 'List[Snapshot]', total_count: 'int')

Bases: object

snapshots: List[Snapshot]

Paginated returned list of snapshots.

total_count: int

Total number of snpashots in the project.

class scaleway.block.v1.ListVolumeTypesRequest(zone: 'Optional[ScwZone]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

page: Optional[int]

Page number.

page_size: Optional[int]

Page size, defines how many entries are returned in one page, must be lower or equal to 100.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.ListVolumeTypesResponse(volume_types: 'List[VolumeType]', total_count: 'int')

Bases: object

total_count: int

Total number of volume-types currently available in stock.

volume_types: List[VolumeType]

Returns paginated list of volume-types.

class scaleway.block.v1.ListVolumesRequest(zone: 'Optional[ScwZone]', order_by: 'Optional[ListVolumesRequestOrderBy]', project_id: 'Optional[str]', organization_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', product_resource_id: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

Filter the return volumes by their names.

order_by: Optional[ListVolumesRequestOrderBy]

Criteria to use when ordering the list.

organization_id: Optional[str]

Filter by Organization ID.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size, defines how many entries are returned in one page, must be lower or equal to 100.

product_resource_id: Optional[str]

Filter by a product resource ID linked to this volume (such as an Instance ID).

project_id: Optional[str]

Filter by Project ID.

tags: Optional[List[str]]

Filter by tags. Only volumes with one or more matching tags will be returned.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.ListVolumesRequestOrderBy(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.block.v1.ListVolumesResponse(volumes: 'List[Volume]', total_count: 'int')

Bases: object

total_count: int

Total number of volumes in the project.

volumes: List[Volume]

Paginated returned list of volumes.

class scaleway.block.v1.Reference(id: 'str', product_resource_type: 'str', product_resource_id: 'str', type_: 'ReferenceType', status: 'ReferenceStatus', created_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Creation date of the reference.

id: str

UUID of the reference.

product_resource_id: str

UUID of the product resource it refers to (according to the product_resource_type).

product_resource_type: str

Type of resource to which the reference is associated.

status: ReferenceStatus

Status of the reference. Statuses include attaching, attached, and detaching.

type_: ReferenceType

Type of reference (link, exclusive, read_only).

class scaleway.block.v1.ReferenceStatus(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

ATTACHED = 'attached'
ATTACHING = 'attaching'
CREATING = 'creating'
DETACHED = 'detached'
DETACHING = 'detaching'
ERROR = 'error'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.block.v1.ReferenceType(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

EXCLUSIVE = 'exclusive'
READ_ONLY = 'read_only'
UNKNOWN_TYPE = 'unknown_type'
class scaleway.block.v1.Snapshot(id: 'str', name: 'str', size: 'int', project_id: 'str', references: 'List[Reference]', status: 'SnapshotStatus', tags: 'List[str]', zone: 'ScwZone', class_: 'StorageClass', parent_volume: 'Optional[SnapshotParentVolume]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

class_: StorageClass

Storage class of the snapshot.

created_at: Optional[datetime]

Creation date of the snapshot.

id: str

UUID of the snapshot.

name: str

Name of the snapshot.

parent_volume: Optional[SnapshotParentVolume]

If the parent volume was deleted, value is null.

project_id: str

UUID of the project the snapshot belongs to.

references: List[Reference]

List of the references to the snapshot.

size: int

Size in bytes of the snapshot.

status: SnapshotStatus

Current status of the snapshot (available, in_use, …).

tags: List[str]

List of tags assigned to the volume.

updated_at: Optional[datetime]

Last modification date of the properties of a snapshot.

zone: str

Snapshot zone.

class scaleway.block.v1.SnapshotParentVolume(id: 'str', name: 'str', type_: 'str', status: 'VolumeStatus')

Bases: object

id: str

Parent volume UUID (volume from which the snapshot originates).

name: str

Name of the parent volume.

status: VolumeStatus

Current status the parent volume.

type_: str

Volume type of the parent volume.

class scaleway.block.v1.SnapshotStatus(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

AVAILABLE = 'available'
CREATING = 'creating'
DELETED = 'deleted'
DELETING = 'deleting'
ERROR = 'error'
EXPORTING = 'exporting'
IN_USE = 'in_use'
LOCKED = 'locked'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.block.v1.StorageClass(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

BSSD = 'bssd'
SBS = 'sbs'
UNKNOWN_STORAGE_CLASS = 'unknown_storage_class'
UNSPECIFIED = 'unspecified'
class scaleway.block.v1.UpdateSnapshotRequest(snapshot_id: 'str', zone: 'Optional[ScwZone]', name: 'Optional[str]', tags: 'Optional[List[str]]')

Bases: object

name: Optional[str]

When defined, is the name of the snapshot.

snapshot_id: str

UUID of the snapshot.

tags: Optional[List[str]]

List of tags assigned to the snapshot.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.UpdateVolumeRequest(volume_id: 'str', zone: 'Optional[ScwZone]', name: 'Optional[str]', size: 'Optional[int]', tags: 'Optional[List[str]]', perf_iops: 'Optional[int]')

Bases: object

name: Optional[str]

When defined, is the new name of the volume.

perf_iops: Optional[int]

The selected value must be available for the volume’s current storage class.

size: Optional[int]

Size in bytes of the volume, with a granularity of 1 GB (10^9 bytes).

Must be compliant with the minimum (1GB) and maximum (10TB) allowed size.

tags: Optional[List[str]]

List of tags assigned to the volume.

volume_id: str

UUID of the volume.

zone: Optional[str]

Zone to target. If none is passed will use default zone from the config.

class scaleway.block.v1.Volume(id: 'str', name: 'str', type_: 'str', size: 'int', project_id: 'str', references: 'List[Reference]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]', parent_snapshot_id: 'Optional[str]', status: 'VolumeStatus', tags: 'List[str]', zone: 'ScwZone', specs: 'Optional[VolumeSpecifications]', last_detached_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Creation date of the volume.

id: str

UUID of the volume.

last_detached_at: Optional[datetime]

Last time the volume was detached.

name: str

Name of the volume.

parent_snapshot_id: Optional[str]

When a volume is created from a snapshot, is the UUID of the snapshot from which the volume has been created.

project_id: str

UUID of the project to which the volume belongs.

references: List[Reference]

List of the references to the volume.

size: int

Volume size in bytes.

specs: Optional[VolumeSpecifications]

Specifications of the volume.

status: VolumeStatus

Current status of the volume (available, in_use, …).

tags: List[str]

List of tags assigned to the volume.

type_: str

Volume type.

updated_at: Optional[datetime]

Last update of the properties of a volume.

zone: str

Volume zone.

class scaleway.block.v1.VolumeSpecifications(class_: 'StorageClass', perf_iops: 'Optional[int]')

Bases: object

class_: StorageClass

The storage class of the volume.

perf_iops: Optional[int]

The maximum IO/s expected, according to the different options available in stock (5000 | 15000).

class scaleway.block.v1.VolumeStatus(value: str, names: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

AVAILABLE = 'available'
CREATING = 'creating'
DELETED = 'deleted'
DELETING = 'deleting'
ERROR = 'error'
IN_USE = 'in_use'
LOCKED = 'locked'
RESIZING = 'resizing'
SNAPSHOTTING = 'snapshotting'
UNKNOWN_STATUS = 'unknown_status'
UPDATING = 'updating'
class scaleway.block.v1.VolumeType(type_: 'str', pricing: 'Optional[Money]', snapshot_pricing: 'Optional[Money]', specs: 'Optional[VolumeSpecifications]')

Bases: object

pricing: Optional[Money]

Price of the volume billed in GB/hour.

snapshot_pricing: Optional[Money]

Price of the snapshot billed in GB/hour.

specs: Optional[VolumeSpecifications]

Volume specifications of the volume type.

type_: str

Volume type.