@scaleway/sdk-k8s 2.17.0 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as K8Sv1 from './v1/index.js';
@@ -0,0 +1,2 @@
1
+ import { v1_exports } from "./v1/index.js";
2
+ export { v1_exports as K8Sv1 };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-k8s";
7
+ readonly namespace: "k8s";
8
+ readonly displayName: "K8S";
9
+ readonly versions: readonly ["v1"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-k8s",
8
+ namespace: "k8s",
9
+ displayName: "K8S",
10
+ versions: ["v1"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -0,0 +1,290 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client';
3
+ import type { AddClusterACLRulesRequest, AddClusterACLRulesResponse, AuthExternalNodeRequest, Cluster, CreateClusterRequest, CreatePoolRequest, DeleteACLRuleRequest, DeleteClusterRequest, DeleteNodeRequest, DeletePoolRequest, ExternalNodeAuth, GetClusterKubeConfigRequest, GetClusterRequest, GetNodeMetadataRequest, GetNodeRequest, GetPoolRequest, GetVersionRequest, ListClusterACLRulesRequest, ListClusterACLRulesResponse, ListClusterAvailableTypesRequest, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsRequest, ListClusterAvailableVersionsResponse, ListClusterTypesRequest, ListClusterTypesResponse, ListClustersRequest, ListClustersResponse, ListNodesRequest, ListNodesResponse, ListPoolsRequest, ListPoolsResponse, ListVersionsRequest, ListVersionsResponse, Node, NodeMetadata, Pool, RebootNodeRequest, ReplaceNodeRequest, ResetClusterAdminTokenRequest, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, SetPoolLabelsRequest, SetPoolStartupTaintsRequest, SetPoolTaintsRequest, UpdateClusterRequest, UpdatePoolRequest, UpgradeClusterRequest, UpgradePoolRequest, Version } from './types.gen.js';
4
+ /**
5
+ * Kubernetes API.
6
+
7
+ This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
15
+ protected pageOfListClusters: (request?: Readonly<ListClustersRequest>) => Promise<ListClustersResponse>;
16
+ /**
17
+ * List Clusters. List all existing Kubernetes clusters in a specific region.
18
+ *
19
+ * @param request - The request {@link ListClustersRequest}
20
+ * @returns A Promise of ListClustersResponse
21
+ */
22
+ listClusters: (request?: Readonly<ListClustersRequest>) => Promise<ListClustersResponse> & {
23
+ all: () => Promise<Cluster[]>;
24
+ [Symbol.asyncIterator]: () => AsyncGenerator<Cluster[], void, void>;
25
+ };
26
+ /**
27
+ * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.
28
+ *
29
+ * @param request - The request {@link CreateClusterRequest}
30
+ * @returns A Promise of Cluster
31
+ */
32
+ createCluster: (request: Readonly<CreateClusterRequest>) => Promise<Cluster>;
33
+ /**
34
+ * Get a Cluster. Retrieve information about a specific Kubernetes cluster.
35
+ *
36
+ * @param request - The request {@link GetClusterRequest}
37
+ * @returns A Promise of Cluster
38
+ */
39
+ getCluster: (request: Readonly<GetClusterRequest>) => Promise<Cluster>;
40
+ /**
41
+ * Waits for {@link Cluster} to be in a final state.
42
+ *
43
+ * @param request - The request {@link GetClusterRequest}
44
+ * @param options - The waiting options
45
+ * @returns A Promise of Cluster
46
+ */
47
+ waitForCluster: (request: Readonly<GetClusterRequest>, options?: Readonly<WaitForOptions<Cluster>>) => Promise<Cluster>;
48
+ /**
49
+ * Update a Cluster. Update information on a specific Kubernetes cluster. You can update details such as its name, description, tags and configuration. To upgrade a cluster, you will need to use the dedicated endpoint.
50
+ *
51
+ * @param request - The request {@link UpdateClusterRequest}
52
+ * @returns A Promise of Cluster
53
+ */
54
+ updateCluster: (request: Readonly<UpdateClusterRequest>) => Promise<Cluster>;
55
+ /**
56
+ * Delete a Cluster. Delete a specific Kubernetes cluster and all its associated pools and nodes, and possibly its associated Load Balancers or Block Volumes.
57
+ *
58
+ * @param request - The request {@link DeleteClusterRequest}
59
+ * @returns A Promise of Cluster
60
+ */
61
+ deleteCluster: (request: Readonly<DeleteClusterRequest>) => Promise<Cluster>;
62
+ /**
63
+ * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its associated pools to a specific and supported Kubernetes version.
64
+ *
65
+ * @param request - The request {@link UpgradeClusterRequest}
66
+ * @returns A Promise of Cluster
67
+ */
68
+ upgradeCluster: (request: Readonly<UpgradeClusterRequest>) => Promise<Cluster>;
69
+ /**
70
+ * 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](#list-available-cluster-types-for-a-cluster).
71
+ *
72
+ * @param request - The request {@link SetClusterTypeRequest}
73
+ * @returns A Promise of Cluster
74
+ */
75
+ setClusterType: (request: Readonly<SetClusterTypeRequest>) => Promise<Cluster>;
76
+ /**
77
+ * List available versions for a Cluster. List the versions that a specific Kubernetes cluster is allowed to upgrade to. Results will include every patch version greater than the current patch, as well as one minor version ahead of the current version. Any upgrade skipping a minor version will not work.
78
+ *
79
+ * @param request - The request {@link ListClusterAvailableVersionsRequest}
80
+ * @returns A Promise of ListClusterAvailableVersionsResponse
81
+ */
82
+ listClusterAvailableVersions: (request: Readonly<ListClusterAvailableVersionsRequest>) => Promise<ListClusterAvailableVersionsResponse>;
83
+ /**
84
+ * List available cluster types for a cluster. List the cluster types that a specific Kubernetes cluster is allowed to switch to.
85
+ *
86
+ * @param request - The request {@link ListClusterAvailableTypesRequest}
87
+ * @returns A Promise of ListClusterAvailableTypesResponse
88
+ */
89
+ listClusterAvailableTypes: (request: Readonly<ListClusterAvailableTypesRequest>) => Promise<ListClusterAvailableTypesResponse>;
90
+ protected _getClusterKubeConfig: (request: Readonly<GetClusterKubeConfigRequest>) => Promise<Blob>;
91
+ /**
92
+ * 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 the kubeconfig again to keep interacting with the cluster.
93
+ *
94
+ * @param request - The request {@link ResetClusterAdminTokenRequest}
95
+ */
96
+ resetClusterAdminToken: (request: Readonly<ResetClusterAdminTokenRequest>) => Promise<void>;
97
+ protected pageOfListClusterACLRules: (request: Readonly<ListClusterACLRulesRequest>) => Promise<ListClusterACLRulesResponse>;
98
+ /**
99
+ * List ACLs. List ACLs for a specific cluster.
100
+ *
101
+ * @param request - The request {@link ListClusterACLRulesRequest}
102
+ * @returns A Promise of ListClusterACLRulesResponse
103
+ */
104
+ listClusterACLRules: (request: Readonly<ListClusterACLRulesRequest>) => Promise<ListClusterACLRulesResponse> & {
105
+ all: () => Promise<import("./types.gen.js").ACLRule[]>;
106
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ACLRule[], void, void>;
107
+ };
108
+ /**
109
+ * Add new ACLs. Add new ACL rules for a specific cluster.
110
+ *
111
+ * @param request - The request {@link AddClusterACLRulesRequest}
112
+ * @returns A Promise of AddClusterACLRulesResponse
113
+ */
114
+ addClusterACLRules: (request: Readonly<AddClusterACLRulesRequest>) => Promise<AddClusterACLRulesResponse>;
115
+ /**
116
+ * Set new ACLs. Set new ACL rules for a specific cluster.
117
+ *
118
+ * @param request - The request {@link SetClusterACLRulesRequest}
119
+ * @returns A Promise of SetClusterACLRulesResponse
120
+ */
121
+ setClusterACLRules: (request: Readonly<SetClusterACLRulesRequest>) => Promise<SetClusterACLRulesResponse>;
122
+ /**
123
+ * Delete an existing ACL.
124
+ *
125
+ * @param request - The request {@link DeleteACLRuleRequest}
126
+ */
127
+ deleteACLRule: (request: Readonly<DeleteACLRuleRequest>) => Promise<void>;
128
+ protected pageOfListPools: (request: Readonly<ListPoolsRequest>) => Promise<ListPoolsResponse>;
129
+ /**
130
+ * List Pools in a Cluster. List all the existing pools for a specific Kubernetes cluster.
131
+ *
132
+ * @param request - The request {@link ListPoolsRequest}
133
+ * @returns A Promise of ListPoolsResponse
134
+ */
135
+ listPools: (request: Readonly<ListPoolsRequest>) => Promise<ListPoolsResponse> & {
136
+ all: () => Promise<Pool[]>;
137
+ [Symbol.asyncIterator]: () => AsyncGenerator<Pool[], void, void>;
138
+ };
139
+ /**
140
+ * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes cluster.
141
+ *
142
+ * @param request - The request {@link CreatePoolRequest}
143
+ * @returns A Promise of Pool
144
+ */
145
+ createPool: (request: Readonly<CreatePoolRequest>) => Promise<Pool>;
146
+ /**
147
+ * Get a Pool in a Cluster. Retrieve details about a specific pool in a Kubernetes cluster.
148
+ *
149
+ * @param request - The request {@link GetPoolRequest}
150
+ * @returns A Promise of Pool
151
+ */
152
+ getPool: (request: Readonly<GetPoolRequest>) => Promise<Pool>;
153
+ /**
154
+ * Waits for {@link Pool} to be in a final state.
155
+ *
156
+ * @param request - The request {@link GetPoolRequest}
157
+ * @param options - The waiting options
158
+ * @returns A Promise of Pool
159
+ */
160
+ waitForPool: (request: Readonly<GetPoolRequest>, options?: Readonly<WaitForOptions<Pool>>) => Promise<Pool>;
161
+ /**
162
+ * 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.
163
+ This will drain and replace the nodes in that pool.
164
+ *
165
+ * @param request - The request {@link UpgradePoolRequest}
166
+ * @returns A Promise of Pool
167
+ */
168
+ upgradePool: (request: Readonly<UpgradePoolRequest>) => Promise<Pool>;
169
+ /**
170
+ * Update a Pool in a Cluster. Update the attributes of a specific pool, such as its desired size, autoscaling settings, and tags. To upgrade a pool, you will need to use the dedicated endpoint.
171
+ *
172
+ * @param request - The request {@link UpdatePoolRequest}
173
+ * @returns A Promise of Pool
174
+ */
175
+ updatePool: (request: Readonly<UpdatePoolRequest>) => Promise<Pool>;
176
+ /**
177
+ * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note that all the pool's nodes will also be deleted.
178
+ *
179
+ * @param request - The request {@link DeletePoolRequest}
180
+ * @returns A Promise of Pool
181
+ */
182
+ deletePool: (request: Readonly<DeletePoolRequest>) => Promise<Pool>;
183
+ /**
184
+ * Set a list of taints for a specific pool. Apply a list of taints to all nodes of the pool which will be periodically reconciled by scaleway.
185
+ *
186
+ * @param request - The request {@link SetPoolTaintsRequest}
187
+ * @returns A Promise of Pool
188
+ */
189
+ setPoolTaints: (request: Readonly<SetPoolTaintsRequest>) => Promise<Pool>;
190
+ /**
191
+ * Set a list of startup taints for a specific pool. Apply a list of taints to new nodes of the pool which would not be reconciled by scaleway.
192
+ *
193
+ * @param request - The request {@link SetPoolStartupTaintsRequest}
194
+ * @returns A Promise of Pool
195
+ */
196
+ setPoolStartupTaints: (request: Readonly<SetPoolStartupTaintsRequest>) => Promise<Pool>;
197
+ /**
198
+ * Set a list of labels for a specific pool. Apply a list of taints to all nodes of the pool (only apply to labels which was set through scaleway api).
199
+ *
200
+ * @param request - The request {@link SetPoolLabelsRequest}
201
+ * @returns A Promise of Pool
202
+ */
203
+ setPoolLabels: (request: Readonly<SetPoolLabelsRequest>) => Promise<Pool>;
204
+ /**
205
+ * 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.
206
+ *
207
+ * @param request - The request {@link GetNodeMetadataRequest}
208
+ * @returns A Promise of NodeMetadata
209
+ */
210
+ getNodeMetadata: (request?: Readonly<GetNodeMetadataRequest>) => Promise<NodeMetadata>;
211
+ /**
212
+ * Authenticate Kosmos external node. Creates a newer Kosmos node and returns its token. This method is not intended to be called by end users but rather programmatically by the node-installer.
213
+ *
214
+ * @param request - The request {@link AuthExternalNodeRequest}
215
+ * @returns A Promise of ExternalNodeAuth
216
+ */
217
+ authExternalNode: (request: Readonly<AuthExternalNodeRequest>) => Promise<ExternalNodeAuth>;
218
+ protected pageOfListNodes: (request: Readonly<ListNodesRequest>) => Promise<ListNodesResponse>;
219
+ /**
220
+ * List Nodes in a Cluster. List all the existing nodes for a specific Kubernetes cluster.
221
+ *
222
+ * @param request - The request {@link ListNodesRequest}
223
+ * @returns A Promise of ListNodesResponse
224
+ */
225
+ listNodes: (request: Readonly<ListNodesRequest>) => Promise<ListNodesResponse> & {
226
+ all: () => Promise<Node[]>;
227
+ [Symbol.asyncIterator]: () => AsyncGenerator<Node[], void, void>;
228
+ };
229
+ /**
230
+ * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.
231
+ *
232
+ * @param request - The request {@link GetNodeRequest}
233
+ * @returns A Promise of Node
234
+ */
235
+ getNode: (request: Readonly<GetNodeRequest>) => Promise<Node>;
236
+ /**
237
+ * Waits for {@link Node} to be in a final state.
238
+ *
239
+ * @param request - The request {@link GetNodeRequest}
240
+ * @param options - The waiting options
241
+ * @returns A Promise of Node
242
+ */
243
+ waitForNode: (request: Readonly<GetNodeRequest>, options?: Readonly<WaitForOptions<Node>>) => Promise<Node>;
244
+ /**
245
+ * Replace a Node in a Cluster. Replace 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.
246
+ *
247
+ * @param request - The request {@link ReplaceNodeRequest}
248
+ * @returns A Promise of Node
249
+ */
250
+ replaceNode: (request: Readonly<ReplaceNodeRequest>) => Promise<Node>;
251
+ /**
252
+ * Reboot a Node in a Cluster. Reboot 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.
253
+ *
254
+ * @param request - The request {@link RebootNodeRequest}
255
+ * @returns A Promise of Node
256
+ */
257
+ rebootNode: (request: Readonly<RebootNodeRequest>) => Promise<Node>;
258
+ /**
259
+ * Delete a Node in a Cluster. Delete a specific Node. Pool size is reduced by 1. 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.
260
+ *
261
+ * @param request - The request {@link DeleteNodeRequest}
262
+ * @returns A Promise of Node
263
+ */
264
+ deleteNode: (request: Readonly<DeleteNodeRequest>) => Promise<Node>;
265
+ /**
266
+ * List all available Versions. List all available versions for the creation of a new Kubernetes cluster.
267
+ *
268
+ * @param request - The request {@link ListVersionsRequest}
269
+ * @returns A Promise of ListVersionsResponse
270
+ */
271
+ listVersions: (request?: Readonly<ListVersionsRequest>) => Promise<ListVersionsResponse>;
272
+ /**
273
+ * Get a Version. Retrieve a specific Kubernetes version and its details.
274
+ *
275
+ * @param request - The request {@link GetVersionRequest}
276
+ * @returns A Promise of Version
277
+ */
278
+ getVersion: (request: Readonly<GetVersionRequest>) => Promise<Version>;
279
+ protected pageOfListClusterTypes: (request?: Readonly<ListClusterTypesRequest>) => Promise<ListClusterTypesResponse>;
280
+ /**
281
+ * List cluster types. List available cluster types and their technical details.
282
+ *
283
+ * @param request - The request {@link ListClusterTypesRequest}
284
+ * @returns A Promise of ListClusterTypesResponse
285
+ */
286
+ listClusterTypes: (request?: Readonly<ListClusterTypesRequest>) => Promise<ListClusterTypesResponse> & {
287
+ all: () => Promise<import("./types.gen.js").ClusterType[]>;
288
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ClusterType[], void, void>;
289
+ };
290
+ }
@@ -0,0 +1,210 @@
1
+ import { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion } from "./marshalling.gen.js";
3
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v1/api.gen.ts
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
+ /**
7
+ * Kubernetes API.
8
+
9
+ This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
10
+ */
11
+ var API = class extends API$1 {
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListClusters = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`,
17
+ urlParams: urlParams(["name", request.name], ["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], ["status", request.status], ["type", request.type], ["version", request.version])
18
+ }, unmarshalListClustersResponse);
19
+ this.listClusters = (request = {}) => enrichForPagination("clusters", this.pageOfListClusters, request);
20
+ this.createCluster = (request) => this.client.fetch({
21
+ body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)),
22
+ headers: jsonContentHeaders,
23
+ method: "POST",
24
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`
25
+ }, unmarshalCluster);
26
+ this.getCluster = (request) => this.client.fetch({
27
+ method: "GET",
28
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
29
+ }, unmarshalCluster);
30
+ this.waitForCluster = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);
31
+ this.updateCluster = (request) => this.client.fetch({
32
+ body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "PATCH",
35
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
36
+ }, unmarshalCluster);
37
+ this.deleteCluster = (request) => this.client.fetch({
38
+ method: "DELETE",
39
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`,
40
+ urlParams: urlParams(["with_additional_resources", request.withAdditionalResources])
41
+ }, unmarshalCluster);
42
+ this.upgradeCluster = (request) => this.client.fetch({
43
+ body: JSON.stringify(marshalUpgradeClusterRequest(request, this.client.settings)),
44
+ headers: jsonContentHeaders,
45
+ method: "POST",
46
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/upgrade`
47
+ }, unmarshalCluster);
48
+ this.setClusterType = (request) => this.client.fetch({
49
+ body: JSON.stringify(marshalSetClusterTypeRequest(request, this.client.settings)),
50
+ headers: jsonContentHeaders,
51
+ method: "POST",
52
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/set-type`
53
+ }, unmarshalCluster);
54
+ this.listClusterAvailableVersions = (request) => this.client.fetch({
55
+ method: "GET",
56
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/available-versions`
57
+ }, unmarshalListClusterAvailableVersionsResponse);
58
+ this.listClusterAvailableTypes = (request) => this.client.fetch({
59
+ method: "GET",
60
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/available-types`
61
+ }, unmarshalListClusterAvailableTypesResponse);
62
+ this._getClusterKubeConfig = (request) => this.client.fetch({
63
+ method: "GET",
64
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/kubeconfig`,
65
+ urlParams: urlParams(["dl", 1], ["redacted", request.redacted]),
66
+ responseType: "blob"
67
+ });
68
+ this.resetClusterAdminToken = (request) => this.client.fetch({
69
+ body: "{}",
70
+ headers: jsonContentHeaders,
71
+ method: "POST",
72
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/reset-admin-token`
73
+ });
74
+ this.pageOfListClusterACLRules = (request) => this.client.fetch({
75
+ method: "GET",
76
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/acls`,
77
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
78
+ }, unmarshalListClusterACLRulesResponse);
79
+ this.listClusterACLRules = (request) => enrichForPagination("rules", this.pageOfListClusterACLRules, request);
80
+ this.addClusterACLRules = (request) => this.client.fetch({
81
+ body: JSON.stringify(marshalAddClusterACLRulesRequest(request, this.client.settings)),
82
+ headers: jsonContentHeaders,
83
+ method: "POST",
84
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/acls`
85
+ }, unmarshalAddClusterACLRulesResponse);
86
+ this.setClusterACLRules = (request) => this.client.fetch({
87
+ body: JSON.stringify(marshalSetClusterACLRulesRequest(request, this.client.settings)),
88
+ headers: jsonContentHeaders,
89
+ method: "PUT",
90
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/acls`
91
+ }, unmarshalSetClusterACLRulesResponse);
92
+ this.deleteACLRule = (request) => this.client.fetch({
93
+ method: "DELETE",
94
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam("aclId", request.aclId)}`
95
+ });
96
+ this.pageOfListPools = (request) => this.client.fetch({
97
+ method: "GET",
98
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/pools`,
99
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["status", request.status])
100
+ }, unmarshalListPoolsResponse);
101
+ this.listPools = (request) => enrichForPagination("pools", this.pageOfListPools, request);
102
+ this.createPool = (request) => this.client.fetch({
103
+ body: JSON.stringify(marshalCreatePoolRequest(request, this.client.settings)),
104
+ headers: jsonContentHeaders,
105
+ method: "POST",
106
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/pools`
107
+ }, unmarshalPool);
108
+ this.getPool = (request) => this.client.fetch({
109
+ method: "GET",
110
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}`
111
+ }, unmarshalPool);
112
+ this.waitForPool = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!POOL_TRANSIENT_STATUSES.includes(res.status))), this.getPool, request, options);
113
+ this.upgradePool = (request) => this.client.fetch({
114
+ body: JSON.stringify(marshalUpgradePoolRequest(request, this.client.settings)),
115
+ headers: jsonContentHeaders,
116
+ method: "POST",
117
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/upgrade`
118
+ }, unmarshalPool);
119
+ this.updatePool = (request) => this.client.fetch({
120
+ body: JSON.stringify(marshalUpdatePoolRequest(request, this.client.settings)),
121
+ headers: jsonContentHeaders,
122
+ method: "PATCH",
123
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}`
124
+ }, unmarshalPool);
125
+ this.deletePool = (request) => this.client.fetch({
126
+ method: "DELETE",
127
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}`
128
+ }, unmarshalPool);
129
+ this.setPoolTaints = (request) => this.client.fetch({
130
+ body: JSON.stringify(marshalSetPoolTaintsRequest(request, this.client.settings)),
131
+ headers: jsonContentHeaders,
132
+ method: "PUT",
133
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/set-taints`
134
+ }, unmarshalPool);
135
+ this.setPoolStartupTaints = (request) => this.client.fetch({
136
+ body: JSON.stringify(marshalSetPoolStartupTaintsRequest(request, this.client.settings)),
137
+ headers: jsonContentHeaders,
138
+ method: "PUT",
139
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/set-startup-taints`
140
+ }, unmarshalPool);
141
+ this.setPoolLabels = (request) => this.client.fetch({
142
+ body: JSON.stringify(marshalSetPoolLabelsRequest(request, this.client.settings)),
143
+ headers: jsonContentHeaders,
144
+ method: "PUT",
145
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/set-labels`
146
+ }, unmarshalPool);
147
+ this.getNodeMetadata = (request = {}) => this.client.fetch({
148
+ method: "GET",
149
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-metadata`
150
+ }, unmarshalNodeMetadata);
151
+ this.authExternalNode = (request) => this.client.fetch({
152
+ body: "{}",
153
+ headers: jsonContentHeaders,
154
+ method: "POST",
155
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/external-nodes/auth`
156
+ }, unmarshalExternalNodeAuth);
157
+ this.pageOfListNodes = (request) => this.client.fetch({
158
+ method: "GET",
159
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/nodes`,
160
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["pool_id", request.poolId], ["status", request.status])
161
+ }, unmarshalListNodesResponse);
162
+ this.listNodes = (request) => enrichForPagination("nodes", this.pageOfListNodes, request);
163
+ this.getNode = (request) => this.client.fetch({
164
+ method: "GET",
165
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}`
166
+ }, unmarshalNode);
167
+ this.waitForNode = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options);
168
+ this.replaceNode = (request) => this.client.fetch({
169
+ body: "{}",
170
+ headers: jsonContentHeaders,
171
+ method: "POST",
172
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}/replace`
173
+ }, unmarshalNode);
174
+ this.rebootNode = (request) => this.client.fetch({
175
+ body: "{}",
176
+ headers: jsonContentHeaders,
177
+ method: "POST",
178
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}/reboot`
179
+ }, unmarshalNode);
180
+ this.deleteNode = (request) => this.client.fetch({
181
+ method: "DELETE",
182
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}`,
183
+ urlParams: urlParams(["skip_drain", request.skipDrain])
184
+ }, unmarshalNode);
185
+ this.listVersions = (request = {}) => this.client.fetch({
186
+ method: "GET",
187
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`
188
+ }, unmarshalListVersionsResponse);
189
+ this.getVersion = (request) => this.client.fetch({
190
+ method: "GET",
191
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam("versionName", request.versionName)}`
192
+ }, unmarshalVersion);
193
+ this.pageOfListClusterTypes = (request = {}) => this.client.fetch({
194
+ method: "GET",
195
+ path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-types`,
196
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
197
+ }, unmarshalListClusterTypesResponse);
198
+ this.listClusterTypes = (request = {}) => enrichForPagination("clusterTypes", this.pageOfListClusterTypes, request);
199
+ }
200
+ static {
201
+ this.LOCALITY = toApiLocality({ regions: [
202
+ "fr-par",
203
+ "nl-ams",
204
+ "pl-waw",
205
+ "it-mil"
206
+ ] });
207
+ }
208
+ };
209
+ //#endregion
210
+ export { API };
@@ -0,0 +1,11 @@
1
+ import { API } from './api.gen';
2
+ import type { GetClusterKubeConfigRequest } from './types.gen';
3
+ export declare class K8SUtilsAPI extends API {
4
+ /**
5
+ * Get configuration of a kube cluster.
6
+ *
7
+ * @param request - The request {@link GetClusterKubeConfigRequest}
8
+ * @returns A Promise of Blob
9
+ */
10
+ getClusterKubeConfig: (request: Readonly<GetClusterKubeConfigRequest>) => Promise<Blob>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { API } from "./api.gen.js";
2
+ //#region src/v1/api.utils.ts
3
+ var K8SUtilsAPI = class extends API {
4
+ constructor(..._args) {
5
+ super(..._args);
6
+ this.getClusterKubeConfig = (request) => this._getClusterKubeConfig(request);
7
+ }
8
+ };
9
+ //#endregion
10
+ export { K8SUtilsAPI };
@@ -0,0 +1,7 @@
1
+ import type { ClusterStatus, NodeStatus, PoolStatus } from './types.gen.js';
2
+ /** Lists transient statutes of the enum {@link ClusterStatus}. */
3
+ export declare const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[];
4
+ /** Lists transient statutes of the enum {@link NodeStatus}. */
5
+ export declare const NODE_TRANSIENT_STATUSES: NodeStatus[];
6
+ /** Lists transient statutes of the enum {@link PoolStatus}. */
7
+ export declare const POOL_TRANSIENT_STATUSES: PoolStatus[];
@@ -0,0 +1,24 @@
1
+ //#region src/v1/content.gen.ts
2
+ /** Lists transient statutes of the enum {@link ClusterStatus}. */
3
+ const CLUSTER_TRANSIENT_STATUSES = [
4
+ "creating",
5
+ "deleting",
6
+ "updating"
7
+ ];
8
+ /** Lists transient statutes of the enum {@link NodeStatus}. */
9
+ const NODE_TRANSIENT_STATUSES = [
10
+ "creating",
11
+ "deleting",
12
+ "rebooting",
13
+ "upgrading",
14
+ "starting",
15
+ "registering"
16
+ ];
17
+ /** Lists transient statutes of the enum {@link PoolStatus}. */
18
+ const POOL_TRANSIENT_STATUSES = [
19
+ "deleting",
20
+ "scaling",
21
+ "upgrading"
22
+ ];
23
+ //#endregion
24
+ export { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES };
@@ -0,0 +1,4 @@
1
+ export { K8SUtilsAPI as API } from './api.utils';
2
+ export * from './content.gen';
3
+ export type * from './types.gen';
4
+ export * as ValidationRules from './validation-rules.gen';
@@ -0,0 +1,5 @@
1
+ export { API, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { ACLRule, ACLRuleRequest, AddClusterACLRulesRequest, AddClusterACLRulesResponse, AuthExternalNodeRequest, AutoscalerEstimator, AutoscalerExpander, CNI, Cluster, ClusterAutoUpgrade, ClusterAutoscalerConfig, ClusterOpenIDConnectConfig, ClusterStatus, ClusterType, ClusterTypeAvailability, ClusterTypeResiliency, CoreV1Taint, CoreV1TaintEffect, CreateClusterRequest, CreateClusterRequestAutoUpgrade, CreateClusterRequestAutoscalerConfig, CreateClusterRequestOpenIDConnectConfig, CreateClusterRequestPoolConfig, CreateClusterRequestPoolConfigUpgradePolicy, CreatePoolRequest, CreatePoolRequestUpgradePolicy, DeleteACLRuleRequest, DeleteClusterRequest, DeleteNodeRequest, DeletePoolRequest, ExternalNodeAuth, GetClusterKubeConfigRequest, GetClusterRequest, GetNodeMetadataRequest, GetNodeRequest, GetPoolRequest, GetVersionRequest, ListClusterACLRulesRequest, ListClusterACLRulesResponse, ListClusterAvailableTypesRequest, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsRequest, ListClusterAvailableVersionsResponse, ListClusterTypesRequest, ListClusterTypesResponse, ListClustersRequest, ListClustersRequestOrderBy, ListClustersResponse, ListNodesRequest, ListNodesRequestOrderBy, ListNodesResponse, ListPoolsRequest, ListPoolsRequestOrderBy, ListPoolsResponse, ListVersionsRequest, ListVersionsResponse, MaintenanceWindow, MaintenanceWindowDayOfTheWeek, Node, NodeMetadata, NodeMetadataCoreV1Taint, NodeStatus, Pool, PoolStatus, PoolUpgradePolicy, PoolVolumeType, RebootNodeRequest, ReplaceNodeRequest, ResetClusterAdminTokenRequest, Runtime, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, SetPoolLabelsRequest, SetPoolStartupTaintsRequest, SetPoolTaintsRequest, UpdateClusterRequest, UpdateClusterRequestAutoUpgrade, UpdateClusterRequestAutoscalerConfig, UpdateClusterRequestOpenIDConnectConfig, UpdatePoolRequest, UpdatePoolRequestUpgradePolicy, UpgradeClusterRequest, UpgradePoolRequest, Version, } from './types.gen.js';
5
+ export * as ValidationRules from './validation-rules.gen.js';
@@ -0,0 +1,5 @@
1
+ import { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion } from "./marshalling.gen.js";
3
+ import { API } from "./api.gen.js";
4
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
5
+ export { API, CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion };