@scaleway/sdk-baremetal 1.3.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.
@@ -1,731 +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
- userData: data.user_data,
230
- zone: data.zone
231
- };
232
- };
233
- const unmarshalOSOSField = (data) => {
234
- if (!sdkClient.isJSONObject(data)) {
235
- throw new TypeError(
236
- `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
237
- );
238
- }
239
- return {
240
- defaultValue: data.default_value,
241
- editable: data.editable,
242
- required: data.required
243
- };
244
- };
245
- const unmarshalOS = (data) => {
246
- if (!sdkClient.isJSONObject(data)) {
247
- throw new TypeError(
248
- `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
249
- );
250
- }
251
- return {
252
- allowed: data.allowed,
253
- cloudInitSupported: data.cloud_init_supported,
254
- cloudInitVersion: data.cloud_init_version,
255
- customPartitioningSupported: data.custom_partitioning_supported,
256
- enabled: data.enabled,
257
- id: data.id,
258
- licenseRequired: data.license_required,
259
- logoUrl: data.logo_url,
260
- name: data.name,
261
- password: data.password ? unmarshalOSOSField(data.password) : void 0,
262
- servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
263
- serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
264
- ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
265
- user: data.user ? unmarshalOSOSField(data.user) : void 0,
266
- version: data.version,
267
- zone: data.zone
268
- };
269
- };
270
- const unmarshalCPU = (data) => {
271
- if (!sdkClient.isJSONObject(data)) {
272
- throw new TypeError(
273
- `Unmarshalling the type 'CPU' failed as data isn't a dictionary.`
274
- );
275
- }
276
- return {
277
- benchmark: data.benchmark,
278
- coreCount: data.core_count,
279
- frequency: data.frequency,
280
- name: data.name,
281
- threadCount: data.thread_count
282
- };
283
- };
284
- const unmarshalDisk = (data) => {
285
- if (!sdkClient.isJSONObject(data)) {
286
- throw new TypeError(
287
- `Unmarshalling the type 'Disk' failed as data isn't a dictionary.`
288
- );
289
- }
290
- return {
291
- capacity: data.capacity,
292
- type: data.type
293
- };
294
- };
295
- const unmarshalGPU = (data) => {
296
- if (!sdkClient.isJSONObject(data)) {
297
- throw new TypeError(
298
- `Unmarshalling the type 'GPU' failed as data isn't a dictionary.`
299
- );
300
- }
301
- return {
302
- name: data.name,
303
- vram: data.vram
304
- };
305
- };
306
- const unmarshalMemory = (data) => {
307
- if (!sdkClient.isJSONObject(data)) {
308
- throw new TypeError(
309
- `Unmarshalling the type 'Memory' failed as data isn't a dictionary.`
310
- );
311
- }
312
- return {
313
- capacity: data.capacity,
314
- frequency: data.frequency,
315
- isEcc: data.is_ecc,
316
- type: data.type
317
- };
318
- };
319
- const unmarshalOfferOptionOffer = (data) => {
320
- if (!sdkClient.isJSONObject(data)) {
321
- throw new TypeError(
322
- `Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`
323
- );
324
- }
325
- return {
326
- certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
327
- enabled: data.enabled,
328
- id: data.id,
329
- license: data.license ? unmarshalLicenseOption(data.license) : void 0,
330
- manageable: data.manageable,
331
- name: data.name,
332
- osId: data.os_id,
333
- price: data.price ? sdkClient.unmarshalMoney(data.price) : void 0,
334
- privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
335
- publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
336
- remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
337
- subscriptionPeriod: data.subscription_period
338
- };
339
- };
340
- const unmarshalPersistentMemory = (data) => {
341
- if (!sdkClient.isJSONObject(data)) {
342
- throw new TypeError(
343
- `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`
344
- );
345
- }
346
- return {
347
- capacity: data.capacity,
348
- frequency: data.frequency,
349
- type: data.type
350
- };
351
- };
352
- const unmarshalRaidController = (data) => {
353
- if (!sdkClient.isJSONObject(data)) {
354
- throw new TypeError(
355
- `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`
356
- );
357
- }
358
- return {
359
- model: data.model,
360
- raidLevel: data.raid_level
361
- };
362
- };
363
- const unmarshalOffer = (data) => {
364
- if (!sdkClient.isJSONObject(data)) {
365
- throw new TypeError(
366
- `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
367
- );
368
- }
369
- return {
370
- bandwidth: data.bandwidth,
371
- commercialRange: data.commercial_range,
372
- cpus: sdkClient.unmarshalArrayOfObject(data.cpus, unmarshalCPU),
373
- disks: sdkClient.unmarshalArrayOfObject(data.disks, unmarshalDisk),
374
- enable: data.enable,
375
- fee: data.fee ? sdkClient.unmarshalMoney(data.fee) : void 0,
376
- gpus: sdkClient.unmarshalArrayOfObject(data.gpus, unmarshalGPU),
377
- id: data.id,
378
- incompatibleOsIds: data.incompatible_os_ids,
379
- maxBandwidth: data.max_bandwidth,
380
- memories: sdkClient.unmarshalArrayOfObject(data.memories, unmarshalMemory),
381
- monthlyOfferId: data.monthly_offer_id,
382
- name: data.name,
383
- operationPath: data.operation_path,
384
- options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),
385
- persistentMemories: sdkClient.unmarshalArrayOfObject(
386
- data.persistent_memories,
387
- unmarshalPersistentMemory
388
- ),
389
- pricePerHour: data.price_per_hour ? sdkClient.unmarshalMoney(data.price_per_hour) : void 0,
390
- pricePerMonth: data.price_per_month ? sdkClient.unmarshalMoney(data.price_per_month) : void 0,
391
- privateBandwidth: data.private_bandwidth,
392
- quotaName: data.quota_name,
393
- raidControllers: sdkClient.unmarshalArrayOfObject(
394
- data.raid_controllers,
395
- unmarshalRaidController
396
- ),
397
- sharedBandwidth: data.shared_bandwidth,
398
- stock: data.stock,
399
- subscriptionPeriod: data.subscription_period,
400
- tags: data.tags,
401
- zone: data.zone
402
- };
403
- };
404
- const unmarshalOption = (data) => {
405
- if (!sdkClient.isJSONObject(data)) {
406
- throw new TypeError(
407
- `Unmarshalling the type 'Option' failed as data isn't a dictionary.`
408
- );
409
- }
410
- return {
411
- certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
412
- id: data.id,
413
- license: data.license ? unmarshalLicenseOption(data.license) : void 0,
414
- manageable: data.manageable,
415
- name: data.name,
416
- privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
417
- publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
418
- remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0
419
- };
420
- };
421
- const unmarshalServerPrivateNetwork = (data) => {
422
- if (!sdkClient.isJSONObject(data)) {
423
- throw new TypeError(
424
- `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
425
- );
426
- }
427
- return {
428
- createdAt: sdkClient.unmarshalDate(data.created_at),
429
- id: data.id,
430
- privateNetworkId: data.private_network_id,
431
- projectId: data.project_id,
432
- serverId: data.server_id,
433
- status: data.status,
434
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
435
- vlan: data.vlan
436
- };
437
- };
438
- const unmarshalSetting = (data) => {
439
- if (!sdkClient.isJSONObject(data)) {
440
- throw new TypeError(
441
- `Unmarshalling the type 'Setting' failed as data isn't a dictionary.`
442
- );
443
- }
444
- return {
445
- enabled: data.enabled,
446
- id: data.id,
447
- projectId: data.project_id,
448
- type: data.type
449
- };
450
- };
451
- const unmarshalBMCAccess = (data) => {
452
- if (!sdkClient.isJSONObject(data)) {
453
- throw new TypeError(
454
- `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`
455
- );
456
- }
457
- return {
458
- expiresAt: sdkClient.unmarshalDate(data.expires_at),
459
- login: data.login,
460
- password: data.password,
461
- url: data.url
462
- };
463
- };
464
- const unmarshalGetServerMetricsResponse = (data) => {
465
- if (!sdkClient.isJSONObject(data)) {
466
- throw new TypeError(
467
- `Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`
468
- );
469
- }
470
- return {
471
- pings: data.pings ? sdkClient.unmarshalTimeSeries(data.pings) : void 0
472
- };
473
- };
474
- const unmarshalListOSResponse = (data) => {
475
- if (!sdkClient.isJSONObject(data)) {
476
- throw new TypeError(
477
- `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`
478
- );
479
- }
480
- return {
481
- os: sdkClient.unmarshalArrayOfObject(data.os, unmarshalOS),
482
- totalCount: data.total_count
483
- };
484
- };
485
- const unmarshalListOffersResponse = (data) => {
486
- if (!sdkClient.isJSONObject(data)) {
487
- throw new TypeError(
488
- `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
489
- );
490
- }
491
- return {
492
- offers: sdkClient.unmarshalArrayOfObject(data.offers, unmarshalOffer),
493
- totalCount: data.total_count
494
- };
495
- };
496
- const unmarshalListOptionsResponse = (data) => {
497
- if (!sdkClient.isJSONObject(data)) {
498
- throw new TypeError(
499
- `Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`
500
- );
501
- }
502
- return {
503
- options: sdkClient.unmarshalArrayOfObject(data.options, unmarshalOption),
504
- totalCount: data.total_count
505
- };
506
- };
507
- const unmarshalServerEvent = (data) => {
508
- if (!sdkClient.isJSONObject(data)) {
509
- throw new TypeError(
510
- `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`
511
- );
512
- }
513
- return {
514
- action: data.action,
515
- createdAt: sdkClient.unmarshalDate(data.created_at),
516
- id: data.id,
517
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
518
- };
519
- };
520
- const unmarshalListServerEventsResponse = (data) => {
521
- if (!sdkClient.isJSONObject(data)) {
522
- throw new TypeError(
523
- `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`
524
- );
525
- }
526
- return {
527
- events: sdkClient.unmarshalArrayOfObject(data.events, unmarshalServerEvent),
528
- totalCount: data.total_count
529
- };
530
- };
531
- const unmarshalListServerPrivateNetworksResponse = (data) => {
532
- if (!sdkClient.isJSONObject(data)) {
533
- throw new TypeError(
534
- `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
535
- );
536
- }
537
- return {
538
- serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
539
- data.server_private_networks,
540
- unmarshalServerPrivateNetwork
541
- ),
542
- totalCount: data.total_count
543
- };
544
- };
545
- const unmarshalListServersResponse = (data) => {
546
- if (!sdkClient.isJSONObject(data)) {
547
- throw new TypeError(
548
- `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`
549
- );
550
- }
551
- return {
552
- servers: sdkClient.unmarshalArrayOfObject(data.servers, unmarshalServer),
553
- totalCount: data.total_count
554
- };
555
- };
556
- const unmarshalListSettingsResponse = (data) => {
557
- if (!sdkClient.isJSONObject(data)) {
558
- throw new TypeError(
559
- `Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`
560
- );
561
- }
562
- return {
563
- settings: sdkClient.unmarshalArrayOfObject(data.settings, unmarshalSetting),
564
- totalCount: data.total_count
565
- };
566
- };
567
- const unmarshalSetServerPrivateNetworksResponse = (data) => {
568
- if (!sdkClient.isJSONObject(data)) {
569
- throw new TypeError(
570
- `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
571
- );
572
- }
573
- return {
574
- serverPrivateNetworks: sdkClient.unmarshalArrayOfObject(
575
- data.server_private_networks,
576
- unmarshalServerPrivateNetwork
577
- )
578
- };
579
- };
580
- const marshalSchemaPartition = (request, defaults) => ({
581
- label: request.label,
582
- number: request.number,
583
- size: request.size,
584
- use_all_available_space: request.useAllAvailableSpace
585
- });
586
- const marshalSchemaPool = (request, defaults) => ({
587
- devices: request.devices,
588
- filesystem_options: request.filesystemOptions,
589
- name: request.name,
590
- options: request.options,
591
- type: request.type
592
- });
593
- const marshalSchemaDisk = (request, defaults) => ({
594
- device: request.device,
595
- partitions: request.partitions.map(
596
- (elt) => marshalSchemaPartition(elt)
597
- )
598
- });
599
- const marshalSchemaFilesystem = (request, defaults) => ({
600
- device: request.device,
601
- format: request.format,
602
- mountpoint: request.mountpoint
603
- });
604
- const marshalSchemaRAID = (request, defaults) => ({
605
- devices: request.devices,
606
- level: request.level,
607
- name: request.name
608
- });
609
- const marshalSchemaZFS = (request, defaults) => ({
610
- pools: request.pools.map((elt) => marshalSchemaPool(elt))
611
- });
612
- const marshalSchema = (request, defaults) => ({
613
- disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
614
- filesystems: request.filesystems.map(
615
- (elt) => marshalSchemaFilesystem(elt)
616
- ),
617
- raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
618
- zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
619
- });
620
- const marshalCreateServerRequestInstall = (request, defaults) => ({
621
- hostname: request.hostname,
622
- os_id: request.osId,
623
- partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
624
- password: request.password,
625
- service_password: request.servicePassword,
626
- service_user: request.serviceUser,
627
- ssh_key_ids: request.sshKeyIds,
628
- user: request.user
629
- });
630
- const marshalCreateServerRequest = (request, defaults) => ({
631
- description: request.description,
632
- install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install) : void 0,
633
- name: request.name,
634
- offer_id: request.offerId,
635
- option_ids: request.optionIds,
636
- protected: request.protected,
637
- tags: request.tags,
638
- user_data: request.userData,
639
- ...sdkClient.resolveOneOf([
640
- {
641
- default: defaults.defaultProjectId,
642
- param: "project_id",
643
- value: request.projectId
644
- },
645
- {
646
- default: defaults.defaultOrganizationId,
647
- param: "organization_id",
648
- value: request.organizationId
649
- }
650
- ])
651
- });
652
- const marshalAddOptionServerRequest = (request, defaults) => ({
653
- expires_at: request.expiresAt
654
- });
655
- const marshalInstallServerRequest = async (request, defaults) => ({
656
- hostname: request.hostname,
657
- os_id: request.osId,
658
- partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
659
- password: request.password,
660
- service_password: request.servicePassword,
661
- service_user: request.serviceUser,
662
- ssh_key_ids: request.sshKeyIds,
663
- user: request.user,
664
- user_data: request.userData !== void 0 ? await sdkClient.marshalBlobToScwFile(request.userData) : void 0
665
- });
666
- const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
667
- private_network_id: request.privateNetworkId
668
- });
669
- const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
670
- private_network_ids: request.privateNetworkIds
671
- });
672
- const marshalRebootServerRequest = (request, defaults) => ({
673
- boot_type: request.bootType,
674
- ssh_key_ids: request.sshKeyIds
675
- });
676
- const marshalStartBMCAccessRequest = (request, defaults) => ({
677
- ip: request.ip
678
- });
679
- const marshalStartServerRequest = (request, defaults) => ({
680
- boot_type: request.bootType,
681
- ssh_key_ids: request.sshKeyIds
682
- });
683
- const marshalUpdateIPRequest = (request, defaults) => ({
684
- reverse: request.reverse
685
- });
686
- const marshalUpdateServerRequest = (request, defaults) => ({
687
- description: request.description,
688
- name: request.name,
689
- protected: request.protected,
690
- tags: request.tags,
691
- user_data: request.userData
692
- });
693
- const marshalUpdateSettingRequest = (request, defaults) => ({
694
- enabled: request.enabled
695
- });
696
- const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
697
- offer_id: request.offerId,
698
- os_id: request.osId,
699
- partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0
700
- });
701
- exports.marshalAddOptionServerRequest = marshalAddOptionServerRequest;
702
- exports.marshalCreateServerRequest = marshalCreateServerRequest;
703
- exports.marshalInstallServerRequest = marshalInstallServerRequest;
704
- exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
705
- exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
706
- exports.marshalRebootServerRequest = marshalRebootServerRequest;
707
- exports.marshalSchema = marshalSchema;
708
- exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;
709
- exports.marshalStartServerRequest = marshalStartServerRequest;
710
- exports.marshalUpdateIPRequest = marshalUpdateIPRequest;
711
- exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
712
- exports.marshalUpdateSettingRequest = marshalUpdateSettingRequest;
713
- exports.marshalValidatePartitioningSchemaRequest = marshalValidatePartitioningSchemaRequest;
714
- exports.unmarshalBMCAccess = unmarshalBMCAccess;
715
- exports.unmarshalGetServerMetricsResponse = unmarshalGetServerMetricsResponse;
716
- exports.unmarshalIP = unmarshalIP;
717
- exports.unmarshalListOSResponse = unmarshalListOSResponse;
718
- exports.unmarshalListOffersResponse = unmarshalListOffersResponse;
719
- exports.unmarshalListOptionsResponse = unmarshalListOptionsResponse;
720
- exports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse;
721
- exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;
722
- exports.unmarshalListServersResponse = unmarshalListServersResponse;
723
- exports.unmarshalListSettingsResponse = unmarshalListSettingsResponse;
724
- exports.unmarshalOS = unmarshalOS;
725
- exports.unmarshalOffer = unmarshalOffer;
726
- exports.unmarshalOption = unmarshalOption;
727
- exports.unmarshalSchema = unmarshalSchema;
728
- exports.unmarshalServer = unmarshalServer;
729
- exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;
730
- exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;
731
- exports.unmarshalSetting = unmarshalSetting;