From 701b91d0c1350c0be9d3acbe784eb6034cea005b Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Fri, 27 Dec 2024 21:33:56 +0100 Subject: [PATCH 1/2] feat: update generated apis (#1696) --- .../src/api/applesilicon/v1alpha1/api.gen.ts | 167 +++++++++++++++++- .../api/applesilicon/v1alpha1/content.gen.ts | 10 +- .../api/applesilicon/v1alpha1/index.gen.ts | 12 +- .../applesilicon/v1alpha1/marshalling.gen.ts | 77 ++++++++ .../api/applesilicon/v1alpha1/types.gen.ts | 107 +++++++++++ 5 files changed, 370 insertions(+), 3 deletions(-) diff --git a/packages/clients/src/api/applesilicon/v1alpha1/api.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/api.gen.ts index 2de8e4ad8..939bba95f 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/api.gen.ts @@ -8,19 +8,27 @@ import { waitForResource, } from '../../../bridge' import type { WaitForOptions, Zone } from '../../../bridge' -import { SERVER_TRANSIENT_STATUSES } from './content.gen' +import { + SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES, + SERVER_TRANSIENT_STATUSES, +} from './content.gen' import { marshalCreateServerRequest, + marshalPrivateNetworkApiAddServerPrivateNetworkRequest, + marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, marshalUpdateServerRequest, unmarshalConnectivityDiagnostic, unmarshalListOSResponse, + unmarshalListServerPrivateNetworksResponse, unmarshalListServerTypesResponse, unmarshalListServersResponse, unmarshalOS, unmarshalServer, + unmarshalServerPrivateNetwork, unmarshalServerType, + unmarshalSetServerPrivateNetworksResponse, unmarshalStartConnectivityDiagnosticResponse, } from './marshalling.gen' import type { @@ -33,15 +41,23 @@ import type { GetServerTypeRequest, ListOSRequest, ListOSResponse, + ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersResponse, OS, + PrivateNetworkApiAddServerPrivateNetworkRequest, + PrivateNetworkApiDeleteServerPrivateNetworkRequest, + PrivateNetworkApiGetServerPrivateNetworkRequest, + PrivateNetworkApiListServerPrivateNetworksRequest, + PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Server, + ServerPrivateNetwork, ServerType, + SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, @@ -328,3 +344,152 @@ export class API extends ParentAPI { unmarshalConnectivityDiagnostic, ) } + +/** Apple silicon - Private Networks API. */ +export class PrivateNetworkAPI extends ParentAPI { + /** Lists the available zones of the API. */ + public static readonly LOCALITIES: Zone[] = ['fr-par-1', 'fr-par-3'] + + getServerPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch( + { + method: 'GET', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }, + unmarshalServerPrivateNetwork, + ) + + /** + * Waits for {@link ServerPrivateNetwork} to be in a final state. + * + * @param request - The request + * {@link PrivateNetworkApiGetServerPrivateNetworkRequest} + * @param options - The waiting options + * @returns A Promise of ServerPrivateNetwork + */ + waitForServerPrivateNetwork = ( + request: Readonly, + options?: Readonly>, + ) => + waitForResource( + options?.stop ?? + (res => + Promise.resolve( + !SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES.includes( + res.status, + ), + )), + this.getServerPrivateNetwork, + request, + options, + ) + + /** + * Add a server to a Private Network. Add an Apple silicon server to a Private + * Network. + * + * @param request - The request + * {@link PrivateNetworkApiAddServerPrivateNetworkRequest} + * @returns A Promise of ServerPrivateNetwork + */ + addServerPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch( + { + body: JSON.stringify( + marshalPrivateNetworkApiAddServerPrivateNetworkRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`, + }, + unmarshalServerPrivateNetwork, + ) + + /** + * Set multiple Private Networks on a server. Configure multiple Private + * Networks on an Apple silicon server. + * + * @param request - The request + * {@link PrivateNetworkApiSetServerPrivateNetworksRequest} + * @returns A Promise of SetServerPrivateNetworksResponse + */ + setServerPrivateNetworks = ( + request: Readonly, + ) => + this.client.fetch( + { + body: JSON.stringify( + marshalPrivateNetworkApiSetServerPrivateNetworksRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'PUT', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`, + }, + unmarshalSetServerPrivateNetworksResponse, + ) + + protected pageOfListServerPrivateNetworks = ( + request: Readonly = {}, + ) => + this.client.fetch( + { + method: 'GET', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-private-networks`, + urlParams: urlParams( + ['ipam_ip_ids', request.ipamIpIds], + ['order_by', request.orderBy], + ['organization_id', request.organizationId], + ['page', request.page], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ['private_network_id', request.privateNetworkId], + ['project_id', request.projectId], + ['server_id', request.serverId], + ), + }, + unmarshalListServerPrivateNetworksResponse, + ) + + /** + * List the Private Networks of a server. List the Private Networks of an + * Apple silicon server. + * + * @param request - The request + * {@link PrivateNetworkApiListServerPrivateNetworksRequest} + * @returns A Promise of ListServerPrivateNetworksResponse + */ + listServerPrivateNetworks = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'serverPrivateNetworks', + this.pageOfListServerPrivateNetworks, + request, + ) + + /** + * Delete a Private Network. + * + * @param request - The request + * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} + */ + deleteServerPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }) +} diff --git a/packages/clients/src/api/applesilicon/v1alpha1/content.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/content.gen.ts index 5f1feed02..32e6d1259 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/content.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/content.gen.ts @@ -1,6 +1,14 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { ServerPrivateNetworkStatus, ServerStatus } from './types.gen' +import type { + ServerPrivateNetworkServerStatus, + ServerPrivateNetworkStatus, + ServerStatus, +} from './types.gen' + +/** Lists transient statutes of the enum {@link ServerPrivateNetworkServerStatus}. */ +export const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[] = + ['attaching', 'detaching'] /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */ export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = diff --git a/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts index 71e4a9920..da05d6767 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts @@ -1,6 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { API } from './api.gen' +export { API, PrivateNetworkAPI } from './api.gen' export * from './content.gen' export type { ConnectivityDiagnostic, @@ -15,15 +15,24 @@ export type { GetServerTypeRequest, ListOSRequest, ListOSResponse, + ListServerPrivateNetworksRequestOrderBy, + ListServerPrivateNetworksResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, OS, + PrivateNetworkApiAddServerPrivateNetworkRequest, + PrivateNetworkApiDeleteServerPrivateNetworkRequest, + PrivateNetworkApiGetServerPrivateNetworkRequest, + PrivateNetworkApiListServerPrivateNetworksRequest, + PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, ReinstallServerRequest, Server, + ServerPrivateNetwork, + ServerPrivateNetworkServerStatus, ServerPrivateNetworkStatus, ServerStatus, ServerType, @@ -33,6 +42,7 @@ export type { ServerTypeMemory, ServerTypeNetwork, ServerTypeStock, + SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, diff --git a/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts index 7ddd62ec0..9f48b6b2d 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts @@ -12,17 +12,22 @@ import type { ConnectivityDiagnosticServerHealth, CreateServerRequest, ListOSResponse, + ListServerPrivateNetworksResponse, ListServerTypesResponse, ListServersResponse, OS, + PrivateNetworkApiAddServerPrivateNetworkRequest, + PrivateNetworkApiSetServerPrivateNetworksRequest, ReinstallServerRequest, Server, + ServerPrivateNetwork, ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, + SetServerPrivateNetworksResponse, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, @@ -48,6 +53,28 @@ export const unmarshalOS = (data: unknown): OS => { } as OS } +export const unmarshalServerPrivateNetwork = ( + data: unknown, +): ServerPrivateNetwork => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`, + ) + } + + return { + createdAt: unmarshalDate(data.created_at), + id: data.id, + ipamIpIds: data.ipam_ip_ids, + privateNetworkId: data.private_network_id, + projectId: data.project_id, + serverId: data.server_id, + status: data.status, + updatedAt: unmarshalDate(data.updated_at), + vlan: data.vlan, + } as ServerPrivateNetwork +} + const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => { if (!isJSONObject(data)) { throw new TypeError( @@ -217,6 +244,24 @@ export const unmarshalListOSResponse = (data: unknown): ListOSResponse => { } as ListOSResponse } +export const unmarshalListServerPrivateNetworksResponse = ( + data: unknown, +): ListServerPrivateNetworksResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`, + ) + } + + return { + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), + totalCount: data.total_count, + } as ListServerPrivateNetworksResponse +} + export const unmarshalListServerTypesResponse = ( data: unknown, ): ListServerTypesResponse => { @@ -246,6 +291,23 @@ export const unmarshalListServersResponse = ( } as ListServersResponse } +export const unmarshalSetServerPrivateNetworksResponse = ( + data: unknown, +): SetServerPrivateNetworksResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`, + ) + } + + return { + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), + } as SetServerPrivateNetworksResponse +} + export const unmarshalStartConnectivityDiagnosticResponse = ( data: unknown, ): StartConnectivityDiagnosticResponse => { @@ -271,6 +333,21 @@ export const marshalCreateServerRequest = ( type: request.type, }) +export const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = ( + request: PrivateNetworkApiAddServerPrivateNetworkRequest, + defaults: DefaultValues, +): Record => ({ + ipam_ip_ids: request.ipamIpIds, + private_network_id: request.privateNetworkId, +}) + +export const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = ( + request: PrivateNetworkApiSetServerPrivateNetworksRequest, + defaults: DefaultValues, +): Record => ({ + per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, +}) + export const marshalReinstallServerRequest = ( request: ReinstallServerRequest, defaults: DefaultValues, diff --git a/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts index d9c805abf..0eb9d6dbc 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts @@ -12,8 +12,22 @@ export type ConnectivityDiagnosticDiagnosticStatus = | 'error' | 'completed' +export type ListServerPrivateNetworksRequestOrderBy = + | 'created_at_asc' + | 'created_at_desc' + | 'updated_at_asc' + | 'updated_at_desc' + export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc' +export type ServerPrivateNetworkServerStatus = + | 'unknown_status' + | 'attaching' + | 'attached' + | 'error' + | 'detaching' + | 'locked' + export type ServerPrivateNetworkStatus = | 'vpc_unknown_status' | 'vpc_enabled' @@ -93,6 +107,27 @@ export interface ConnectivityDiagnosticServerHealth { isVncPortUp: boolean } +export interface ServerPrivateNetwork { + /** ID of the Server-to-Private Network mapping. */ + id: string + /** Private Network Project ID. */ + projectId: string + /** Apple silicon server ID. */ + serverId: string + /** Private Network ID. */ + privateNetworkId: string + /** ID of the VLAN associated with the Private Network. */ + vlan?: number + /** Configuration status of the Private Network. */ + status: ServerPrivateNetworkServerStatus + /** Private Network creation date. */ + createdAt?: Date + /** Date the Private Network was last modified. */ + updatedAt?: Date + /** IPAM IP IDs of the server, if it has any. */ + ipamIpIds: string[] +} + export interface ServerType { /** CPU description. */ cpu?: ServerTypeCPU @@ -262,6 +297,11 @@ export interface ListOSResponse { os: OS[] } +export interface ListServerPrivateNetworksResponse { + serverPrivateNetworks: ServerPrivateNetwork[] + totalCount: number +} + export type ListServerTypesRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: Zone @@ -297,6 +337,69 @@ export interface ListServersResponse { servers: Server[] } +export type PrivateNetworkApiAddServerPrivateNetworkRequest = { + /** Zone to target. If none is passed will use default zone from the config. */ + zone?: Zone + /** ID of the server. */ + serverId: string + /** ID of the Private Network. */ + privateNetworkId: string + /** IPAM IDs of IPs to attach to the server. */ + ipamIpIds?: string[] +} + +export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { + /** Zone to target. If none is passed will use default zone from the config. */ + zone?: Zone + /** ID of the server. */ + serverId: string + /** ID of the Private Network. */ + privateNetworkId: string +} + +export type PrivateNetworkApiGetServerPrivateNetworkRequest = { + /** Zone to target. If none is passed will use default zone from the config. */ + zone?: Zone + serverId: string + privateNetworkId: string +} + +export type PrivateNetworkApiListServerPrivateNetworksRequest = { + /** Zone to target. If none is passed will use default zone from the config. */ + zone?: Zone + /** Sort order for the returned Private Networks. */ + orderBy?: ListServerPrivateNetworksRequestOrderBy + /** Page number for the returned Private Networks. */ + page?: number + /** Maximum number of Private Networks per page. */ + pageSize?: number + /** Filter Private Networks by server ID. */ + serverId?: string + /** Filter Private Networks by Private Network ID. */ + privateNetworkId?: string + /** Filter Private Networks by Organization ID. */ + organizationId?: string + /** Filter Private Networks by Project ID. */ + projectId?: string + /** Filter Private Networks by IPAM IP IDs. */ + ipamIpIds?: string[] +} + +export type PrivateNetworkApiSetServerPrivateNetworksRequest = { + /** Zone to target. If none is passed will use default zone from the config. */ + zone?: Zone + /** ID of the server. */ + serverId: string + /** + * Object where the keys are the IDs of Private Networks and the values are + * arrays of IPAM IDs representing the IPs to assign to this Apple silicon + * server on the Private Network. If the array supplied for a Private Network + * is empty, the next available IP from the Private Network's CIDR block will + * automatically be used for attachment. + */ + perPrivateNetworkIpamIpIds: Record +} + export type RebootServerRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: Zone @@ -316,6 +419,10 @@ export type ReinstallServerRequest = { osId?: string } +export interface SetServerPrivateNetworksResponse { + serverPrivateNetworks: ServerPrivateNetwork[] +} + export type StartConnectivityDiagnosticRequest = { /** Zone to target. If none is passed will use default zone from the config. */ zone?: Zone From 506a671a8a1c327f1c1ae6bfbb657841082b2f9c Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Fri, 27 Dec 2024 21:35:16 +0100 Subject: [PATCH 2/2] feat: update generated apis (#1697) Co-authored-by: philibeaux --- packages/clients/src/api/k8s/v1/api.gen.ts | 42 +++---- packages/clients/src/api/k8s/v1/types.gen.ts | 117 ++++++++++++------- 2 files changed, 95 insertions(+), 64 deletions(-) diff --git a/packages/clients/src/api/k8s/v1/api.gen.ts b/packages/clients/src/api/k8s/v1/api.gen.ts index edc5752f0..143f14d1f 100644 --- a/packages/clients/src/api/k8s/v1/api.gen.ts +++ b/packages/clients/src/api/k8s/v1/api.gen.ts @@ -218,8 +218,8 @@ export class API extends ParentAPI { /** * Delete a Cluster. Delete a specific Kubernetes cluster and all its - * associated pools and nodes. Note that this method will not delete any Load - * Balancer or Block Volume that are associated with the cluster. + * associated pools and nodes, and possibly its associated Load Balancers or + * Block Volumes. * * @param request - The request {@link DeleteClusterRequest} * @returns A Promise of Cluster @@ -260,8 +260,7 @@ export class API extends ParentAPI { /** * Change the Cluster type. Change the type of a specific Kubernetes cluster. * To see the possible values you can enter for the `type` field, [list - * available cluster - * types](#path-clusters-list-available-cluster-types-for-a-cluster). + * available cluster types](#list-available-cluster-types-for-a-cluster). * * @param request - The request {@link SetClusterTypeRequest} * @returns A Promise of Cluster @@ -332,7 +331,7 @@ export class API extends ParentAPI { * Reset the admin token of a Cluster. Reset the admin token for a specific * Kubernetes cluster. This will revoke the old admin token (which will not be * usable afterwards) and create a new one. Note that you will need to - * download kubeconfig again to keep interacting with the cluster. + * download the kubeconfig again to keep interacting with the cluster. * * @param request - The request {@link ResetClusterAdminTokenRequest} */ @@ -347,7 +346,8 @@ export class API extends ParentAPI { /** * Migrate a cluster to SBS CSI. Enable the latest CSI compatible with * Scaleway Block Storage (SBS) and migrate all existing - * PersistentVolumes/VolumeSnapshotContents to SBS. + * PersistentVolumes/VolumeSnapshotContents to SBS. Make sure to have the + * necessary Quota before running this command. * * @param request - The request {@link MigrateClusterToSBSCSIRequest} * @returns A Promise of Cluster @@ -526,7 +526,7 @@ export class API extends ParentAPI { /** * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific * pool. Note that it only works if the targeted version matches the cluster's - * version. + * version. This will drain and replace the nodes in that pool. * * @param request - The request {@link UpgradePoolRequest} * @returns A Promise of Pool @@ -546,7 +546,8 @@ export class API extends ParentAPI { /** * Update a Pool in a Cluster. Update the attributes of a specific pool, such - * as its desired size, autoscaling settings, and tags. + * as its desired size, autoscaling settings, and tags. To upgrade a pool, you + * will need to use the dedicated endpoint. * * @param request - The request {@link UpdatePoolRequest} * @returns A Promise of Pool @@ -701,11 +702,10 @@ export class API extends ParentAPI { /** * Replace a Node in a Cluster. Replace a specific Node. The node will first - * be cordoned (scheduling will be disabled on it). The existing pods on the - * node will then be drained and rescheduled onto another schedulable node. - * Note that when there is not enough space to reschedule all the pods (such - * as in a one-node cluster), disruption of your applications can be - * expected. + * be drained and pods will be rescheduled onto another node. Note that when + * there is not enough space to reschedule all the pods (such as in a one-node + * cluster, or with specific constraints), disruption of your applications may + * occur. * * @deprecated * @param request - The request {@link ReplaceNodeRequest} @@ -724,10 +724,10 @@ export class API extends ParentAPI { /** * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be - * cordoned (scheduling will be disabled on it). The existing pods on the node - * will then be drained and rescheduled onto another schedulable node. Note - * that when there is not enough space to reschedule all the pods (such as in - * a one-node cluster), disruption of your applications can be expected. + * drained and pods will be rescheduled onto another node. Note that when + * there is not enough space to reschedule all the pods (such as in a one-node + * cluster, or with specific constraints), disruption of your applications may + * occur. * * @param request - The request {@link RebootNodeRequest} * @returns A Promise of Node @@ -744,9 +744,11 @@ export class API extends ParentAPI { ) /** - * Delete a Node in a Cluster. Delete a specific Node. Note that when there is - * not enough space to reschedule all the pods (such as in a one-node - * cluster), disruption of your applications can be expected. + * Delete a Node in a Cluster. Delete a specific Node. The node will first be + * drained and pods will be rescheduled onto another node. Note that when + * there is not enough space to reschedule all the pods (such as in a one-node + * cluster, or with specific constraints), disruption of your applications may + * occur. * * @param request - The request {@link DeleteNodeRequest} * @returns A Promise of Node diff --git a/packages/clients/src/api/k8s/v1/types.gen.ts b/packages/clients/src/api/k8s/v1/types.gen.ts index 45d71d270..63017b5a6 100644 --- a/packages/clients/src/api/k8s/v1/types.gen.ts +++ b/packages/clients/src/api/k8s/v1/types.gen.ts @@ -50,7 +50,17 @@ export type ListClustersRequestOrderBy = | 'version_asc' | 'version_desc' -export type ListNodesRequestOrderBy = 'created_at_asc' | 'created_at_desc' +export type ListNodesRequestOrderBy = + | 'created_at_asc' + | 'created_at_desc' + | 'updated_at_asc' + | 'updated_at_desc' + | 'name_asc' + | 'name_desc' + | 'status_asc' + | 'status_desc' + | 'version_asc' + | 'version_desc' export type ListPoolsRequestOrderBy = | 'created_at_asc' @@ -136,7 +146,7 @@ export interface ClusterAutoUpgrade { export interface ClusterAutoscalerConfig { /** Disable the cluster autoscaler. */ scaleDownDisabled: boolean - /** How long after scale up that scale down evaluation resumes. */ + /** How long after scale up the scale down evaluation resumes. */ scaleDownDelayAfterAdd: string /** Type of resource estimator to be used in scale up. */ estimator: AutoscalerEstimator @@ -248,17 +258,19 @@ export interface Pool { * when autoscaling is enabled on the pool. */ maxSize: number - /** - * Customization of the container runtime is available for each pool. Note - * that `docker` has been deprecated since version 1.20 and will be removed by - * version 1.24. - */ + /** Customization of the container runtime is available for each pool. */ containerRuntime: Runtime /** Defines whether the autohealing feature is enabled for the pool. */ autohealing: boolean - /** Tags associated with the pool. */ + /** + * Tags associated with the pool, see [managing + * tags](https://www.scaleway.com/en/docs/containers/kubernetes/api-cli/managing-tags). + */ tags: string[] - /** Placement group ID in which all the nodes of the pool will be created. */ + /** + * Placement group ID in which all the nodes of the pool will be created, + * placement groups are limited to 20 instances. + */ placementGroupId?: string /** * Kubelet arguments to be used by this pool. Note that this feature is @@ -270,11 +282,15 @@ export interface Pool { /** Zone in which the pool's nodes will be spawned. */ zone: Zone /** - * Defines the system volume disk type. Two different types of volume - * (`volume_type`) are provided: `l_ssd` is a local block storage which means - * your system is stored locally on your node's hypervisor. `b_ssd` is a - * remote block storage which means your system is stored on a centralized and - * resilient cluster. + * - `l_ssd` is a local block storage which means your system is stored locally + * on your node's hypervisor. This type is not available for all node types + * `sbs-5k` is a remote block storage which means your system is stored on a + * centralized and resilient cluster with 5k IOPS limits `sbs-15k` is a + * faster remote block storage which means your system is stored on a + * centralized and resilient cluster with 15k IOPS limits `b_ssd` is the + * legacy remote block storage which means your system is stored on a + * centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` + * instead. */ rootVolumeType: PoolVolumeType /** System volume disk size. */ @@ -335,7 +351,7 @@ export interface CreateClusterRequestAutoUpgrade { export interface CreateClusterRequestAutoscalerConfig { /** Disable the cluster autoscaler. */ scaleDownDisabled?: boolean - /** How long after scale up that scale down evaluation resumes. */ + /** How long after scale up the scale down evaluation resumes. */ scaleDownDelayAfterAdd?: string /** Type of resource estimator to be used in scale up. */ estimator: AutoscalerEstimator @@ -421,7 +437,10 @@ export interface CreateClusterRequestPoolConfig { * cloud providers in a Kosmos Cluster. */ nodeType: string - /** Placement group ID in which all the nodes of the pool will be created. */ + /** + * Placement group ID in which all the nodes of the pool will be created, + * placement groups are limited to 20 instances. + */ placementGroupId?: string /** Defines whether the autoscaling feature is enabled for the pool. */ autoscaling: boolean @@ -437,15 +456,14 @@ export interface CreateClusterRequestPoolConfig { * when autoscaling is enabled on the pool. */ maxSize?: number - /** - * Customization of the container runtime is available for each pool. Note - * that `docker` has been deprecated since version 1.20 and will be removed by - * version 1.24. - */ + /** Customization of the container runtime is available for each pool. */ containerRuntime: Runtime /** Defines whether the autohealing feature is enabled for the pool. */ autohealing: boolean - /** Tags associated with the pool. */ + /** + * Tags associated with the pool, see [managing + * tags](https://www.scaleway.com/en/docs/containers/kubernetes/api-cli/managing-tags). + */ tags: string[] /** * Kubelet arguments to be used by this pool. Note that this feature is @@ -457,11 +475,15 @@ export interface CreateClusterRequestPoolConfig { /** Zone in which the pool's nodes will be spawned. */ zone: Zone /** - * Defines the system volume disk type. Two different types of volume - * (`volume_type`) are provided: `l_ssd` is a local block storage which means - * your system is stored locally on your node's hypervisor. `b_ssd` is a - * remote block storage which means your system is stored on a centralized and - * resilient cluster. + * - `l_ssd` is a local block storage which means your system is stored locally + * on your node's hypervisor. This type is not available for all node types + * `sbs-5k` is a remote block storage which means your system is stored on a + * centralized and resilient cluster with 5k IOPS limits `sbs-15k` is a + * faster remote block storage which means your system is stored on a + * centralized and resilient cluster with 15k IOPS limits `b_ssd` is the + * legacy remote block storage which means your system is stored on a + * centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` + * instead. */ rootVolumeType: PoolVolumeType /** System volume disk size. */ @@ -563,7 +585,7 @@ export interface Cluster { updatedAt?: Date /** Autoscaler config for the cluster. */ autoscalerConfig?: ClusterAutoscalerConfig - /** Auto upgrade configuration of the cluster. */ + /** Auto upgrade Kubernetes version of the cluster. */ autoUpgrade?: ClusterAutoUpgrade /** Defines whether a new Kubernetes version is available. */ upgradeAvailable: boolean @@ -646,7 +668,7 @@ export interface UpdateClusterRequestAutoUpgrade { export interface UpdateClusterRequestAutoscalerConfig { /** Disable the cluster autoscaler. */ scaleDownDisabled?: boolean - /** How long after scale up that scale down evaluation resumes. */ + /** How long after scale up the scale down evaluation resumes. */ scaleDownDelayAfterAdd?: string /** Type of resource estimator to be used in scale up. */ estimator: AutoscalerEstimator @@ -775,8 +797,9 @@ export type CreateClusterRequest = { */ projectId?: string /** - * Type of the cluster (possible values are kapsule, multicloud, - * kapsule-dedicated-8, kapsule-dedicated-16). + * Type of the cluster. See [list available cluster + * types](#list-available-cluster-types-for-a-cluster) for a list of valid + * types. */ type: string /** Cluster name. */ @@ -851,7 +874,10 @@ export type CreatePoolRequest = { * cloud providers in a Kosmos Cluster. */ nodeType: string - /** Placement group ID in which all the nodes of the pool will be created. */ + /** + * Placement group ID in which all the nodes of the pool will be created, + * placement groups are limited to 20 instances. + */ placementGroupId?: string /** Defines whether the autoscaling feature is enabled for the pool. */ autoscaling: boolean @@ -867,15 +893,14 @@ export type CreatePoolRequest = { * when autoscaling is enabled on the pool. */ maxSize?: number - /** - * Customization of the container runtime is available for each pool. Note - * that `docker` has been deprecated since version 1.20 and will be removed by - * version 1.24. - */ + /** Customization of the container runtime is available for each pool. */ containerRuntime?: Runtime /** Defines whether the autohealing feature is enabled for the pool. */ autohealing: boolean - /** Tags associated with the pool. */ + /** + * Tags associated with the pool, see [managing + * tags](https://www.scaleway.com/en/docs/containers/kubernetes/api-cli/managing-tags). + */ tags?: string[] /** * Kubelet arguments to be used by this pool. Note that this feature is @@ -887,11 +912,15 @@ export type CreatePoolRequest = { /** Zone in which the pool's nodes will be spawned. */ zone?: Zone /** - * Defines the system volume disk type. Two different types of volume - * (`volume_type`) are provided: `l_ssd` is a local block storage which means - * your system is stored locally on your node's hypervisor. `b_ssd` is a - * remote block storage which means your system is stored on a centralized and - * resilient cluster. + * - `l_ssd` is a local block storage which means your system is stored locally + * on your node's hypervisor. This type is not available for all node types + * `sbs-5k` is a remote block storage which means your system is stored on a + * centralized and resilient cluster with 5k IOPS limits `sbs-15k` is a + * faster remote block storage which means your system is stored on a + * centralized and resilient cluster with 15k IOPS limits `b_ssd` is the + * legacy remote block storage which means your system is stored on a + * centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` + * instead. */ rootVolumeType?: PoolVolumeType /** System volume disk size. */ @@ -1331,7 +1360,7 @@ export type UpdateClusterRequest = { /** New autoscaler config for the cluster. */ autoscalerConfig?: UpdateClusterRequestAutoscalerConfig /** - * New auto upgrade configuration for the cluster. Note that all fields need + * New auto upgrade configuration for the cluster. Note that all fields needs * to be set. */ autoUpgrade?: UpdateClusterRequestAutoUpgrade