Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages_generated/k8s/src/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
marshalAddClusterACLRulesRequest,
marshalCreateClusterRequest,
marshalCreatePoolRequest,
marshalMigratePoolsToNewImagesRequest,
marshalSetClusterACLRulesRequest,
marshalSetClusterTypeRequest,
marshalUpdateClusterRequest,
Expand Down Expand Up @@ -77,6 +78,7 @@ import type {
ListPoolsResponse,
ListVersionsRequest,
ListVersionsResponse,
MigratePoolsToNewImagesRequest,
Node,
NodeMetadata,
Pool,
Expand Down Expand Up @@ -545,6 +547,23 @@ This will drain and replace the nodes in that pool.
unmarshalPool,
)

/**
* Migrate specific pools or all pools of a cluster to new images.. If no pool is specified, all pools of the cluster will be migrated to new images.
*
* @param request - The request {@link MigratePoolsToNewImagesRequest}
*/
migratePoolsToNewImages = (
request: Readonly<MigratePoolsToNewImagesRequest>,
) =>
this.client.fetch<void>({
body: JSON.stringify(
marshalMigratePoolsToNewImagesRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-pools-to-new-images`,
})

/**
* Fetch node metadata. Rerieve metadata to instantiate a Kapsule/Kosmos node. This method is not intended to be called by end users but rather programmatically by the node-installer.
*
Expand Down
1 change: 1 addition & 0 deletions packages_generated/k8s/src/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type {
ListVersionsResponse,
MaintenanceWindow,
MaintenanceWindowDayOfTheWeek,
MigratePoolsToNewImagesRequest,
Node,
NodeMetadata,
NodeMetadataCoreV1Taint,
Expand Down
10 changes: 10 additions & 0 deletions packages_generated/k8s/src/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import type {
ListPoolsResponse,
ListVersionsResponse,
MaintenanceWindow,
MigratePoolsToNewImagesRequest,
Node,
NodeMetadata,
NodeMetadataCoreV1Taint,
Expand Down Expand Up @@ -88,6 +89,7 @@ export const unmarshalPool = (data: unknown): Pool => {
maxSize: data.max_size,
minSize: data.min_size,
name: data.name,
newImagesEnabled: data.new_images_enabled,
nodeType: data.node_type,
placementGroupId: data.placement_group_id,
publicIpDisabled: data.public_ip_disabled,
Expand Down Expand Up @@ -223,6 +225,7 @@ export const unmarshalCluster = (data: unknown): Cluster => {
iamNodesGroupId: data.iam_nodes_group_id,
id: data.id,
name: data.name,
newImagesEnabled: data.new_images_enabled,
openIdConnectConfig: data.open_id_connect_config
? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config)
: undefined,
Expand Down Expand Up @@ -741,6 +744,13 @@ export const marshalCreatePoolRequest = (
zone: request.zone ?? defaults.defaultZone,
})

export const marshalMigratePoolsToNewImagesRequest = (
request: MigratePoolsToNewImagesRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
pool_ids: request.poolIds,
})

export const marshalSetClusterACLRulesRequest = (
request: SetClusterACLRulesRequest,
defaults: DefaultValues,
Expand Down
17 changes: 17 additions & 0 deletions packages_generated/k8s/src/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ export interface Pool {
* Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
*/
publicIpDisabled: boolean
/**
* @deprecated Defines whether the pool is migrated to new images.
*/
newImagesEnabled?: boolean
/**
* Cluster region of the pool.
*/
Expand Down Expand Up @@ -718,6 +722,10 @@ export interface Cluster {
* IAM group that nodes are members of (this field might be empty during early stage of cluster creation).
*/
iamNodesGroupId: string
/**
* @deprecated Defines whether all pools are migrated to new images.
*/
newImagesEnabled?: boolean
}

export interface Node {
Expand Down Expand Up @@ -1461,6 +1469,15 @@ export interface ListVersionsResponse {
versions: Version[]
}

export type MigratePoolsToNewImagesRequest = {
/**
* Region to target. If none is passed will use default region from the config.
*/
region?: ScwRegion
clusterId: string
poolIds?: string[]
}

export interface NodeMetadata {
id: string
name: string
Expand Down
Loading