@scaleway/sdk-k8s 1.2.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,569 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class API extends sdkClient.API {
10
+ /** Lists the available regions of the API. */
11
+ static LOCALITIES = [
12
+ "fr-par",
13
+ "nl-ams",
14
+ "pl-waw"
15
+ ];
16
+ pageOfListClusters = (request = {}) => this.client.fetch(
17
+ {
18
+ method: "GET",
19
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`,
20
+ urlParams: sdkClient.urlParams(
21
+ ["name", request.name],
22
+ ["order_by", request.orderBy],
23
+ ["organization_id", request.organizationId],
24
+ ["page", request.page],
25
+ [
26
+ "page_size",
27
+ request.pageSize ?? this.client.settings.defaultPageSize
28
+ ],
29
+ ["private_network_id", request.privateNetworkId],
30
+ ["project_id", request.projectId],
31
+ ["status", request.status],
32
+ ["type", request.type]
33
+ )
34
+ },
35
+ marshalling_gen.unmarshalListClustersResponse
36
+ );
37
+ /**
38
+ * List Clusters. List all existing Kubernetes clusters in a specific region.
39
+ *
40
+ * @param request - The request {@link ListClustersRequest}
41
+ * @returns A Promise of ListClustersResponse
42
+ */
43
+ listClusters = (request = {}) => sdkClient.enrichForPagination("clusters", this.pageOfListClusters, request);
44
+ /**
45
+ * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.
46
+ *
47
+ * @param request - The request {@link CreateClusterRequest}
48
+ * @returns A Promise of Cluster
49
+ */
50
+ createCluster = (request) => this.client.fetch(
51
+ {
52
+ body: JSON.stringify(
53
+ marshalling_gen.marshalCreateClusterRequest(request, this.client.settings)
54
+ ),
55
+ headers: jsonContentHeaders,
56
+ method: "POST",
57
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`
58
+ },
59
+ marshalling_gen.unmarshalCluster
60
+ );
61
+ /**
62
+ * Get a Cluster. Retrieve information about a specific Kubernetes cluster.
63
+ *
64
+ * @param request - The request {@link GetClusterRequest}
65
+ * @returns A Promise of Cluster
66
+ */
67
+ getCluster = (request) => this.client.fetch(
68
+ {
69
+ method: "GET",
70
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}`
71
+ },
72
+ marshalling_gen.unmarshalCluster
73
+ );
74
+ /**
75
+ * Waits for {@link Cluster} to be in a final state.
76
+ *
77
+ * @param request - The request {@link GetClusterRequest}
78
+ * @param options - The waiting options
79
+ * @returns A Promise of Cluster
80
+ */
81
+ waitForCluster = (request, options) => sdkClient.waitForResource(
82
+ options?.stop ?? ((res) => Promise.resolve(
83
+ !content_gen.CLUSTER_TRANSIENT_STATUSES.includes(res.status)
84
+ )),
85
+ this.getCluster,
86
+ request,
87
+ options
88
+ );
89
+ /**
90
+ * 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.
91
+ *
92
+ * @param request - The request {@link UpdateClusterRequest}
93
+ * @returns A Promise of Cluster
94
+ */
95
+ updateCluster = (request) => this.client.fetch(
96
+ {
97
+ body: JSON.stringify(
98
+ marshalling_gen.marshalUpdateClusterRequest(request, this.client.settings)
99
+ ),
100
+ headers: jsonContentHeaders,
101
+ method: "PATCH",
102
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}`
103
+ },
104
+ marshalling_gen.unmarshalCluster
105
+ );
106
+ /**
107
+ * Delete a Cluster. Delete a specific Kubernetes cluster and all its associated pools and nodes, and possibly its associated Load Balancers or Block Volumes.
108
+ *
109
+ * @param request - The request {@link DeleteClusterRequest}
110
+ * @returns A Promise of Cluster
111
+ */
112
+ deleteCluster = (request) => this.client.fetch(
113
+ {
114
+ method: "DELETE",
115
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}`,
116
+ urlParams: sdkClient.urlParams([
117
+ "with_additional_resources",
118
+ request.withAdditionalResources
119
+ ])
120
+ },
121
+ marshalling_gen.unmarshalCluster
122
+ );
123
+ /**
124
+ * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its associated pools to a specific and supported Kubernetes version.
125
+ *
126
+ * @param request - The request {@link UpgradeClusterRequest}
127
+ * @returns A Promise of Cluster
128
+ */
129
+ upgradeCluster = (request) => this.client.fetch(
130
+ {
131
+ body: JSON.stringify(
132
+ marshalling_gen.marshalUpgradeClusterRequest(request, this.client.settings)
133
+ ),
134
+ headers: jsonContentHeaders,
135
+ method: "POST",
136
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/upgrade`
137
+ },
138
+ marshalling_gen.unmarshalCluster
139
+ );
140
+ /**
141
+ * 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).
142
+ *
143
+ * @param request - The request {@link SetClusterTypeRequest}
144
+ * @returns A Promise of Cluster
145
+ */
146
+ setClusterType = (request) => this.client.fetch(
147
+ {
148
+ body: JSON.stringify(
149
+ marshalling_gen.marshalSetClusterTypeRequest(request, this.client.settings)
150
+ ),
151
+ headers: jsonContentHeaders,
152
+ method: "POST",
153
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/set-type`
154
+ },
155
+ marshalling_gen.unmarshalCluster
156
+ );
157
+ /**
158
+ * 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.
159
+ *
160
+ * @param request - The request {@link ListClusterAvailableVersionsRequest}
161
+ * @returns A Promise of ListClusterAvailableVersionsResponse
162
+ */
163
+ listClusterAvailableVersions = (request) => this.client.fetch(
164
+ {
165
+ method: "GET",
166
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/available-versions`
167
+ },
168
+ marshalling_gen.unmarshalListClusterAvailableVersionsResponse
169
+ );
170
+ /**
171
+ * List available cluster types for a cluster. List the cluster types that a specific Kubernetes cluster is allowed to switch to.
172
+ *
173
+ * @param request - The request {@link ListClusterAvailableTypesRequest}
174
+ * @returns A Promise of ListClusterAvailableTypesResponse
175
+ */
176
+ listClusterAvailableTypes = (request) => this.client.fetch(
177
+ {
178
+ method: "GET",
179
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/available-types`
180
+ },
181
+ marshalling_gen.unmarshalListClusterAvailableTypesResponse
182
+ );
183
+ _getClusterKubeConfig = (request) => this.client.fetch({
184
+ method: "GET",
185
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/kubeconfig`,
186
+ urlParams: sdkClient.urlParams(["dl", 1], ["redacted", request.redacted]),
187
+ responseType: "blob"
188
+ });
189
+ /**
190
+ * 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.
191
+ *
192
+ * @param request - The request {@link ResetClusterAdminTokenRequest}
193
+ */
194
+ resetClusterAdminToken = (request) => this.client.fetch({
195
+ body: "{}",
196
+ headers: jsonContentHeaders,
197
+ method: "POST",
198
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/reset-admin-token`
199
+ });
200
+ pageOfListClusterACLRules = (request) => this.client.fetch(
201
+ {
202
+ method: "GET",
203
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/acls`,
204
+ urlParams: sdkClient.urlParams(
205
+ ["page", request.page],
206
+ [
207
+ "page_size",
208
+ request.pageSize ?? this.client.settings.defaultPageSize
209
+ ]
210
+ )
211
+ },
212
+ marshalling_gen.unmarshalListClusterACLRulesResponse
213
+ );
214
+ /**
215
+ * List ACLs. List ACLs for a specific cluster.
216
+ *
217
+ * @param request - The request {@link ListClusterACLRulesRequest}
218
+ * @returns A Promise of ListClusterACLRulesResponse
219
+ */
220
+ listClusterACLRules = (request) => sdkClient.enrichForPagination("rules", this.pageOfListClusterACLRules, request);
221
+ /**
222
+ * Add new ACLs. Add new ACL rules for a specific cluster.
223
+ *
224
+ * @param request - The request {@link AddClusterACLRulesRequest}
225
+ * @returns A Promise of AddClusterACLRulesResponse
226
+ */
227
+ addClusterACLRules = (request) => this.client.fetch(
228
+ {
229
+ body: JSON.stringify(
230
+ marshalling_gen.marshalAddClusterACLRulesRequest(request, this.client.settings)
231
+ ),
232
+ headers: jsonContentHeaders,
233
+ method: "POST",
234
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/acls`
235
+ },
236
+ marshalling_gen.unmarshalAddClusterACLRulesResponse
237
+ );
238
+ /**
239
+ * Set new ACLs. Set new ACL rules for a specific cluster.
240
+ *
241
+ * @param request - The request {@link SetClusterACLRulesRequest}
242
+ * @returns A Promise of SetClusterACLRulesResponse
243
+ */
244
+ setClusterACLRules = (request) => this.client.fetch(
245
+ {
246
+ body: JSON.stringify(
247
+ marshalling_gen.marshalSetClusterACLRulesRequest(request, this.client.settings)
248
+ ),
249
+ headers: jsonContentHeaders,
250
+ method: "PUT",
251
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/acls`
252
+ },
253
+ marshalling_gen.unmarshalSetClusterACLRulesResponse
254
+ );
255
+ /**
256
+ * Delete an existing ACL.
257
+ *
258
+ * @param request - The request {@link DeleteACLRuleRequest}
259
+ */
260
+ deleteACLRule = (request) => this.client.fetch({
261
+ method: "DELETE",
262
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${sdkClient.validatePathParam("aclId", request.aclId)}`
263
+ });
264
+ pageOfListPools = (request) => this.client.fetch(
265
+ {
266
+ method: "GET",
267
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/pools`,
268
+ urlParams: sdkClient.urlParams(
269
+ ["name", request.name],
270
+ ["order_by", request.orderBy],
271
+ ["page", request.page],
272
+ [
273
+ "page_size",
274
+ request.pageSize ?? this.client.settings.defaultPageSize
275
+ ],
276
+ ["status", request.status]
277
+ )
278
+ },
279
+ marshalling_gen.unmarshalListPoolsResponse
280
+ );
281
+ /**
282
+ * List Pools in a Cluster. List all the existing pools for a specific Kubernetes cluster.
283
+ *
284
+ * @param request - The request {@link ListPoolsRequest}
285
+ * @returns A Promise of ListPoolsResponse
286
+ */
287
+ listPools = (request) => sdkClient.enrichForPagination("pools", this.pageOfListPools, request);
288
+ /**
289
+ * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes cluster.
290
+ *
291
+ * @param request - The request {@link CreatePoolRequest}
292
+ * @returns A Promise of Pool
293
+ */
294
+ createPool = (request) => this.client.fetch(
295
+ {
296
+ body: JSON.stringify(
297
+ marshalling_gen.marshalCreatePoolRequest(request, this.client.settings)
298
+ ),
299
+ headers: jsonContentHeaders,
300
+ method: "POST",
301
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/pools`
302
+ },
303
+ marshalling_gen.unmarshalPool
304
+ );
305
+ /**
306
+ * Get a Pool in a Cluster. Retrieve details about a specific pool in a Kubernetes cluster.
307
+ *
308
+ * @param request - The request {@link GetPoolRequest}
309
+ * @returns A Promise of Pool
310
+ */
311
+ getPool = (request) => this.client.fetch(
312
+ {
313
+ method: "GET",
314
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${sdkClient.validatePathParam("poolId", request.poolId)}`
315
+ },
316
+ marshalling_gen.unmarshalPool
317
+ );
318
+ /**
319
+ * Waits for {@link Pool} to be in a final state.
320
+ *
321
+ * @param request - The request {@link GetPoolRequest}
322
+ * @param options - The waiting options
323
+ * @returns A Promise of Pool
324
+ */
325
+ waitForPool = (request, options) => sdkClient.waitForResource(
326
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.POOL_TRANSIENT_STATUSES.includes(res.status))),
327
+ this.getPool,
328
+ request,
329
+ options
330
+ );
331
+ /**
332
+ * 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.
333
+ This will drain and replace the nodes in that pool.
334
+ *
335
+ * @param request - The request {@link UpgradePoolRequest}
336
+ * @returns A Promise of Pool
337
+ */
338
+ upgradePool = (request) => this.client.fetch(
339
+ {
340
+ body: JSON.stringify(
341
+ marshalling_gen.marshalUpgradePoolRequest(request, this.client.settings)
342
+ ),
343
+ headers: jsonContentHeaders,
344
+ method: "POST",
345
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${sdkClient.validatePathParam("poolId", request.poolId)}/upgrade`
346
+ },
347
+ marshalling_gen.unmarshalPool
348
+ );
349
+ /**
350
+ * 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.
351
+ *
352
+ * @param request - The request {@link UpdatePoolRequest}
353
+ * @returns A Promise of Pool
354
+ */
355
+ updatePool = (request) => this.client.fetch(
356
+ {
357
+ body: JSON.stringify(
358
+ marshalling_gen.marshalUpdatePoolRequest(request, this.client.settings)
359
+ ),
360
+ headers: jsonContentHeaders,
361
+ method: "PATCH",
362
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${sdkClient.validatePathParam("poolId", request.poolId)}`
363
+ },
364
+ marshalling_gen.unmarshalPool
365
+ );
366
+ /**
367
+ * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note that all the pool's nodes will also be deleted.
368
+ *
369
+ * @param request - The request {@link DeletePoolRequest}
370
+ * @returns A Promise of Pool
371
+ */
372
+ deletePool = (request) => this.client.fetch(
373
+ {
374
+ method: "DELETE",
375
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${sdkClient.validatePathParam("poolId", request.poolId)}`
376
+ },
377
+ marshalling_gen.unmarshalPool
378
+ );
379
+ /**
380
+ * 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.
381
+ *
382
+ * @param request - The request {@link GetNodeMetadataRequest}
383
+ * @returns A Promise of NodeMetadata
384
+ */
385
+ getNodeMetadata = (request = {}) => this.client.fetch(
386
+ {
387
+ method: "GET",
388
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-metadata`
389
+ },
390
+ marshalling_gen.unmarshalNodeMetadata
391
+ );
392
+ /**
393
+ * 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.
394
+ *
395
+ * @param request - The request {@link AuthExternalNodeRequest}
396
+ * @returns A Promise of ExternalNodeAuth
397
+ */
398
+ authExternalNode = (request) => this.client.fetch(
399
+ {
400
+ body: "{}",
401
+ headers: jsonContentHeaders,
402
+ method: "POST",
403
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${sdkClient.validatePathParam("poolId", request.poolId)}/external-nodes/auth`
404
+ },
405
+ marshalling_gen.unmarshalExternalNodeAuth
406
+ );
407
+ /**
408
+ * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is not intended to be called by end users but rather programmatically by the kapsule-node-agent.
409
+ *
410
+ * @param request - The request {@link CreateExternalNodeRequest}
411
+ * @returns A Promise of ExternalNode
412
+ */
413
+ createExternalNode = (request) => this.client.fetch(
414
+ {
415
+ body: "{}",
416
+ headers: jsonContentHeaders,
417
+ method: "POST",
418
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${sdkClient.validatePathParam("poolId", request.poolId)}/external-nodes`
419
+ },
420
+ marshalling_gen.unmarshalExternalNode
421
+ );
422
+ pageOfListNodes = (request) => this.client.fetch(
423
+ {
424
+ method: "GET",
425
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${sdkClient.validatePathParam("clusterId", request.clusterId)}/nodes`,
426
+ urlParams: sdkClient.urlParams(
427
+ ["name", request.name],
428
+ ["order_by", request.orderBy],
429
+ ["page", request.page],
430
+ [
431
+ "page_size",
432
+ request.pageSize ?? this.client.settings.defaultPageSize
433
+ ],
434
+ ["pool_id", request.poolId],
435
+ ["status", request.status]
436
+ )
437
+ },
438
+ marshalling_gen.unmarshalListNodesResponse
439
+ );
440
+ /**
441
+ * List Nodes in a Cluster. List all the existing nodes for a specific Kubernetes cluster.
442
+ *
443
+ * @param request - The request {@link ListNodesRequest}
444
+ * @returns A Promise of ListNodesResponse
445
+ */
446
+ listNodes = (request) => sdkClient.enrichForPagination("nodes", this.pageOfListNodes, request);
447
+ /**
448
+ * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.
449
+ *
450
+ * @param request - The request {@link GetNodeRequest}
451
+ * @returns A Promise of Node
452
+ */
453
+ getNode = (request) => this.client.fetch(
454
+ {
455
+ method: "GET",
456
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${sdkClient.validatePathParam("nodeId", request.nodeId)}`
457
+ },
458
+ marshalling_gen.unmarshalNode
459
+ );
460
+ /**
461
+ * Waits for {@link Node} to be in a final state.
462
+ *
463
+ * @param request - The request {@link GetNodeRequest}
464
+ * @param options - The waiting options
465
+ * @returns A Promise of Node
466
+ */
467
+ waitForNode = (request, options) => sdkClient.waitForResource(
468
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.NODE_TRANSIENT_STATUSES.includes(res.status))),
469
+ this.getNode,
470
+ request,
471
+ options
472
+ );
473
+ /**
474
+ * 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.
475
+ *
476
+ * @deprecated
477
+ * @param request - The request {@link ReplaceNodeRequest}
478
+ * @returns A Promise of Node
479
+ */
480
+ replaceNode = (request) => this.client.fetch(
481
+ {
482
+ body: "{}",
483
+ headers: jsonContentHeaders,
484
+ method: "POST",
485
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${sdkClient.validatePathParam("nodeId", request.nodeId)}/replace`
486
+ },
487
+ marshalling_gen.unmarshalNode
488
+ );
489
+ /**
490
+ * 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.
491
+ *
492
+ * @param request - The request {@link RebootNodeRequest}
493
+ * @returns A Promise of Node
494
+ */
495
+ rebootNode = (request) => this.client.fetch(
496
+ {
497
+ body: "{}",
498
+ headers: jsonContentHeaders,
499
+ method: "POST",
500
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${sdkClient.validatePathParam("nodeId", request.nodeId)}/reboot`
501
+ },
502
+ marshalling_gen.unmarshalNode
503
+ );
504
+ /**
505
+ * 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.
506
+ *
507
+ * @param request - The request {@link DeleteNodeRequest}
508
+ * @returns A Promise of Node
509
+ */
510
+ deleteNode = (request) => this.client.fetch(
511
+ {
512
+ method: "DELETE",
513
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${sdkClient.validatePathParam("nodeId", request.nodeId)}`,
514
+ urlParams: sdkClient.urlParams(
515
+ ["replace", request.replace],
516
+ ["skip_drain", request.skipDrain]
517
+ )
518
+ },
519
+ marshalling_gen.unmarshalNode
520
+ );
521
+ /**
522
+ * List all available Versions. List all available versions for the creation of a new Kubernetes cluster.
523
+ *
524
+ * @param request - The request {@link ListVersionsRequest}
525
+ * @returns A Promise of ListVersionsResponse
526
+ */
527
+ listVersions = (request = {}) => this.client.fetch(
528
+ {
529
+ method: "GET",
530
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`
531
+ },
532
+ marshalling_gen.unmarshalListVersionsResponse
533
+ );
534
+ /**
535
+ * Get a Version. Retrieve a specific Kubernetes version and its details.
536
+ *
537
+ * @param request - The request {@link GetVersionRequest}
538
+ * @returns A Promise of Version
539
+ */
540
+ getVersion = (request) => this.client.fetch(
541
+ {
542
+ method: "GET",
543
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions/${sdkClient.validatePathParam("versionName", request.versionName)}`
544
+ },
545
+ marshalling_gen.unmarshalVersion
546
+ );
547
+ pageOfListClusterTypes = (request = {}) => this.client.fetch(
548
+ {
549
+ method: "GET",
550
+ path: `/k8s/v1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-types`,
551
+ urlParams: sdkClient.urlParams(
552
+ ["page", request.page],
553
+ [
554
+ "page_size",
555
+ request.pageSize ?? this.client.settings.defaultPageSize
556
+ ]
557
+ )
558
+ },
559
+ marshalling_gen.unmarshalListClusterTypesResponse
560
+ );
561
+ /**
562
+ * List cluster types. List available cluster types and their technical details.
563
+ *
564
+ * @param request - The request {@link ListClusterTypesRequest}
565
+ * @returns A Promise of ListClusterTypesResponse
566
+ */
567
+ listClusterTypes = (request = {}) => sdkClient.enrichForPagination("clusterTypes", this.pageOfListClusterTypes, request);
568
+ }
569
+ exports.API = API;