Skip to content

Commit 06ba7ce

Browse files
authored
feat(k8s): expose MigrateClusterToSBSCSI (#1413)
1 parent ebf37be commit 06ba7ce

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

packages/clients/src/api/k8s/v1/api.gen.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import type {
6868
ListVersionsRequest,
6969
ListVersionsResponse,
7070
MigrateClusterToRoutedIPsRequest,
71+
MigrateClusterToSBSCSIRequest,
7172
Node,
7273
NodeMetadata,
7374
Pool,
@@ -352,6 +353,25 @@ export class API extends ParentAPI {
352353
unmarshalCluster,
353354
)
354355

356+
/**
357+
* Migrate a cluster to SBS CSI. Enable the latest CSI compatible with
358+
* Scaleway Block Storage (SBS) and migrate all existing
359+
* PersistentVolumes/VolumeSnapshotContents to SBS.
360+
*
361+
* @param request - The request {@link MigrateClusterToSBSCSIRequest}
362+
* @returns A Promise of Cluster
363+
*/
364+
migrateClusterToSBSCSI = (request: Readonly<MigrateClusterToSBSCSIRequest>) =>
365+
this.client.fetch<Cluster>(
366+
{
367+
body: '{}',
368+
headers: jsonContentHeaders,
369+
method: 'POST',
370+
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-sbs-csi`,
371+
},
372+
unmarshalCluster,
373+
)
374+
355375
protected pageOfListPools = (request: Readonly<ListPoolsRequest>) =>
356376
this.client.fetch<ListPoolsResponse>(
357377
{

packages/clients/src/api/k8s/v1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export type {
5656
MaintenanceWindow,
5757
MaintenanceWindowDayOfTheWeek,
5858
MigrateClusterToRoutedIPsRequest,
59+
MigrateClusterToSBSCSIRequest,
5960
Node,
6061
NodeMetadata,
6162
NodeMetadataCoreV1Taint,

packages/clients/src/api/k8s/v1/types.gen.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,20 @@ export type MigrateClusterToRoutedIPsRequest = {
11441144
* config.
11451145
*/
11461146
region?: Region
1147+
/** Cluster ID for which the routed ip will be enabled for the nodes. */
1148+
clusterId: string
1149+
}
1150+
1151+
export type MigrateClusterToSBSCSIRequest = {
1152+
/**
1153+
* Region to target. If none is passed will use default region from the
1154+
* config.
1155+
*/
1156+
region?: Region
1157+
/**
1158+
* Cluster ID for which the latest CSI compatible with Scaleway Block Storage
1159+
* will be enabled.
1160+
*/
11471161
clusterId: string
11481162
}
11491163

0 commit comments

Comments
 (0)