@scaleway/sdk-k8s 2.8.0 → 2.10.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.
- package/dist/.vite/license.md +3 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1/api.gen.d.ts +3 -3
- package/dist/v1/api.gen.js +202 -426
- package/dist/v1/api.utils.js +4 -7
- package/dist/v1/content.gen.js +3 -3
- package/dist/v1/marshalling.gen.js +52 -52
- package/dist/v1/metadata.gen.js +1 -1
- package/dist/v1/utils-metadata.js +1 -1
- package/dist/v1/validation-rules.gen.js +17 -17
- package/package.json +16 -6
- package/LICENSE +0 -191
package/dist/v1/api.gen.js
CHANGED
|
@@ -2,438 +2,214 @@ import { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STA
|
|
|
2
2
|
import { marshalAddClusterACLRulesRequest, marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterACLRulesRequest, marshalSetClusterTypeRequest, marshalSetPoolLabelsRequest, marshalSetPoolStartupTaintsRequest, marshalSetPoolTaintsRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalAddClusterACLRulesResponse, unmarshalCluster, unmarshalExternalNode, unmarshalExternalNodeAuth, unmarshalListClusterACLRulesResponse, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalNodeMetadata, unmarshalPool, unmarshalSetClusterACLRulesResponse, unmarshalVersion } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v1/api.gen.ts
|
|
5
|
-
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
6
|
/**
|
|
7
7
|
* Kubernetes API.
|
|
8
8
|
|
|
9
9
|
This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
|
|
10
10
|
*/
|
|
11
11
|
var API = class extends API$1 {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
method: "POST",
|
|
214
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/pools`
|
|
215
|
-
}, unmarshalPool);
|
|
216
|
-
/**
|
|
217
|
-
* Get a Pool in a Cluster. Retrieve details about a specific pool in a Kubernetes cluster.
|
|
218
|
-
*
|
|
219
|
-
* @param request - The request {@link GetPoolRequest}
|
|
220
|
-
* @returns A Promise of Pool
|
|
221
|
-
*/
|
|
222
|
-
getPool = (request) => this.client.fetch({
|
|
223
|
-
method: "GET",
|
|
224
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}`
|
|
225
|
-
}, unmarshalPool);
|
|
226
|
-
/**
|
|
227
|
-
* Waits for {@link Pool} to be in a final state.
|
|
228
|
-
*
|
|
229
|
-
* @param request - The request {@link GetPoolRequest}
|
|
230
|
-
* @param options - The waiting options
|
|
231
|
-
* @returns A Promise of Pool
|
|
232
|
-
*/
|
|
233
|
-
waitForPool = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!POOL_TRANSIENT_STATUSES.includes(res.status))), this.getPool, request, options);
|
|
234
|
-
/**
|
|
235
|
-
* 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.
|
|
236
|
-
This will drain and replace the nodes in that pool.
|
|
237
|
-
*
|
|
238
|
-
* @param request - The request {@link UpgradePoolRequest}
|
|
239
|
-
* @returns A Promise of Pool
|
|
240
|
-
*/
|
|
241
|
-
upgradePool = (request) => this.client.fetch({
|
|
242
|
-
body: JSON.stringify(marshalUpgradePoolRequest(request, this.client.settings)),
|
|
243
|
-
headers: jsonContentHeaders,
|
|
244
|
-
method: "POST",
|
|
245
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/upgrade`
|
|
246
|
-
}, unmarshalPool);
|
|
247
|
-
/**
|
|
248
|
-
* 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.
|
|
249
|
-
*
|
|
250
|
-
* @param request - The request {@link UpdatePoolRequest}
|
|
251
|
-
* @returns A Promise of Pool
|
|
252
|
-
*/
|
|
253
|
-
updatePool = (request) => this.client.fetch({
|
|
254
|
-
body: JSON.stringify(marshalUpdatePoolRequest(request, this.client.settings)),
|
|
255
|
-
headers: jsonContentHeaders,
|
|
256
|
-
method: "PATCH",
|
|
257
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}`
|
|
258
|
-
}, unmarshalPool);
|
|
259
|
-
/**
|
|
260
|
-
* Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note that all the pool's nodes will also be deleted.
|
|
261
|
-
*
|
|
262
|
-
* @param request - The request {@link DeletePoolRequest}
|
|
263
|
-
* @returns A Promise of Pool
|
|
264
|
-
*/
|
|
265
|
-
deletePool = (request) => this.client.fetch({
|
|
266
|
-
method: "DELETE",
|
|
267
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}`
|
|
268
|
-
}, unmarshalPool);
|
|
269
|
-
/**
|
|
270
|
-
* 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.
|
|
271
|
-
*
|
|
272
|
-
* @param request - The request {@link SetPoolTaintsRequest}
|
|
273
|
-
* @returns A Promise of Pool
|
|
274
|
-
*/
|
|
275
|
-
setPoolTaints = (request) => this.client.fetch({
|
|
276
|
-
body: JSON.stringify(marshalSetPoolTaintsRequest(request, this.client.settings)),
|
|
277
|
-
headers: jsonContentHeaders,
|
|
278
|
-
method: "PUT",
|
|
279
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/set-taints`
|
|
280
|
-
}, unmarshalPool);
|
|
281
|
-
/**
|
|
282
|
-
* 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.
|
|
283
|
-
*
|
|
284
|
-
* @param request - The request {@link SetPoolStartupTaintsRequest}
|
|
285
|
-
* @returns A Promise of Pool
|
|
286
|
-
*/
|
|
287
|
-
setPoolStartupTaints = (request) => this.client.fetch({
|
|
288
|
-
body: JSON.stringify(marshalSetPoolStartupTaintsRequest(request, this.client.settings)),
|
|
289
|
-
headers: jsonContentHeaders,
|
|
290
|
-
method: "PUT",
|
|
291
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/set-startup-taints`
|
|
292
|
-
}, unmarshalPool);
|
|
293
|
-
/**
|
|
294
|
-
* 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).
|
|
295
|
-
*
|
|
296
|
-
* @param request - The request {@link SetPoolLabelsRequest}
|
|
297
|
-
* @returns A Promise of Pool
|
|
298
|
-
*/
|
|
299
|
-
setPoolLabels = (request) => this.client.fetch({
|
|
300
|
-
body: JSON.stringify(marshalSetPoolLabelsRequest(request, this.client.settings)),
|
|
301
|
-
headers: jsonContentHeaders,
|
|
302
|
-
method: "PUT",
|
|
303
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/set-labels`
|
|
304
|
-
}, unmarshalPool);
|
|
305
|
-
/**
|
|
306
|
-
* 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.
|
|
307
|
-
*
|
|
308
|
-
* @param request - The request {@link GetNodeMetadataRequest}
|
|
309
|
-
* @returns A Promise of NodeMetadata
|
|
310
|
-
*/
|
|
311
|
-
getNodeMetadata = (request = {}) => this.client.fetch({
|
|
312
|
-
method: "GET",
|
|
313
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-metadata`
|
|
314
|
-
}, unmarshalNodeMetadata);
|
|
315
|
-
/**
|
|
316
|
-
* 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.
|
|
317
|
-
*
|
|
318
|
-
* @param request - The request {@link AuthExternalNodeRequest}
|
|
319
|
-
* @returns A Promise of ExternalNodeAuth
|
|
320
|
-
*/
|
|
321
|
-
authExternalNode = (request) => this.client.fetch({
|
|
322
|
-
body: "{}",
|
|
323
|
-
headers: jsonContentHeaders,
|
|
324
|
-
method: "POST",
|
|
325
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/external-nodes/auth`
|
|
326
|
-
}, unmarshalExternalNodeAuth);
|
|
327
|
-
/**
|
|
328
|
-
* 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.
|
|
329
|
-
*
|
|
330
|
-
* @param request - The request {@link CreateExternalNodeRequest}
|
|
331
|
-
* @returns A Promise of ExternalNode
|
|
332
|
-
*/
|
|
333
|
-
createExternalNode = (request) => this.client.fetch({
|
|
334
|
-
body: "{}",
|
|
335
|
-
headers: jsonContentHeaders,
|
|
336
|
-
method: "POST",
|
|
337
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/external-nodes`
|
|
338
|
-
}, unmarshalExternalNode);
|
|
339
|
-
pageOfListNodes = (request) => this.client.fetch({
|
|
340
|
-
method: "GET",
|
|
341
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/nodes`,
|
|
342
|
-
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])
|
|
343
|
-
}, unmarshalListNodesResponse);
|
|
344
|
-
/**
|
|
345
|
-
* List Nodes in a Cluster. List all the existing nodes for a specific Kubernetes cluster.
|
|
346
|
-
*
|
|
347
|
-
* @param request - The request {@link ListNodesRequest}
|
|
348
|
-
* @returns A Promise of ListNodesResponse
|
|
349
|
-
*/
|
|
350
|
-
listNodes = (request) => enrichForPagination("nodes", this.pageOfListNodes, request);
|
|
351
|
-
/**
|
|
352
|
-
* Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.
|
|
353
|
-
*
|
|
354
|
-
* @param request - The request {@link GetNodeRequest}
|
|
355
|
-
* @returns A Promise of Node
|
|
356
|
-
*/
|
|
357
|
-
getNode = (request) => this.client.fetch({
|
|
358
|
-
method: "GET",
|
|
359
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}`
|
|
360
|
-
}, unmarshalNode);
|
|
361
|
-
/**
|
|
362
|
-
* Waits for {@link Node} to be in a final state.
|
|
363
|
-
*
|
|
364
|
-
* @param request - The request {@link GetNodeRequest}
|
|
365
|
-
* @param options - The waiting options
|
|
366
|
-
* @returns A Promise of Node
|
|
367
|
-
*/
|
|
368
|
-
waitForNode = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options);
|
|
369
|
-
/**
|
|
370
|
-
* 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.
|
|
371
|
-
*
|
|
372
|
-
* @deprecated
|
|
373
|
-
* @param request - The request {@link ReplaceNodeRequest}
|
|
374
|
-
* @returns A Promise of Node
|
|
375
|
-
*/
|
|
376
|
-
replaceNode = (request) => this.client.fetch({
|
|
377
|
-
body: "{}",
|
|
378
|
-
headers: jsonContentHeaders,
|
|
379
|
-
method: "POST",
|
|
380
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}/replace`
|
|
381
|
-
}, unmarshalNode);
|
|
382
|
-
/**
|
|
383
|
-
* 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.
|
|
384
|
-
*
|
|
385
|
-
* @param request - The request {@link RebootNodeRequest}
|
|
386
|
-
* @returns A Promise of Node
|
|
387
|
-
*/
|
|
388
|
-
rebootNode = (request) => this.client.fetch({
|
|
389
|
-
body: "{}",
|
|
390
|
-
headers: jsonContentHeaders,
|
|
391
|
-
method: "POST",
|
|
392
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}/reboot`
|
|
393
|
-
}, unmarshalNode);
|
|
394
|
-
/**
|
|
395
|
-
* 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.
|
|
396
|
-
*
|
|
397
|
-
* @param request - The request {@link DeleteNodeRequest}
|
|
398
|
-
* @returns A Promise of Node
|
|
399
|
-
*/
|
|
400
|
-
deleteNode = (request) => this.client.fetch({
|
|
401
|
-
method: "DELETE",
|
|
402
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}`,
|
|
403
|
-
urlParams: urlParams(["replace", request.replace], ["skip_drain", request.skipDrain])
|
|
404
|
-
}, unmarshalNode);
|
|
405
|
-
/**
|
|
406
|
-
* List all available Versions. List all available versions for the creation of a new Kubernetes cluster.
|
|
407
|
-
*
|
|
408
|
-
* @param request - The request {@link ListVersionsRequest}
|
|
409
|
-
* @returns A Promise of ListVersionsResponse
|
|
410
|
-
*/
|
|
411
|
-
listVersions = (request = {}) => this.client.fetch({
|
|
412
|
-
method: "GET",
|
|
413
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`
|
|
414
|
-
}, unmarshalListVersionsResponse);
|
|
415
|
-
/**
|
|
416
|
-
* Get a Version. Retrieve a specific Kubernetes version and its details.
|
|
417
|
-
*
|
|
418
|
-
* @param request - The request {@link GetVersionRequest}
|
|
419
|
-
* @returns A Promise of Version
|
|
420
|
-
*/
|
|
421
|
-
getVersion = (request) => this.client.fetch({
|
|
422
|
-
method: "GET",
|
|
423
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam("versionName", request.versionName)}`
|
|
424
|
-
}, unmarshalVersion);
|
|
425
|
-
pageOfListClusterTypes = (request = {}) => this.client.fetch({
|
|
426
|
-
method: "GET",
|
|
427
|
-
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-types`,
|
|
428
|
-
urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
429
|
-
}, unmarshalListClusterTypesResponse);
|
|
430
|
-
/**
|
|
431
|
-
* List cluster types. List available cluster types and their technical details.
|
|
432
|
-
*
|
|
433
|
-
* @param request - The request {@link ListClusterTypesRequest}
|
|
434
|
-
* @returns A Promise of ListClusterTypesResponse
|
|
435
|
-
*/
|
|
436
|
-
listClusterTypes = (request = {}) => enrichForPagination("clusterTypes", this.pageOfListClusterTypes, request);
|
|
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])
|
|
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.createExternalNode = (request) => this.client.fetch({
|
|
158
|
+
body: "{}",
|
|
159
|
+
headers: jsonContentHeaders,
|
|
160
|
+
method: "POST",
|
|
161
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam("poolId", request.poolId)}/external-nodes`
|
|
162
|
+
}, unmarshalExternalNode);
|
|
163
|
+
this.pageOfListNodes = (request) => this.client.fetch({
|
|
164
|
+
method: "GET",
|
|
165
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/nodes`,
|
|
166
|
+
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])
|
|
167
|
+
}, unmarshalListNodesResponse);
|
|
168
|
+
this.listNodes = (request) => enrichForPagination("nodes", this.pageOfListNodes, request);
|
|
169
|
+
this.getNode = (request) => this.client.fetch({
|
|
170
|
+
method: "GET",
|
|
171
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}`
|
|
172
|
+
}, unmarshalNode);
|
|
173
|
+
this.waitForNode = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options);
|
|
174
|
+
this.replaceNode = (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)}/replace`
|
|
179
|
+
}, unmarshalNode);
|
|
180
|
+
this.rebootNode = (request) => this.client.fetch({
|
|
181
|
+
body: "{}",
|
|
182
|
+
headers: jsonContentHeaders,
|
|
183
|
+
method: "POST",
|
|
184
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}/reboot`
|
|
185
|
+
}, unmarshalNode);
|
|
186
|
+
this.deleteNode = (request) => this.client.fetch({
|
|
187
|
+
method: "DELETE",
|
|
188
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam("nodeId", request.nodeId)}`,
|
|
189
|
+
urlParams: urlParams(["replace", request.replace], ["skip_drain", request.skipDrain])
|
|
190
|
+
}, unmarshalNode);
|
|
191
|
+
this.listVersions = (request = {}) => this.client.fetch({
|
|
192
|
+
method: "GET",
|
|
193
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`
|
|
194
|
+
}, unmarshalListVersionsResponse);
|
|
195
|
+
this.getVersion = (request) => this.client.fetch({
|
|
196
|
+
method: "GET",
|
|
197
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam("versionName", request.versionName)}`
|
|
198
|
+
}, unmarshalVersion);
|
|
199
|
+
this.pageOfListClusterTypes = (request = {}) => this.client.fetch({
|
|
200
|
+
method: "GET",
|
|
201
|
+
path: `/k8s/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-types`,
|
|
202
|
+
urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
203
|
+
}, unmarshalListClusterTypesResponse);
|
|
204
|
+
this.listClusterTypes = (request = {}) => enrichForPagination("clusterTypes", this.pageOfListClusterTypes, request);
|
|
205
|
+
}
|
|
206
|
+
static {
|
|
207
|
+
this.LOCALITY = toApiLocality({ regions: [
|
|
208
|
+
"fr-par",
|
|
209
|
+
"nl-ams",
|
|
210
|
+
"pl-waw"
|
|
211
|
+
] });
|
|
212
|
+
}
|
|
437
213
|
};
|
|
438
214
|
//#endregion
|
|
439
215
|
export { API };
|