diff --git a/scaleway-async/scaleway_async/webhosting/v1/__init__.py b/scaleway-async/scaleway_async/webhosting/v1/__init__.py index 9be5ae1cd..797369354 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/__init__.py +++ b/scaleway-async/scaleway_async/webhosting/v1/__init__.py @@ -29,6 +29,7 @@ from .types import OfferOptionName from .types import OfferOptionWarning from .types import PlatformPlatformGroup +from .types import ProgressStatus from .types import AutoConfigDomainDns from .types import PlatformControlPanelUrls from .types import HostingDomainCustomDomain @@ -54,11 +55,14 @@ from .types import FtpAccount from .types import HostingSummary from .types import MailAccount +from .types import ProgressSummary from .types import Website from .types import DomainAvailability from .types import BackupApiGetBackupRequest +from .types import BackupApiGetProgressRequest from .types import BackupApiListBackupItemsRequest from .types import BackupApiListBackupsRequest +from .types import BackupApiListRecentProgressesRequest from .types import BackupApiRestoreBackupItemsRequest from .types import BackupApiRestoreBackupRequest from .types import CheckFreeDomainAvailabilityResponse @@ -109,12 +113,14 @@ from .types import ListHostingsResponse from .types import ListMailAccountsResponse from .types import ListOffersResponse +from .types import ListRecentProgressesResponse from .types import ListWebsitesResponse from .types import MailAccountApiChangeMailAccountPasswordRequest from .types import MailAccountApiCreateMailAccountRequest from .types import MailAccountApiListMailAccountsRequest from .types import MailAccountApiRemoveMailAccountRequest from .types import OfferApiListOffersRequest +from .types import Progress from .types import ResetHostingPasswordResponse from .types import ResourceSummary from .types import RestoreBackupItemsResponse @@ -163,6 +169,7 @@ "OfferOptionName", "OfferOptionWarning", "PlatformPlatformGroup", + "ProgressStatus", "AutoConfigDomainDns", "PlatformControlPanelUrls", "HostingDomainCustomDomain", @@ -188,11 +195,14 @@ "FtpAccount", "HostingSummary", "MailAccount", + "ProgressSummary", "Website", "DomainAvailability", "BackupApiGetBackupRequest", + "BackupApiGetProgressRequest", "BackupApiListBackupItemsRequest", "BackupApiListBackupsRequest", + "BackupApiListRecentProgressesRequest", "BackupApiRestoreBackupItemsRequest", "BackupApiRestoreBackupRequest", "CheckFreeDomainAvailabilityResponse", @@ -243,12 +253,14 @@ "ListHostingsResponse", "ListMailAccountsResponse", "ListOffersResponse", + "ListRecentProgressesResponse", "ListWebsitesResponse", "MailAccountApiChangeMailAccountPasswordRequest", "MailAccountApiCreateMailAccountRequest", "MailAccountApiListMailAccountsRequest", "MailAccountApiRemoveMailAccountRequest", "OfferApiListOffersRequest", + "Progress", "ResetHostingPasswordResponse", "ResourceSummary", "RestoreBackupItemsResponse", diff --git a/scaleway-async/scaleway_async/webhosting/v1/api.py b/scaleway-async/scaleway_async/webhosting/v1/api.py index ce41c662a..3dabe73c4 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/api.py +++ b/scaleway-async/scaleway_async/webhosting/v1/api.py @@ -62,6 +62,7 @@ ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, + ListRecentProgressesResponse, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, @@ -69,6 +70,7 @@ MailAccountApiRemoveMailAccountRequest, Offer, OfferOptionRequest, + Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, @@ -105,7 +107,9 @@ unmarshal_ListHostingsResponse, unmarshal_ListMailAccountsResponse, unmarshal_ListOffersResponse, + unmarshal_ListRecentProgressesResponse, unmarshal_ListWebsitesResponse, + unmarshal_Progress, unmarshal_ResetHostingPasswordResponse, unmarshal_ResourceSummary, unmarshal_RestoreBackupItemsResponse, @@ -421,6 +425,76 @@ async def restore_backup_items( self._throw_on_error(res) return unmarshal_RestoreBackupItemsResponse(res.json()) + async def get_progress( + self, + *, + hosting_id: str, + progress_id: str, + region: Optional[ScwRegion] = None, + ) -> Progress: + """ + Retrieve detailed information about a specific progress by its ID. + :param hosting_id: ID of the hosting associated with the progress. + :param progress_id: ID of the progress to retrieve. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`Progress ` + + Usage: + :: + + result = await api.get_progress( + hosting_id="example", + progress_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_hosting_id = validate_path_param("hosting_id", hosting_id) + param_progress_id = validate_path_param("progress_id", progress_id) + + res = self._request( + "GET", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/progresses/{param_progress_id}", + ) + + self._throw_on_error(res) + return unmarshal_Progress(res.json()) + + async def list_recent_progresses( + self, + *, + hosting_id: str, + region: Optional[ScwRegion] = None, + ) -> ListRecentProgressesResponse: + """ + List recent progresses associated with a specific backup, grouped by type. + :param hosting_id: ID of the hosting linked to the progress. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`ListRecentProgressesResponse ` + + Usage: + :: + + result = await api.list_recent_progresses( + hosting_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_hosting_id = validate_path_param("hosting_id", hosting_id) + + res = self._request( + "GET", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/progresses", + ) + + self._throw_on_error(res) + return unmarshal_ListRecentProgressesResponse(res.json()) + class WebhostingV1ControlPanelAPI(API): """ diff --git a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py index c10d9ce39..4a569d7f4 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py +++ b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py @@ -30,6 +30,7 @@ OfferOptionName, OfferOptionWarning, PlatformPlatformGroup, + ProgressStatus, Backup, DatabaseUser, Database, @@ -66,8 +67,11 @@ ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, + ProgressSummary, + ListRecentProgressesResponse, Website, ListWebsitesResponse, + Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, @@ -1401,6 +1405,60 @@ def unmarshal_ListOffersResponse(data: Any) -> ListOffersResponse: return ListOffersResponse(**args) +def unmarshal_ProgressSummary(data: Any) -> ProgressSummary: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ProgressSummary' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("backup_items_count", None) + if field is not None: + args["backup_items_count"] = field + else: + args["backup_items_count"] = 0 + + field = data.get("percentage", None) + if field is not None: + args["percentage"] = field + else: + args["percentage"] = 0 + + field = data.get("status", None) + if field is not None: + args["status"] = field + else: + args["status"] = ProgressStatus.UNKNOWN_STATUS + + return ProgressSummary(**args) + + +def unmarshal_ListRecentProgressesResponse(data: Any) -> ListRecentProgressesResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListRecentProgressesResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("progresses", None) + if field is not None: + args["progresses"] = ( + [unmarshal_ProgressSummary(v) for v in field] if field is not None else None + ) + else: + args["progresses"] = [] + + return ListRecentProgressesResponse(**args) + + def unmarshal_Website(data: Any) -> Website: if not isinstance(data, dict): raise TypeError( @@ -1455,6 +1513,43 @@ def unmarshal_ListWebsitesResponse(data: Any) -> ListWebsitesResponse: return ListWebsitesResponse(**args) +def unmarshal_Progress(data: Any) -> Progress: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Progress' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("backup_item_groups", None) + if field is not None: + args["backup_item_groups"] = ( + [unmarshal_BackupItemGroup(v) for v in field] if field is not None else None + ) + else: + args["backup_item_groups"] = [] + + field = data.get("percentage", None) + if field is not None: + args["percentage"] = field + else: + args["percentage"] = 0 + + field = data.get("status", None) + if field is not None: + args["status"] = field + else: + args["status"] = ProgressStatus.UNKNOWN_STATUS + + return Progress(**args) + + def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordResponse: if not isinstance(data, dict): raise TypeError( @@ -1521,6 +1616,12 @@ def unmarshal_RestoreBackupItemsResponse(data: Any) -> RestoreBackupItemsRespons args: dict[str, Any] = {} + field = data.get("progress_id", None) + if field is not None: + args["progress_id"] = field + else: + args["progress_id"] = None + return RestoreBackupItemsResponse(**args) @@ -1532,6 +1633,12 @@ def unmarshal_RestoreBackupResponse(data: Any) -> RestoreBackupResponse: args: dict[str, Any] = {} + field = data.get("progress_id", None) + if field is not None: + args["progress_id"] = field + else: + args["progress_id"] = None + return RestoreBackupResponse(**args) diff --git a/scaleway-async/scaleway_async/webhosting/v1/types.py b/scaleway-async/scaleway_async/webhosting/v1/types.py index 446eb672c..b3ef08f04 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/types.py +++ b/scaleway-async/scaleway_async/webhosting/v1/types.py @@ -288,6 +288,20 @@ def __str__(self) -> str: return str(self.value) +class ProgressStatus(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_STATUS = "unknown_status" + PENDING = "pending" + PROCESSING = "processing" + COMPLETED = "completed" + PARTIALLY_COMPLETED = "partially_completed" + FAILED = "failed" + ABORTED = "aborted" + NEVER_FINISHED = "never_finished" + + def __str__(self) -> str: + return str(self.value) + + @dataclass class AutoConfigDomainDns: nameservers: bool @@ -844,6 +858,29 @@ class MailAccount: """ +@dataclass +class ProgressSummary: + id: str + """ + ID of the progress. + """ + + backup_items_count: int + """ + Total number of backup items included in the progress. + """ + + percentage: int + """ + Completion percentage of the progress. + """ + + status: ProgressStatus + """ + Current status of the progress operation. + """ + + @dataclass class Website: domain: str @@ -913,6 +950,24 @@ class BackupApiGetBackupRequest: """ +@dataclass +class BackupApiGetProgressRequest: + hosting_id: str + """ + ID of the hosting associated with the progress. + """ + + progress_id: str + """ + ID of the progress to retrieve. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class BackupApiListBackupItemsRequest: hosting_id: str @@ -961,6 +1016,19 @@ class BackupApiListBackupsRequest: """ +@dataclass +class BackupApiListRecentProgressesRequest: + hosting_id: str + """ + ID of the hosting linked to the progress. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class BackupApiRestoreBackupItemsRequest: hosting_id: str @@ -2082,6 +2150,14 @@ class ListOffersResponse: """ +@dataclass +class ListRecentProgressesResponse: + progresses: list[ProgressSummary] + """ + List of summarized progress entries. + """ + + @dataclass class ListWebsitesResponse: total_count: int @@ -2242,6 +2318,29 @@ class OfferApiListOffersRequest: """ +@dataclass +class Progress: + id: str + """ + ID of the progress. + """ + + backup_item_groups: list[BackupItemGroup] + """ + Groups of backup items included in this progress. + """ + + percentage: int + """ + Completion percentage of the progress. + """ + + status: ProgressStatus + """ + Current status of the progress operation. + """ + + @dataclass class ResetHostingPasswordResponse: one_time_password_b64: str @@ -2280,12 +2379,18 @@ class ResourceSummary: @dataclass class RestoreBackupItemsResponse: - pass + progress_id: str + """ + Identifier used to track the item restoration progress. + """ @dataclass class RestoreBackupResponse: - pass + progress_id: str + """ + Identifier used to track the backup restoration progress. + """ @dataclass diff --git a/scaleway/scaleway/webhosting/v1/__init__.py b/scaleway/scaleway/webhosting/v1/__init__.py index 9be5ae1cd..797369354 100644 --- a/scaleway/scaleway/webhosting/v1/__init__.py +++ b/scaleway/scaleway/webhosting/v1/__init__.py @@ -29,6 +29,7 @@ from .types import OfferOptionName from .types import OfferOptionWarning from .types import PlatformPlatformGroup +from .types import ProgressStatus from .types import AutoConfigDomainDns from .types import PlatformControlPanelUrls from .types import HostingDomainCustomDomain @@ -54,11 +55,14 @@ from .types import FtpAccount from .types import HostingSummary from .types import MailAccount +from .types import ProgressSummary from .types import Website from .types import DomainAvailability from .types import BackupApiGetBackupRequest +from .types import BackupApiGetProgressRequest from .types import BackupApiListBackupItemsRequest from .types import BackupApiListBackupsRequest +from .types import BackupApiListRecentProgressesRequest from .types import BackupApiRestoreBackupItemsRequest from .types import BackupApiRestoreBackupRequest from .types import CheckFreeDomainAvailabilityResponse @@ -109,12 +113,14 @@ from .types import ListHostingsResponse from .types import ListMailAccountsResponse from .types import ListOffersResponse +from .types import ListRecentProgressesResponse from .types import ListWebsitesResponse from .types import MailAccountApiChangeMailAccountPasswordRequest from .types import MailAccountApiCreateMailAccountRequest from .types import MailAccountApiListMailAccountsRequest from .types import MailAccountApiRemoveMailAccountRequest from .types import OfferApiListOffersRequest +from .types import Progress from .types import ResetHostingPasswordResponse from .types import ResourceSummary from .types import RestoreBackupItemsResponse @@ -163,6 +169,7 @@ "OfferOptionName", "OfferOptionWarning", "PlatformPlatformGroup", + "ProgressStatus", "AutoConfigDomainDns", "PlatformControlPanelUrls", "HostingDomainCustomDomain", @@ -188,11 +195,14 @@ "FtpAccount", "HostingSummary", "MailAccount", + "ProgressSummary", "Website", "DomainAvailability", "BackupApiGetBackupRequest", + "BackupApiGetProgressRequest", "BackupApiListBackupItemsRequest", "BackupApiListBackupsRequest", + "BackupApiListRecentProgressesRequest", "BackupApiRestoreBackupItemsRequest", "BackupApiRestoreBackupRequest", "CheckFreeDomainAvailabilityResponse", @@ -243,12 +253,14 @@ "ListHostingsResponse", "ListMailAccountsResponse", "ListOffersResponse", + "ListRecentProgressesResponse", "ListWebsitesResponse", "MailAccountApiChangeMailAccountPasswordRequest", "MailAccountApiCreateMailAccountRequest", "MailAccountApiListMailAccountsRequest", "MailAccountApiRemoveMailAccountRequest", "OfferApiListOffersRequest", + "Progress", "ResetHostingPasswordResponse", "ResourceSummary", "RestoreBackupItemsResponse", diff --git a/scaleway/scaleway/webhosting/v1/api.py b/scaleway/scaleway/webhosting/v1/api.py index be47decff..19a5c25a4 100644 --- a/scaleway/scaleway/webhosting/v1/api.py +++ b/scaleway/scaleway/webhosting/v1/api.py @@ -62,6 +62,7 @@ ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, + ListRecentProgressesResponse, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, @@ -69,6 +70,7 @@ MailAccountApiRemoveMailAccountRequest, Offer, OfferOptionRequest, + Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, @@ -105,7 +107,9 @@ unmarshal_ListHostingsResponse, unmarshal_ListMailAccountsResponse, unmarshal_ListOffersResponse, + unmarshal_ListRecentProgressesResponse, unmarshal_ListWebsitesResponse, + unmarshal_Progress, unmarshal_ResetHostingPasswordResponse, unmarshal_ResourceSummary, unmarshal_RestoreBackupItemsResponse, @@ -421,6 +425,76 @@ def restore_backup_items( self._throw_on_error(res) return unmarshal_RestoreBackupItemsResponse(res.json()) + def get_progress( + self, + *, + hosting_id: str, + progress_id: str, + region: Optional[ScwRegion] = None, + ) -> Progress: + """ + Retrieve detailed information about a specific progress by its ID. + :param hosting_id: ID of the hosting associated with the progress. + :param progress_id: ID of the progress to retrieve. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`Progress ` + + Usage: + :: + + result = api.get_progress( + hosting_id="example", + progress_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_hosting_id = validate_path_param("hosting_id", hosting_id) + param_progress_id = validate_path_param("progress_id", progress_id) + + res = self._request( + "GET", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/progresses/{param_progress_id}", + ) + + self._throw_on_error(res) + return unmarshal_Progress(res.json()) + + def list_recent_progresses( + self, + *, + hosting_id: str, + region: Optional[ScwRegion] = None, + ) -> ListRecentProgressesResponse: + """ + List recent progresses associated with a specific backup, grouped by type. + :param hosting_id: ID of the hosting linked to the progress. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`ListRecentProgressesResponse ` + + Usage: + :: + + result = api.list_recent_progresses( + hosting_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_hosting_id = validate_path_param("hosting_id", hosting_id) + + res = self._request( + "GET", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/progresses", + ) + + self._throw_on_error(res) + return unmarshal_ListRecentProgressesResponse(res.json()) + class WebhostingV1ControlPanelAPI(API): """ diff --git a/scaleway/scaleway/webhosting/v1/marshalling.py b/scaleway/scaleway/webhosting/v1/marshalling.py index c10d9ce39..4a569d7f4 100644 --- a/scaleway/scaleway/webhosting/v1/marshalling.py +++ b/scaleway/scaleway/webhosting/v1/marshalling.py @@ -30,6 +30,7 @@ OfferOptionName, OfferOptionWarning, PlatformPlatformGroup, + ProgressStatus, Backup, DatabaseUser, Database, @@ -66,8 +67,11 @@ ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, + ProgressSummary, + ListRecentProgressesResponse, Website, ListWebsitesResponse, + Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, @@ -1401,6 +1405,60 @@ def unmarshal_ListOffersResponse(data: Any) -> ListOffersResponse: return ListOffersResponse(**args) +def unmarshal_ProgressSummary(data: Any) -> ProgressSummary: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ProgressSummary' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("backup_items_count", None) + if field is not None: + args["backup_items_count"] = field + else: + args["backup_items_count"] = 0 + + field = data.get("percentage", None) + if field is not None: + args["percentage"] = field + else: + args["percentage"] = 0 + + field = data.get("status", None) + if field is not None: + args["status"] = field + else: + args["status"] = ProgressStatus.UNKNOWN_STATUS + + return ProgressSummary(**args) + + +def unmarshal_ListRecentProgressesResponse(data: Any) -> ListRecentProgressesResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ListRecentProgressesResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("progresses", None) + if field is not None: + args["progresses"] = ( + [unmarshal_ProgressSummary(v) for v in field] if field is not None else None + ) + else: + args["progresses"] = [] + + return ListRecentProgressesResponse(**args) + + def unmarshal_Website(data: Any) -> Website: if not isinstance(data, dict): raise TypeError( @@ -1455,6 +1513,43 @@ def unmarshal_ListWebsitesResponse(data: Any) -> ListWebsitesResponse: return ListWebsitesResponse(**args) +def unmarshal_Progress(data: Any) -> Progress: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'Progress' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("id", None) + if field is not None: + args["id"] = field + else: + args["id"] = None + + field = data.get("backup_item_groups", None) + if field is not None: + args["backup_item_groups"] = ( + [unmarshal_BackupItemGroup(v) for v in field] if field is not None else None + ) + else: + args["backup_item_groups"] = [] + + field = data.get("percentage", None) + if field is not None: + args["percentage"] = field + else: + args["percentage"] = 0 + + field = data.get("status", None) + if field is not None: + args["status"] = field + else: + args["status"] = ProgressStatus.UNKNOWN_STATUS + + return Progress(**args) + + def unmarshal_ResetHostingPasswordResponse(data: Any) -> ResetHostingPasswordResponse: if not isinstance(data, dict): raise TypeError( @@ -1521,6 +1616,12 @@ def unmarshal_RestoreBackupItemsResponse(data: Any) -> RestoreBackupItemsRespons args: dict[str, Any] = {} + field = data.get("progress_id", None) + if field is not None: + args["progress_id"] = field + else: + args["progress_id"] = None + return RestoreBackupItemsResponse(**args) @@ -1532,6 +1633,12 @@ def unmarshal_RestoreBackupResponse(data: Any) -> RestoreBackupResponse: args: dict[str, Any] = {} + field = data.get("progress_id", None) + if field is not None: + args["progress_id"] = field + else: + args["progress_id"] = None + return RestoreBackupResponse(**args) diff --git a/scaleway/scaleway/webhosting/v1/types.py b/scaleway/scaleway/webhosting/v1/types.py index 446eb672c..b3ef08f04 100644 --- a/scaleway/scaleway/webhosting/v1/types.py +++ b/scaleway/scaleway/webhosting/v1/types.py @@ -288,6 +288,20 @@ def __str__(self) -> str: return str(self.value) +class ProgressStatus(str, Enum, metaclass=StrEnumMeta): + UNKNOWN_STATUS = "unknown_status" + PENDING = "pending" + PROCESSING = "processing" + COMPLETED = "completed" + PARTIALLY_COMPLETED = "partially_completed" + FAILED = "failed" + ABORTED = "aborted" + NEVER_FINISHED = "never_finished" + + def __str__(self) -> str: + return str(self.value) + + @dataclass class AutoConfigDomainDns: nameservers: bool @@ -844,6 +858,29 @@ class MailAccount: """ +@dataclass +class ProgressSummary: + id: str + """ + ID of the progress. + """ + + backup_items_count: int + """ + Total number of backup items included in the progress. + """ + + percentage: int + """ + Completion percentage of the progress. + """ + + status: ProgressStatus + """ + Current status of the progress operation. + """ + + @dataclass class Website: domain: str @@ -913,6 +950,24 @@ class BackupApiGetBackupRequest: """ +@dataclass +class BackupApiGetProgressRequest: + hosting_id: str + """ + ID of the hosting associated with the progress. + """ + + progress_id: str + """ + ID of the progress to retrieve. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class BackupApiListBackupItemsRequest: hosting_id: str @@ -961,6 +1016,19 @@ class BackupApiListBackupsRequest: """ +@dataclass +class BackupApiListRecentProgressesRequest: + hosting_id: str + """ + ID of the hosting linked to the progress. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class BackupApiRestoreBackupItemsRequest: hosting_id: str @@ -2082,6 +2150,14 @@ class ListOffersResponse: """ +@dataclass +class ListRecentProgressesResponse: + progresses: list[ProgressSummary] + """ + List of summarized progress entries. + """ + + @dataclass class ListWebsitesResponse: total_count: int @@ -2242,6 +2318,29 @@ class OfferApiListOffersRequest: """ +@dataclass +class Progress: + id: str + """ + ID of the progress. + """ + + backup_item_groups: list[BackupItemGroup] + """ + Groups of backup items included in this progress. + """ + + percentage: int + """ + Completion percentage of the progress. + """ + + status: ProgressStatus + """ + Current status of the progress operation. + """ + + @dataclass class ResetHostingPasswordResponse: one_time_password_b64: str @@ -2280,12 +2379,18 @@ class ResourceSummary: @dataclass class RestoreBackupItemsResponse: - pass + progress_id: str + """ + Identifier used to track the item restoration progress. + """ @dataclass class RestoreBackupResponse: - pass + progress_id: str + """ + Identifier used to track the backup restoration progress. + """ @dataclass