@scaleway/sdk-baremetal 1.0.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,40 +105,6 @@ const unmarshalIP = (data) => {
105
105
  version: data.version
106
106
  };
107
107
  };
108
- const unmarshalOSOSField = (data) => {
109
- if (!isJSONObject(data)) {
110
- throw new TypeError(
111
- `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
112
- );
113
- }
114
- return {
115
- defaultValue: data.default_value,
116
- editable: data.editable,
117
- required: data.required
118
- };
119
- };
120
- const unmarshalOS = (data) => {
121
- if (!isJSONObject(data)) {
122
- throw new TypeError(
123
- `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
124
- );
125
- }
126
- return {
127
- allowed: data.allowed,
128
- customPartitioningSupported: data.custom_partitioning_supported,
129
- enabled: data.enabled,
130
- id: data.id,
131
- licenseRequired: data.license_required,
132
- logoUrl: data.logo_url,
133
- name: data.name,
134
- password: data.password ? unmarshalOSOSField(data.password) : void 0,
135
- servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
136
- serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
137
- ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
138
- user: data.user ? unmarshalOSOSField(data.user) : void 0,
139
- version: data.version
140
- };
141
- };
142
108
  const unmarshalCertificationOption = (data) => {
143
109
  if (!isJSONObject(data)) {
144
110
  throw new TypeError(
@@ -185,6 +151,117 @@ const unmarshalRemoteAccessOption = (data) => {
185
151
  }
186
152
  return {};
187
153
  };
154
+ const unmarshalServerInstall = (data) => {
155
+ if (!isJSONObject(data)) {
156
+ throw new TypeError(
157
+ `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
158
+ );
159
+ }
160
+ return {
161
+ hostname: data.hostname,
162
+ osId: data.os_id,
163
+ partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
164
+ serviceUrl: data.service_url,
165
+ serviceUser: data.service_user,
166
+ sshKeyIds: data.ssh_key_ids,
167
+ status: data.status,
168
+ user: data.user
169
+ };
170
+ };
171
+ const unmarshalServerOption = (data) => {
172
+ if (!isJSONObject(data)) {
173
+ throw new TypeError(
174
+ `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
175
+ );
176
+ }
177
+ return {
178
+ certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
179
+ expiresAt: unmarshalDate(data.expires_at),
180
+ id: data.id,
181
+ license: data.license ? unmarshalLicenseOption(data.license) : void 0,
182
+ manageable: data.manageable,
183
+ name: data.name,
184
+ privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
185
+ publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
186
+ remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
187
+ status: data.status
188
+ };
189
+ };
190
+ const unmarshalServerRescueServer = (data) => {
191
+ if (!isJSONObject(data)) {
192
+ throw new TypeError(
193
+ `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
194
+ );
195
+ }
196
+ return {
197
+ password: data.password,
198
+ user: data.user
199
+ };
200
+ };
201
+ const unmarshalServer = (data) => {
202
+ if (!isJSONObject(data)) {
203
+ throw new TypeError(
204
+ `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
205
+ );
206
+ }
207
+ return {
208
+ bootType: data.boot_type,
209
+ createdAt: unmarshalDate(data.created_at),
210
+ description: data.description,
211
+ domain: data.domain,
212
+ id: data.id,
213
+ install: data.install ? unmarshalServerInstall(data.install) : void 0,
214
+ ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
215
+ name: data.name,
216
+ offerId: data.offer_id,
217
+ offerName: data.offer_name,
218
+ options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
219
+ organizationId: data.organization_id,
220
+ pingStatus: data.ping_status,
221
+ projectId: data.project_id,
222
+ protected: data.protected,
223
+ rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
224
+ status: data.status,
225
+ tags: data.tags,
226
+ updatedAt: unmarshalDate(data.updated_at),
227
+ zone: data.zone
228
+ };
229
+ };
230
+ const unmarshalOSOSField = (data) => {
231
+ if (!isJSONObject(data)) {
232
+ throw new TypeError(
233
+ `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`
234
+ );
235
+ }
236
+ return {
237
+ defaultValue: data.default_value,
238
+ editable: data.editable,
239
+ required: data.required
240
+ };
241
+ };
242
+ const unmarshalOS = (data) => {
243
+ if (!isJSONObject(data)) {
244
+ throw new TypeError(
245
+ `Unmarshalling the type 'OS' failed as data isn't a dictionary.`
246
+ );
247
+ }
248
+ return {
249
+ allowed: data.allowed,
250
+ customPartitioningSupported: data.custom_partitioning_supported,
251
+ enabled: data.enabled,
252
+ id: data.id,
253
+ licenseRequired: data.license_required,
254
+ logoUrl: data.logo_url,
255
+ name: data.name,
256
+ password: data.password ? unmarshalOSOSField(data.password) : void 0,
257
+ servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,
258
+ serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,
259
+ ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,
260
+ user: data.user ? unmarshalOSOSField(data.user) : void 0,
261
+ version: data.version,
262
+ zone: data.zone
263
+ };
264
+ };
188
265
  const unmarshalCPU = (data) => {
189
266
  if (!isJSONObject(data)) {
190
267
  throw new TypeError(
@@ -315,7 +392,8 @@ const unmarshalOffer = (data) => {
315
392
  sharedBandwidth: data.shared_bandwidth,
316
393
  stock: data.stock,
317
394
  subscriptionPeriod: data.subscription_period,
318
- tags: data.tags
395
+ tags: data.tags,
396
+ zone: data.zone
319
397
  };
320
398
  };
321
399
  const unmarshalOption = (data) => {
@@ -352,81 +430,6 @@ const unmarshalServerPrivateNetwork = (data) => {
352
430
  vlan: data.vlan
353
431
  };
354
432
  };
355
- const unmarshalServerInstall = (data) => {
356
- if (!isJSONObject(data)) {
357
- throw new TypeError(
358
- `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`
359
- );
360
- }
361
- return {
362
- hostname: data.hostname,
363
- osId: data.os_id,
364
- partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
365
- serviceUrl: data.service_url,
366
- serviceUser: data.service_user,
367
- sshKeyIds: data.ssh_key_ids,
368
- status: data.status,
369
- user: data.user
370
- };
371
- };
372
- const unmarshalServerOption = (data) => {
373
- if (!isJSONObject(data)) {
374
- throw new TypeError(
375
- `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`
376
- );
377
- }
378
- return {
379
- certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,
380
- expiresAt: unmarshalDate(data.expires_at),
381
- id: data.id,
382
- license: data.license ? unmarshalLicenseOption(data.license) : void 0,
383
- manageable: data.manageable,
384
- name: data.name,
385
- privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,
386
- publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,
387
- remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,
388
- status: data.status
389
- };
390
- };
391
- const unmarshalServerRescueServer = (data) => {
392
- if (!isJSONObject(data)) {
393
- throw new TypeError(
394
- `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`
395
- );
396
- }
397
- return {
398
- password: data.password,
399
- user: data.user
400
- };
401
- };
402
- const unmarshalServer = (data) => {
403
- if (!isJSONObject(data)) {
404
- throw new TypeError(
405
- `Unmarshalling the type 'Server' failed as data isn't a dictionary.`
406
- );
407
- }
408
- return {
409
- bootType: data.boot_type,
410
- createdAt: unmarshalDate(data.created_at),
411
- description: data.description,
412
- domain: data.domain,
413
- id: data.id,
414
- install: data.install ? unmarshalServerInstall(data.install) : void 0,
415
- ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
416
- name: data.name,
417
- offerId: data.offer_id,
418
- offerName: data.offer_name,
419
- options: unmarshalArrayOfObject(data.options, unmarshalServerOption),
420
- organizationId: data.organization_id,
421
- pingStatus: data.ping_status,
422
- projectId: data.project_id,
423
- rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,
424
- status: data.status,
425
- tags: data.tags,
426
- updatedAt: unmarshalDate(data.updated_at),
427
- zone: data.zone
428
- };
429
- };
430
433
  const unmarshalSetting = (data) => {
431
434
  if (!isJSONObject(data)) {
432
435
  throw new TypeError(
@@ -569,9 +572,6 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
569
572
  )
570
573
  };
571
574
  };
572
- const marshalAddOptionServerRequest = (request, defaults) => ({
573
- expires_at: request.expiresAt
574
- });
575
575
  const marshalSchemaPartition = (request, defaults) => ({
576
576
  label: request.label,
577
577
  number: request.number,
@@ -628,6 +628,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
628
628
  name: request.name,
629
629
  offer_id: request.offerId,
630
630
  option_ids: request.optionIds,
631
+ protected: request.protected,
631
632
  tags: request.tags,
632
633
  ...resolveOneOf([
633
634
  {
@@ -642,6 +643,9 @@ const marshalCreateServerRequest = (request, defaults) => ({
642
643
  }
643
644
  ])
644
645
  });
646
+ const marshalAddOptionServerRequest = (request, defaults) => ({
647
+ expires_at: request.expiresAt
648
+ });
645
649
  const marshalInstallServerRequest = (request, defaults) => ({
646
650
  hostname: request.hostname,
647
651
  os_id: request.osId,
@@ -659,13 +663,15 @@ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaul
659
663
  private_network_ids: request.privateNetworkIds
660
664
  });
661
665
  const marshalRebootServerRequest = (request, defaults) => ({
662
- boot_type: request.bootType
666
+ boot_type: request.bootType,
667
+ ssh_key_ids: request.sshKeyIds
663
668
  });
664
669
  const marshalStartBMCAccessRequest = (request, defaults) => ({
665
670
  ip: request.ip
666
671
  });
667
672
  const marshalStartServerRequest = (request, defaults) => ({
668
- boot_type: request.bootType
673
+ boot_type: request.bootType,
674
+ ssh_key_ids: request.sshKeyIds
669
675
  });
670
676
  const marshalUpdateIPRequest = (request, defaults) => ({
671
677
  reverse: request.reverse
@@ -673,6 +679,7 @@ const marshalUpdateIPRequest = (request, defaults) => ({
673
679
  const marshalUpdateServerRequest = (request, defaults) => ({
674
680
  description: request.description,
675
681
  name: request.name,
682
+ protected: request.protected,
676
683
  tags: request.tags
677
684
  });
678
685
  const marshalUpdateSettingRequest = (request, defaults) => ({