@scaleway/sdk-k8s 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/dist/index.gen.cjs +4 -0
- package/dist/index.gen.d.ts +5 -0
- package/dist/index.gen.js +4 -0
- package/dist/v1/api.gen.cjs +569 -0
- package/dist/v1/api.gen.d.ts +274 -0
- package/dist/v1/api.gen.js +569 -0
- package/dist/v1/api.utils.cjs +13 -0
- package/dist/v1/api.utils.d.ts +11 -0
- package/dist/v1/api.utils.js +13 -0
- package/dist/v1/content.gen.cjs +23 -0
- package/dist/v1/content.gen.d.ts +7 -0
- package/dist/v1/content.gen.js +23 -0
- package/dist/v1/index.cjs +10 -0
- package/dist/v1/index.d.ts +4 -0
- package/dist/v1/index.gen.d.ts +5 -0
- package/dist/v1/index.js +10 -0
- package/dist/v1/marshalling.gen.cjs +619 -0
- package/dist/v1/marshalling.gen.d.ts +28 -0
- package/dist/v1/marshalling.gen.js +619 -0
- package/dist/v1/types.gen.d.ts +1499 -0
- package/dist/v1/validation-rules.gen.cjs +171 -0
- package/dist/v1/validation-rules.gen.d.ts +153 -0
- package/dist/v1/validation-rules.gen.js +171 -0
- package/package.json +51 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { API } from './api.gen';
|
|
2
|
+
export * from './content.gen';
|
|
3
|
+
export * from './marshalling.gen';
|
|
4
|
+
export type { ACLRule, ACLRuleRequest, AddClusterACLRulesRequest, AddClusterACLRulesResponse, AuthExternalNodeRequest, AutoscalerEstimator, AutoscalerExpander, CNI, Cluster, ClusterAutoUpgrade, ClusterAutoscalerConfig, ClusterOpenIDConnectConfig, ClusterStatus, ClusterType, ClusterTypeAvailability, ClusterTypeResiliency, CreateClusterRequest, CreateClusterRequestAutoUpgrade, CreateClusterRequestAutoscalerConfig, CreateClusterRequestOpenIDConnectConfig, CreateClusterRequestPoolConfig, CreateClusterRequestPoolConfigUpgradePolicy, CreateExternalNodeRequest, CreatePoolRequest, CreatePoolRequestUpgradePolicy, DeleteACLRuleRequest, DeleteClusterRequest, DeleteNodeRequest, DeletePoolRequest, ExternalNode, ExternalNodeAuth, ExternalNodeCoreV1Taint, GetClusterKubeConfigRequest, GetClusterRequest, GetNodeMetadataRequest, GetNodeRequest, GetPoolRequest, GetVersionRequest, ListClusterACLRulesRequest, ListClusterACLRulesResponse, ListClusterAvailableTypesRequest, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsRequest, ListClusterAvailableVersionsResponse, ListClusterTypesRequest, ListClusterTypesResponse, ListClustersRequest, ListClustersRequestOrderBy, ListClustersResponse, ListNodesRequest, ListNodesRequestOrderBy, ListNodesResponse, ListPoolsRequest, ListPoolsRequestOrderBy, ListPoolsResponse, ListVersionsRequest, ListVersionsResponse, MaintenanceWindow, MaintenanceWindowDayOfTheWeek, Node, NodeMetadata, NodeMetadataCoreV1Taint, NodeStatus, Pool, PoolStatus, PoolUpgradePolicy, PoolVolumeType, RebootNodeRequest, ReplaceNodeRequest, ResetClusterAdminTokenRequest, Runtime, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, UpdateClusterRequest, UpdateClusterRequestAutoUpgrade, UpdateClusterRequestAutoscalerConfig, UpdateClusterRequestOpenIDConnectConfig, UpdatePoolRequest, UpdatePoolRequestUpgradePolicy, UpgradeClusterRequest, UpgradePoolRequest, Version, } from './types.gen';
|
|
5
|
+
export * as ValidationRules from './validation-rules.gen';
|
package/dist/v1/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { K8SUtilsAPI } from "./api.utils.js";
|
|
2
|
+
import { CLUSTER_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
|
+
export {
|
|
5
|
+
K8SUtilsAPI as API,
|
|
6
|
+
CLUSTER_TRANSIENT_STATUSES,
|
|
7
|
+
NODE_TRANSIENT_STATUSES,
|
|
8
|
+
POOL_TRANSIENT_STATUSES,
|
|
9
|
+
validationRules_gen as ValidationRules
|
|
10
|
+
};
|
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const randomName = require("@scaleway/random-name");
|
|
4
|
+
const sdkClient = require("@scaleway/sdk-client");
|
|
5
|
+
const unmarshalPoolUpgradePolicy = (data) => {
|
|
6
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
maxSurge: data.max_surge,
|
|
13
|
+
maxUnavailable: data.max_unavailable
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalPool = (data) => {
|
|
17
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(
|
|
19
|
+
`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
autohealing: data.autohealing,
|
|
24
|
+
autoscaling: data.autoscaling,
|
|
25
|
+
clusterId: data.cluster_id,
|
|
26
|
+
containerRuntime: data.container_runtime,
|
|
27
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
28
|
+
id: data.id,
|
|
29
|
+
kubeletArgs: data.kubelet_args,
|
|
30
|
+
maxSize: data.max_size,
|
|
31
|
+
minSize: data.min_size,
|
|
32
|
+
name: data.name,
|
|
33
|
+
nodeType: data.node_type,
|
|
34
|
+
placementGroupId: data.placement_group_id,
|
|
35
|
+
publicIpDisabled: data.public_ip_disabled,
|
|
36
|
+
region: data.region,
|
|
37
|
+
rootVolumeSize: data.root_volume_size,
|
|
38
|
+
rootVolumeType: data.root_volume_type,
|
|
39
|
+
size: data.size,
|
|
40
|
+
status: data.status,
|
|
41
|
+
tags: data.tags,
|
|
42
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at),
|
|
43
|
+
upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : void 0,
|
|
44
|
+
version: data.version,
|
|
45
|
+
zone: data.zone
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const unmarshalVersion = (data) => {
|
|
49
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
50
|
+
throw new TypeError(
|
|
51
|
+
`Unmarshalling the type 'Version' failed as data isn't a dictionary.`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
availableAdmissionPlugins: data.available_admission_plugins,
|
|
56
|
+
availableCnis: data.available_cnis,
|
|
57
|
+
availableContainerRuntimes: data.available_container_runtimes,
|
|
58
|
+
availableFeatureGates: data.available_feature_gates,
|
|
59
|
+
availableKubeletArgs: data.available_kubelet_args,
|
|
60
|
+
label: data.label,
|
|
61
|
+
name: data.name,
|
|
62
|
+
region: data.region
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const unmarshalMaintenanceWindow = (data) => {
|
|
66
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
67
|
+
throw new TypeError(
|
|
68
|
+
`Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
day: data.day,
|
|
73
|
+
startHour: data.start_hour
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const unmarshalClusterAutoUpgrade = (data) => {
|
|
77
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
78
|
+
throw new TypeError(
|
|
79
|
+
`Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
enabled: data.enabled,
|
|
84
|
+
maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : void 0
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const unmarshalClusterAutoscalerConfig = (data) => {
|
|
88
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
89
|
+
throw new TypeError(
|
|
90
|
+
`Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
balanceSimilarNodeGroups: data.balance_similar_node_groups,
|
|
95
|
+
estimator: data.estimator,
|
|
96
|
+
expander: data.expander,
|
|
97
|
+
expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff,
|
|
98
|
+
ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization,
|
|
99
|
+
maxGracefulTerminationSec: data.max_graceful_termination_sec,
|
|
100
|
+
scaleDownDelayAfterAdd: data.scale_down_delay_after_add,
|
|
101
|
+
scaleDownDisabled: data.scale_down_disabled,
|
|
102
|
+
scaleDownUnneededTime: data.scale_down_unneeded_time,
|
|
103
|
+
scaleDownUtilizationThreshold: data.scale_down_utilization_threshold
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
const unmarshalClusterOpenIDConnectConfig = (data) => {
|
|
107
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
108
|
+
throw new TypeError(
|
|
109
|
+
`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
clientId: data.client_id,
|
|
114
|
+
groupsClaim: data.groups_claim,
|
|
115
|
+
groupsPrefix: data.groups_prefix,
|
|
116
|
+
issuerUrl: data.issuer_url,
|
|
117
|
+
requiredClaim: data.required_claim,
|
|
118
|
+
usernameClaim: data.username_claim,
|
|
119
|
+
usernamePrefix: data.username_prefix
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const unmarshalCluster = (data) => {
|
|
123
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
124
|
+
throw new TypeError(
|
|
125
|
+
`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
aclAvailable: data.acl_available,
|
|
130
|
+
admissionPlugins: data.admission_plugins,
|
|
131
|
+
apiserverCertSans: data.apiserver_cert_sans,
|
|
132
|
+
autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : void 0,
|
|
133
|
+
autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : void 0,
|
|
134
|
+
clusterUrl: data.cluster_url,
|
|
135
|
+
cni: data.cni,
|
|
136
|
+
commitmentEndsAt: sdkClient.unmarshalDate(data.commitment_ends_at),
|
|
137
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
138
|
+
description: data.description,
|
|
139
|
+
dnsWildcard: data.dns_wildcard,
|
|
140
|
+
featureGates: data.feature_gates,
|
|
141
|
+
iamNodesGroupId: data.iam_nodes_group_id,
|
|
142
|
+
id: data.id,
|
|
143
|
+
name: data.name,
|
|
144
|
+
openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : void 0,
|
|
145
|
+
organizationId: data.organization_id,
|
|
146
|
+
privateNetworkId: data.private_network_id,
|
|
147
|
+
projectId: data.project_id,
|
|
148
|
+
region: data.region,
|
|
149
|
+
status: data.status,
|
|
150
|
+
tags: data.tags,
|
|
151
|
+
type: data.type,
|
|
152
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at),
|
|
153
|
+
upgradeAvailable: data.upgrade_available,
|
|
154
|
+
version: data.version
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const unmarshalNode = (data) => {
|
|
158
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
159
|
+
throw new TypeError(
|
|
160
|
+
`Unmarshalling the type 'Node' failed as data isn't a dictionary.`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
clusterId: data.cluster_id,
|
|
165
|
+
conditions: data.conditions ? data.conditions : void 0,
|
|
166
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
167
|
+
errorMessage: data.error_message,
|
|
168
|
+
id: data.id,
|
|
169
|
+
name: data.name,
|
|
170
|
+
poolId: data.pool_id,
|
|
171
|
+
providerId: data.provider_id,
|
|
172
|
+
publicIpV4: data.public_ip_v4,
|
|
173
|
+
publicIpV6: data.public_ip_v6,
|
|
174
|
+
region: data.region,
|
|
175
|
+
status: data.status,
|
|
176
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
const unmarshalACLRule = (data) => {
|
|
180
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
181
|
+
throw new TypeError(
|
|
182
|
+
`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
description: data.description,
|
|
187
|
+
id: data.id,
|
|
188
|
+
ip: data.ip,
|
|
189
|
+
scalewayRanges: data.scaleway_ranges
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
const unmarshalAddClusterACLRulesResponse = (data) => {
|
|
193
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
194
|
+
throw new TypeError(
|
|
195
|
+
`Unmarshalling the type 'AddClusterACLRulesResponse' failed as data isn't a dictionary.`
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
rules: sdkClient.unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
const unmarshalExternalNodeCoreV1Taint = (data) => {
|
|
203
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
204
|
+
throw new TypeError(
|
|
205
|
+
`Unmarshalling the type 'ExternalNodeCoreV1Taint' failed as data isn't a dictionary.`
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
effect: data.effect,
|
|
210
|
+
key: data.key,
|
|
211
|
+
value: data.value
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
const unmarshalExternalNode = (data) => {
|
|
215
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
216
|
+
throw new TypeError(
|
|
217
|
+
`Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
clusterCa: data.cluster_ca,
|
|
222
|
+
clusterUrl: data.cluster_url,
|
|
223
|
+
cniPluginsVersion: data.cni_plugins_version,
|
|
224
|
+
containerdVersion: data.containerd_version,
|
|
225
|
+
externalIp: data.external_ip,
|
|
226
|
+
iamToken: data.iam_token,
|
|
227
|
+
id: data.id,
|
|
228
|
+
kubeToken: data.kube_token,
|
|
229
|
+
kubeletConfig: data.kubelet_config,
|
|
230
|
+
name: data.name,
|
|
231
|
+
nodeLabels: data.node_labels,
|
|
232
|
+
nodeTaints: sdkClient.unmarshalArrayOfObject(
|
|
233
|
+
data.node_taints,
|
|
234
|
+
unmarshalExternalNodeCoreV1Taint
|
|
235
|
+
),
|
|
236
|
+
poolVersion: data.pool_version,
|
|
237
|
+
runcVersion: data.runc_version
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
const unmarshalExternalNodeAuth = (data) => {
|
|
241
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
242
|
+
throw new TypeError(
|
|
243
|
+
`Unmarshalling the type 'ExternalNodeAuth' failed as data isn't a dictionary.`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
metadataUrl: data.metadata_url,
|
|
248
|
+
nodeSecretKey: data.node_secret_key
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
const unmarshalListClusterACLRulesResponse = (data) => {
|
|
252
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
253
|
+
throw new TypeError(
|
|
254
|
+
`Unmarshalling the type 'ListClusterACLRulesResponse' failed as data isn't a dictionary.`
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
rules: sdkClient.unmarshalArrayOfObject(data.rules, unmarshalACLRule),
|
|
259
|
+
totalCount: data.total_count
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
const unmarshalClusterType = (data) => {
|
|
263
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
264
|
+
throw new TypeError(
|
|
265
|
+
`Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.`
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
auditLogsSupported: data.audit_logs_supported,
|
|
270
|
+
availability: data.availability,
|
|
271
|
+
commitmentDelay: data.commitment_delay,
|
|
272
|
+
dedicated: data.dedicated,
|
|
273
|
+
maxEtcdSize: data.max_etcd_size,
|
|
274
|
+
maxNodes: data.max_nodes,
|
|
275
|
+
memory: data.memory,
|
|
276
|
+
name: data.name,
|
|
277
|
+
resiliency: data.resiliency,
|
|
278
|
+
sla: data.sla
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
const unmarshalListClusterAvailableTypesResponse = (data) => {
|
|
282
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
283
|
+
throw new TypeError(
|
|
284
|
+
`Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
clusterTypes: sdkClient.unmarshalArrayOfObject(
|
|
289
|
+
data.cluster_types,
|
|
290
|
+
unmarshalClusterType
|
|
291
|
+
),
|
|
292
|
+
totalCount: data.total_count
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
const unmarshalListClusterAvailableVersionsResponse = (data) => {
|
|
296
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
297
|
+
throw new TypeError(
|
|
298
|
+
`Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
versions: sdkClient.unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
const unmarshalListClusterTypesResponse = (data) => {
|
|
306
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
307
|
+
throw new TypeError(
|
|
308
|
+
`Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
clusterTypes: sdkClient.unmarshalArrayOfObject(
|
|
313
|
+
data.cluster_types,
|
|
314
|
+
unmarshalClusterType
|
|
315
|
+
),
|
|
316
|
+
totalCount: data.total_count
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
const unmarshalListClustersResponse = (data) => {
|
|
320
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
321
|
+
throw new TypeError(
|
|
322
|
+
`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
clusters: sdkClient.unmarshalArrayOfObject(data.clusters, unmarshalCluster),
|
|
327
|
+
totalCount: data.total_count
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
const unmarshalListNodesResponse = (data) => {
|
|
331
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
332
|
+
throw new TypeError(
|
|
333
|
+
`Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
nodes: sdkClient.unmarshalArrayOfObject(data.nodes, unmarshalNode),
|
|
338
|
+
totalCount: data.total_count
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
const unmarshalListPoolsResponse = (data) => {
|
|
342
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
343
|
+
throw new TypeError(
|
|
344
|
+
`Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
pools: sdkClient.unmarshalArrayOfObject(data.pools, unmarshalPool),
|
|
349
|
+
totalCount: data.total_count
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
const unmarshalListVersionsResponse = (data) => {
|
|
353
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
354
|
+
throw new TypeError(
|
|
355
|
+
`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
return {
|
|
359
|
+
versions: sdkClient.unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
const unmarshalNodeMetadataCoreV1Taint = (data) => {
|
|
363
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
364
|
+
throw new TypeError(
|
|
365
|
+
`Unmarshalling the type 'NodeMetadataCoreV1Taint' failed as data isn't a dictionary.`
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
effect: data.effect,
|
|
370
|
+
key: data.key,
|
|
371
|
+
value: data.value
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
const unmarshalNodeMetadata = (data) => {
|
|
375
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
376
|
+
throw new TypeError(
|
|
377
|
+
`Unmarshalling the type 'NodeMetadata' failed as data isn't a dictionary.`
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
clusterCa: data.cluster_ca,
|
|
382
|
+
clusterUrl: data.cluster_url,
|
|
383
|
+
credentialProviderConfig: data.credential_provider_config,
|
|
384
|
+
externalIp: data.external_ip,
|
|
385
|
+
hasGpu: data.has_gpu,
|
|
386
|
+
id: data.id,
|
|
387
|
+
kubeletConfig: data.kubelet_config,
|
|
388
|
+
name: data.name,
|
|
389
|
+
nodeLabels: data.node_labels,
|
|
390
|
+
nodeTaints: sdkClient.unmarshalArrayOfObject(
|
|
391
|
+
data.node_taints,
|
|
392
|
+
unmarshalNodeMetadataCoreV1Taint
|
|
393
|
+
),
|
|
394
|
+
poolVersion: data.pool_version,
|
|
395
|
+
repoUri: data.repo_uri
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
const unmarshalSetClusterACLRulesResponse = (data) => {
|
|
399
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
400
|
+
throw new TypeError(
|
|
401
|
+
`Unmarshalling the type 'SetClusterACLRulesResponse' failed as data isn't a dictionary.`
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
return {
|
|
405
|
+
rules: sdkClient.unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
const marshalACLRuleRequest = (request, defaults) => ({
|
|
409
|
+
description: request.description,
|
|
410
|
+
...sdkClient.resolveOneOf([
|
|
411
|
+
{ param: "ip", value: request.ip },
|
|
412
|
+
{ param: "scaleway_ranges", value: request.scalewayRanges }
|
|
413
|
+
])
|
|
414
|
+
});
|
|
415
|
+
const marshalAddClusterACLRulesRequest = (request, defaults) => ({
|
|
416
|
+
acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0
|
|
417
|
+
});
|
|
418
|
+
const marshalMaintenanceWindow = (request, defaults) => ({
|
|
419
|
+
day: request.day,
|
|
420
|
+
start_hour: request.startHour
|
|
421
|
+
});
|
|
422
|
+
const marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({
|
|
423
|
+
max_surge: request.maxSurge,
|
|
424
|
+
max_unavailable: request.maxUnavailable
|
|
425
|
+
});
|
|
426
|
+
const marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({
|
|
427
|
+
enable: request.enable,
|
|
428
|
+
maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow) : void 0
|
|
429
|
+
});
|
|
430
|
+
const marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({
|
|
431
|
+
balance_similar_node_groups: request.balanceSimilarNodeGroups,
|
|
432
|
+
estimator: request.estimator,
|
|
433
|
+
expander: request.expander,
|
|
434
|
+
expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
|
|
435
|
+
ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
|
|
436
|
+
max_graceful_termination_sec: request.maxGracefulTerminationSec,
|
|
437
|
+
scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
|
|
438
|
+
scale_down_disabled: request.scaleDownDisabled,
|
|
439
|
+
scale_down_unneeded_time: request.scaleDownUnneededTime,
|
|
440
|
+
scale_down_utilization_threshold: request.scaleDownUtilizationThreshold
|
|
441
|
+
});
|
|
442
|
+
const marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
|
|
443
|
+
client_id: request.clientId,
|
|
444
|
+
groups_claim: request.groupsClaim,
|
|
445
|
+
groups_prefix: request.groupsPrefix,
|
|
446
|
+
issuer_url: request.issuerUrl,
|
|
447
|
+
required_claim: request.requiredClaim,
|
|
448
|
+
username_claim: request.usernameClaim,
|
|
449
|
+
username_prefix: request.usernamePrefix
|
|
450
|
+
});
|
|
451
|
+
const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({
|
|
452
|
+
autohealing: request.autohealing,
|
|
453
|
+
autoscaling: request.autoscaling,
|
|
454
|
+
container_runtime: request.containerRuntime,
|
|
455
|
+
kubelet_args: request.kubeletArgs,
|
|
456
|
+
max_size: request.maxSize,
|
|
457
|
+
min_size: request.minSize,
|
|
458
|
+
name: request.name,
|
|
459
|
+
node_type: request.nodeType,
|
|
460
|
+
placement_group_id: request.placementGroupId,
|
|
461
|
+
public_ip_disabled: request.publicIpDisabled,
|
|
462
|
+
root_volume_size: request.rootVolumeSize,
|
|
463
|
+
root_volume_type: request.rootVolumeType,
|
|
464
|
+
size: request.size,
|
|
465
|
+
tags: request.tags,
|
|
466
|
+
upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreateClusterRequestPoolConfigUpgradePolicy(
|
|
467
|
+
request.upgradePolicy
|
|
468
|
+
) : void 0,
|
|
469
|
+
zone: request.zone
|
|
470
|
+
});
|
|
471
|
+
const marshalCreateClusterRequest = (request, defaults) => ({
|
|
472
|
+
admission_plugins: request.admissionPlugins,
|
|
473
|
+
apiserver_cert_sans: request.apiserverCertSans,
|
|
474
|
+
auto_upgrade: request.autoUpgrade !== void 0 ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0,
|
|
475
|
+
autoscaler_config: request.autoscalerConfig !== void 0 ? marshalCreateClusterRequestAutoscalerConfig(
|
|
476
|
+
request.autoscalerConfig
|
|
477
|
+
) : void 0,
|
|
478
|
+
cni: request.cni,
|
|
479
|
+
description: request.description,
|
|
480
|
+
feature_gates: request.featureGates,
|
|
481
|
+
name: request.name || randomName("k8s"),
|
|
482
|
+
open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalCreateClusterRequestOpenIDConnectConfig(
|
|
483
|
+
request.openIdConnectConfig
|
|
484
|
+
) : void 0,
|
|
485
|
+
pools: request.pools !== void 0 ? request.pools.map(
|
|
486
|
+
(elt) => marshalCreateClusterRequestPoolConfig(elt)
|
|
487
|
+
) : void 0,
|
|
488
|
+
private_network_id: request.privateNetworkId,
|
|
489
|
+
tags: request.tags,
|
|
490
|
+
type: request.type,
|
|
491
|
+
version: request.version,
|
|
492
|
+
...sdkClient.resolveOneOf([
|
|
493
|
+
{
|
|
494
|
+
default: defaults.defaultProjectId,
|
|
495
|
+
param: "project_id",
|
|
496
|
+
value: request.projectId
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
default: defaults.defaultOrganizationId,
|
|
500
|
+
param: "organization_id",
|
|
501
|
+
value: request.organizationId
|
|
502
|
+
}
|
|
503
|
+
])
|
|
504
|
+
});
|
|
505
|
+
const marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({
|
|
506
|
+
max_surge: request.maxSurge,
|
|
507
|
+
max_unavailable: request.maxUnavailable
|
|
508
|
+
});
|
|
509
|
+
const marshalCreatePoolRequest = (request, defaults) => ({
|
|
510
|
+
autohealing: request.autohealing,
|
|
511
|
+
autoscaling: request.autoscaling,
|
|
512
|
+
container_runtime: request.containerRuntime,
|
|
513
|
+
kubelet_args: request.kubeletArgs !== void 0 ? request.kubeletArgs : void 0,
|
|
514
|
+
max_size: request.maxSize,
|
|
515
|
+
min_size: request.minSize,
|
|
516
|
+
name: request.name || randomName("pool"),
|
|
517
|
+
node_type: request.nodeType,
|
|
518
|
+
placement_group_id: request.placementGroupId,
|
|
519
|
+
public_ip_disabled: request.publicIpDisabled,
|
|
520
|
+
root_volume_size: request.rootVolumeSize,
|
|
521
|
+
root_volume_type: request.rootVolumeType,
|
|
522
|
+
size: request.size,
|
|
523
|
+
tags: request.tags,
|
|
524
|
+
upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : void 0,
|
|
525
|
+
zone: request.zone ?? defaults.defaultZone
|
|
526
|
+
});
|
|
527
|
+
const marshalSetClusterACLRulesRequest = (request, defaults) => ({
|
|
528
|
+
acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0
|
|
529
|
+
});
|
|
530
|
+
const marshalSetClusterTypeRequest = (request, defaults) => ({
|
|
531
|
+
type: request.type
|
|
532
|
+
});
|
|
533
|
+
const marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({
|
|
534
|
+
enable: request.enable,
|
|
535
|
+
maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow) : void 0
|
|
536
|
+
});
|
|
537
|
+
const marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({
|
|
538
|
+
balance_similar_node_groups: request.balanceSimilarNodeGroups,
|
|
539
|
+
estimator: request.estimator,
|
|
540
|
+
expander: request.expander,
|
|
541
|
+
expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
|
|
542
|
+
ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
|
|
543
|
+
max_graceful_termination_sec: request.maxGracefulTerminationSec,
|
|
544
|
+
scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
|
|
545
|
+
scale_down_disabled: request.scaleDownDisabled,
|
|
546
|
+
scale_down_unneeded_time: request.scaleDownUnneededTime,
|
|
547
|
+
scale_down_utilization_threshold: request.scaleDownUtilizationThreshold
|
|
548
|
+
});
|
|
549
|
+
const marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
|
|
550
|
+
client_id: request.clientId,
|
|
551
|
+
groups_claim: request.groupsClaim,
|
|
552
|
+
groups_prefix: request.groupsPrefix,
|
|
553
|
+
issuer_url: request.issuerUrl,
|
|
554
|
+
required_claim: request.requiredClaim,
|
|
555
|
+
username_claim: request.usernameClaim,
|
|
556
|
+
username_prefix: request.usernamePrefix
|
|
557
|
+
});
|
|
558
|
+
const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
559
|
+
admission_plugins: request.admissionPlugins,
|
|
560
|
+
apiserver_cert_sans: request.apiserverCertSans,
|
|
561
|
+
auto_upgrade: request.autoUpgrade !== void 0 ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0,
|
|
562
|
+
autoscaler_config: request.autoscalerConfig !== void 0 ? marshalUpdateClusterRequestAutoscalerConfig(
|
|
563
|
+
request.autoscalerConfig
|
|
564
|
+
) : void 0,
|
|
565
|
+
description: request.description,
|
|
566
|
+
feature_gates: request.featureGates,
|
|
567
|
+
name: request.name,
|
|
568
|
+
open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalUpdateClusterRequestOpenIDConnectConfig(
|
|
569
|
+
request.openIdConnectConfig
|
|
570
|
+
) : void 0,
|
|
571
|
+
tags: request.tags
|
|
572
|
+
});
|
|
573
|
+
const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({
|
|
574
|
+
max_surge: request.maxSurge,
|
|
575
|
+
max_unavailable: request.maxUnavailable
|
|
576
|
+
});
|
|
577
|
+
const marshalUpdatePoolRequest = (request, defaults) => ({
|
|
578
|
+
autohealing: request.autohealing,
|
|
579
|
+
autoscaling: request.autoscaling,
|
|
580
|
+
kubelet_args: request.kubeletArgs,
|
|
581
|
+
max_size: request.maxSize,
|
|
582
|
+
min_size: request.minSize,
|
|
583
|
+
size: request.size,
|
|
584
|
+
tags: request.tags,
|
|
585
|
+
upgrade_policy: request.upgradePolicy !== void 0 ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : void 0
|
|
586
|
+
});
|
|
587
|
+
const marshalUpgradeClusterRequest = (request, defaults) => ({
|
|
588
|
+
upgrade_pools: request.upgradePools,
|
|
589
|
+
version: request.version
|
|
590
|
+
});
|
|
591
|
+
const marshalUpgradePoolRequest = (request, defaults) => ({
|
|
592
|
+
version: request.version
|
|
593
|
+
});
|
|
594
|
+
exports.marshalAddClusterACLRulesRequest = marshalAddClusterACLRulesRequest;
|
|
595
|
+
exports.marshalCreateClusterRequest = marshalCreateClusterRequest;
|
|
596
|
+
exports.marshalCreatePoolRequest = marshalCreatePoolRequest;
|
|
597
|
+
exports.marshalSetClusterACLRulesRequest = marshalSetClusterACLRulesRequest;
|
|
598
|
+
exports.marshalSetClusterTypeRequest = marshalSetClusterTypeRequest;
|
|
599
|
+
exports.marshalUpdateClusterRequest = marshalUpdateClusterRequest;
|
|
600
|
+
exports.marshalUpdatePoolRequest = marshalUpdatePoolRequest;
|
|
601
|
+
exports.marshalUpgradeClusterRequest = marshalUpgradeClusterRequest;
|
|
602
|
+
exports.marshalUpgradePoolRequest = marshalUpgradePoolRequest;
|
|
603
|
+
exports.unmarshalAddClusterACLRulesResponse = unmarshalAddClusterACLRulesResponse;
|
|
604
|
+
exports.unmarshalCluster = unmarshalCluster;
|
|
605
|
+
exports.unmarshalExternalNode = unmarshalExternalNode;
|
|
606
|
+
exports.unmarshalExternalNodeAuth = unmarshalExternalNodeAuth;
|
|
607
|
+
exports.unmarshalListClusterACLRulesResponse = unmarshalListClusterACLRulesResponse;
|
|
608
|
+
exports.unmarshalListClusterAvailableTypesResponse = unmarshalListClusterAvailableTypesResponse;
|
|
609
|
+
exports.unmarshalListClusterAvailableVersionsResponse = unmarshalListClusterAvailableVersionsResponse;
|
|
610
|
+
exports.unmarshalListClusterTypesResponse = unmarshalListClusterTypesResponse;
|
|
611
|
+
exports.unmarshalListClustersResponse = unmarshalListClustersResponse;
|
|
612
|
+
exports.unmarshalListNodesResponse = unmarshalListNodesResponse;
|
|
613
|
+
exports.unmarshalListPoolsResponse = unmarshalListPoolsResponse;
|
|
614
|
+
exports.unmarshalListVersionsResponse = unmarshalListVersionsResponse;
|
|
615
|
+
exports.unmarshalNode = unmarshalNode;
|
|
616
|
+
exports.unmarshalNodeMetadata = unmarshalNodeMetadata;
|
|
617
|
+
exports.unmarshalPool = unmarshalPool;
|
|
618
|
+
exports.unmarshalSetClusterACLRulesResponse = unmarshalSetClusterACLRulesResponse;
|
|
619
|
+
exports.unmarshalVersion = unmarshalVersion;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { AddClusterACLRulesRequest, AddClusterACLRulesResponse, Cluster, CreateClusterRequest, CreatePoolRequest, ExternalNode, ExternalNodeAuth, ListClusterACLRulesResponse, ListClusterAvailableTypesResponse, ListClusterAvailableVersionsResponse, ListClusterTypesResponse, ListClustersResponse, ListNodesResponse, ListPoolsResponse, ListVersionsResponse, Node, NodeMetadata, Pool, SetClusterACLRulesRequest, SetClusterACLRulesResponse, SetClusterTypeRequest, UpdateClusterRequest, UpdatePoolRequest, UpgradeClusterRequest, UpgradePoolRequest, Version } from './types.gen';
|
|
3
|
+
export declare const unmarshalPool: (data: unknown) => Pool;
|
|
4
|
+
export declare const unmarshalVersion: (data: unknown) => Version;
|
|
5
|
+
export declare const unmarshalCluster: (data: unknown) => Cluster;
|
|
6
|
+
export declare const unmarshalNode: (data: unknown) => Node;
|
|
7
|
+
export declare const unmarshalAddClusterACLRulesResponse: (data: unknown) => AddClusterACLRulesResponse;
|
|
8
|
+
export declare const unmarshalExternalNode: (data: unknown) => ExternalNode;
|
|
9
|
+
export declare const unmarshalExternalNodeAuth: (data: unknown) => ExternalNodeAuth;
|
|
10
|
+
export declare const unmarshalListClusterACLRulesResponse: (data: unknown) => ListClusterACLRulesResponse;
|
|
11
|
+
export declare const unmarshalListClusterAvailableTypesResponse: (data: unknown) => ListClusterAvailableTypesResponse;
|
|
12
|
+
export declare const unmarshalListClusterAvailableVersionsResponse: (data: unknown) => ListClusterAvailableVersionsResponse;
|
|
13
|
+
export declare const unmarshalListClusterTypesResponse: (data: unknown) => ListClusterTypesResponse;
|
|
14
|
+
export declare const unmarshalListClustersResponse: (data: unknown) => ListClustersResponse;
|
|
15
|
+
export declare const unmarshalListNodesResponse: (data: unknown) => ListNodesResponse;
|
|
16
|
+
export declare const unmarshalListPoolsResponse: (data: unknown) => ListPoolsResponse;
|
|
17
|
+
export declare const unmarshalListVersionsResponse: (data: unknown) => ListVersionsResponse;
|
|
18
|
+
export declare const unmarshalNodeMetadata: (data: unknown) => NodeMetadata;
|
|
19
|
+
export declare const unmarshalSetClusterACLRulesResponse: (data: unknown) => SetClusterACLRulesResponse;
|
|
20
|
+
export declare const marshalAddClusterACLRulesRequest: (request: AddClusterACLRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
21
|
+
export declare const marshalCreateClusterRequest: (request: CreateClusterRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
22
|
+
export declare const marshalCreatePoolRequest: (request: CreatePoolRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
23
|
+
export declare const marshalSetClusterACLRulesRequest: (request: SetClusterACLRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
24
|
+
export declare const marshalSetClusterTypeRequest: (request: SetClusterTypeRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
25
|
+
export declare const marshalUpdateClusterRequest: (request: UpdateClusterRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
26
|
+
export declare const marshalUpdatePoolRequest: (request: UpdatePoolRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
27
|
+
export declare const marshalUpgradeClusterRequest: (request: UpgradeClusterRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
28
|
+
export declare const marshalUpgradePoolRequest: (request: UpgradePoolRequest, defaults: DefaultValues) => Record<string, unknown>;
|