@scaleway/sdk 1.14.0 → 1.15.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.
Files changed (49) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
  3. package/dist/api/baremetal/v1/api.gen.js +434 -378
  4. package/dist/api/baremetal/v1/api.utils.js +19 -22
  5. package/dist/api/billing/v2alpha1/api.gen.js +21 -17
  6. package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
  7. package/dist/api/container/v1beta1/api.gen.js +384 -337
  8. package/dist/api/domain/v2beta1/api.gen.js +754 -668
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
  10. package/dist/api/function/v1beta1/api.gen.js +467 -407
  11. package/dist/api/iam/v1alpha1/api.gen.js +641 -557
  12. package/dist/api/instance/v1/api.gen.js +802 -677
  13. package/dist/api/instance/v1/api.utils.js +337 -325
  14. package/dist/api/instance/v1/marshalling.gen.js +2 -1
  15. package/dist/api/iot/v1/api.gen.js +508 -452
  16. package/dist/api/ipfs/index.js +2 -0
  17. package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
  18. package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
  19. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  20. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
  21. package/dist/api/k8s/v1/api.gen.js +403 -342
  22. package/dist/api/k8s/v1/api.utils.js +7 -10
  23. package/dist/api/k8s/v1/marshalling.gen.js +19 -1
  24. package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
  25. package/dist/api/lb/v1/api.gen.js +1501 -1363
  26. package/dist/api/lb/v1/api.utils.js +71 -75
  27. package/dist/api/lb/v1/marshalling.gen.js +6 -0
  28. package/dist/api/marketplace/v1/api.gen.js +35 -32
  29. package/dist/api/marketplace/v2/api.gen.js +117 -102
  30. package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
  31. package/dist/api/rdb/v1/api.gen.js +897 -819
  32. package/dist/api/redis/v1/api.gen.js +358 -333
  33. package/dist/api/registry/v1/api.gen.js +211 -189
  34. package/dist/api/secret/v1alpha1/api.gen.js +265 -245
  35. package/dist/api/tem/v1alpha1/api.gen.js +182 -147
  36. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  37. package/dist/api/test/v1/api.gen.js +116 -104
  38. package/dist/api/vpc/v1/api.gen.js +74 -65
  39. package/dist/api/vpc/v2/api.gen.js +200 -178
  40. package/dist/api/vpc/v2/marshalling.gen.js +1 -0
  41. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  42. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  43. package/dist/index.cjs +732 -311
  44. package/dist/index.d.ts +2040 -1540
  45. package/dist/index.js +28 -26
  46. package/dist/internal/logger/console-logger.js +4 -5
  47. package/dist/scw/constants.js +1 -1
  48. package/dist/scw/errors/scw-error.js +2 -2
  49. package/package.json +2 -2
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { CLUSTER_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListClustersResponse, marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, marshalUpgradeClusterRequest, marshalSetClusterTypeRequest, unmarshalListClusterAvailableVersionsResponse, marshalMigrateToPrivateNetworkClusterRequest, unmarshalListPoolsResponse, marshalCreatePoolRequest, unmarshalPool, marshalUpgradePoolRequest, marshalUpdatePoolRequest, unmarshalExternalNode, unmarshalListNodesResponse, unmarshalNode, unmarshalListVersionsResponse, unmarshalVersion } from './marshalling.gen.js';
6
+ import { unmarshalListClustersResponse, marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, marshalUpgradeClusterRequest, marshalSetClusterTypeRequest, unmarshalListClusterAvailableVersionsResponse, marshalMigrateToPrivateNetworkClusterRequest, unmarshalListPoolsResponse, marshalCreatePoolRequest, unmarshalPool, marshalUpgradePoolRequest, marshalUpdatePoolRequest, unmarshalExternalNode, unmarshalListNodesResponse, unmarshalNode, unmarshalListVersionsResponse, unmarshalVersion, unmarshalListClusterTypesResponse } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -13,11 +13,11 @@ const jsonContentHeaders = {
13
13
 
14
14
  /** Kubernetes API. */
15
15
  class API extends API$1 {
16
- constructor() {
17
- var _this;
18
- super(...arguments);
19
- _this = this;
20
- this.pageOfListClusters = function (request) {
16
+ /** Lists the available regions of the API. */
17
+ static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
18
+ pageOfListClusters = (() => {
19
+ var _this = this;
20
+ return function (request) {
21
21
  if (request === void 0) {
22
22
  request = {};
23
23
  }
@@ -27,352 +27,413 @@ class API extends API$1 {
27
27
  urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['type', request.type])
28
28
  }, unmarshalListClustersResponse);
29
29
  };
30
- /**
31
- * List Clusters. List all existing Kubernetes clusters in a specific region.
32
- *
33
- * @param request - The request {@link ListClustersRequest}
34
- * @returns A Promise of ListClustersResponse
35
- */
36
- this.listClusters = function (request) {
30
+ })();
31
+
32
+ /**
33
+ * List Clusters. List all existing Kubernetes clusters in a specific region.
34
+ *
35
+ * @param request - The request {@link ListClustersRequest}
36
+ * @returns A Promise of ListClustersResponse
37
+ */
38
+ listClusters = (() => {
39
+ var _this2 = this;
40
+ return function (request) {
37
41
  if (request === void 0) {
38
42
  request = {};
39
43
  }
40
- return enrichForPagination('clusters', _this.pageOfListClusters, request);
44
+ return enrichForPagination('clusters', _this2.pageOfListClusters, request);
41
45
  };
42
- /**
43
- * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.
44
- *
45
- * @param request - The request {@link CreateClusterRequest}
46
- * @returns A Promise of Cluster
47
- */
48
- this.createCluster = request => this.client.fetch({
49
- body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)),
50
- headers: jsonContentHeaders,
51
- method: 'POST',
52
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters`
53
- }, unmarshalCluster);
54
- /**
55
- * Get a Cluster. Retrieve information about a specific Kubernetes cluster.
56
- *
57
- * @param request - The request {@link GetClusterRequest}
58
- * @returns A Promise of Cluster
59
- */
60
- this.getCluster = request => this.client.fetch({
61
- method: 'GET',
62
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
63
- }, unmarshalCluster);
64
- /**
65
- * Waits for {@link Cluster} to be in a final state.
66
- *
67
- * @param request - The request {@link GetClusterRequest}
68
- * @param options - The waiting options
69
- * @returns A Promise of Cluster
70
- */
71
- this.waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);
72
- /**
73
- * Update a Cluster. Update information on a specific Kubernetes cluster. You
74
- * can update details such as its name, description, tags and configuration.
75
- * To upgrade a cluster, you will need to use the dedicated endpoint.
76
- *
77
- * @param request - The request {@link UpdateClusterRequest}
78
- * @returns A Promise of Cluster
79
- */
80
- this.updateCluster = request => this.client.fetch({
81
- body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)),
82
- headers: jsonContentHeaders,
83
- method: 'PATCH',
84
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
85
- }, unmarshalCluster);
86
- /**
87
- * Delete a Cluster. Delete a specific Kubernetes cluster and all its
88
- * associated pools and nodes. Note that this method will not delete any Load
89
- * Balancer or Block Volume that are associated with the cluster.
90
- *
91
- * @param request - The request {@link DeleteClusterRequest}
92
- * @returns A Promise of Cluster
93
- */
94
- this.deleteCluster = request => this.client.fetch({
95
- method: 'DELETE',
96
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`,
97
- urlParams: urlParams(['with_additional_resources', request.withAdditionalResources])
98
- }, unmarshalCluster);
99
- /**
100
- * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its
101
- * associated pools to a specific and supported Kubernetes version.
102
- *
103
- * @param request - The request {@link UpgradeClusterRequest}
104
- * @returns A Promise of Cluster
105
- */
106
- this.upgradeCluster = request => this.client.fetch({
107
- body: JSON.stringify(marshalUpgradeClusterRequest(request, this.client.settings)),
108
- headers: jsonContentHeaders,
109
- method: 'POST',
110
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/upgrade`
111
- }, unmarshalCluster);
112
- /**
113
- * Change the Cluster type. Change the type of a specific Kubernetes cluster.
114
- *
115
- * @param request - The request {@link SetClusterTypeRequest}
116
- * @returns A Promise of Cluster
117
- */
118
- this.setClusterType = request => this.client.fetch({
119
- body: JSON.stringify(marshalSetClusterTypeRequest(request, this.client.settings)),
120
- headers: jsonContentHeaders,
121
- method: 'POST',
122
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/set-type`
123
- }, unmarshalCluster);
124
- /**
125
- * List available versions for a Cluster. List the versions that a specific
126
- * Kubernetes cluster is allowed to upgrade to. Results will include every
127
- * patch version greater than the current patch, as well as one minor version
128
- * ahead of the current version. Any upgrade skipping a minor version will not
129
- * work.
130
- *
131
- * @param request - The request {@link ListClusterAvailableVersionsRequest}
132
- * @returns A Promise of ListClusterAvailableVersionsResponse
133
- */
134
- this.listClusterAvailableVersions = request => this.client.fetch({
135
- method: 'GET',
136
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/available-versions`
137
- }, unmarshalListClusterAvailableVersionsResponse);
138
- this._getClusterKubeConfig = request => this.client.fetch({
139
- method: 'GET',
140
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`,
141
- urlParams: urlParams(['dl', 1]),
142
- responseType: 'blob'
143
- });
144
- /**
145
- * Reset the admin token of a Cluster. Reset the admin token for a specific
146
- * Kubernetes cluster. This will revoke the old admin token (which will not be
147
- * usable afterwards) and create a new one. Note that you will need to
148
- * download kubeconfig again to keep interacting with the cluster.
149
- *
150
- * @param request - The request {@link ResetClusterAdminTokenRequest}
151
- */
152
- this.resetClusterAdminToken = request => this.client.fetch({
153
- body: '{}',
154
- headers: jsonContentHeaders,
155
- method: 'POST',
156
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/reset-admin-token`
157
- });
158
- /**
159
- * Migrate an existing cluster to a Private Network cluster. Migrate a cluster
160
- * that was created before the release of Private Network clusters to a new
161
- * one with a Private Network.
162
- *
163
- * @param request - The request {@link MigrateToPrivateNetworkClusterRequest}
164
- * @returns A Promise of Cluster
165
- */
166
- this.migrateToPrivateNetworkCluster = request => this.client.fetch({
167
- body: JSON.stringify(marshalMigrateToPrivateNetworkClusterRequest(request, this.client.settings)),
168
- headers: jsonContentHeaders,
169
- method: 'POST',
170
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-private-network`
171
- }, unmarshalCluster);
172
- this.pageOfListPools = request => this.client.fetch({
173
- method: 'GET',
174
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`,
175
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown'])
176
- }, unmarshalListPoolsResponse);
177
- /**
178
- * List Pools in a Cluster. List all the existing pools for a specific
179
- * Kubernetes cluster.
180
- *
181
- * @param request - The request {@link ListPoolsRequest}
182
- * @returns A Promise of ListPoolsResponse
183
- */
184
- this.listPools = request => enrichForPagination('pools', this.pageOfListPools, request);
185
- /**
186
- * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes
187
- * cluster.
188
- *
189
- * @param request - The request {@link CreatePoolRequest}
190
- * @returns A Promise of Pool
191
- */
192
- this.createPool = request => this.client.fetch({
193
- body: JSON.stringify(marshalCreatePoolRequest(request, this.client.settings)),
194
- headers: jsonContentHeaders,
195
- method: 'POST',
196
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`
197
- }, unmarshalPool);
198
- /**
199
- * Get a Pool in a Cluster. Retrieve details about a specific pool in a
200
- * Kubernetes cluster.
201
- *
202
- * @param request - The request {@link GetPoolRequest}
203
- * @returns A Promise of Pool
204
- */
205
- this.getPool = request => this.client.fetch({
206
- method: 'GET',
207
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`
208
- }, unmarshalPool);
209
- /**
210
- * Waits for {@link Pool} to be in a final state.
211
- *
212
- * @param request - The request {@link GetPoolRequest}
213
- * @param options - The waiting options
214
- * @returns A Promise of Pool
215
- */
216
- this.waitForPool = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!POOL_TRANSIENT_STATUSES.includes(res.status))), this.getPool, request, options);
217
- /**
218
- * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific
219
- * pool. Note that it only works if the targeted version matches the cluster's
220
- * version.
221
- *
222
- * @param request - The request {@link UpgradePoolRequest}
223
- * @returns A Promise of Pool
224
- */
225
- this.upgradePool = request => this.client.fetch({
226
- body: JSON.stringify(marshalUpgradePoolRequest(request, this.client.settings)),
227
- headers: jsonContentHeaders,
228
- method: 'POST',
229
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/upgrade`
230
- }, unmarshalPool);
231
- /**
232
- * Update a Pool in a Cluster. Update the attributes of a specific pool, such
233
- * as its desired size, autoscaling settings, and tags.
234
- *
235
- * @param request - The request {@link UpdatePoolRequest}
236
- * @returns A Promise of Pool
237
- */
238
- this.updatePool = request => this.client.fetch({
239
- body: JSON.stringify(marshalUpdatePoolRequest(request, this.client.settings)),
240
- headers: jsonContentHeaders,
241
- method: 'PATCH',
242
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`
243
- }, unmarshalPool);
244
- /**
245
- * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note
246
- * that all the pool's nodes will also be deleted.
247
- *
248
- * @param request - The request {@link DeletePoolRequest}
249
- * @returns A Promise of Pool
250
- */
251
- this.deletePool = request => this.client.fetch({
252
- method: 'DELETE',
253
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`
254
- }, unmarshalPool);
255
- /**
256
- * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is
257
- * not intended to be called by end users but rather programmatically by the
258
- * kapsule-node-agent.
259
- *
260
- * @param request - The request {@link CreateExternalNodeRequest}
261
- * @returns A Promise of ExternalNode
262
- */
263
- this.createExternalNode = request => this.client.fetch({
264
- body: '{}',
265
- headers: jsonContentHeaders,
266
- method: 'POST',
267
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/external-nodes`
268
- }, unmarshalExternalNode);
269
- this.pageOfListNodes = request => this.client.fetch({
270
- method: 'GET',
271
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/nodes`,
272
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['pool_id', request.poolId], ['status', request.status ?? 'unknown'])
273
- }, unmarshalListNodesResponse);
274
- /**
275
- * List Nodes in a Cluster. List all the existing nodes for a specific
276
- * Kubernetes cluster.
277
- *
278
- * @param request - The request {@link ListNodesRequest}
279
- * @returns A Promise of ListNodesResponse
280
- */
281
- this.listNodes = request => enrichForPagination('nodes', this.pageOfListNodes, request);
282
- /**
283
- * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.
284
- *
285
- * @param request - The request {@link GetNodeRequest}
286
- * @returns A Promise of Node
287
- */
288
- this.getNode = request => this.client.fetch({
289
- method: 'GET',
290
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`
291
- }, unmarshalNode);
292
- /**
293
- * Waits for {@link Node} to be in a final state.
294
- *
295
- * @param request - The request {@link GetNodeRequest}
296
- * @param options - The waiting options
297
- * @returns A Promise of Node
298
- */
299
- this.waitForNode = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options);
300
- /**
301
- * Replace a Node in a Cluster. Replace a specific Node. The node will first
302
- * be cordoned (scheduling will be disabled on it). The existing pods on the
303
- * node will then be drained and rescheduled onto another schedulable node.
304
- * Note that when there is not enough space to reschedule all the pods (such
305
- * as in a one-node cluster), disruption of your applications can be
306
- * expected.
307
- *
308
- * @deprecated
309
- * @param request - The request {@link ReplaceNodeRequest}
310
- * @returns A Promise of Node
311
- */
312
- this.replaceNode = request => this.client.fetch({
313
- body: '{}',
314
- headers: jsonContentHeaders,
315
- method: 'POST',
316
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/replace`
317
- }, unmarshalNode);
318
- /**
319
- * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be
320
- * cordoned (scheduling will be disabled on it). The existing pods on the node
321
- * will then be drained and rescheduled onto another schedulable node. Note
322
- * that when there is not enough space to reschedule all the pods (such as in
323
- * a one-node cluster), disruption of your applications can be expected.
324
- *
325
- * @param request - The request {@link RebootNodeRequest}
326
- * @returns A Promise of Node
327
- */
328
- this.rebootNode = request => this.client.fetch({
329
- body: '{}',
330
- headers: jsonContentHeaders,
331
- method: 'POST',
332
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/reboot`
333
- }, unmarshalNode);
334
- /**
335
- * Delete a Node in a Cluster. Delete a specific Node. Note that when there is
336
- * not enough space to reschedule all the pods (such as in a one-node
337
- * cluster), disruption of your applications can be expected.
338
- *
339
- * @param request - The request {@link DeleteNodeRequest}
340
- * @returns A Promise of Node
341
- */
342
- this.deleteNode = request => this.client.fetch({
343
- method: 'DELETE',
344
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`,
345
- urlParams: urlParams(['replace', request.replace], ['skip_drain', request.skipDrain])
346
- }, unmarshalNode);
347
- /**
348
- * List all available Versions. List all available versions for the creation
349
- * of a new Kubernetes cluster.
350
- *
351
- * @param request - The request {@link ListVersionsRequest}
352
- * @returns A Promise of ListVersionsResponse
353
- */
354
- this.listVersions = function (request) {
46
+ })();
47
+
48
+ /**
49
+ * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.
50
+ *
51
+ * @param request - The request {@link CreateClusterRequest}
52
+ * @returns A Promise of Cluster
53
+ */
54
+ createCluster = request => this.client.fetch({
55
+ body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)),
56
+ headers: jsonContentHeaders,
57
+ method: 'POST',
58
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters`
59
+ }, 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
+ method: 'GET',
69
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
70
+ }, unmarshalCluster);
71
+
72
+ /**
73
+ * Waits for {@link Cluster} to be in a final state.
74
+ *
75
+ * @param request - The request {@link GetClusterRequest}
76
+ * @param options - The waiting options
77
+ * @returns A Promise of Cluster
78
+ */
79
+ waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);
80
+
81
+ /**
82
+ * Update a Cluster. Update information on a specific Kubernetes cluster. You
83
+ * can update details such as its name, description, tags and configuration.
84
+ * To upgrade a cluster, you will need to use the dedicated endpoint.
85
+ *
86
+ * @param request - The request {@link UpdateClusterRequest}
87
+ * @returns A Promise of Cluster
88
+ */
89
+ updateCluster = request => this.client.fetch({
90
+ body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)),
91
+ headers: jsonContentHeaders,
92
+ method: 'PATCH',
93
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
94
+ }, unmarshalCluster);
95
+
96
+ /**
97
+ * Delete a Cluster. Delete a specific Kubernetes cluster and all its
98
+ * associated pools and nodes. Note that this method will not delete any Load
99
+ * Balancer or Block Volume that are associated with the cluster.
100
+ *
101
+ * @param request - The request {@link DeleteClusterRequest}
102
+ * @returns A Promise of Cluster
103
+ */
104
+ deleteCluster = request => this.client.fetch({
105
+ method: 'DELETE',
106
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`,
107
+ urlParams: urlParams(['with_additional_resources', request.withAdditionalResources])
108
+ }, unmarshalCluster);
109
+
110
+ /**
111
+ * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its
112
+ * associated pools to a specific and supported Kubernetes version.
113
+ *
114
+ * @param request - The request {@link UpgradeClusterRequest}
115
+ * @returns A Promise of Cluster
116
+ */
117
+ upgradeCluster = request => this.client.fetch({
118
+ body: JSON.stringify(marshalUpgradeClusterRequest(request, this.client.settings)),
119
+ headers: jsonContentHeaders,
120
+ method: 'POST',
121
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/upgrade`
122
+ }, unmarshalCluster);
123
+
124
+ /**
125
+ * Change the Cluster type. Change the type of a specific Kubernetes cluster.
126
+ *
127
+ * @param request - The request {@link SetClusterTypeRequest}
128
+ * @returns A Promise of Cluster
129
+ */
130
+ setClusterType = request => this.client.fetch({
131
+ body: JSON.stringify(marshalSetClusterTypeRequest(request, this.client.settings)),
132
+ headers: jsonContentHeaders,
133
+ method: 'POST',
134
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/set-type`
135
+ }, unmarshalCluster);
136
+
137
+ /**
138
+ * List available versions for a Cluster. List the versions that a specific
139
+ * Kubernetes cluster is allowed to upgrade to. Results will include every
140
+ * patch version greater than the current patch, as well as one minor version
141
+ * ahead of the current version. Any upgrade skipping a minor version will not
142
+ * work.
143
+ *
144
+ * @param request - The request {@link ListClusterAvailableVersionsRequest}
145
+ * @returns A Promise of ListClusterAvailableVersionsResponse
146
+ */
147
+ listClusterAvailableVersions = request => this.client.fetch({
148
+ method: 'GET',
149
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/available-versions`
150
+ }, unmarshalListClusterAvailableVersionsResponse);
151
+ _getClusterKubeConfig = request => this.client.fetch({
152
+ method: 'GET',
153
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`,
154
+ urlParams: urlParams(['dl', 1]),
155
+ responseType: 'blob'
156
+ });
157
+
158
+ /**
159
+ * Reset the admin token of a Cluster. Reset the admin token for a specific
160
+ * Kubernetes cluster. This will revoke the old admin token (which will not be
161
+ * usable afterwards) and create a new one. Note that you will need to
162
+ * download kubeconfig again to keep interacting with the cluster.
163
+ *
164
+ * @param request - The request {@link ResetClusterAdminTokenRequest}
165
+ */
166
+ resetClusterAdminToken = request => this.client.fetch({
167
+ body: '{}',
168
+ headers: jsonContentHeaders,
169
+ method: 'POST',
170
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/reset-admin-token`
171
+ });
172
+
173
+ /**
174
+ * Migrate an existing cluster to a Private Network cluster. Migrate a cluster
175
+ * that was created before the release of Private Network clusters to a new
176
+ * one with a Private Network.
177
+ *
178
+ * @param request - The request {@link MigrateToPrivateNetworkClusterRequest}
179
+ * @returns A Promise of Cluster
180
+ */
181
+ migrateToPrivateNetworkCluster = request => this.client.fetch({
182
+ body: JSON.stringify(marshalMigrateToPrivateNetworkClusterRequest(request, this.client.settings)),
183
+ headers: jsonContentHeaders,
184
+ method: 'POST',
185
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-private-network`
186
+ }, unmarshalCluster);
187
+ pageOfListPools = request => this.client.fetch({
188
+ method: 'GET',
189
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`,
190
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown'])
191
+ }, unmarshalListPoolsResponse);
192
+
193
+ /**
194
+ * List Pools in a Cluster. List all the existing pools for a specific
195
+ * Kubernetes cluster.
196
+ *
197
+ * @param request - The request {@link ListPoolsRequest}
198
+ * @returns A Promise of ListPoolsResponse
199
+ */
200
+ listPools = request => enrichForPagination('pools', this.pageOfListPools, request);
201
+
202
+ /**
203
+ * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes
204
+ * cluster.
205
+ *
206
+ * @param request - The request {@link CreatePoolRequest}
207
+ * @returns A Promise of Pool
208
+ */
209
+ createPool = request => this.client.fetch({
210
+ body: JSON.stringify(marshalCreatePoolRequest(request, this.client.settings)),
211
+ headers: jsonContentHeaders,
212
+ method: 'POST',
213
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`
214
+ }, unmarshalPool);
215
+
216
+ /**
217
+ * Get a Pool in a Cluster. Retrieve details about a specific pool in a
218
+ * Kubernetes cluster.
219
+ *
220
+ * @param request - The request {@link GetPoolRequest}
221
+ * @returns A Promise of Pool
222
+ */
223
+ getPool = request => this.client.fetch({
224
+ method: 'GET',
225
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`
226
+ }, unmarshalPool);
227
+
228
+ /**
229
+ * Waits for {@link Pool} to be in a final state.
230
+ *
231
+ * @param request - The request {@link GetPoolRequest}
232
+ * @param options - The waiting options
233
+ * @returns A Promise of Pool
234
+ */
235
+ waitForPool = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!POOL_TRANSIENT_STATUSES.includes(res.status))), this.getPool, request, options);
236
+
237
+ /**
238
+ * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific
239
+ * pool. Note that it only works if the targeted version matches the cluster's
240
+ * version.
241
+ *
242
+ * @param request - The request {@link UpgradePoolRequest}
243
+ * @returns A Promise of Pool
244
+ */
245
+ upgradePool = request => this.client.fetch({
246
+ body: JSON.stringify(marshalUpgradePoolRequest(request, this.client.settings)),
247
+ headers: jsonContentHeaders,
248
+ method: 'POST',
249
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/upgrade`
250
+ }, unmarshalPool);
251
+
252
+ /**
253
+ * Update a Pool in a Cluster. Update the attributes of a specific pool, such
254
+ * as its desired size, autoscaling settings, and tags.
255
+ *
256
+ * @param request - The request {@link UpdatePoolRequest}
257
+ * @returns A Promise of Pool
258
+ */
259
+ updatePool = request => this.client.fetch({
260
+ body: JSON.stringify(marshalUpdatePoolRequest(request, this.client.settings)),
261
+ headers: jsonContentHeaders,
262
+ method: 'PATCH',
263
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`
264
+ }, unmarshalPool);
265
+
266
+ /**
267
+ * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note
268
+ * that all the pool's nodes will also be deleted.
269
+ *
270
+ * @param request - The request {@link DeletePoolRequest}
271
+ * @returns A Promise of Pool
272
+ */
273
+ deletePool = request => this.client.fetch({
274
+ method: 'DELETE',
275
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`
276
+ }, unmarshalPool);
277
+
278
+ /**
279
+ * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is
280
+ * not intended to be called by end users but rather programmatically by the
281
+ * kapsule-node-agent.
282
+ *
283
+ * @param request - The request {@link CreateExternalNodeRequest}
284
+ * @returns A Promise of ExternalNode
285
+ */
286
+ createExternalNode = request => this.client.fetch({
287
+ body: '{}',
288
+ headers: jsonContentHeaders,
289
+ method: 'POST',
290
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/external-nodes`
291
+ }, unmarshalExternalNode);
292
+ pageOfListNodes = request => this.client.fetch({
293
+ method: 'GET',
294
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/nodes`,
295
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['pool_id', request.poolId], ['status', request.status ?? 'unknown'])
296
+ }, unmarshalListNodesResponse);
297
+
298
+ /**
299
+ * List Nodes in a Cluster. List all the existing nodes for a specific
300
+ * Kubernetes cluster.
301
+ *
302
+ * @param request - The request {@link ListNodesRequest}
303
+ * @returns A Promise of ListNodesResponse
304
+ */
305
+ listNodes = request => enrichForPagination('nodes', this.pageOfListNodes, request);
306
+
307
+ /**
308
+ * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.
309
+ *
310
+ * @param request - The request {@link GetNodeRequest}
311
+ * @returns A Promise of Node
312
+ */
313
+ getNode = request => this.client.fetch({
314
+ method: 'GET',
315
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`
316
+ }, unmarshalNode);
317
+
318
+ /**
319
+ * Waits for {@link Node} to be in a final state.
320
+ *
321
+ * @param request - The request {@link GetNodeRequest}
322
+ * @param options - The waiting options
323
+ * @returns A Promise of Node
324
+ */
325
+ waitForNode = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options);
326
+
327
+ /**
328
+ * Replace a Node in a Cluster. Replace a specific Node. The node will first
329
+ * be cordoned (scheduling will be disabled on it). The existing pods on the
330
+ * node will then be drained and rescheduled onto another schedulable node.
331
+ * Note that when there is not enough space to reschedule all the pods (such
332
+ * as in a one-node cluster), disruption of your applications can be
333
+ * expected.
334
+ *
335
+ * @deprecated
336
+ * @param request - The request {@link ReplaceNodeRequest}
337
+ * @returns A Promise of Node
338
+ */
339
+ replaceNode = request => this.client.fetch({
340
+ body: '{}',
341
+ headers: jsonContentHeaders,
342
+ method: 'POST',
343
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/replace`
344
+ }, unmarshalNode);
345
+
346
+ /**
347
+ * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be
348
+ * cordoned (scheduling will be disabled on it). The existing pods on the node
349
+ * will then be drained and rescheduled onto another schedulable node. Note
350
+ * that when there is not enough space to reschedule all the pods (such as in
351
+ * a one-node cluster), disruption of your applications can be expected.
352
+ *
353
+ * @param request - The request {@link RebootNodeRequest}
354
+ * @returns A Promise of Node
355
+ */
356
+ rebootNode = request => this.client.fetch({
357
+ body: '{}',
358
+ headers: jsonContentHeaders,
359
+ method: 'POST',
360
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/reboot`
361
+ }, unmarshalNode);
362
+
363
+ /**
364
+ * Delete a Node in a Cluster. Delete a specific Node. Note that when there is
365
+ * not enough space to reschedule all the pods (such as in a one-node
366
+ * cluster), disruption of your applications can be expected.
367
+ *
368
+ * @param request - The request {@link DeleteNodeRequest}
369
+ * @returns A Promise of Node
370
+ */
371
+ deleteNode = request => this.client.fetch({
372
+ method: 'DELETE',
373
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`,
374
+ urlParams: urlParams(['replace', request.replace], ['skip_drain', request.skipDrain])
375
+ }, unmarshalNode);
376
+
377
+ /**
378
+ * List all available Versions. List all available versions for the creation
379
+ * of a new Kubernetes cluster.
380
+ *
381
+ * @param request - The request {@link ListVersionsRequest}
382
+ * @returns A Promise of ListVersionsResponse
383
+ */
384
+ listVersions = (() => {
385
+ var _this3 = this;
386
+ return function (request) {
355
387
  if (request === void 0) {
356
388
  request = {};
357
389
  }
358
- return _this.client.fetch({
390
+ return _this3.client.fetch({
359
391
  method: 'GET',
360
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/versions`
392
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/versions`
361
393
  }, unmarshalListVersionsResponse);
362
394
  };
363
- /**
364
- * Get a Version. Retrieve a specific Kubernetes version and its details.
365
- *
366
- * @param request - The request {@link GetVersionRequest}
367
- * @returns A Promise of Version
368
- */
369
- this.getVersion = request => this.client.fetch({
370
- method: 'GET',
371
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam('versionName', request.versionName)}`
372
- }, unmarshalVersion);
373
- }
395
+ })();
396
+
397
+ /**
398
+ * Get a Version. Retrieve a specific Kubernetes version and its details.
399
+ *
400
+ * @param request - The request {@link GetVersionRequest}
401
+ * @returns A Promise of Version
402
+ */
403
+ getVersion = request => this.client.fetch({
404
+ method: 'GET',
405
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam('versionName', request.versionName)}`
406
+ }, unmarshalVersion);
407
+ pageOfListClusterTypes = (() => {
408
+ var _this4 = this;
409
+ return function (request) {
410
+ if (request === void 0) {
411
+ request = {};
412
+ }
413
+ return _this4.client.fetch({
414
+ method: 'GET',
415
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/cluster-types`,
416
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize])
417
+ }, unmarshalListClusterTypesResponse);
418
+ };
419
+ })();
420
+
421
+ /**
422
+ * List cluster types. List available cluster types and their technical
423
+ * details.
424
+ *
425
+ * @param request - The request {@link ListClusterTypesRequest}
426
+ * @returns A Promise of ListClusterTypesResponse
427
+ */
428
+ listClusterTypes = (() => {
429
+ var _this5 = this;
430
+ return function (request) {
431
+ if (request === void 0) {
432
+ request = {};
433
+ }
434
+ return enrichForPagination('clusterTypes', _this5.pageOfListClusterTypes, request);
435
+ };
436
+ })();
374
437
  }
375
- /** Lists the available regions of the API. */
376
- API.LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
377
438
 
378
439
  export { API };