File tree Expand file tree Collapse file tree 6 files changed +100
-0
lines changed
scaleway-async/scaleway_async/k8s/v1 Expand file tree Collapse file tree 6 files changed +100
-0
lines changed Original file line number Diff line number Diff line change 6969from .types import ListVersionsRequest
7070from .types import ListVersionsResponse
7171from .types import MigrateClusterToRoutedIPsRequest
72+ from .types import MigrateClusterToSBSCSIRequest
7273from .types import NodeMetadata
7374from .types import RebootNodeRequest
7475from .types import ReplaceNodeRequest
150151 "ListVersionsRequest" ,
151152 "ListVersionsResponse" ,
152153 "MigrateClusterToRoutedIPsRequest" ,
154+ "MigrateClusterToSBSCSIRequest" ,
153155 "NodeMetadata" ,
154156 "RebootNodeRequest" ,
155157 "ReplaceNodeRequest" ,
Original file line number Diff line number Diff line change @@ -749,6 +749,41 @@ async def migrate_cluster_to_routed_i_ps(
749749 self ._throw_on_error (res )
750750 return unmarshal_Cluster (res .json ())
751751
752+ async def migrate_cluster_to_sbscsi (
753+ self ,
754+ * ,
755+ cluster_id : str ,
756+ region : Optional [Region ] = None ,
757+ ) -> Cluster :
758+ """
759+ Migrate a cluster to SBS CSI.
760+ Enable the latest CSI compatible with Scaleway Block Storage (SBS) and migrate all existing PersistentVolumes/VolumeSnapshotContents to SBS.
761+ :param cluster_id: Cluster ID for which the latest CSI compatible with Scaleway Block Storage will be enabled.
762+ :param region: Region to target. If none is passed will use default region from the config.
763+ :return: :class:`Cluster <Cluster>`
764+
765+ Usage:
766+ ::
767+
768+ result = await api.migrate_cluster_to_sbscsi(
769+ cluster_id="example",
770+ )
771+ """
772+
773+ param_region = validate_path_param (
774+ "region" , region or self .client .default_region
775+ )
776+ param_cluster_id = validate_path_param ("cluster_id" , cluster_id )
777+
778+ res = self ._request (
779+ "POST" ,
780+ f"/k8s/v1/regions/{ param_region } /clusters/{ param_cluster_id } /migrate-to-sbs-csi" ,
781+ body = {},
782+ )
783+
784+ self ._throw_on_error (res )
785+ return unmarshal_Cluster (res .json ())
786+
752787 async def list_pools (
753788 self ,
754789 * ,
Original file line number Diff line number Diff line change @@ -1707,6 +1707,19 @@ class MigrateClusterToRoutedIPsRequest:
17071707 """
17081708
17091709
1710+ @dataclass
1711+ class MigrateClusterToSBSCSIRequest :
1712+ cluster_id : str
1713+ """
1714+ Cluster ID for which the latest CSI compatible with Scaleway Block Storage will be enabled.
1715+ """
1716+
1717+ region : Optional [Region ]
1718+ """
1719+ Region to target. If none is passed will use default region from the config.
1720+ """
1721+
1722+
17101723@dataclass
17111724class NodeMetadata :
17121725 id : str
Original file line number Diff line number Diff line change 6969from .types import ListVersionsRequest
7070from .types import ListVersionsResponse
7171from .types import MigrateClusterToRoutedIPsRequest
72+ from .types import MigrateClusterToSBSCSIRequest
7273from .types import NodeMetadata
7374from .types import RebootNodeRequest
7475from .types import ReplaceNodeRequest
150151 "ListVersionsRequest" ,
151152 "ListVersionsResponse" ,
152153 "MigrateClusterToRoutedIPsRequest" ,
154+ "MigrateClusterToSBSCSIRequest" ,
153155 "NodeMetadata" ,
154156 "RebootNodeRequest" ,
155157 "ReplaceNodeRequest" ,
Original file line number Diff line number Diff line change @@ -749,6 +749,41 @@ def migrate_cluster_to_routed_i_ps(
749749 self ._throw_on_error (res )
750750 return unmarshal_Cluster (res .json ())
751751
752+ def migrate_cluster_to_sbscsi (
753+ self ,
754+ * ,
755+ cluster_id : str ,
756+ region : Optional [Region ] = None ,
757+ ) -> Cluster :
758+ """
759+ Migrate a cluster to SBS CSI.
760+ Enable the latest CSI compatible with Scaleway Block Storage (SBS) and migrate all existing PersistentVolumes/VolumeSnapshotContents to SBS.
761+ :param cluster_id: Cluster ID for which the latest CSI compatible with Scaleway Block Storage will be enabled.
762+ :param region: Region to target. If none is passed will use default region from the config.
763+ :return: :class:`Cluster <Cluster>`
764+
765+ Usage:
766+ ::
767+
768+ result = api.migrate_cluster_to_sbscsi(
769+ cluster_id="example",
770+ )
771+ """
772+
773+ param_region = validate_path_param (
774+ "region" , region or self .client .default_region
775+ )
776+ param_cluster_id = validate_path_param ("cluster_id" , cluster_id )
777+
778+ res = self ._request (
779+ "POST" ,
780+ f"/k8s/v1/regions/{ param_region } /clusters/{ param_cluster_id } /migrate-to-sbs-csi" ,
781+ body = {},
782+ )
783+
784+ self ._throw_on_error (res )
785+ return unmarshal_Cluster (res .json ())
786+
752787 def list_pools (
753788 self ,
754789 * ,
Original file line number Diff line number Diff line change @@ -1707,6 +1707,19 @@ class MigrateClusterToRoutedIPsRequest:
17071707 """
17081708
17091709
1710+ @dataclass
1711+ class MigrateClusterToSBSCSIRequest :
1712+ cluster_id : str
1713+ """
1714+ Cluster ID for which the latest CSI compatible with Scaleway Block Storage will be enabled.
1715+ """
1716+
1717+ region : Optional [Region ]
1718+ """
1719+ Region to target. If none is passed will use default region from the config.
1720+ """
1721+
1722+
17101723@dataclass
17111724class NodeMetadata :
17121725 id : str
You can’t perform that action at this time.
0 commit comments