@scaleway/sdk-baremetal 2.1.1 → 2.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.
@@ -29,7 +29,10 @@ class API extends API$1 {
29
29
  ["order_by", request.orderBy],
30
30
  ["organization_id", request.organizationId],
31
31
  ["page", request.page],
32
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
32
+ [
33
+ "page_size",
34
+ request.pageSize ?? this.client.settings.defaultPageSize
35
+ ],
33
36
  ["project_id", request.projectId],
34
37
  ["status", request.status],
35
38
  ["tags", request.tags]
@@ -65,7 +68,9 @@ class API extends API$1 {
65
68
  * @returns A Promise of Server
66
69
  */
67
70
  waitForServer = (request, options) => waitForResource(
68
- options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))),
71
+ options?.stop ?? ((res) => Promise.resolve(
72
+ !SERVER_TRANSIENT_STATUSES.includes(res.status)
73
+ )),
69
74
  this.getServer,
70
75
  request,
71
76
  options
@@ -203,7 +208,10 @@ class API extends API$1 {
203
208
  urlParams: urlParams(
204
209
  ["order_by", request.orderBy],
205
210
  ["page", request.page],
206
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
211
+ [
212
+ "page_size",
213
+ request.pageSize ?? this.client.settings.defaultPageSize
214
+ ]
207
215
  )
208
216
  },
209
217
  unmarshalListServerEventsResponse
@@ -237,16 +245,14 @@ class API extends API$1 {
237
245
  *
238
246
  * @param request - The request {@link ValidatePartitioningSchemaRequest}
239
247
  */
240
- validatePartitioningSchema = (request) => this.client.fetch(
241
- {
242
- body: JSON.stringify(
243
- marshalValidatePartitioningSchemaRequest(request, this.client.settings)
244
- ),
245
- headers: jsonContentHeaders,
246
- method: "POST",
247
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
248
- }
249
- );
248
+ validatePartitioningSchema = (request) => this.client.fetch({
249
+ body: JSON.stringify(
250
+ marshalValidatePartitioningSchemaRequest(request, this.client.settings)
251
+ ),
252
+ headers: jsonContentHeaders,
253
+ method: "POST",
254
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
255
+ });
250
256
  /**
251
257
  * Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
252
258
  The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
@@ -285,12 +291,10 @@ class API extends API$1 {
285
291
  *
286
292
  * @param request - The request {@link StopBMCAccessRequest}
287
293
  */
288
- stopBMCAccess = (request) => this.client.fetch(
289
- {
290
- method: "DELETE",
291
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
292
- }
293
- );
294
+ stopBMCAccess = (request) => this.client.fetch({
295
+ method: "DELETE",
296
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
297
+ });
294
298
  /**
295
299
  * Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.
296
300
  *
@@ -358,7 +362,10 @@ class API extends API$1 {
358
362
  urlParams: urlParams(
359
363
  ["name", request.name],
360
364
  ["page", request.page],
361
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
365
+ [
366
+ "page_size",
367
+ request.pageSize ?? this.client.settings.defaultPageSize
368
+ ],
362
369
  ["subscription_period", request.subscriptionPeriod]
363
370
  )
364
371
  },
@@ -405,7 +412,10 @@ class API extends API$1 {
405
412
  ["name", request.name],
406
413
  ["offer_id", request.offerId],
407
414
  ["page", request.page],
408
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
415
+ [
416
+ "page_size",
417
+ request.pageSize ?? this.client.settings.defaultPageSize
418
+ ]
409
419
  )
410
420
  },
411
421
  unmarshalListOptionsResponse
@@ -424,8 +434,14 @@ class API extends API$1 {
424
434
  urlParams: urlParams(
425
435
  ["order_by", request.orderBy],
426
436
  ["page", request.page],
427
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
428
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
437
+ [
438
+ "page_size",
439
+ request.pageSize ?? this.client.settings.defaultPageSize
440
+ ],
441
+ [
442
+ "project_id",
443
+ request.projectId ?? this.client.settings.defaultProjectId
444
+ ]
429
445
  )
430
446
  },
431
447
  unmarshalListSettingsResponse
@@ -461,7 +477,10 @@ class API extends API$1 {
461
477
  urlParams: urlParams(
462
478
  ["offer_id", request.offerId],
463
479
  ["page", request.page],
464
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
480
+ [
481
+ "page_size",
482
+ request.pageSize ?? this.client.settings.defaultPageSize
483
+ ]
465
484
  )
466
485
  },
467
486
  unmarshalListOSResponse
@@ -493,9 +512,7 @@ class PrivateNetworkAPI extends API$1 {
493
512
  * type ∈ {'zone','region','global','unspecified'}
494
513
  */
495
514
  static LOCALITY = toApiLocality({
496
- zones: [
497
- "fr-par-2"
498
- ]
515
+ zones: ["fr-par-2"]
499
516
  });
500
517
  /**
501
518
  * Add a server to a Private Network.
@@ -506,7 +523,10 @@ class PrivateNetworkAPI extends API$1 {
506
523
  addServerPrivateNetwork = (request) => this.client.fetch(
507
524
  {
508
525
  body: JSON.stringify(
509
- marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)
526
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
527
+ request,
528
+ this.client.settings
529
+ )
510
530
  ),
511
531
  headers: jsonContentHeaders,
512
532
  method: "POST",
@@ -523,7 +543,10 @@ class PrivateNetworkAPI extends API$1 {
523
543
  setServerPrivateNetworks = (request) => this.client.fetch(
524
544
  {
525
545
  body: JSON.stringify(
526
- marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)
546
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
547
+ request,
548
+ this.client.settings
549
+ )
527
550
  ),
528
551
  headers: jsonContentHeaders,
529
552
  method: "PUT",
@@ -539,7 +562,10 @@ class PrivateNetworkAPI extends API$1 {
539
562
  ["order_by", request.orderBy],
540
563
  ["organization_id", request.organizationId],
541
564
  ["page", request.page],
542
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
565
+ [
566
+ "page_size",
567
+ request.pageSize ?? this.client.settings.defaultPageSize
568
+ ],
543
569
  ["private_network_id", request.privateNetworkId],
544
570
  ["project_id", request.projectId],
545
571
  ["server_id", request.serverId]
@@ -553,18 +579,20 @@ class PrivateNetworkAPI extends API$1 {
553
579
  * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
554
580
  * @returns A Promise of ListServerPrivateNetworksResponse
555
581
  */
556
- listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
582
+ listServerPrivateNetworks = (request = {}) => enrichForPagination(
583
+ "serverPrivateNetworks",
584
+ this.pageOfListServerPrivateNetworks,
585
+ request
586
+ );
557
587
  /**
558
588
  * Delete a Private Network.
559
589
  *
560
590
  * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
561
591
  */
562
- deleteServerPrivateNetwork = (request) => this.client.fetch(
563
- {
564
- method: "DELETE",
565
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
566
- }
567
- );
592
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
593
+ method: "DELETE",
594
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
595
+ });
568
596
  }
569
597
  export {
570
598
  API,
@@ -2,10 +2,7 @@ const SERVER_INSTALL_TRANSIENT_STATUSES = [
2
2
  "to_install",
3
3
  "installing"
4
4
  ];
5
- const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [
6
- "attaching",
7
- "detaching"
8
- ];
5
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
9
6
  const SERVER_TRANSIENT_STATUSES = [
10
7
  "delivering",
11
8
  "stopping",
@@ -34,7 +34,10 @@ const unmarshalSchemaDisk = (data) => {
34
34
  }
35
35
  return {
36
36
  device: data.device,
37
- partitions: unmarshalArrayOfObject(data.partitions, unmarshalSchemaPartition)
37
+ partitions: unmarshalArrayOfObject(
38
+ data.partitions,
39
+ unmarshalSchemaPartition
40
+ )
38
41
  };
39
42
  };
40
43
  const unmarshalSchemaFilesystem = (data) => {
@@ -79,7 +82,10 @@ const unmarshalSchema = (data) => {
79
82
  }
80
83
  return {
81
84
  disks: unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
82
- filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalSchemaFilesystem),
85
+ filesystems: unmarshalArrayOfObject(
86
+ data.filesystems,
87
+ unmarshalSchemaFilesystem
88
+ ),
83
89
  raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
84
90
  zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
85
91
  };
@@ -374,12 +380,18 @@ const unmarshalOffer = (data) => {
374
380
  name: data.name,
375
381
  operationPath: data.operation_path,
376
382
  options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),
377
- persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory),
383
+ persistentMemories: unmarshalArrayOfObject(
384
+ data.persistent_memories,
385
+ unmarshalPersistentMemory
386
+ ),
378
387
  pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : void 0,
379
388
  pricePerMonth: data.price_per_month ? unmarshalMoney(data.price_per_month) : void 0,
380
389
  privateBandwidth: data.private_bandwidth,
381
390
  quotaName: data.quota_name,
382
- raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController),
391
+ raidControllers: unmarshalArrayOfObject(
392
+ data.raid_controllers,
393
+ unmarshalRaidController
394
+ ),
383
395
  sharedBandwidth: data.shared_bandwidth,
384
396
  stock: data.stock,
385
397
  subscriptionPeriod: data.subscription_period,
@@ -521,7 +533,10 @@ const unmarshalListServerPrivateNetworksResponse = (data) => {
521
533
  );
522
534
  }
523
535
  return {
524
- serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
536
+ serverPrivateNetworks: unmarshalArrayOfObject(
537
+ data.server_private_networks,
538
+ unmarshalServerPrivateNetwork
539
+ ),
525
540
  totalCount: data.total_count
526
541
  };
527
542
  };
@@ -554,7 +569,10 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
554
569
  );
555
570
  }
556
571
  return {
557
- serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
572
+ serverPrivateNetworks: unmarshalArrayOfObject(
573
+ data.server_private_networks,
574
+ unmarshalServerPrivateNetwork
575
+ )
558
576
  };
559
577
  };
560
578
  const marshalSchemaPartition = (request, defaults) => ({
@@ -572,7 +590,9 @@ const marshalSchemaPool = (request, defaults) => ({
572
590
  });
573
591
  const marshalSchemaDisk = (request, defaults) => ({
574
592
  device: request.device,
575
- partitions: request.partitions.map((elt) => marshalSchemaPartition(elt))
593
+ partitions: request.partitions.map(
594
+ (elt) => marshalSchemaPartition(elt)
595
+ )
576
596
  });
577
597
  const marshalSchemaFilesystem = (request, defaults) => ({
578
598
  device: request.device,
@@ -589,7 +609,9 @@ const marshalSchemaZFS = (request, defaults) => ({
589
609
  });
590
610
  const marshalSchema = (request, defaults) => ({
591
611
  disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
592
- filesystems: request.filesystems.map((elt) => marshalSchemaFilesystem(elt)),
612
+ filesystems: request.filesystems.map(
613
+ (elt) => marshalSchemaFilesystem(elt)
614
+ ),
593
615
  raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
594
616
  zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
595
617
  });
@@ -27,7 +27,10 @@ class PrivateNetworkAPI extends API$1 {
27
27
  addServerPrivateNetwork = (request) => this.client.fetch(
28
28
  {
29
29
  body: JSON.stringify(
30
- marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)
30
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
31
+ request,
32
+ this.client.settings
33
+ )
31
34
  ),
32
35
  headers: jsonContentHeaders,
33
36
  method: "POST",
@@ -44,7 +47,10 @@ class PrivateNetworkAPI extends API$1 {
44
47
  setServerPrivateNetworks = (request) => this.client.fetch(
45
48
  {
46
49
  body: JSON.stringify(
47
- marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)
50
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
51
+ request,
52
+ this.client.settings
53
+ )
48
54
  ),
49
55
  headers: jsonContentHeaders,
50
56
  method: "PUT",
@@ -61,7 +67,10 @@ class PrivateNetworkAPI extends API$1 {
61
67
  ["order_by", request.orderBy],
62
68
  ["organization_id", request.organizationId],
63
69
  ["page", request.page],
64
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
70
+ [
71
+ "page_size",
72
+ request.pageSize ?? this.client.settings.defaultPageSize
73
+ ],
65
74
  ["private_network_id", request.privateNetworkId],
66
75
  ["project_id", request.projectId],
67
76
  ["server_id", request.serverId]
@@ -75,18 +84,20 @@ class PrivateNetworkAPI extends API$1 {
75
84
  * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
76
85
  * @returns A Promise of ListServerPrivateNetworksResponse
77
86
  */
78
- listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
87
+ listServerPrivateNetworks = (request = {}) => enrichForPagination(
88
+ "serverPrivateNetworks",
89
+ this.pageOfListServerPrivateNetworks,
90
+ request
91
+ );
79
92
  /**
80
93
  * Delete a Private Network.
81
94
  *
82
95
  * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
83
96
  */
84
- deleteServerPrivateNetwork = (request) => this.client.fetch(
85
- {
86
- method: "DELETE",
87
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
88
- }
89
- );
97
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
98
+ method: "DELETE",
99
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
100
+ });
90
101
  }
91
102
  export {
92
103
  PrivateNetworkAPI
@@ -1,7 +1,4 @@
1
- const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [
2
- "attaching",
3
- "detaching"
4
- ];
1
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
5
2
  export {
6
3
  SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES
7
4
  };
@@ -1,4 +1,4 @@
1
- export { PrivateNetworkAPI, } from './api.gen.js';
1
+ export { PrivateNetworkAPI } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, ServerPrivateNetworkStatus, SetServerPrivateNetworksResponse, } from './types.gen.js';
@@ -24,7 +24,10 @@ const unmarshalListServerPrivateNetworksResponse = (data) => {
24
24
  );
25
25
  }
26
26
  return {
27
- serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
27
+ serverPrivateNetworks: unmarshalArrayOfObject(
28
+ data.server_private_networks,
29
+ unmarshalServerPrivateNetwork
30
+ ),
28
31
  totalCount: data.total_count
29
32
  };
30
33
  };
@@ -35,7 +38,10 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
35
38
  );
36
39
  }
37
40
  return {
38
- serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)
41
+ serverPrivateNetworks: unmarshalArrayOfObject(
42
+ data.server_private_networks,
43
+ unmarshalServerPrivateNetwork
44
+ )
39
45
  };
40
46
  };
41
47
  const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-baremetal",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Scaleway SDK baremetal",
5
5
  "license": "Apache-2.0",
6
6
  "files": [