@scaleway/sdk-baremetal 1.2.0 → 2.1.1
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/README.md +96 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +39 -67
- package/dist/v1/content.gen.js +4 -1
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.js +18 -34
- package/dist/v1/types.gen.d.ts +26 -2
- package/dist/v3/api.gen.d.ts +1 -1
- package/dist/v3/api.gen.js +10 -21
- package/dist/v3/content.gen.js +4 -1
- package/dist/v3/index.gen.d.ts +1 -1
- package/dist/v3/marshalling.gen.js +2 -8
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -6
- package/dist/v1/api.gen.cjs +0 -600
- package/dist/v1/content.gen.cjs +0 -19
- package/dist/v1/index.gen.cjs +0 -43
- package/dist/v1/marshalling.gen.cjs +0 -725
- package/dist/v1/validation-rules.gen.cjs +0 -116
- package/dist/v3/api.gen.cjs +0 -104
- package/dist/v3/content.gen.cjs +0 -4
- package/dist/v3/index.gen.cjs +0 -12
- package/dist/v3/marshalling.gen.cjs +0 -60
|
@@ -1,725 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const sdkClient = require("@scaleway/sdk-client");
|
|
4
|
-
const unmarshalSchemaPartition = (data) => {
|
|
5
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
6
|
-
throw new TypeError(
|
|
7
|
-
`Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
label: data.label,
|
|
12
|
-
number: data.number,
|
|
13
|
-
size: data.size,
|
|
14
|
-
useAllAvailableSpace: data.use_all_available_space
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
const unmarshalSchemaPool = (data) => {
|
|
18
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
19
|
-
throw new TypeError(
|
|
20
|
-
`Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
devices: data.devices,
|
|
25
|
-
filesystemOptions: data.filesystem_options,
|
|
26
|
-
name: data.name,
|
|
27
|
-
options: data.options,
|
|
28
|
-
type: data.type
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const unmarshalSchemaDisk = (data) => {
|
|
32
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
33
|
-
throw new TypeError(
|
|
34
|
-
`Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
device: data.device,
|
|
39
|
-
partitions: sdkClient.unmarshalArrayOfObject(
|
|
40
|
-
data.partitions,
|
|
41
|
-
unmarshalSchemaPartition
|
|
42
|
-
)
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const unmarshalSchemaFilesystem = (data) => {
|
|
46
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
47
|
-
throw new TypeError(
|
|
48
|
-
`Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
device: data.device,
|
|
53
|
-
format: data.format,
|
|
54
|
-
mountpoint: data.mountpoint
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
const unmarshalSchemaRAID = (data) => {
|
|
58
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
59
|
-
throw new TypeError(
|
|
60
|
-
`Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
devices: data.devices,
|
|
65
|
-
level: data.level,
|
|
66
|
-
name: data.name
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
const unmarshalSchemaZFS = (data) => {
|
|
70
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
71
|
-
throw new TypeError(
|
|
72
|
-
`Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
pools: sdkClient.unmarshalArrayOfObject(data.pools, unmarshalSchemaPool)
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
const unmarshalSchema = (data) => {
|
|
80
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
81
|
-
throw new TypeError(
|
|
82
|
-
`Unmarshalling the type 'Schema' failed as data isn't a dictionary.`
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
|
|
87
|
-
filesystems: sdkClient.unmarshalArrayOfObject(
|
|
88
|
-
data.filesystems,
|
|
89
|
-
unmarshalSchemaFilesystem
|
|
90
|
-
),
|
|
91
|
-
raids: sdkClient.unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
|
|
92
|
-
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
const unmarshalIP = (data) => {
|
|
96
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
97
|
-
throw new TypeError(
|
|
98
|
-
`Unmarshalling the type 'IP' failed as data isn't a dictionary.`
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
address: data.address,
|
|
103
|
-
id: data.id,
|
|
104
|
-
reverse: data.reverse,
|
|
105
|
-
reverseStatus: data.reverse_status,
|
|
106
|
-
reverseStatusMessage: data.reverse_status_message,
|
|
107
|
-
version: data.version
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
const unmarshalCertificationOption = (data) => {
|
|
111
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
112
|
-
throw new TypeError(
|
|
113
|
-
`Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.`
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
return {};
|
|
117
|
-
};
|
|
118
|
-
const unmarshalLicenseOption = (data) => {
|
|
119
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
120
|
-
throw new TypeError(
|
|
121
|
-
`Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.`
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
osId: data.os_id
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
const unmarshalPrivateNetworkOption = (data) => {
|
|
129
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
130
|
-
throw new TypeError(
|
|
131
|
-
`Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
bandwidthInBps: data.bandwidth_in_bps
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
const unmarshalPublicBandwidthOption = (data) => {
|
|
139
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
140
|
-
throw new TypeError(
|
|
141
|
-
`Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
bandwidthInBps: data.bandwidth_in_bps
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
const unmarshalRemoteAccessOption = (data) => {
|
|
149
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
150
|
-
throw new TypeError(
|
|
151
|
-
`Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.`
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
return {};
|
|
155
|
-
};
|
|
156
|
-
const unmarshalServerInstall = (data) => {
|
|
157
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
158
|
-
throw new TypeError(
|
|
159
|
-
`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
hostname: data.hostname,
|
|
164
|
-
osId: data.os_id,
|
|
165
|
-
partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
|
|
166
|
-
serviceUrl: data.service_url,
|
|
167
|
-
serviceUser: data.service_user,
|
|
168
|
-
sshKeyIds: data.ssh_key_ids,
|
|
169
|
-
status: data.status,
|
|
170
|
-
user: data.user
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
const unmarshalServerOption = (data) => {
|
|
174
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
175
|
-
throw new TypeError(
|
|
176
|
-
`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
181
|
-
expiresAt: sdkClient.unmarshalDate(data.expires_at),
|
|
182
|
-
id: data.id,
|
|
183
|
-
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
184
|
-
manageable: data.manageable,
|
|
185
|
-
name: data.name,
|
|
186
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
187
|
-
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
188
|
-
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
|
|
189
|
-
status: data.status
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
const unmarshalServerRescueServer = (data) => {
|
|
193
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
194
|
-
throw new TypeError(
|
|
195
|
-
`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
return {
|
|
199
|
-
password: data.password,
|
|
200
|
-
user: data.user
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
const unmarshalServer = (data) => {
|
|
204
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
205
|
-
throw new TypeError(
|
|
206
|
-
`Unmarshalling the type 'Server' failed as data isn't a dictionary.`
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
return {
|
|
210
|
-
bootType: data.boot_type,
|
|
211
|
-
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
212
|
-
description: data.description,
|
|
213
|
-
domain: data.domain,
|
|
214
|
-
id: data.id,
|
|
215
|
-
install: data.install ? unmarshalServerInstall(data.install) : void 0,
|
|
216
|
-
ips: sdkClient.unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
217
|
-
name: data.name,
|
|
218
|
-
offerId: data.offer_id,
|
|
219
|
-
offerName: data.offer_name,
|
|
220
|
-
options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalServerOption),
|
|
221
|
-
organizationId: data.organization_id,
|
|
222
|
-
pingStatus: data.ping_status,
|
|
223
|
-
projectId: data.project_id,
|
|
224
|
-
protected: data.protected,
|
|
225
|
-
rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
|
|
226
|
-
status: data.status,
|
|
227
|
-
tags: data.tags,
|
|
228
|
-
updatedAt: sdkClient.unmarshalDate(data.updated_at),
|
|
229
|
-
zone: data.zone
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
const unmarshalOSOSField = (data) => {
|
|
233
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
234
|
-
throw new TypeError(
|
|
235
|
-
`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
return {
|
|
239
|
-
defaultValue: data.default_value,
|
|
240
|
-
editable: data.editable,
|
|
241
|
-
required: data.required
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
const unmarshalOS = (data) => {
|
|
245
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
246
|
-
throw new TypeError(
|
|
247
|
-
`Unmarshalling the type 'OS' failed as data isn't a dictionary.`
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
return {
|
|
251
|
-
allowed: data.allowed,
|
|
252
|
-
customPartitioningSupported: data.custom_partitioning_supported,
|
|
253
|
-
enabled: data.enabled,
|
|
254
|
-
id: data.id,
|
|
255
|
-
licenseRequired: data.license_required,
|
|
256
|
-
logoUrl: data.logo_url,
|
|
257
|
-
name: data.name,
|
|
258
|
-
password: data.password ? unmarshalOSOSField(data.password) : void 0,
|
|
259
|
-
servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
|
|
260
|
-
serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
|
|
261
|
-
ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
|
|
262
|
-
user: data.user ? unmarshalOSOSField(data.user) : void 0,
|
|
263
|
-
version: data.version,
|
|
264
|
-
zone: data.zone
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
const unmarshalCPU = (data) => {
|
|
268
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
269
|
-
throw new TypeError(
|
|
270
|
-
`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
return {
|
|
274
|
-
benchmark: data.benchmark,
|
|
275
|
-
coreCount: data.core_count,
|
|
276
|
-
frequency: data.frequency,
|
|
277
|
-
name: data.name,
|
|
278
|
-
threadCount: data.thread_count
|
|
279
|
-
};
|
|
280
|
-
};
|
|
281
|
-
const unmarshalDisk = (data) => {
|
|
282
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
283
|
-
throw new TypeError(
|
|
284
|
-
`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
return {
|
|
288
|
-
capacity: data.capacity,
|
|
289
|
-
type: data.type
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
const unmarshalGPU = (data) => {
|
|
293
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
294
|
-
throw new TypeError(
|
|
295
|
-
`Unmarshalling the type 'GPU' failed as data isn't a dictionary.`
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
return {
|
|
299
|
-
name: data.name,
|
|
300
|
-
vram: data.vram
|
|
301
|
-
};
|
|
302
|
-
};
|
|
303
|
-
const unmarshalMemory = (data) => {
|
|
304
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
305
|
-
throw new TypeError(
|
|
306
|
-
`Unmarshalling the type 'Memory' failed as data isn't a dictionary.`
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
return {
|
|
310
|
-
capacity: data.capacity,
|
|
311
|
-
frequency: data.frequency,
|
|
312
|
-
isEcc: data.is_ecc,
|
|
313
|
-
type: data.type
|
|
314
|
-
};
|
|
315
|
-
};
|
|
316
|
-
const unmarshalOfferOptionOffer = (data) => {
|
|
317
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
318
|
-
throw new TypeError(
|
|
319
|
-
`Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
return {
|
|
323
|
-
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
324
|
-
enabled: data.enabled,
|
|
325
|
-
id: data.id,
|
|
326
|
-
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
327
|
-
manageable: data.manageable,
|
|
328
|
-
name: data.name,
|
|
329
|
-
osId: data.os_id,
|
|
330
|
-
price: data.price ? sdkClient.unmarshalMoney(data.price) : void 0,
|
|
331
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
332
|
-
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
333
|
-
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
|
|
334
|
-
subscriptionPeriod: data.subscription_period
|
|
335
|
-
};
|
|
336
|
-
};
|
|
337
|
-
const unmarshalPersistentMemory = (data) => {
|
|
338
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
339
|
-
throw new TypeError(
|
|
340
|
-
`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
return {
|
|
344
|
-
capacity: data.capacity,
|
|
345
|
-
frequency: data.frequency,
|
|
346
|
-
type: data.type
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
const unmarshalRaidController = (data) => {
|
|
350
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
351
|
-
throw new TypeError(
|
|
352
|
-
`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
return {
|
|
356
|
-
model: data.model,
|
|
357
|
-
raidLevel: data.raid_level
|
|
358
|
-
};
|
|
359
|
-
};
|
|
360
|
-
const unmarshalOffer = (data) => {
|
|
361
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
362
|
-
throw new TypeError(
|
|
363
|
-
`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
return {
|
|
367
|
-
bandwidth: data.bandwidth,
|
|
368
|
-
commercialRange: data.commercial_range,
|
|
369
|
-
cpus: sdkClient.unmarshalArrayOfObject(data.cpus, unmarshalCPU),
|
|
370
|
-
disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalDisk),
|
|
371
|
-
enable: data.enable,
|
|
372
|
-
fee: data.fee ? sdkClient.unmarshalMoney(data.fee) : void 0,
|
|
373
|
-
gpus: sdkClient.unmarshalArrayOfObject(data.gpus, unmarshalGPU),
|
|
374
|
-
id: data.id,
|
|
375
|
-
incompatibleOsIds: data.incompatible_os_ids,
|
|
376
|
-
maxBandwidth: data.max_bandwidth,
|
|
377
|
-
memories: sdkClient.unmarshalArrayOfObject(data.memories, unmarshalMemory),
|
|
378
|
-
monthlyOfferId: data.monthly_offer_id,
|
|
379
|
-
name: data.name,
|
|
380
|
-
operationPath: data.operation_path,
|
|
381
|
-
options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),
|
|
382
|
-
persistentMemories: sdkClient.unmarshalArrayOfObject(
|
|
383
|
-
data.persistent_memories,
|
|
384
|
-
unmarshalPersistentMemory
|
|
385
|
-
),
|
|
386
|
-
pricePerHour: data.price_per_hour ? sdkClient.unmarshalMoney(data.price_per_hour) : void 0,
|
|
387
|
-
pricePerMonth: data.price_per_month ? sdkClient.unmarshalMoney(data.price_per_month) : void 0,
|
|
388
|
-
privateBandwidth: data.private_bandwidth,
|
|
389
|
-
quotaName: data.quota_name,
|
|
390
|
-
raidControllers: sdkClient.unmarshalArrayOfObject(
|
|
391
|
-
data.raid_controllers,
|
|
392
|
-
unmarshalRaidController
|
|
393
|
-
),
|
|
394
|
-
sharedBandwidth: data.shared_bandwidth,
|
|
395
|
-
stock: data.stock,
|
|
396
|
-
subscriptionPeriod: data.subscription_period,
|
|
397
|
-
tags: data.tags,
|
|
398
|
-
zone: data.zone
|
|
399
|
-
};
|
|
400
|
-
};
|
|
401
|
-
const unmarshalOption = (data) => {
|
|
402
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
403
|
-
throw new TypeError(
|
|
404
|
-
`Unmarshalling the type 'Option' failed as data isn't a dictionary.`
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
return {
|
|
408
|
-
certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
|
|
409
|
-
id: data.id,
|
|
410
|
-
license: data.license ? unmarshalLicenseOption(data.license) : void 0,
|
|
411
|
-
manageable: data.manageable,
|
|
412
|
-
name: data.name,
|
|
413
|
-
privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
|
|
414
|
-
publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
|
|
415
|
-
remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0
|
|
416
|
-
};
|
|
417
|
-
};
|
|
418
|
-
const unmarshalServerPrivateNetwork = (data) => {
|
|
419
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
420
|
-
throw new TypeError(
|
|
421
|
-
`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
return {
|
|
425
|
-
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
426
|
-
id: data.id,
|
|
427
|
-
privateNetworkId: data.private_network_id,
|
|
428
|
-
projectId: data.project_id,
|
|
429
|
-
serverId: data.server_id,
|
|
430
|
-
status: data.status,
|
|
431
|
-
updatedAt: sdkClient.unmarshalDate(data.updated_at),
|
|
432
|
-
vlan: data.vlan
|
|
433
|
-
};
|
|
434
|
-
};
|
|
435
|
-
const unmarshalSetting = (data) => {
|
|
436
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
437
|
-
throw new TypeError(
|
|
438
|
-
`Unmarshalling the type 'Setting' failed as data isn't a dictionary.`
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
return {
|
|
442
|
-
enabled: data.enabled,
|
|
443
|
-
id: data.id,
|
|
444
|
-
projectId: data.project_id,
|
|
445
|
-
type: data.type
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
const unmarshalBMCAccess = (data) => {
|
|
449
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
450
|
-
throw new TypeError(
|
|
451
|
-
`Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
return {
|
|
455
|
-
expiresAt: sdkClient.unmarshalDate(data.expires_at),
|
|
456
|
-
login: data.login,
|
|
457
|
-
password: data.password,
|
|
458
|
-
url: data.url
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
|
-
const unmarshalGetServerMetricsResponse = (data) => {
|
|
462
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
463
|
-
throw new TypeError(
|
|
464
|
-
`Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`
|
|
465
|
-
);
|
|
466
|
-
}
|
|
467
|
-
return {
|
|
468
|
-
pings: data.pings ? sdkClient.unmarshalTimeSeries(data.pings) : void 0
|
|
469
|
-
};
|
|
470
|
-
};
|
|
471
|
-
const unmarshalListOSResponse = (data) => {
|
|
472
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
473
|
-
throw new TypeError(
|
|
474
|
-
`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
return {
|
|
478
|
-
os: sdkClient.unmarshalArrayOfObject(data.os, unmarshalOS),
|
|
479
|
-
totalCount: data.total_count
|
|
480
|
-
};
|
|
481
|
-
};
|
|
482
|
-
const unmarshalListOffersResponse = (data) => {
|
|
483
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
484
|
-
throw new TypeError(
|
|
485
|
-
`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
return {
|
|
489
|
-
offers: sdkClient.unmarshalArrayOfObject(data.offers, unmarshalOffer),
|
|
490
|
-
totalCount: data.total_count
|
|
491
|
-
};
|
|
492
|
-
};
|
|
493
|
-
const unmarshalListOptionsResponse = (data) => {
|
|
494
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
495
|
-
throw new TypeError(
|
|
496
|
-
`Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`
|
|
497
|
-
);
|
|
498
|
-
}
|
|
499
|
-
return {
|
|
500
|
-
options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalOption),
|
|
501
|
-
totalCount: data.total_count
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
const unmarshalServerEvent = (data) => {
|
|
505
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
506
|
-
throw new TypeError(
|
|
507
|
-
`Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
return {
|
|
511
|
-
action: data.action,
|
|
512
|
-
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
513
|
-
id: data.id,
|
|
514
|
-
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
515
|
-
};
|
|
516
|
-
};
|
|
517
|
-
const unmarshalListServerEventsResponse = (data) => {
|
|
518
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
519
|
-
throw new TypeError(
|
|
520
|
-
`Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`
|
|
521
|
-
);
|
|
522
|
-
}
|
|
523
|
-
return {
|
|
524
|
-
events: sdkClient.unmarshalArrayOfObject(data.events, unmarshalServerEvent),
|
|
525
|
-
totalCount: data.total_count
|
|
526
|
-
};
|
|
527
|
-
};
|
|
528
|
-
const unmarshalListServerPrivateNetworksResponse = (data) => {
|
|
529
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
530
|
-
throw new TypeError(
|
|
531
|
-
`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
return {
|
|
535
|
-
serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
|
|
536
|
-
data.server_private_networks,
|
|
537
|
-
unmarshalServerPrivateNetwork
|
|
538
|
-
),
|
|
539
|
-
totalCount: data.total_count
|
|
540
|
-
};
|
|
541
|
-
};
|
|
542
|
-
const unmarshalListServersResponse = (data) => {
|
|
543
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
544
|
-
throw new TypeError(
|
|
545
|
-
`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
|
|
546
|
-
);
|
|
547
|
-
}
|
|
548
|
-
return {
|
|
549
|
-
servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer),
|
|
550
|
-
totalCount: data.total_count
|
|
551
|
-
};
|
|
552
|
-
};
|
|
553
|
-
const unmarshalListSettingsResponse = (data) => {
|
|
554
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
555
|
-
throw new TypeError(
|
|
556
|
-
`Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`
|
|
557
|
-
);
|
|
558
|
-
}
|
|
559
|
-
return {
|
|
560
|
-
settings: sdkClient.unmarshalArrayOfObject(data.settings, unmarshalSetting),
|
|
561
|
-
totalCount: data.total_count
|
|
562
|
-
};
|
|
563
|
-
};
|
|
564
|
-
const unmarshalSetServerPrivateNetworksResponse = (data) => {
|
|
565
|
-
if (!sdkClient.isJSONObject(data)) {
|
|
566
|
-
throw new TypeError(
|
|
567
|
-
`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
return {
|
|
571
|
-
serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
|
|
572
|
-
data.server_private_networks,
|
|
573
|
-
unmarshalServerPrivateNetwork
|
|
574
|
-
)
|
|
575
|
-
};
|
|
576
|
-
};
|
|
577
|
-
const marshalSchemaPartition = (request, defaults) => ({
|
|
578
|
-
label: request.label,
|
|
579
|
-
number: request.number,
|
|
580
|
-
size: request.size,
|
|
581
|
-
use_all_available_space: request.useAllAvailableSpace
|
|
582
|
-
});
|
|
583
|
-
const marshalSchemaPool = (request, defaults) => ({
|
|
584
|
-
devices: request.devices,
|
|
585
|
-
filesystem_options: request.filesystemOptions,
|
|
586
|
-
name: request.name,
|
|
587
|
-
options: request.options,
|
|
588
|
-
type: request.type
|
|
589
|
-
});
|
|
590
|
-
const marshalSchemaDisk = (request, defaults) => ({
|
|
591
|
-
device: request.device,
|
|
592
|
-
partitions: request.partitions.map(
|
|
593
|
-
(elt) => marshalSchemaPartition(elt)
|
|
594
|
-
)
|
|
595
|
-
});
|
|
596
|
-
const marshalSchemaFilesystem = (request, defaults) => ({
|
|
597
|
-
device: request.device,
|
|
598
|
-
format: request.format,
|
|
599
|
-
mountpoint: request.mountpoint
|
|
600
|
-
});
|
|
601
|
-
const marshalSchemaRAID = (request, defaults) => ({
|
|
602
|
-
devices: request.devices,
|
|
603
|
-
level: request.level,
|
|
604
|
-
name: request.name
|
|
605
|
-
});
|
|
606
|
-
const marshalSchemaZFS = (request, defaults) => ({
|
|
607
|
-
pools: request.pools.map((elt) => marshalSchemaPool(elt))
|
|
608
|
-
});
|
|
609
|
-
const marshalSchema = (request, defaults) => ({
|
|
610
|
-
disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
|
|
611
|
-
filesystems: request.filesystems.map(
|
|
612
|
-
(elt) => marshalSchemaFilesystem(elt)
|
|
613
|
-
),
|
|
614
|
-
raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
|
|
615
|
-
zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
|
|
616
|
-
});
|
|
617
|
-
const marshalCreateServerRequestInstall = (request, defaults) => ({
|
|
618
|
-
hostname: request.hostname,
|
|
619
|
-
os_id: request.osId,
|
|
620
|
-
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
|
|
621
|
-
password: request.password,
|
|
622
|
-
service_password: request.servicePassword,
|
|
623
|
-
service_user: request.serviceUser,
|
|
624
|
-
ssh_key_ids: request.sshKeyIds,
|
|
625
|
-
user: request.user
|
|
626
|
-
});
|
|
627
|
-
const marshalCreateServerRequest = (request, defaults) => ({
|
|
628
|
-
description: request.description,
|
|
629
|
-
install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install) : void 0,
|
|
630
|
-
name: request.name,
|
|
631
|
-
offer_id: request.offerId,
|
|
632
|
-
option_ids: request.optionIds,
|
|
633
|
-
protected: request.protected,
|
|
634
|
-
tags: request.tags,
|
|
635
|
-
...sdkClient.resolveOneOf([
|
|
636
|
-
{
|
|
637
|
-
default: defaults.defaultProjectId,
|
|
638
|
-
param: "project_id",
|
|
639
|
-
value: request.projectId
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
default: defaults.defaultOrganizationId,
|
|
643
|
-
param: "organization_id",
|
|
644
|
-
value: request.organizationId
|
|
645
|
-
}
|
|
646
|
-
])
|
|
647
|
-
});
|
|
648
|
-
const marshalAddOptionServerRequest = (request, defaults) => ({
|
|
649
|
-
expires_at: request.expiresAt
|
|
650
|
-
});
|
|
651
|
-
const marshalInstallServerRequest = (request, defaults) => ({
|
|
652
|
-
hostname: request.hostname,
|
|
653
|
-
os_id: request.osId,
|
|
654
|
-
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
|
|
655
|
-
password: request.password,
|
|
656
|
-
service_password: request.servicePassword,
|
|
657
|
-
service_user: request.serviceUser,
|
|
658
|
-
ssh_key_ids: request.sshKeyIds,
|
|
659
|
-
user: request.user
|
|
660
|
-
});
|
|
661
|
-
const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
|
|
662
|
-
private_network_id: request.privateNetworkId
|
|
663
|
-
});
|
|
664
|
-
const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
|
|
665
|
-
private_network_ids: request.privateNetworkIds
|
|
666
|
-
});
|
|
667
|
-
const marshalRebootServerRequest = (request, defaults) => ({
|
|
668
|
-
boot_type: request.bootType,
|
|
669
|
-
ssh_key_ids: request.sshKeyIds
|
|
670
|
-
});
|
|
671
|
-
const marshalStartBMCAccessRequest = (request, defaults) => ({
|
|
672
|
-
ip: request.ip
|
|
673
|
-
});
|
|
674
|
-
const marshalStartServerRequest = (request, defaults) => ({
|
|
675
|
-
boot_type: request.bootType,
|
|
676
|
-
ssh_key_ids: request.sshKeyIds
|
|
677
|
-
});
|
|
678
|
-
const marshalUpdateIPRequest = (request, defaults) => ({
|
|
679
|
-
reverse: request.reverse
|
|
680
|
-
});
|
|
681
|
-
const marshalUpdateServerRequest = (request, defaults) => ({
|
|
682
|
-
description: request.description,
|
|
683
|
-
name: request.name,
|
|
684
|
-
protected: request.protected,
|
|
685
|
-
tags: request.tags
|
|
686
|
-
});
|
|
687
|
-
const marshalUpdateSettingRequest = (request, defaults) => ({
|
|
688
|
-
enabled: request.enabled
|
|
689
|
-
});
|
|
690
|
-
const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
|
|
691
|
-
offer_id: request.offerId,
|
|
692
|
-
os_id: request.osId,
|
|
693
|
-
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0
|
|
694
|
-
});
|
|
695
|
-
exports.marshalAddOptionServerRequest = marshalAddOptionServerRequest;
|
|
696
|
-
exports.marshalCreateServerRequest = marshalCreateServerRequest;
|
|
697
|
-
exports.marshalInstallServerRequest = marshalInstallServerRequest;
|
|
698
|
-
exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
|
|
699
|
-
exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
|
|
700
|
-
exports.marshalRebootServerRequest = marshalRebootServerRequest;
|
|
701
|
-
exports.marshalSchema = marshalSchema;
|
|
702
|
-
exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;
|
|
703
|
-
exports.marshalStartServerRequest = marshalStartServerRequest;
|
|
704
|
-
exports.marshalUpdateIPRequest = marshalUpdateIPRequest;
|
|
705
|
-
exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
|
|
706
|
-
exports.marshalUpdateSettingRequest = marshalUpdateSettingRequest;
|
|
707
|
-
exports.marshalValidatePartitioningSchemaRequest = marshalValidatePartitioningSchemaRequest;
|
|
708
|
-
exports.unmarshalBMCAccess = unmarshalBMCAccess;
|
|
709
|
-
exports.unmarshalGetServerMetricsResponse = unmarshalGetServerMetricsResponse;
|
|
710
|
-
exports.unmarshalIP = unmarshalIP;
|
|
711
|
-
exports.unmarshalListOSResponse = unmarshalListOSResponse;
|
|
712
|
-
exports.unmarshalListOffersResponse = unmarshalListOffersResponse;
|
|
713
|
-
exports.unmarshalListOptionsResponse = unmarshalListOptionsResponse;
|
|
714
|
-
exports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse;
|
|
715
|
-
exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;
|
|
716
|
-
exports.unmarshalListServersResponse = unmarshalListServersResponse;
|
|
717
|
-
exports.unmarshalListSettingsResponse = unmarshalListSettingsResponse;
|
|
718
|
-
exports.unmarshalOS = unmarshalOS;
|
|
719
|
-
exports.unmarshalOffer = unmarshalOffer;
|
|
720
|
-
exports.unmarshalOption = unmarshalOption;
|
|
721
|
-
exports.unmarshalSchema = unmarshalSchema;
|
|
722
|
-
exports.unmarshalServer = unmarshalServer;
|
|
723
|
-
exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;
|
|
724
|
-
exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;
|
|
725
|
-
exports.unmarshalSetting = unmarshalSetting;
|