diff --git a/scaleway-async/scaleway_async/file/__init__.py b/scaleway-async/scaleway_async/file/__init__.py new file mode 100644 index 000000000..8b74a5ed7 --- /dev/null +++ b/scaleway-async/scaleway_async/file/__init__.py @@ -0,0 +1,2 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. diff --git a/scaleway-async/scaleway_async/file/v1alpha1/__init__.py b/scaleway-async/scaleway_async/file/v1alpha1/__init__.py new file mode 100644 index 000000000..05c3dbdf6 --- /dev/null +++ b/scaleway-async/scaleway_async/file/v1alpha1/__init__.py @@ -0,0 +1,35 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from .types import AttachmentResourceType +from .types import FileSystemStatus +from .content import FILE_SYSTEM_TRANSIENT_STATUSES +from .types import ListFileSystemsRequestOrderBy +from .types import Attachment +from .types import FileSystem +from .types import CreateFileSystemRequest +from .types import DeleteFileSystemRequest +from .types import GetFileSystemRequest +from .types import ListAttachmentsRequest +from .types import ListAttachmentsResponse +from .types import ListFileSystemsRequest +from .types import ListFileSystemsResponse +from .types import UpdateFileSystemRequest +from .api import FileV1Alpha1API + +__all__ = [ + "AttachmentResourceType", + "FileSystemStatus", + "FILE_SYSTEM_TRANSIENT_STATUSES", + "ListFileSystemsRequestOrderBy", + "Attachment", + "FileSystem", + "CreateFileSystemRequest", + "DeleteFileSystemRequest", + "GetFileSystemRequest", + "ListAttachmentsRequest", + "ListAttachmentsResponse", + "ListFileSystemsRequest", + "ListFileSystemsResponse", + "UpdateFileSystemRequest", + "FileV1Alpha1API", +] diff --git a/scaleway-async/scaleway_async/file/v1alpha1/api.py b/scaleway-async/scaleway_async/file/v1alpha1/api.py new file mode 100644 index 000000000..733f3a81a --- /dev/null +++ b/scaleway-async/scaleway_async/file/v1alpha1/api.py @@ -0,0 +1,434 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Awaitable, List, Optional, Union + +from scaleway_core.api import API +from scaleway_core.bridge import ( + Region as ScwRegion, +) +from scaleway_core.utils import ( + WaitForOptions, + validate_path_param, + fetch_all_pages_async, + wait_for_resource_async, +) +from .types import ( + AttachmentResourceType, + ListFileSystemsRequestOrderBy, + Attachment, + CreateFileSystemRequest, + FileSystem, + ListAttachmentsResponse, + ListFileSystemsResponse, + UpdateFileSystemRequest, +) +from .content import ( + FILE_SYSTEM_TRANSIENT_STATUSES, +) +from .marshalling import ( + unmarshal_FileSystem, + unmarshal_ListAttachmentsResponse, + unmarshal_ListFileSystemsResponse, + marshal_CreateFileSystemRequest, + marshal_UpdateFileSystemRequest, +) + + +class FileV1Alpha1API(API): + """ + This API allows you to manage your File Storage resources. + """ + + async def get_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + ) -> FileSystem: + """ + Get filesystem details. + Retrieve all properties and current status of a specific filesystem identified by its ID. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`FileSystem ` + + Usage: + :: + + result = await api.get_file_system( + filesystem_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_filesystem_id = validate_path_param("filesystem_id", filesystem_id) + + res = self._request( + "GET", + f"/file/v1alpha1/regions/{param_region}/filesystems/{param_filesystem_id}", + ) + + self._throw_on_error(res) + return unmarshal_FileSystem(res.json()) + + async def wait_for_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + options: Optional[ + WaitForOptions[FileSystem, Union[bool, Awaitable[bool]]] + ] = None, + ) -> FileSystem: + """ + Get filesystem details. + Retrieve all properties and current status of a specific filesystem identified by its ID. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`FileSystem ` + + Usage: + :: + + result = await api.get_file_system( + filesystem_id="example", + ) + """ + + if not options: + options = WaitForOptions() + + if not options.stop: + options.stop = lambda res: res.status not in FILE_SYSTEM_TRANSIENT_STATUSES + + return await wait_for_resource_async( + fetcher=self.get_file_system, + options=options, + args={ + "filesystem_id": filesystem_id, + "region": region, + }, + ) + + async def list_file_systems( + self, + *, + region: Optional[ScwRegion] = None, + order_by: Optional[ListFileSystemsRequestOrderBy] = None, + project_id: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + name: Optional[str] = None, + tags: Optional[List[str]] = None, + ) -> ListFileSystemsResponse: + """ + List all filesystems. + Retrieve all filesystems in the specified region. Results are ordered by creation date in ascending order by default. + Use the order_by parameter to modify the sorting behavior. + :param region: Region to target. If none is passed will use default region from the config. + :param order_by: Criteria to use when ordering the list. + :param project_id: Filter by project ID. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :param name: Filter the return filesystems by their names. + :param tags: Filter by tags. Only filesystems with one or more matching tags will be returned. + :return: :class:`ListFileSystemsResponse ` + + Usage: + :: + + result = await api.list_file_systems() + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "GET", + f"/file/v1alpha1/regions/{param_region}/filesystems", + params={ + "name": name, + "order_by": order_by, + "page": page, + "page_size": page_size or self.client.default_page_size, + "project_id": project_id or self.client.default_project_id, + "tags": tags, + }, + ) + + self._throw_on_error(res) + return unmarshal_ListFileSystemsResponse(res.json()) + + async def list_file_systems_all( + self, + *, + region: Optional[ScwRegion] = None, + order_by: Optional[ListFileSystemsRequestOrderBy] = None, + project_id: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + name: Optional[str] = None, + tags: Optional[List[str]] = None, + ) -> List[FileSystem]: + """ + List all filesystems. + Retrieve all filesystems in the specified region. Results are ordered by creation date in ascending order by default. + Use the order_by parameter to modify the sorting behavior. + :param region: Region to target. If none is passed will use default region from the config. + :param order_by: Criteria to use when ordering the list. + :param project_id: Filter by project ID. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :param name: Filter the return filesystems by their names. + :param tags: Filter by tags. Only filesystems with one or more matching tags will be returned. + :return: :class:`List[FileSystem] ` + + Usage: + :: + + result = await api.list_file_systems_all() + """ + + return await fetch_all_pages_async( + type=ListFileSystemsResponse, + key="filesystems", + fetcher=self.list_file_systems, + args={ + "region": region, + "order_by": order_by, + "project_id": project_id, + "page": page, + "page_size": page_size, + "name": name, + "tags": tags, + }, + ) + + async def list_attachments( + self, + *, + region: Optional[ScwRegion] = None, + filesystem_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_type: Optional[AttachmentResourceType] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + ) -> ListAttachmentsResponse: + """ + List filesystems attachments. + List all existing attachments in a specified region. + By default, the attachments listed are ordered by creation date in ascending order. + This can be modified using the `order_by` field. + :param region: Region to target. If none is passed will use default region from the config. + :param filesystem_id: UUID of the File Storage volume. + :param resource_id: Filter by resource ID. + :param resource_type: Filter by resource type. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :return: :class:`ListAttachmentsResponse ` + + Usage: + :: + + result = await api.list_attachments() + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "GET", + f"/file/v1alpha1/regions/{param_region}/attachments", + params={ + "filesystem_id": filesystem_id, + "page": page, + "page_size": page_size or self.client.default_page_size, + "resource_id": resource_id, + "resource_type": resource_type, + }, + ) + + self._throw_on_error(res) + return unmarshal_ListAttachmentsResponse(res.json()) + + async def list_attachments_all( + self, + *, + region: Optional[ScwRegion] = None, + filesystem_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_type: Optional[AttachmentResourceType] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[Attachment]: + """ + List filesystems attachments. + List all existing attachments in a specified region. + By default, the attachments listed are ordered by creation date in ascending order. + This can be modified using the `order_by` field. + :param region: Region to target. If none is passed will use default region from the config. + :param filesystem_id: UUID of the File Storage volume. + :param resource_id: Filter by resource ID. + :param resource_type: Filter by resource type. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :return: :class:`List[Attachment] ` + + Usage: + :: + + result = await api.list_attachments_all() + """ + + return await fetch_all_pages_async( + type=ListAttachmentsResponse, + key="attachments", + fetcher=self.list_attachments, + args={ + "region": region, + "filesystem_id": filesystem_id, + "resource_id": resource_id, + "resource_type": resource_type, + "page": page, + "page_size": page_size, + }, + ) + + async def create_file_system( + self, + *, + name: str, + size: int, + region: Optional[ScwRegion] = None, + project_id: Optional[str] = None, + tags: Optional[List[str]] = None, + ) -> FileSystem: + """ + Create a new filesystem. + To create a new filesystem, you need to provide a name, a size, and a project ID. + :param name: Name of the filesystem. + :param size: Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + :param region: Region to target. If none is passed will use default region from the config. + :param project_id: UUID of the project the filesystem belongs to. + :param tags: List of tags assigned to the filesystem. + :return: :class:`FileSystem ` + + Usage: + :: + + result = await api.create_file_system( + name="example", + size=1, + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "POST", + f"/file/v1alpha1/regions/{param_region}/filesystems", + body=marshal_CreateFileSystemRequest( + CreateFileSystemRequest( + name=name, + size=size, + region=region, + project_id=project_id, + tags=tags, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_FileSystem(res.json()) + + async def delete_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + ) -> None: + """ + Delete a detached filesystem. + You must specify the `filesystem_id` of the filesystem you want to delete. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + + Usage: + :: + + result = await api.delete_file_system( + filesystem_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_filesystem_id = validate_path_param("filesystem_id", filesystem_id) + + res = self._request( + "DELETE", + f"/file/v1alpha1/regions/{param_region}/filesystems/{param_filesystem_id}", + ) + + self._throw_on_error(res) + + async def update_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + name: Optional[str] = None, + size: Optional[int] = None, + tags: Optional[List[str]] = None, + ) -> FileSystem: + """ + Update filesystem properties. + Update the technical details of a filesystem, such as its name, tags or its new size. + You can only resize a filesystem to a larger size. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + :param name: When defined, is the new name of the filesystem. + :param size: Size in bytes, with a granularity of 100 GB (10^11 bytes). + Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + :param tags: List of tags assigned to the filesystem. + :return: :class:`FileSystem ` + + Usage: + :: + + result = await api.update_file_system( + filesystem_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_filesystem_id = validate_path_param("filesystem_id", filesystem_id) + + res = self._request( + "PATCH", + f"/file/v1alpha1/regions/{param_region}/filesystems/{param_filesystem_id}", + body=marshal_UpdateFileSystemRequest( + UpdateFileSystemRequest( + filesystem_id=filesystem_id, + region=region, + name=name, + size=size, + tags=tags, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_FileSystem(res.json()) diff --git a/scaleway-async/scaleway_async/file/v1alpha1/content.py b/scaleway-async/scaleway_async/file/v1alpha1/content.py new file mode 100644 index 000000000..c6a422b4e --- /dev/null +++ b/scaleway-async/scaleway_async/file/v1alpha1/content.py @@ -0,0 +1,15 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from typing import List + +from .types import ( + FileSystemStatus, +) + +FILE_SYSTEM_TRANSIENT_STATUSES: List[FileSystemStatus] = [ + FileSystemStatus.CREATING, + FileSystemStatus.UPDATING, +] +""" +Lists transient statutes of the enum :class:`FileSystemStatus `. +""" diff --git a/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py new file mode 100644 index 000000000..16d195ff0 --- /dev/null +++ b/scaleway-async/scaleway_async/file/v1alpha1/marshalling.py @@ -0,0 +1,182 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Any, Dict +from dateutil import parser + +from scaleway_core.profile import ProfileDefaults +from .types import ( + FileSystem, + Attachment, + ListAttachmentsResponse, + ListFileSystemsResponse, + CreateFileSystemRequest, + UpdateFileSystemRequest, +) + + +def unmarshal_FileSystem(data: Any) -> FileSystem: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'FileSystem' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("size", None) + if field is not None: + args["size"] = field + + field = data.get("status", None) + if field is not None: + args["status"] = field + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + + field = data.get("tags", None) + if field is not None: + args["tags"] = field + + field = data.get("number_of_attachments", None) + if field is not None: + args["number_of_attachments"] = field + + field = data.get("region", None) + if field is not None: + args["region"] = field + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + return FileSystem(**args) + + +def unmarshal_Attachment(data: Any) -> Attachment: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Attachment' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("filesystem_id", None) + if field is not None: + args["filesystem_id"] = field + + field = data.get("resource_id", None) + if field is not None: + args["resource_id"] = field + + field = data.get("resource_type", None) + if field is not None: + args["resource_type"] = field + + return Attachment(**args) + + +def unmarshal_ListAttachmentsResponse(data: Any) -> ListAttachmentsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListAttachmentsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("attachments", None) + if field is not None: + args["attachments"] = ( + [unmarshal_Attachment(v) for v in field] if field is not None else None + ) + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + return ListAttachmentsResponse(**args) + + +def unmarshal_ListFileSystemsResponse(data: Any) -> ListFileSystemsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListFileSystemsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("filesystems", None) + if field is not None: + args["filesystems"] = ( + [unmarshal_FileSystem(v) for v in field] if field is not None else None + ) + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + return ListFileSystemsResponse(**args) + + +def marshal_CreateFileSystemRequest( + request: CreateFileSystemRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.name is not None: + output["name"] = request.name + + if request.size is not None: + output["size"] = request.size + + if request.project_id is not None: + output["project_id"] = request.project_id or defaults.default_project_id + + if request.tags is not None: + output["tags"] = request.tags + + return output + + +def marshal_UpdateFileSystemRequest( + request: UpdateFileSystemRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.name is not None: + output["name"] = request.name + + if request.size is not None: + output["size"] = request.size + + if request.tags is not None: + output["tags"] = request.tags + + return output diff --git a/scaleway-async/scaleway_async/file/v1alpha1/types.py b/scaleway-async/scaleway_async/file/v1alpha1/types.py new file mode 100644 index 000000000..d9049b6db --- /dev/null +++ b/scaleway-async/scaleway_async/file/v1alpha1/types.py @@ -0,0 +1,345 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from enum import Enum +from typing import List, Optional + +from scaleway_core.bridge import ( + Region as ScwRegion, +) +from scaleway_core.utils import ( + StrEnumMeta, +) + + +class AttachmentResourceType(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_RESOURCE_TYPE = "unknown_resource_type" + INSTANCE_SERVER = "instance_server" + + def __str__(self) -> str: + return str(self.value) + + +class FileSystemStatus(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_STATUS = "unknown_status" + AVAILABLE = "available" + ERROR = "error" + CREATING = "creating" + UPDATING = "updating" + + def __str__(self) -> str: + return str(self.value) + + +class ListFileSystemsRequestOrderBy(str, Enum, metaclass=StrEnumMeta): + CREATED_AT_ASC = "created_at_asc" + CREATED_AT_DESC = "created_at_desc" + NAME_ASC = "name_asc" + NAME_DESC = "name_desc" + + def __str__(self) -> str: + return str(self.value) + + +@dataclass +class Attachment: + """ + Represents an attachment between a filesystem and a resource. + """ + + id: str + """ + UUID of the attachment. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + resource_id: str + """ + UUID of the attached resource. + """ + + resource_type: AttachmentResourceType + """ + The type of the attached resource. + """ + + +@dataclass +class FileSystem: + """ + Represents a filesystem resource and its properties. + """ + + id: str + """ + UUID of the filesystem. + """ + + name: str + """ + Name of the filesystem. + """ + + size: int + """ + Filesystem size in bytes. + """ + + status: FileSystemStatus + """ + Current status of the filesystem (e.g. creating, available, ...). + """ + + project_id: str + """ + UUID of the project to which the filesystem belongs. + """ + + organization_id: str + """ + UUID of the organization to which the filesystem belongs. + """ + + tags: List[str] + """ + List of tags assigned to the filesystem. + """ + + number_of_attachments: int + """ + The current number of attachments (mounts) that the filesystem has. + """ + + region: ScwRegion + """ + Region where the filesystem is located. + """ + + created_at: Optional[datetime] + """ + Creation date of the filesystem. + """ + + updated_at: Optional[datetime] + """ + Last update date of the properties of the filesystem. + """ + + +@dataclass +class CreateFileSystemRequest: + """ + Request to create a new filesystem. + """ + + name: str + """ + Name of the filesystem. + """ + + size: int + """ + Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + project_id: Optional[str] + """ + UUID of the project the filesystem belongs to. + """ + + tags: Optional[List[str]] + """ + List of tags assigned to the filesystem. + """ + + +@dataclass +class DeleteFileSystemRequest: + """ + Request to delete a specific filesystem. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class GetFileSystemRequest: + """ + Request to retrieve a specific filesystem. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class ListAttachmentsRequest: + """ + Request to list filesystem attachments with filtering and pagination options. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + filesystem_id: Optional[str] + """ + UUID of the File Storage volume. + """ + + resource_id: Optional[str] + """ + Filter by resource ID. + """ + + resource_type: Optional[AttachmentResourceType] + """ + Filter by resource type. + """ + + page: Optional[int] + """ + Page number (starting at 1). + """ + + page_size: Optional[int] + """ + Number of entries per page (default: 20, max: 100). + """ + + +@dataclass +class ListAttachmentsResponse: + """ + Response containing a list of filesystem attachments and total count. + """ + + attachments: List[Attachment] + """ + List of filesystem attachments matching the request criteria. + """ + + total_count: int + """ + Total number of filesystem attachments matching the criteria. + """ + + +@dataclass +class ListFileSystemsRequest: + """ + Request to list filesystems with filtering and pagination options. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + order_by: Optional[ListFileSystemsRequestOrderBy] + """ + Criteria to use when ordering the list. + """ + + project_id: Optional[str] + """ + Filter by project ID. + """ + + page: Optional[int] + """ + Page number (starting at 1). + """ + + page_size: Optional[int] + """ + Number of entries per page (default: 20, max: 100). + """ + + name: Optional[str] + """ + Filter the return filesystems by their names. + """ + + tags: Optional[List[str]] + """ + Filter by tags. Only filesystems with one or more matching tags will be returned. + """ + + +@dataclass +class ListFileSystemsResponse: + """ + Response containing a list of filesystems and total count. + """ + + filesystems: List[FileSystem] + """ + List of filesystems matching the request criteria. + """ + + total_count: int + """ + Total number of filesystems matching the criteria. + """ + + +@dataclass +class UpdateFileSystemRequest: + """ + Request to update a specific filesystem. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + name: Optional[str] + """ + When defined, is the new name of the filesystem. + """ + + size: Optional[int] + """ + Size in bytes, with a granularity of 100 GB (10^11 bytes). +Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + """ + + tags: Optional[List[str]] + """ + List of tags assigned to the filesystem. + """ diff --git a/scaleway/scaleway/file/__init__.py b/scaleway/scaleway/file/__init__.py new file mode 100644 index 000000000..8b74a5ed7 --- /dev/null +++ b/scaleway/scaleway/file/__init__.py @@ -0,0 +1,2 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. diff --git a/scaleway/scaleway/file/v1alpha1/__init__.py b/scaleway/scaleway/file/v1alpha1/__init__.py new file mode 100644 index 000000000..05c3dbdf6 --- /dev/null +++ b/scaleway/scaleway/file/v1alpha1/__init__.py @@ -0,0 +1,35 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from .types import AttachmentResourceType +from .types import FileSystemStatus +from .content import FILE_SYSTEM_TRANSIENT_STATUSES +from .types import ListFileSystemsRequestOrderBy +from .types import Attachment +from .types import FileSystem +from .types import CreateFileSystemRequest +from .types import DeleteFileSystemRequest +from .types import GetFileSystemRequest +from .types import ListAttachmentsRequest +from .types import ListAttachmentsResponse +from .types import ListFileSystemsRequest +from .types import ListFileSystemsResponse +from .types import UpdateFileSystemRequest +from .api import FileV1Alpha1API + +__all__ = [ + "AttachmentResourceType", + "FileSystemStatus", + "FILE_SYSTEM_TRANSIENT_STATUSES", + "ListFileSystemsRequestOrderBy", + "Attachment", + "FileSystem", + "CreateFileSystemRequest", + "DeleteFileSystemRequest", + "GetFileSystemRequest", + "ListAttachmentsRequest", + "ListAttachmentsResponse", + "ListFileSystemsRequest", + "ListFileSystemsResponse", + "UpdateFileSystemRequest", + "FileV1Alpha1API", +] diff --git a/scaleway/scaleway/file/v1alpha1/api.py b/scaleway/scaleway/file/v1alpha1/api.py new file mode 100644 index 000000000..53fba926c --- /dev/null +++ b/scaleway/scaleway/file/v1alpha1/api.py @@ -0,0 +1,432 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import List, Optional + +from scaleway_core.api import API +from scaleway_core.bridge import ( + Region as ScwRegion, +) +from scaleway_core.utils import ( + WaitForOptions, + validate_path_param, + fetch_all_pages, + wait_for_resource, +) +from .types import ( + AttachmentResourceType, + ListFileSystemsRequestOrderBy, + Attachment, + CreateFileSystemRequest, + FileSystem, + ListAttachmentsResponse, + ListFileSystemsResponse, + UpdateFileSystemRequest, +) +from .content import ( + FILE_SYSTEM_TRANSIENT_STATUSES, +) +from .marshalling import ( + unmarshal_FileSystem, + unmarshal_ListAttachmentsResponse, + unmarshal_ListFileSystemsResponse, + marshal_CreateFileSystemRequest, + marshal_UpdateFileSystemRequest, +) + + +class FileV1Alpha1API(API): + """ + This API allows you to manage your File Storage resources. + """ + + def get_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + ) -> FileSystem: + """ + Get filesystem details. + Retrieve all properties and current status of a specific filesystem identified by its ID. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`FileSystem ` + + Usage: + :: + + result = api.get_file_system( + filesystem_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_filesystem_id = validate_path_param("filesystem_id", filesystem_id) + + res = self._request( + "GET", + f"/file/v1alpha1/regions/{param_region}/filesystems/{param_filesystem_id}", + ) + + self._throw_on_error(res) + return unmarshal_FileSystem(res.json()) + + def wait_for_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + options: Optional[WaitForOptions[FileSystem, bool]] = None, + ) -> FileSystem: + """ + Get filesystem details. + Retrieve all properties and current status of a specific filesystem identified by its ID. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`FileSystem ` + + Usage: + :: + + result = api.get_file_system( + filesystem_id="example", + ) + """ + + if not options: + options = WaitForOptions() + + if not options.stop: + options.stop = lambda res: res.status not in FILE_SYSTEM_TRANSIENT_STATUSES + + return wait_for_resource( + fetcher=self.get_file_system, + options=options, + args={ + "filesystem_id": filesystem_id, + "region": region, + }, + ) + + def list_file_systems( + self, + *, + region: Optional[ScwRegion] = None, + order_by: Optional[ListFileSystemsRequestOrderBy] = None, + project_id: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + name: Optional[str] = None, + tags: Optional[List[str]] = None, + ) -> ListFileSystemsResponse: + """ + List all filesystems. + Retrieve all filesystems in the specified region. Results are ordered by creation date in ascending order by default. + Use the order_by parameter to modify the sorting behavior. + :param region: Region to target. If none is passed will use default region from the config. + :param order_by: Criteria to use when ordering the list. + :param project_id: Filter by project ID. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :param name: Filter the return filesystems by their names. + :param tags: Filter by tags. Only filesystems with one or more matching tags will be returned. + :return: :class:`ListFileSystemsResponse ` + + Usage: + :: + + result = api.list_file_systems() + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "GET", + f"/file/v1alpha1/regions/{param_region}/filesystems", + params={ + "name": name, + "order_by": order_by, + "page": page, + "page_size": page_size or self.client.default_page_size, + "project_id": project_id or self.client.default_project_id, + "tags": tags, + }, + ) + + self._throw_on_error(res) + return unmarshal_ListFileSystemsResponse(res.json()) + + def list_file_systems_all( + self, + *, + region: Optional[ScwRegion] = None, + order_by: Optional[ListFileSystemsRequestOrderBy] = None, + project_id: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + name: Optional[str] = None, + tags: Optional[List[str]] = None, + ) -> List[FileSystem]: + """ + List all filesystems. + Retrieve all filesystems in the specified region. Results are ordered by creation date in ascending order by default. + Use the order_by parameter to modify the sorting behavior. + :param region: Region to target. If none is passed will use default region from the config. + :param order_by: Criteria to use when ordering the list. + :param project_id: Filter by project ID. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :param name: Filter the return filesystems by their names. + :param tags: Filter by tags. Only filesystems with one or more matching tags will be returned. + :return: :class:`List[FileSystem] ` + + Usage: + :: + + result = api.list_file_systems_all() + """ + + return fetch_all_pages( + type=ListFileSystemsResponse, + key="filesystems", + fetcher=self.list_file_systems, + args={ + "region": region, + "order_by": order_by, + "project_id": project_id, + "page": page, + "page_size": page_size, + "name": name, + "tags": tags, + }, + ) + + def list_attachments( + self, + *, + region: Optional[ScwRegion] = None, + filesystem_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_type: Optional[AttachmentResourceType] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + ) -> ListAttachmentsResponse: + """ + List filesystems attachments. + List all existing attachments in a specified region. + By default, the attachments listed are ordered by creation date in ascending order. + This can be modified using the `order_by` field. + :param region: Region to target. If none is passed will use default region from the config. + :param filesystem_id: UUID of the File Storage volume. + :param resource_id: Filter by resource ID. + :param resource_type: Filter by resource type. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :return: :class:`ListAttachmentsResponse ` + + Usage: + :: + + result = api.list_attachments() + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "GET", + f"/file/v1alpha1/regions/{param_region}/attachments", + params={ + "filesystem_id": filesystem_id, + "page": page, + "page_size": page_size or self.client.default_page_size, + "resource_id": resource_id, + "resource_type": resource_type, + }, + ) + + self._throw_on_error(res) + return unmarshal_ListAttachmentsResponse(res.json()) + + def list_attachments_all( + self, + *, + region: Optional[ScwRegion] = None, + filesystem_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_type: Optional[AttachmentResourceType] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[Attachment]: + """ + List filesystems attachments. + List all existing attachments in a specified region. + By default, the attachments listed are ordered by creation date in ascending order. + This can be modified using the `order_by` field. + :param region: Region to target. If none is passed will use default region from the config. + :param filesystem_id: UUID of the File Storage volume. + :param resource_id: Filter by resource ID. + :param resource_type: Filter by resource type. + :param page: Page number (starting at 1). + :param page_size: Number of entries per page (default: 20, max: 100). + :return: :class:`List[Attachment] ` + + Usage: + :: + + result = api.list_attachments_all() + """ + + return fetch_all_pages( + type=ListAttachmentsResponse, + key="attachments", + fetcher=self.list_attachments, + args={ + "region": region, + "filesystem_id": filesystem_id, + "resource_id": resource_id, + "resource_type": resource_type, + "page": page, + "page_size": page_size, + }, + ) + + def create_file_system( + self, + *, + name: str, + size: int, + region: Optional[ScwRegion] = None, + project_id: Optional[str] = None, + tags: Optional[List[str]] = None, + ) -> FileSystem: + """ + Create a new filesystem. + To create a new filesystem, you need to provide a name, a size, and a project ID. + :param name: Name of the filesystem. + :param size: Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + :param region: Region to target. If none is passed will use default region from the config. + :param project_id: UUID of the project the filesystem belongs to. + :param tags: List of tags assigned to the filesystem. + :return: :class:`FileSystem ` + + Usage: + :: + + result = api.create_file_system( + name="example", + size=1, + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + + res = self._request( + "POST", + f"/file/v1alpha1/regions/{param_region}/filesystems", + body=marshal_CreateFileSystemRequest( + CreateFileSystemRequest( + name=name, + size=size, + region=region, + project_id=project_id, + tags=tags, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_FileSystem(res.json()) + + def delete_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + ) -> None: + """ + Delete a detached filesystem. + You must specify the `filesystem_id` of the filesystem you want to delete. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + + Usage: + :: + + result = api.delete_file_system( + filesystem_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_filesystem_id = validate_path_param("filesystem_id", filesystem_id) + + res = self._request( + "DELETE", + f"/file/v1alpha1/regions/{param_region}/filesystems/{param_filesystem_id}", + ) + + self._throw_on_error(res) + + def update_file_system( + self, + *, + filesystem_id: str, + region: Optional[ScwRegion] = None, + name: Optional[str] = None, + size: Optional[int] = None, + tags: Optional[List[str]] = None, + ) -> FileSystem: + """ + Update filesystem properties. + Update the technical details of a filesystem, such as its name, tags or its new size. + You can only resize a filesystem to a larger size. + :param filesystem_id: UUID of the filesystem. + :param region: Region to target. If none is passed will use default region from the config. + :param name: When defined, is the new name of the filesystem. + :param size: Size in bytes, with a granularity of 100 GB (10^11 bytes). + Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + :param tags: List of tags assigned to the filesystem. + :return: :class:`FileSystem ` + + Usage: + :: + + result = api.update_file_system( + filesystem_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_filesystem_id = validate_path_param("filesystem_id", filesystem_id) + + res = self._request( + "PATCH", + f"/file/v1alpha1/regions/{param_region}/filesystems/{param_filesystem_id}", + body=marshal_UpdateFileSystemRequest( + UpdateFileSystemRequest( + filesystem_id=filesystem_id, + region=region, + name=name, + size=size, + tags=tags, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_FileSystem(res.json()) diff --git a/scaleway/scaleway/file/v1alpha1/content.py b/scaleway/scaleway/file/v1alpha1/content.py new file mode 100644 index 000000000..c6a422b4e --- /dev/null +++ b/scaleway/scaleway/file/v1alpha1/content.py @@ -0,0 +1,15 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from typing import List + +from .types import ( + FileSystemStatus, +) + +FILE_SYSTEM_TRANSIENT_STATUSES: List[FileSystemStatus] = [ + FileSystemStatus.CREATING, + FileSystemStatus.UPDATING, +] +""" +Lists transient statutes of the enum :class:`FileSystemStatus `. +""" diff --git a/scaleway/scaleway/file/v1alpha1/marshalling.py b/scaleway/scaleway/file/v1alpha1/marshalling.py new file mode 100644 index 000000000..16d195ff0 --- /dev/null +++ b/scaleway/scaleway/file/v1alpha1/marshalling.py @@ -0,0 +1,182 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. + +from typing import Any, Dict +from dateutil import parser + +from scaleway_core.profile import ProfileDefaults +from .types import ( + FileSystem, + Attachment, + ListAttachmentsResponse, + ListFileSystemsResponse, + CreateFileSystemRequest, + UpdateFileSystemRequest, +) + + +def unmarshal_FileSystem(data: Any) -> FileSystem: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'FileSystem' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("name", None) + if field is not None: + args["name"] = field + + field = data.get("size", None) + if field is not None: + args["size"] = field + + field = data.get("status", None) + if field is not None: + args["status"] = field + + field = data.get("project_id", None) + if field is not None: + args["project_id"] = field + + field = data.get("organization_id", None) + if field is not None: + args["organization_id"] = field + + field = data.get("tags", None) + if field is not None: + args["tags"] = field + + field = data.get("number_of_attachments", None) + if field is not None: + args["number_of_attachments"] = field + + field = data.get("region", None) + if field is not None: + args["region"] = field + + field = data.get("created_at", None) + if field is not None: + args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["created_at"] = None + + field = data.get("updated_at", None) + if field is not None: + args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field + else: + args["updated_at"] = None + + return FileSystem(**args) + + +def unmarshal_Attachment(data: Any) -> Attachment: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Attachment' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + + field = data.get("filesystem_id", None) + if field is not None: + args["filesystem_id"] = field + + field = data.get("resource_id", None) + if field is not None: + args["resource_id"] = field + + field = data.get("resource_type", None) + if field is not None: + args["resource_type"] = field + + return Attachment(**args) + + +def unmarshal_ListAttachmentsResponse(data: Any) -> ListAttachmentsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListAttachmentsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("attachments", None) + if field is not None: + args["attachments"] = ( + [unmarshal_Attachment(v) for v in field] if field is not None else None + ) + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + return ListAttachmentsResponse(**args) + + +def unmarshal_ListFileSystemsResponse(data: Any) -> ListFileSystemsResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListFileSystemsResponse' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("filesystems", None) + if field is not None: + args["filesystems"] = ( + [unmarshal_FileSystem(v) for v in field] if field is not None else None + ) + + field = data.get("total_count", None) + if field is not None: + args["total_count"] = field + + return ListFileSystemsResponse(**args) + + +def marshal_CreateFileSystemRequest( + request: CreateFileSystemRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.name is not None: + output["name"] = request.name + + if request.size is not None: + output["size"] = request.size + + if request.project_id is not None: + output["project_id"] = request.project_id or defaults.default_project_id + + if request.tags is not None: + output["tags"] = request.tags + + return output + + +def marshal_UpdateFileSystemRequest( + request: UpdateFileSystemRequest, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.name is not None: + output["name"] = request.name + + if request.size is not None: + output["size"] = request.size + + if request.tags is not None: + output["tags"] = request.tags + + return output diff --git a/scaleway/scaleway/file/v1alpha1/types.py b/scaleway/scaleway/file/v1alpha1/types.py new file mode 100644 index 000000000..d9049b6db --- /dev/null +++ b/scaleway/scaleway/file/v1alpha1/types.py @@ -0,0 +1,345 @@ +# This file was automatically generated. DO NOT EDIT. +# If you have any remark or suggestion do not hesitate to open an issue. +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime +from enum import Enum +from typing import List, Optional + +from scaleway_core.bridge import ( + Region as ScwRegion, +) +from scaleway_core.utils import ( + StrEnumMeta, +) + + +class AttachmentResourceType(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_RESOURCE_TYPE = "unknown_resource_type" + INSTANCE_SERVER = "instance_server" + + def __str__(self) -> str: + return str(self.value) + + +class FileSystemStatus(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_STATUS = "unknown_status" + AVAILABLE = "available" + ERROR = "error" + CREATING = "creating" + UPDATING = "updating" + + def __str__(self) -> str: + return str(self.value) + + +class ListFileSystemsRequestOrderBy(str, Enum, metaclass=StrEnumMeta): + CREATED_AT_ASC = "created_at_asc" + CREATED_AT_DESC = "created_at_desc" + NAME_ASC = "name_asc" + NAME_DESC = "name_desc" + + def __str__(self) -> str: + return str(self.value) + + +@dataclass +class Attachment: + """ + Represents an attachment between a filesystem and a resource. + """ + + id: str + """ + UUID of the attachment. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + resource_id: str + """ + UUID of the attached resource. + """ + + resource_type: AttachmentResourceType + """ + The type of the attached resource. + """ + + +@dataclass +class FileSystem: + """ + Represents a filesystem resource and its properties. + """ + + id: str + """ + UUID of the filesystem. + """ + + name: str + """ + Name of the filesystem. + """ + + size: int + """ + Filesystem size in bytes. + """ + + status: FileSystemStatus + """ + Current status of the filesystem (e.g. creating, available, ...). + """ + + project_id: str + """ + UUID of the project to which the filesystem belongs. + """ + + organization_id: str + """ + UUID of the organization to which the filesystem belongs. + """ + + tags: List[str] + """ + List of tags assigned to the filesystem. + """ + + number_of_attachments: int + """ + The current number of attachments (mounts) that the filesystem has. + """ + + region: ScwRegion + """ + Region where the filesystem is located. + """ + + created_at: Optional[datetime] + """ + Creation date of the filesystem. + """ + + updated_at: Optional[datetime] + """ + Last update date of the properties of the filesystem. + """ + + +@dataclass +class CreateFileSystemRequest: + """ + Request to create a new filesystem. + """ + + name: str + """ + Name of the filesystem. + """ + + size: int + """ + Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + project_id: Optional[str] + """ + UUID of the project the filesystem belongs to. + """ + + tags: Optional[List[str]] + """ + List of tags assigned to the filesystem. + """ + + +@dataclass +class DeleteFileSystemRequest: + """ + Request to delete a specific filesystem. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class GetFileSystemRequest: + """ + Request to retrieve a specific filesystem. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class ListAttachmentsRequest: + """ + Request to list filesystem attachments with filtering and pagination options. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + filesystem_id: Optional[str] + """ + UUID of the File Storage volume. + """ + + resource_id: Optional[str] + """ + Filter by resource ID. + """ + + resource_type: Optional[AttachmentResourceType] + """ + Filter by resource type. + """ + + page: Optional[int] + """ + Page number (starting at 1). + """ + + page_size: Optional[int] + """ + Number of entries per page (default: 20, max: 100). + """ + + +@dataclass +class ListAttachmentsResponse: + """ + Response containing a list of filesystem attachments and total count. + """ + + attachments: List[Attachment] + """ + List of filesystem attachments matching the request criteria. + """ + + total_count: int + """ + Total number of filesystem attachments matching the criteria. + """ + + +@dataclass +class ListFileSystemsRequest: + """ + Request to list filesystems with filtering and pagination options. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + order_by: Optional[ListFileSystemsRequestOrderBy] + """ + Criteria to use when ordering the list. + """ + + project_id: Optional[str] + """ + Filter by project ID. + """ + + page: Optional[int] + """ + Page number (starting at 1). + """ + + page_size: Optional[int] + """ + Number of entries per page (default: 20, max: 100). + """ + + name: Optional[str] + """ + Filter the return filesystems by their names. + """ + + tags: Optional[List[str]] + """ + Filter by tags. Only filesystems with one or more matching tags will be returned. + """ + + +@dataclass +class ListFileSystemsResponse: + """ + Response containing a list of filesystems and total count. + """ + + filesystems: List[FileSystem] + """ + List of filesystems matching the request criteria. + """ + + total_count: int + """ + Total number of filesystems matching the criteria. + """ + + +@dataclass +class UpdateFileSystemRequest: + """ + Request to update a specific filesystem. + """ + + filesystem_id: str + """ + UUID of the filesystem. + """ + + region: Optional[ScwRegion] + """ + Region to target. If none is passed will use default region from the config. + """ + + name: Optional[str] + """ + When defined, is the new name of the filesystem. + """ + + size: Optional[int] + """ + Size in bytes, with a granularity of 100 GB (10^11 bytes). +Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. + """ + + tags: Optional[List[str]] + """ + List of tags assigned to the filesystem. + """