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