@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.14
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/api/account/index.js +4 -0
- package/dist/api/account/v2/api.gen.js +147 -0
- package/dist/api/account/v2/index.gen.js +4 -0
- package/dist/api/account/v2/marshalling.gen.js +39 -0
- package/dist/api/account/v3/api.gen.js +129 -0
- package/dist/api/account/v3/index.gen.js +6 -0
- package/dist/api/account/v3/marshalling.gen.js +39 -0
- package/dist/api/account/v3/validation-rules.gen.js +39 -0
- package/dist/api/applesilicon/index.js +2 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
- package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
- package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
- package/dist/api/baremetal/index.js +2 -0
- package/dist/api/baremetal/v1/api.gen.js +523 -0
- package/dist/api/baremetal/v1/api.utils.js +27 -0
- package/dist/api/baremetal/v1/content.gen.js +13 -0
- package/dist/api/baremetal/v1/index.js +5 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +80 -0
- package/dist/api/billing/v2alpha1/index.gen.js +4 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
- package/dist/api/block/index.js +2 -0
- package/dist/api/block/v1alpha1/api.gen.js +249 -0
- package/dist/api/block/v1alpha1/content.gen.js +13 -0
- package/dist/api/block/v1alpha1/index.gen.js +7 -0
- package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
- package/dist/api/cockpit/index.js +2 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
- package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
- package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
- package/dist/api/container/index.js +2 -0
- package/dist/api/container/v1beta1/api.gen.js +549 -0
- package/dist/api/container/v1beta1/content.gen.js +22 -0
- package/dist/api/container/v1beta1/index.gen.js +7 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
- package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/document_db/index.js +2 -0
- package/dist/api/document_db/v1beta1/api.gen.js +830 -0
- package/dist/api/document_db/v1beta1/content.gen.js +19 -0
- package/dist/api/document_db/v1beta1/index.gen.js +7 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
- package/dist/api/domain/index.js +2 -0
- package/dist/api/domain/v2beta1/api.gen.js +867 -0
- package/dist/api/domain/v2beta1/content.gen.js +28 -0
- package/dist/api/domain/v2beta1/index.gen.js +5 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
- package/dist/api/flexibleip/index.js +2 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
- package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
- package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -0
- package/dist/api/function/v1beta1/api.gen.js +560 -0
- package/dist/api/function/v1beta1/content.gen.js +22 -0
- package/dist/api/function/v1beta1/index.gen.js +7 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
- package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/iam/index.js +2 -0
- package/dist/api/iam/v1alpha1/api.gen.js +783 -0
- package/dist/api/iam/v1alpha1/index.gen.js +6 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
- package/dist/api/instance/index.js +2 -0
- package/dist/api/instance/v1/api.gen.js +1003 -0
- package/dist/api/instance/v1/api.utils.js +369 -0
- package/dist/api/instance/v1/content.gen.js +31 -0
- package/dist/api/instance/v1/index.js +2 -0
- package/dist/api/instance/v1/marshalling.gen.js +1415 -0
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -0
- package/dist/api/iot/v1/api.gen.js +573 -0
- package/dist/api/iot/v1/content.gen.js +7 -0
- package/dist/api/iot/v1/index.gen.js +5 -0
- package/dist/api/iot/v1/marshalling.gen.js +439 -0
- package/dist/api/ipam/index.js +2 -0
- package/dist/api/ipam/v1/api.gen.js +113 -0
- package/dist/api/ipam/v1/index.gen.js +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +77 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
- package/dist/api/ipfs/index.js +2 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
- package/dist/api/k8s/index.js +2 -0
- package/dist/api/k8s/v1/api.gen.js +454 -0
- package/dist/api/k8s/v1/api.utils.js +13 -0
- package/dist/api/k8s/v1/content.gen.js +13 -0
- package/dist/api/k8s/v1/index.js +4 -0
- package/dist/api/k8s/v1/marshalling.gen.js +421 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
- package/dist/api/lb/index.js +2 -0
- package/dist/api/lb/v1/api.gen.js +1669 -0
- package/dist/api/lb/v1/api.utils.js +81 -0
- package/dist/api/lb/v1/content.gen.js +16 -0
- package/dist/api/lb/v1/index.js +2 -0
- package/dist/api/lb/v1/marshalling.gen.js +1039 -0
- package/dist/api/marketplace/index.js +4 -0
- package/dist/api/marketplace/v1/api.gen.js +60 -0
- package/dist/api/marketplace/v1/index.gen.js +4 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
- package/dist/api/marketplace/v2/api.gen.js +162 -0
- package/dist/api/marketplace/v2/index.gen.js +4 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
- package/dist/api/mnq/index.js +4 -0
- package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
- package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
- package/dist/api/mnq/v1beta1/api.gen.js +529 -0
- package/dist/api/mnq/v1beta1/index.gen.js +6 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
- package/dist/api/rdb/index.js +2 -0
- package/dist/api/rdb/v1/api.gen.js +972 -0
- package/dist/api/rdb/v1/content.gen.js +22 -0
- package/dist/api/rdb/v1/index.gen.js +7 -0
- package/dist/api/rdb/v1/marshalling.gen.js +694 -0
- package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
- package/dist/api/redis/index.js +2 -0
- package/dist/api/redis/v1/api.gen.js +389 -0
- package/dist/api/redis/v1/content.gen.js +7 -0
- package/dist/api/redis/v1/index.gen.js +5 -0
- package/dist/api/redis/v1/marshalling.gen.js +283 -0
- package/dist/api/registry/index.js +2 -0
- package/dist/api/registry/v1/api.gen.js +252 -0
- package/dist/api/registry/v1/content.gen.js +13 -0
- package/dist/api/registry/v1/index.gen.js +5 -0
- package/dist/api/registry/v1/marshalling.gen.js +108 -0
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +415 -0
- package/dist/api/secret/v1alpha1/index.gen.js +4 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +229 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +5 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
- package/dist/api/test/index.js +2 -0
- package/dist/api/test/v1/api.gen.js +152 -0
- package/dist/api/test/v1/content.gen.js +7 -0
- package/dist/api/test/v1/index.gen.js +5 -0
- package/dist/api/test/v1/marshalling.gen.js +81 -0
- package/dist/api/vpc/index.js +4 -0
- package/dist/api/vpc/v1/api.gen.js +110 -0
- package/dist/api/vpc/v1/index.gen.js +4 -0
- package/dist/api/vpc/v1/marshalling.gen.js +44 -0
- package/dist/api/vpc/v2/api.gen.js +276 -0
- package/dist/api/vpc/v2/index.gen.js +4 -0
- package/dist/api/vpc/v2/marshalling.gen.js +137 -0
- package/dist/api/vpcgw/index.js +2 -0
- package/dist/api/vpcgw/v1/api.gen.js +669 -0
- package/dist/api/vpcgw/v1/content.gen.js +10 -0
- package/dist/api/vpcgw/v1/index.gen.js +5 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
- package/dist/api/webhosting/index.js +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
- package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/helpers/is-browser.js +5 -0
- package/dist/helpers/is-response.js +10 -0
- package/dist/helpers/json.js +11 -0
- package/dist/helpers/marshalling.js +130 -0
- package/dist/index.cjs +26484 -0
- package/dist/index.d.ts +31184 -0
- package/dist/index.js +71 -0
- package/dist/internal/async/interval-retrier.js +105 -0
- package/dist/internal/async/sleep.js +13 -0
- package/dist/internal/interceptors/composer.js +46 -0
- package/dist/internal/interceptors/helpers.js +32 -0
- package/dist/internal/logger/console-logger.js +38 -0
- package/dist/internal/logger/index.js +41 -0
- package/dist/internal/logger/level-resolver.js +13 -0
- package/dist/internal/validations/string-validation.js +38 -0
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +12 -0
- package/dist/scw/auth.js +68 -0
- package/dist/scw/client-ini-factory.js +174 -0
- package/dist/scw/client-ini-profile.js +54 -0
- package/dist/scw/client-settings.js +78 -0
- package/dist/scw/client.js +98 -0
- package/dist/scw/constants.js +4 -0
- package/dist/scw/custom-marshalling.js +131 -0
- package/dist/scw/errors/error-parser.js +107 -0
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
- package/dist/scw/errors/scw-error.js +66 -0
- package/dist/scw/errors/standard/already-exists-error.js +26 -0
- package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
- package/dist/scw/errors/standard/index.js +13 -0
- package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
- package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
- package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
- package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
- package/dist/scw/errors/standard/resource-expired-error.js +26 -0
- package/dist/scw/errors/standard/resource-locked-error.js +25 -0
- package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
- package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
- package/dist/scw/errors/standard/transient-state-error.js +26 -0
- package/dist/scw/errors/types.js +23 -0
- package/dist/scw/fetch/build-fetcher.js +72 -0
- package/dist/scw/fetch/http-dumper.js +54 -0
- package/dist/scw/fetch/http-interceptors.js +99 -0
- package/dist/scw/fetch/resource-paginator.js +84 -0
- package/dist/scw/fetch/response-parser.js +72 -0
- package/package.json +2 -2
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
+
const unmarshalPoolUpgradePolicy = data => {
|
|
8
|
+
if (!isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
maxSurge: data.max_surge,
|
|
13
|
+
maxUnavailable: data.max_unavailable
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalPool = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
autohealing: data.autohealing,
|
|
22
|
+
autoscaling: data.autoscaling,
|
|
23
|
+
clusterId: data.cluster_id,
|
|
24
|
+
containerRuntime: data.container_runtime,
|
|
25
|
+
createdAt: unmarshalDate(data.created_at),
|
|
26
|
+
id: data.id,
|
|
27
|
+
kubeletArgs: data.kubelet_args,
|
|
28
|
+
maxSize: data.max_size,
|
|
29
|
+
minSize: data.min_size,
|
|
30
|
+
name: data.name,
|
|
31
|
+
nodeType: data.node_type,
|
|
32
|
+
placementGroupId: data.placement_group_id,
|
|
33
|
+
publicIpDisabled: data.public_ip_disabled,
|
|
34
|
+
region: data.region,
|
|
35
|
+
rootVolumeSize: data.root_volume_size,
|
|
36
|
+
rootVolumeType: data.root_volume_type,
|
|
37
|
+
size: data.size,
|
|
38
|
+
status: data.status,
|
|
39
|
+
tags: data.tags,
|
|
40
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
41
|
+
upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined,
|
|
42
|
+
version: data.version,
|
|
43
|
+
zone: data.zone
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const unmarshalVersion = data => {
|
|
47
|
+
if (!isJSONObject(data)) {
|
|
48
|
+
throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
availableAdmissionPlugins: data.available_admission_plugins,
|
|
52
|
+
availableCnis: data.available_cnis,
|
|
53
|
+
availableContainerRuntimes: data.available_container_runtimes,
|
|
54
|
+
availableFeatureGates: data.available_feature_gates,
|
|
55
|
+
availableIngresses: data.available_ingresses ? data.available_ingresses : undefined,
|
|
56
|
+
availableKubeletArgs: data.available_kubelet_args,
|
|
57
|
+
label: data.label,
|
|
58
|
+
name: data.name,
|
|
59
|
+
region: data.region
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const unmarshalMaintenanceWindow = data => {
|
|
63
|
+
if (!isJSONObject(data)) {
|
|
64
|
+
throw new TypeError(`Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
day: data.day,
|
|
68
|
+
startHour: data.start_hour
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const unmarshalClusterAutoUpgrade = data => {
|
|
72
|
+
if (!isJSONObject(data)) {
|
|
73
|
+
throw new TypeError(`Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.`);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
enabled: data.enabled,
|
|
77
|
+
maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : undefined
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const unmarshalClusterAutoscalerConfig = data => {
|
|
81
|
+
if (!isJSONObject(data)) {
|
|
82
|
+
throw new TypeError(`Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
balanceSimilarNodeGroups: data.balance_similar_node_groups,
|
|
86
|
+
estimator: data.estimator,
|
|
87
|
+
expander: data.expander,
|
|
88
|
+
expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff,
|
|
89
|
+
ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization,
|
|
90
|
+
maxGracefulTerminationSec: data.max_graceful_termination_sec,
|
|
91
|
+
scaleDownDelayAfterAdd: data.scale_down_delay_after_add,
|
|
92
|
+
scaleDownDisabled: data.scale_down_disabled,
|
|
93
|
+
scaleDownUnneededTime: data.scale_down_unneeded_time,
|
|
94
|
+
scaleDownUtilizationThreshold: data.scale_down_utilization_threshold
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const unmarshalClusterOpenIDConnectConfig = data => {
|
|
98
|
+
if (!isJSONObject(data)) {
|
|
99
|
+
throw new TypeError(`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
clientId: data.client_id,
|
|
103
|
+
groupsClaim: data.groups_claim,
|
|
104
|
+
groupsPrefix: data.groups_prefix,
|
|
105
|
+
issuerUrl: data.issuer_url,
|
|
106
|
+
requiredClaim: data.required_claim,
|
|
107
|
+
usernameClaim: data.username_claim,
|
|
108
|
+
usernamePrefix: data.username_prefix
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const unmarshalCluster = data => {
|
|
112
|
+
if (!isJSONObject(data)) {
|
|
113
|
+
throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
admissionPlugins: data.admission_plugins,
|
|
117
|
+
apiserverCertSans: data.apiserver_cert_sans,
|
|
118
|
+
autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : undefined,
|
|
119
|
+
autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : undefined,
|
|
120
|
+
clusterUrl: data.cluster_url,
|
|
121
|
+
cni: data.cni,
|
|
122
|
+
commitmentEndsAt: unmarshalDate(data.commitment_ends_at),
|
|
123
|
+
createdAt: unmarshalDate(data.created_at),
|
|
124
|
+
dashboardEnabled: data.dashboard_enabled,
|
|
125
|
+
description: data.description,
|
|
126
|
+
dnsWildcard: data.dns_wildcard,
|
|
127
|
+
featureGates: data.feature_gates,
|
|
128
|
+
id: data.id,
|
|
129
|
+
ingress: data.ingress ? data.ingress : undefined,
|
|
130
|
+
name: data.name,
|
|
131
|
+
openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : undefined,
|
|
132
|
+
organizationId: data.organization_id,
|
|
133
|
+
privateNetworkId: data.private_network_id,
|
|
134
|
+
projectId: data.project_id,
|
|
135
|
+
region: data.region,
|
|
136
|
+
status: data.status,
|
|
137
|
+
tags: data.tags,
|
|
138
|
+
type: data.type,
|
|
139
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
140
|
+
upgradeAvailable: data.upgrade_available,
|
|
141
|
+
version: data.version
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
const unmarshalNode = data => {
|
|
145
|
+
if (!isJSONObject(data)) {
|
|
146
|
+
throw new TypeError(`Unmarshalling the type 'Node' failed as data isn't a dictionary.`);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
clusterId: data.cluster_id,
|
|
150
|
+
conditions: data.conditions ? data.conditions : undefined,
|
|
151
|
+
createdAt: unmarshalDate(data.created_at),
|
|
152
|
+
errorMessage: data.error_message,
|
|
153
|
+
id: data.id,
|
|
154
|
+
name: data.name,
|
|
155
|
+
poolId: data.pool_id,
|
|
156
|
+
providerId: data.provider_id,
|
|
157
|
+
publicIpV4: data.public_ip_v4,
|
|
158
|
+
publicIpV6: data.public_ip_v6,
|
|
159
|
+
region: data.region,
|
|
160
|
+
status: data.status,
|
|
161
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
const unmarshalExternalNode = data => {
|
|
165
|
+
if (!isJSONObject(data)) {
|
|
166
|
+
throw new TypeError(`Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.`);
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
clusterCa: data.cluster_ca,
|
|
170
|
+
clusterUrl: data.cluster_url,
|
|
171
|
+
externalIp: data.external_ip,
|
|
172
|
+
id: data.id,
|
|
173
|
+
kubeToken: data.kube_token,
|
|
174
|
+
kubeletConfig: data.kubelet_config,
|
|
175
|
+
name: data.name,
|
|
176
|
+
poolVersion: data.pool_version
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
const unmarshalClusterType = data => {
|
|
180
|
+
if (!isJSONObject(data)) {
|
|
181
|
+
throw new TypeError(`Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.`);
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
availability: data.availability,
|
|
185
|
+
commitmentDelay: data.commitment_delay,
|
|
186
|
+
dedicated: data.dedicated,
|
|
187
|
+
maxNodes: data.max_nodes,
|
|
188
|
+
memory: data.memory,
|
|
189
|
+
name: data.name,
|
|
190
|
+
resiliency: data.resiliency,
|
|
191
|
+
sla: data.sla
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
const unmarshalListClusterAvailableTypesResponse = data => {
|
|
195
|
+
if (!isJSONObject(data)) {
|
|
196
|
+
throw new TypeError(`Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`);
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),
|
|
200
|
+
totalCount: data.total_count
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
const unmarshalListClusterAvailableVersionsResponse = data => {
|
|
204
|
+
if (!isJSONObject(data)) {
|
|
205
|
+
throw new TypeError(`Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`);
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
const unmarshalListClusterTypesResponse = data => {
|
|
212
|
+
if (!isJSONObject(data)) {
|
|
213
|
+
throw new TypeError(`Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`);
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),
|
|
217
|
+
totalCount: data.total_count
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
const unmarshalListClustersResponse = data => {
|
|
221
|
+
if (!isJSONObject(data)) {
|
|
222
|
+
throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
|
|
226
|
+
totalCount: data.total_count
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
const unmarshalListNodesResponse = data => {
|
|
230
|
+
if (!isJSONObject(data)) {
|
|
231
|
+
throw new TypeError(`Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`);
|
|
232
|
+
}
|
|
233
|
+
return {
|
|
234
|
+
nodes: unmarshalArrayOfObject(data.nodes, unmarshalNode),
|
|
235
|
+
totalCount: data.total_count
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
const unmarshalListPoolsResponse = data => {
|
|
239
|
+
if (!isJSONObject(data)) {
|
|
240
|
+
throw new TypeError(`Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`);
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
pools: unmarshalArrayOfObject(data.pools, unmarshalPool),
|
|
244
|
+
totalCount: data.total_count
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
const unmarshalListVersionsResponse = data => {
|
|
248
|
+
if (!isJSONObject(data)) {
|
|
249
|
+
throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
const marshalMaintenanceWindow = (request, defaults) => ({
|
|
256
|
+
day: request.day,
|
|
257
|
+
start_hour: request.startHour
|
|
258
|
+
});
|
|
259
|
+
const marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({
|
|
260
|
+
max_surge: request.maxSurge,
|
|
261
|
+
max_unavailable: request.maxUnavailable
|
|
262
|
+
});
|
|
263
|
+
const marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({
|
|
264
|
+
enable: request.enable,
|
|
265
|
+
maintenance_window: request.maintenanceWindow !== undefined ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined
|
|
266
|
+
});
|
|
267
|
+
const marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({
|
|
268
|
+
balance_similar_node_groups: request.balanceSimilarNodeGroups,
|
|
269
|
+
estimator: request.estimator,
|
|
270
|
+
expander: request.expander,
|
|
271
|
+
expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
|
|
272
|
+
ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
|
|
273
|
+
max_graceful_termination_sec: request.maxGracefulTerminationSec,
|
|
274
|
+
scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
|
|
275
|
+
scale_down_disabled: request.scaleDownDisabled,
|
|
276
|
+
scale_down_unneeded_time: request.scaleDownUnneededTime,
|
|
277
|
+
scale_down_utilization_threshold: request.scaleDownUtilizationThreshold
|
|
278
|
+
});
|
|
279
|
+
const marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
|
|
280
|
+
client_id: request.clientId,
|
|
281
|
+
groups_claim: request.groupsClaim,
|
|
282
|
+
groups_prefix: request.groupsPrefix,
|
|
283
|
+
issuer_url: request.issuerUrl,
|
|
284
|
+
required_claim: request.requiredClaim,
|
|
285
|
+
username_claim: request.usernameClaim,
|
|
286
|
+
username_prefix: request.usernamePrefix
|
|
287
|
+
});
|
|
288
|
+
const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({
|
|
289
|
+
autohealing: request.autohealing,
|
|
290
|
+
autoscaling: request.autoscaling,
|
|
291
|
+
container_runtime: request.containerRuntime,
|
|
292
|
+
kubelet_args: request.kubeletArgs,
|
|
293
|
+
max_size: request.maxSize,
|
|
294
|
+
min_size: request.minSize,
|
|
295
|
+
name: request.name,
|
|
296
|
+
node_type: request.nodeType,
|
|
297
|
+
placement_group_id: request.placementGroupId,
|
|
298
|
+
public_ip_disabled: request.publicIpDisabled,
|
|
299
|
+
root_volume_size: request.rootVolumeSize,
|
|
300
|
+
root_volume_type: request.rootVolumeType,
|
|
301
|
+
size: request.size,
|
|
302
|
+
tags: request.tags,
|
|
303
|
+
upgrade_policy: request.upgradePolicy !== undefined ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy) : undefined,
|
|
304
|
+
zone: request.zone
|
|
305
|
+
});
|
|
306
|
+
const marshalCreateClusterRequest = (request, defaults) => ({
|
|
307
|
+
admission_plugins: request.admissionPlugins,
|
|
308
|
+
apiserver_cert_sans: request.apiserverCertSans,
|
|
309
|
+
auto_upgrade: request.autoUpgrade !== undefined ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined,
|
|
310
|
+
autoscaler_config: request.autoscalerConfig !== undefined ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined,
|
|
311
|
+
cni: request.cni,
|
|
312
|
+
description: request.description,
|
|
313
|
+
enable_dashboard: request.enableDashboard,
|
|
314
|
+
feature_gates: request.featureGates,
|
|
315
|
+
ingress: request.ingress,
|
|
316
|
+
name: request.name || randomName('k8s'),
|
|
317
|
+
open_id_connect_config: request.openIdConnectConfig !== undefined ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,
|
|
318
|
+
pools: request.pools !== undefined ? request.pools.map(elt => marshalCreateClusterRequestPoolConfig(elt)) : undefined,
|
|
319
|
+
private_network_id: request.privateNetworkId,
|
|
320
|
+
tags: request.tags,
|
|
321
|
+
type: request.type,
|
|
322
|
+
version: request.version,
|
|
323
|
+
...resolveOneOf([{
|
|
324
|
+
default: defaults.defaultOrganizationId,
|
|
325
|
+
param: 'organization_id',
|
|
326
|
+
value: request.organizationId
|
|
327
|
+
}, {
|
|
328
|
+
default: defaults.defaultProjectId,
|
|
329
|
+
param: 'project_id',
|
|
330
|
+
value: request.projectId
|
|
331
|
+
}])
|
|
332
|
+
});
|
|
333
|
+
const marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({
|
|
334
|
+
max_surge: request.maxSurge,
|
|
335
|
+
max_unavailable: request.maxUnavailable
|
|
336
|
+
});
|
|
337
|
+
const marshalCreatePoolRequest = (request, defaults) => ({
|
|
338
|
+
autohealing: request.autohealing,
|
|
339
|
+
autoscaling: request.autoscaling,
|
|
340
|
+
container_runtime: request.containerRuntime,
|
|
341
|
+
kubelet_args: request.kubeletArgs !== undefined ? request.kubeletArgs : undefined,
|
|
342
|
+
max_size: request.maxSize,
|
|
343
|
+
min_size: request.minSize,
|
|
344
|
+
name: request.name || randomName('pool'),
|
|
345
|
+
node_type: request.nodeType,
|
|
346
|
+
placement_group_id: request.placementGroupId,
|
|
347
|
+
public_ip_disabled: request.publicIpDisabled,
|
|
348
|
+
root_volume_size: request.rootVolumeSize,
|
|
349
|
+
root_volume_type: request.rootVolumeType,
|
|
350
|
+
size: request.size,
|
|
351
|
+
tags: request.tags,
|
|
352
|
+
upgrade_policy: request.upgradePolicy !== undefined ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined,
|
|
353
|
+
zone: request.zone ?? defaults.defaultZone
|
|
354
|
+
});
|
|
355
|
+
const marshalMigrateToPrivateNetworkClusterRequest = (request, defaults) => ({
|
|
356
|
+
private_network_id: request.privateNetworkId
|
|
357
|
+
});
|
|
358
|
+
const marshalSetClusterTypeRequest = (request, defaults) => ({
|
|
359
|
+
type: request.type
|
|
360
|
+
});
|
|
361
|
+
const marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({
|
|
362
|
+
enable: request.enable,
|
|
363
|
+
maintenance_window: request.maintenanceWindow !== undefined ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined
|
|
364
|
+
});
|
|
365
|
+
const marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({
|
|
366
|
+
balance_similar_node_groups: request.balanceSimilarNodeGroups,
|
|
367
|
+
estimator: request.estimator,
|
|
368
|
+
expander: request.expander,
|
|
369
|
+
expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
|
|
370
|
+
ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
|
|
371
|
+
max_graceful_termination_sec: request.maxGracefulTerminationSec,
|
|
372
|
+
scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
|
|
373
|
+
scale_down_disabled: request.scaleDownDisabled,
|
|
374
|
+
scale_down_unneeded_time: request.scaleDownUnneededTime,
|
|
375
|
+
scale_down_utilization_threshold: request.scaleDownUtilizationThreshold
|
|
376
|
+
});
|
|
377
|
+
const marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
|
|
378
|
+
client_id: request.clientId,
|
|
379
|
+
groups_claim: request.groupsClaim,
|
|
380
|
+
groups_prefix: request.groupsPrefix,
|
|
381
|
+
issuer_url: request.issuerUrl,
|
|
382
|
+
required_claim: request.requiredClaim,
|
|
383
|
+
username_claim: request.usernameClaim,
|
|
384
|
+
username_prefix: request.usernamePrefix
|
|
385
|
+
});
|
|
386
|
+
const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
387
|
+
admission_plugins: request.admissionPlugins,
|
|
388
|
+
apiserver_cert_sans: request.apiserverCertSans,
|
|
389
|
+
auto_upgrade: request.autoUpgrade !== undefined ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined,
|
|
390
|
+
autoscaler_config: request.autoscalerConfig !== undefined ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined,
|
|
391
|
+
description: request.description,
|
|
392
|
+
enable_dashboard: request.enableDashboard,
|
|
393
|
+
feature_gates: request.featureGates,
|
|
394
|
+
ingress: request.ingress,
|
|
395
|
+
name: request.name,
|
|
396
|
+
open_id_connect_config: request.openIdConnectConfig !== undefined ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,
|
|
397
|
+
tags: request.tags
|
|
398
|
+
});
|
|
399
|
+
const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({
|
|
400
|
+
max_surge: request.maxSurge,
|
|
401
|
+
max_unavailable: request.maxUnavailable
|
|
402
|
+
});
|
|
403
|
+
const marshalUpdatePoolRequest = (request, defaults) => ({
|
|
404
|
+
autohealing: request.autohealing,
|
|
405
|
+
autoscaling: request.autoscaling,
|
|
406
|
+
kubelet_args: request.kubeletArgs,
|
|
407
|
+
max_size: request.maxSize,
|
|
408
|
+
min_size: request.minSize,
|
|
409
|
+
size: request.size,
|
|
410
|
+
tags: request.tags,
|
|
411
|
+
upgrade_policy: request.upgradePolicy !== undefined ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined
|
|
412
|
+
});
|
|
413
|
+
const marshalUpgradeClusterRequest = (request, defaults) => ({
|
|
414
|
+
upgrade_pools: request.upgradePools,
|
|
415
|
+
version: request.version
|
|
416
|
+
});
|
|
417
|
+
const marshalUpgradePoolRequest = (request, defaults) => ({
|
|
418
|
+
version: request.version
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
export { marshalCreateClusterRequest, marshalCreatePoolRequest, marshalMigrateToPrivateNetworkClusterRequest, marshalSetClusterTypeRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalCluster, unmarshalExternalNode, unmarshalListClusterAvailableTypesResponse, unmarshalListClusterAvailableVersionsResponse, unmarshalListClusterTypesResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalPool, unmarshalVersion };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
+
|
|
4
|
+
const CreateClusterRequest = {
|
|
5
|
+
name: {
|
|
6
|
+
minLength: 1
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const CreateClusterRequestAutoscalerConfig = {
|
|
10
|
+
scaleDownUtilizationThreshold: {
|
|
11
|
+
greaterThan: 0,
|
|
12
|
+
lessThan: 1
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const CreateClusterRequestOpenIDConnectConfig = {
|
|
16
|
+
clientId: {
|
|
17
|
+
minLength: 1
|
|
18
|
+
},
|
|
19
|
+
groupsPrefix: {
|
|
20
|
+
minLength: 1
|
|
21
|
+
},
|
|
22
|
+
usernameClaim: {
|
|
23
|
+
minLength: 1
|
|
24
|
+
},
|
|
25
|
+
usernamePrefix: {
|
|
26
|
+
minLength: 1
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const CreateClusterRequestPoolConfig = {
|
|
30
|
+
name: {
|
|
31
|
+
minLength: 1
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const CreatePoolRequest = {
|
|
35
|
+
name: {
|
|
36
|
+
minLength: 1
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const ListClusterTypesRequest = {
|
|
40
|
+
page: {
|
|
41
|
+
greaterThan: 0
|
|
42
|
+
},
|
|
43
|
+
pageSize: {
|
|
44
|
+
greaterThan: 0,
|
|
45
|
+
lessThanOrEqual: 100
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const ListClustersRequest = {
|
|
49
|
+
name: {
|
|
50
|
+
minLength: 1
|
|
51
|
+
},
|
|
52
|
+
page: {
|
|
53
|
+
greaterThan: 0
|
|
54
|
+
},
|
|
55
|
+
pageSize: {
|
|
56
|
+
greaterThan: 0,
|
|
57
|
+
lessThanOrEqual: 100
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const ListNodesRequest = {
|
|
61
|
+
name: {
|
|
62
|
+
minLength: 1
|
|
63
|
+
},
|
|
64
|
+
page: {
|
|
65
|
+
greaterThan: 0
|
|
66
|
+
},
|
|
67
|
+
pageSize: {
|
|
68
|
+
greaterThan: 0,
|
|
69
|
+
lessThanOrEqual: 100
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const ListPoolsRequest = {
|
|
73
|
+
name: {
|
|
74
|
+
minLength: 1
|
|
75
|
+
},
|
|
76
|
+
page: {
|
|
77
|
+
greaterThan: 0
|
|
78
|
+
},
|
|
79
|
+
pageSize: {
|
|
80
|
+
greaterThan: 0,
|
|
81
|
+
lessThanOrEqual: 100
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const MaintenanceWindow = {
|
|
85
|
+
startHour: {
|
|
86
|
+
lessThanOrEqual: 23
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const UpdateClusterRequest = {
|
|
90
|
+
name: {
|
|
91
|
+
minLength: 1
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const UpdateClusterRequestAutoscalerConfig = {
|
|
95
|
+
scaleDownUtilizationThreshold: {
|
|
96
|
+
greaterThan: 0,
|
|
97
|
+
lessThan: 1
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { CreateClusterRequest, CreateClusterRequestAutoscalerConfig, CreateClusterRequestOpenIDConnectConfig, CreateClusterRequestPoolConfig, CreatePoolRequest, ListClusterTypesRequest, ListClustersRequest, ListNodesRequest, ListPoolsRequest, MaintenanceWindow, UpdateClusterRequest, UpdateClusterRequestAutoscalerConfig };
|