@scaleway/sdk 2.48.0 → 2.49.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.
Files changed (39) hide show
  1. package/dist/api/baremetal/index.gen.cjs +2 -0
  2. package/dist/api/baremetal/index.gen.d.ts +1 -0
  3. package/dist/api/baremetal/index.gen.js +3 -1
  4. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  5. package/dist/api/baremetal/v1/marshalling.gen.cjs +42 -102
  6. package/dist/api/baremetal/v1/marshalling.gen.d.ts +1 -1
  7. package/dist/api/baremetal/v1/marshalling.gen.js +42 -102
  8. package/dist/api/baremetal/v1/types.gen.d.ts +8 -19
  9. package/dist/api/baremetal/v3/api.gen.cjs +109 -0
  10. package/dist/api/baremetal/v3/api.gen.d.ts +46 -0
  11. package/dist/api/baremetal/v3/api.gen.js +109 -0
  12. package/dist/api/baremetal/v3/content.gen.cjs +4 -0
  13. package/dist/api/baremetal/v3/content.gen.d.ts +3 -0
  14. package/dist/api/baremetal/v3/content.gen.js +4 -0
  15. package/dist/api/baremetal/v3/index.gen.cjs +6 -0
  16. package/dist/api/baremetal/v3/index.gen.d.ts +3 -0
  17. package/dist/api/baremetal/v3/index.gen.js +6 -0
  18. package/dist/api/baremetal/v3/marshalling.gen.cjs +62 -0
  19. package/dist/api/baremetal/v3/marshalling.gen.d.ts +7 -0
  20. package/dist/api/baremetal/v3/marshalling.gen.js +62 -0
  21. package/dist/api/baremetal/v3/types.gen.d.ts +82 -0
  22. package/dist/api/edge_services/v1alpha1/api.gen.cjs +2 -10
  23. package/dist/api/edge_services/v1alpha1/api.gen.js +2 -10
  24. package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +3 -0
  25. package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +3 -0
  26. package/dist/api/iam/v1alpha1/validation-rules.gen.js +3 -0
  27. package/dist/api/instance/v1/api.gen.cjs +7 -8
  28. package/dist/api/instance/v1/api.gen.d.ts +8 -9
  29. package/dist/api/instance/v1/api.gen.js +7 -8
  30. package/dist/scw/constants.cjs +1 -1
  31. package/dist/scw/constants.d.ts +2 -2
  32. package/dist/scw/constants.js +1 -1
  33. package/dist/scw/custom-marshalling.cjs +19 -4
  34. package/dist/scw/custom-marshalling.d.ts +4 -2
  35. package/dist/scw/custom-marshalling.js +19 -4
  36. package/dist/scw/custom-types.cjs +1 -0
  37. package/dist/scw/custom-types.d.ts +1 -0
  38. package/dist/scw/custom-types.js +1 -0
  39. package/package.json +2 -2
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("./v1/index.cjs");
4
+ const index_gen = require("./v3/index.gen.cjs");
4
5
  exports.v1 = index;
6
+ exports.v3 = index_gen;
@@ -3,3 +3,4 @@
3
3
  * EDIT HERE
4
4
  */
5
5
  export * as v1 from './v1/index';
6
+ export * as v3 from './v3/index.gen';
@@ -1,4 +1,6 @@
1
1
  import * as index from "./v1/index.js";
2
+ import * as index_gen from "./v3/index.gen.js";
2
3
  export {
3
- index as v1
4
+ index as v1,
5
+ index_gen as v3
4
6
  };
@@ -1,4 +1,4 @@
1
1
  export { API, PrivateNetworkAPI } from './api.gen';
2
2
  export * from './content.gen';
3
- export type { AddOptionServerRequest, BMCAccess, CPU, CertificationOption, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, DeleteServerRequest, Disk, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOSRequest, GetOfferRequest, GetOptionRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, IP, IPReverseStatus, IPVersion, InstallServerRequest, LicenseOption, ListOSRequest, ListOSResponse, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListServerEventsRequest, ListServerEventsRequestOrderBy, ListServerEventsResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, ListSettingsRequest, ListSettingsRequestOrderBy, ListSettingsResponse, Memory, OS, OSOSField, Offer, OfferOptionOffer, OfferStock, OfferSubscriptionPeriod, Option, PersistentMemory, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, PrivateNetworkOption, PublicBandwidthOption, RaidController, RebootServerRequest, RemoteAccessOption, Schema, SchemaDisk, SchemaFilesystem, SchemaFilesystemFormat, SchemaLVM, SchemaLogicalVolume, SchemaLogicalVolumeType, SchemaPartition, SchemaPartitionLabel, SchemaPool, SchemaPoolType, SchemaRAID, SchemaRAIDLevel, SchemaVolumeGroup, SchemaZFS, Server, ServerBootType, ServerEvent, ServerInstall, ServerInstallStatus, ServerOption, ServerOptionOptionStatus, ServerPingStatus, ServerPrivateNetwork, ServerPrivateNetworkStatus, ServerRescueServer, ServerStatus, SetServerPrivateNetworksResponse, Setting, SettingType, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest, } from './types.gen';
3
+ export type { AddOptionServerRequest, BMCAccess, CPU, CertificationOption, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, DeleteServerRequest, Disk, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOSRequest, GetOfferRequest, GetOptionRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, IP, IPReverseStatus, IPVersion, InstallServerRequest, LicenseOption, ListOSRequest, ListOSResponse, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListServerEventsRequest, ListServerEventsRequestOrderBy, ListServerEventsResponse, ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, ListSettingsRequest, ListSettingsRequestOrderBy, ListSettingsResponse, Memory, OS, OSOSField, Offer, OfferOptionOffer, OfferStock, OfferSubscriptionPeriod, Option, PersistentMemory, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, PrivateNetworkOption, PublicBandwidthOption, RaidController, RebootServerRequest, RemoteAccessOption, Schema, SchemaDisk, SchemaFilesystem, SchemaFilesystemFormat, SchemaPartition, SchemaPartitionLabel, SchemaPool, SchemaPoolType, SchemaRAID, SchemaRAIDLevel, SchemaZFS, Server, ServerBootType, ServerEvent, ServerInstall, ServerInstallStatus, ServerOption, ServerOptionOptionStatus, ServerPingStatus, ServerPrivateNetwork, ServerPrivateNetworkStatus, ServerRescueServer, ServerStatus, SetServerPrivateNetworksResponse, Setting, SettingType, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest, } from './types.gen';
4
4
  export * as ValidationRules from './validation-rules.gen';
@@ -3,20 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const json = require("../../../helpers/json.cjs");
4
4
  const customMarshalling = require("../../../scw/custom-marshalling.cjs");
5
5
  const marshalling = require("../../../helpers/marshalling.cjs");
6
- const unmarshalSchemaLogicalVolume = (data) => {
7
- if (!json.isJSONObject(data)) {
8
- throw new TypeError(
9
- `Unmarshalling the type 'SchemaLogicalVolume' failed as data isn't a dictionary.`
10
- );
11
- }
12
- return {
13
- mirrorNumber: data.mirror_number,
14
- name: data.name,
15
- size: data.size,
16
- stripedNumber: data.striped_number,
17
- type: data.type
18
- };
19
- };
20
6
  const unmarshalSchemaPartition = (data) => {
21
7
  if (!json.isJSONObject(data)) {
22
8
  throw new TypeError(
@@ -29,21 +15,6 @@ const unmarshalSchemaPartition = (data) => {
29
15
  size: data.size
30
16
  };
31
17
  };
32
- const unmarshalSchemaVolumeGroup = (data) => {
33
- if (!json.isJSONObject(data)) {
34
- throw new TypeError(
35
- `Unmarshalling the type 'SchemaVolumeGroup' failed as data isn't a dictionary.`
36
- );
37
- }
38
- return {
39
- logicalVolumes: marshalling.unmarshalArrayOfObject(
40
- data.logical_volumes,
41
- unmarshalSchemaLogicalVolume
42
- ),
43
- physicalVolumes: data.physical_volumes,
44
- volumeGroupName: data.volume_group_name
45
- };
46
- };
47
18
  const unmarshalSchemaPool = (data) => {
48
19
  if (!json.isJSONObject(data)) {
49
20
  throw new TypeError(
@@ -84,19 +55,6 @@ const unmarshalSchemaFilesystem = (data) => {
84
55
  mountpoint: data.mountpoint
85
56
  };
86
57
  };
87
- const unmarshalSchemaLVM = (data) => {
88
- if (!json.isJSONObject(data)) {
89
- throw new TypeError(
90
- `Unmarshalling the type 'SchemaLVM' failed as data isn't a dictionary.`
91
- );
92
- }
93
- return {
94
- volumeGroups: marshalling.unmarshalArrayOfObject(
95
- data.volume_groups,
96
- unmarshalSchemaVolumeGroup
97
- )
98
- };
99
- };
100
58
  const unmarshalSchemaRAID = (data) => {
101
59
  if (!json.isJSONObject(data)) {
102
60
  throw new TypeError(
@@ -131,7 +89,6 @@ const unmarshalSchema = (data) => {
131
89
  data.filesystems,
132
90
  unmarshalSchemaFilesystem
133
91
  ),
134
- lvm: data.lvm ? unmarshalSchemaLVM(data.lvm) : void 0,
135
92
  raids: marshalling.unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
136
93
  zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
137
94
  };
@@ -392,6 +349,7 @@ const unmarshalServerInstall = (data) => {
392
349
  return {
393
350
  hostname: data.hostname,
394
351
  osId: data.os_id,
352
+ partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
395
353
  serviceUrl: data.service_url,
396
354
  serviceUser: data.service_user,
397
355
  sshKeyIds: data.ssh_key_ids,
@@ -602,9 +560,49 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
602
560
  const marshalAddOptionServerRequest = (request, defaults) => ({
603
561
  expires_at: request.expiresAt
604
562
  });
563
+ const marshalSchemaPartition = (request, defaults) => ({
564
+ label: request.label,
565
+ number: request.number,
566
+ size: request.size
567
+ });
568
+ const marshalSchemaPool = (request, defaults) => ({
569
+ devices: request.devices,
570
+ filesystem_options: request.filesystemOptions,
571
+ name: request.name,
572
+ options: request.options,
573
+ type: request.type
574
+ });
575
+ const marshalSchemaDisk = (request, defaults) => ({
576
+ device: request.device,
577
+ partitions: request.partitions.map(
578
+ (elt) => marshalSchemaPartition(elt)
579
+ )
580
+ });
581
+ const marshalSchemaFilesystem = (request, defaults) => ({
582
+ device: request.device,
583
+ format: request.format,
584
+ mountpoint: request.mountpoint
585
+ });
586
+ const marshalSchemaRAID = (request, defaults) => ({
587
+ devices: request.devices,
588
+ level: request.level,
589
+ name: request.name
590
+ });
591
+ const marshalSchemaZFS = (request, defaults) => ({
592
+ pools: request.pools.map((elt) => marshalSchemaPool(elt))
593
+ });
594
+ const marshalSchema = (request, defaults) => ({
595
+ disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
596
+ filesystems: request.filesystems.map(
597
+ (elt) => marshalSchemaFilesystem(elt)
598
+ ),
599
+ raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
600
+ zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
601
+ });
605
602
  const marshalCreateServerRequestInstall = (request, defaults) => ({
606
603
  hostname: request.hostname,
607
604
  os_id: request.osId,
605
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
608
606
  password: request.password,
609
607
  service_password: request.servicePassword,
610
608
  service_user: request.serviceUser,
@@ -634,6 +632,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
634
632
  const marshalInstallServerRequest = (request, defaults) => ({
635
633
  hostname: request.hostname,
636
634
  os_id: request.osId,
635
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
637
636
  password: request.password,
638
637
  service_password: request.servicePassword,
639
638
  service_user: request.serviceUser,
@@ -666,65 +665,6 @@ const marshalUpdateServerRequest = (request, defaults) => ({
666
665
  const marshalUpdateSettingRequest = (request, defaults) => ({
667
666
  enabled: request.enabled
668
667
  });
669
- const marshalSchemaLogicalVolume = (request, defaults) => ({
670
- mirror_number: request.mirrorNumber,
671
- name: request.name,
672
- size: request.size,
673
- striped_number: request.stripedNumber,
674
- type: request.type
675
- });
676
- const marshalSchemaPartition = (request, defaults) => ({
677
- label: request.label,
678
- number: request.number,
679
- size: request.size
680
- });
681
- const marshalSchemaVolumeGroup = (request, defaults) => ({
682
- logical_volumes: request.logicalVolumes.map(
683
- (elt) => marshalSchemaLogicalVolume(elt)
684
- ),
685
- physical_volumes: request.physicalVolumes,
686
- volume_group_name: request.volumeGroupName
687
- });
688
- const marshalSchemaPool = (request, defaults) => ({
689
- devices: request.devices,
690
- filesystem_options: request.filesystemOptions,
691
- name: request.name,
692
- options: request.options,
693
- type: request.type
694
- });
695
- const marshalSchemaDisk = (request, defaults) => ({
696
- device: request.device,
697
- partitions: request.partitions.map(
698
- (elt) => marshalSchemaPartition(elt)
699
- )
700
- });
701
- const marshalSchemaFilesystem = (request, defaults) => ({
702
- device: request.device,
703
- format: request.format,
704
- mountpoint: request.mountpoint
705
- });
706
- const marshalSchemaLVM = (request, defaults) => ({
707
- volume_groups: request.volumeGroups.map(
708
- (elt) => marshalSchemaVolumeGroup(elt)
709
- )
710
- });
711
- const marshalSchemaRAID = (request, defaults) => ({
712
- devices: request.devices,
713
- level: request.level,
714
- name: request.name
715
- });
716
- const marshalSchemaZFS = (request, defaults) => ({
717
- pools: request.pools.map((elt) => marshalSchemaPool(elt))
718
- });
719
- const marshalSchema = (request, defaults) => ({
720
- disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
721
- filesystems: request.filesystems.map(
722
- (elt) => marshalSchemaFilesystem(elt)
723
- ),
724
- lvm: request.lvm !== void 0 ? marshalSchemaLVM(request.lvm) : void 0,
725
- raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
726
- zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
727
- });
728
668
  const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
729
669
  offer_id: request.offerId,
730
670
  os_id: request.osId,
@@ -19,6 +19,7 @@ export declare const unmarshalListServersResponse: (data: unknown) => ListServer
19
19
  export declare const unmarshalListSettingsResponse: (data: unknown) => ListSettingsResponse;
20
20
  export declare const unmarshalSetServerPrivateNetworksResponse: (data: unknown) => SetServerPrivateNetworksResponse;
21
21
  export declare const marshalAddOptionServerRequest: (request: AddOptionServerRequest, defaults: DefaultValues) => Record<string, unknown>;
22
+ export declare const marshalSchema: (request: Schema, defaults: DefaultValues) => Record<string, unknown>;
22
23
  export declare const marshalCreateServerRequest: (request: CreateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
23
24
  export declare const marshalInstallServerRequest: (request: InstallServerRequest, defaults: DefaultValues) => Record<string, unknown>;
24
25
  export declare const marshalPrivateNetworkApiAddServerPrivateNetworkRequest: (request: PrivateNetworkApiAddServerPrivateNetworkRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -29,5 +30,4 @@ export declare const marshalStartServerRequest: (request: StartServerRequest, de
29
30
  export declare const marshalUpdateIPRequest: (request: UpdateIPRequest, defaults: DefaultValues) => Record<string, unknown>;
30
31
  export declare const marshalUpdateServerRequest: (request: UpdateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
31
32
  export declare const marshalUpdateSettingRequest: (request: UpdateSettingRequest, defaults: DefaultValues) => Record<string, unknown>;
32
- export declare const marshalSchema: (request: Schema, defaults: DefaultValues) => Record<string, unknown>;
33
33
  export declare const marshalValidatePartitioningSchemaRequest: (request: ValidatePartitioningSchemaRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,20 +1,6 @@
1
1
  import { isJSONObject } from "../../../helpers/json.js";
2
2
  import { unmarshalMoney, unmarshalTimeSeries } from "../../../scw/custom-marshalling.js";
3
3
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
4
- const unmarshalSchemaLogicalVolume = (data) => {
5
- if (!isJSONObject(data)) {
6
- throw new TypeError(
7
- `Unmarshalling the type 'SchemaLogicalVolume' failed as data isn't a dictionary.`
8
- );
9
- }
10
- return {
11
- mirrorNumber: data.mirror_number,
12
- name: data.name,
13
- size: data.size,
14
- stripedNumber: data.striped_number,
15
- type: data.type
16
- };
17
- };
18
4
  const unmarshalSchemaPartition = (data) => {
19
5
  if (!isJSONObject(data)) {
20
6
  throw new TypeError(
@@ -27,21 +13,6 @@ const unmarshalSchemaPartition = (data) => {
27
13
  size: data.size
28
14
  };
29
15
  };
30
- const unmarshalSchemaVolumeGroup = (data) => {
31
- if (!isJSONObject(data)) {
32
- throw new TypeError(
33
- `Unmarshalling the type 'SchemaVolumeGroup' failed as data isn't a dictionary.`
34
- );
35
- }
36
- return {
37
- logicalVolumes: unmarshalArrayOfObject(
38
- data.logical_volumes,
39
- unmarshalSchemaLogicalVolume
40
- ),
41
- physicalVolumes: data.physical_volumes,
42
- volumeGroupName: data.volume_group_name
43
- };
44
- };
45
16
  const unmarshalSchemaPool = (data) => {
46
17
  if (!isJSONObject(data)) {
47
18
  throw new TypeError(
@@ -82,19 +53,6 @@ const unmarshalSchemaFilesystem = (data) => {
82
53
  mountpoint: data.mountpoint
83
54
  };
84
55
  };
85
- const unmarshalSchemaLVM = (data) => {
86
- if (!isJSONObject(data)) {
87
- throw new TypeError(
88
- `Unmarshalling the type 'SchemaLVM' failed as data isn't a dictionary.`
89
- );
90
- }
91
- return {
92
- volumeGroups: unmarshalArrayOfObject(
93
- data.volume_groups,
94
- unmarshalSchemaVolumeGroup
95
- )
96
- };
97
- };
98
56
  const unmarshalSchemaRAID = (data) => {
99
57
  if (!isJSONObject(data)) {
100
58
  throw new TypeError(
@@ -129,7 +87,6 @@ const unmarshalSchema = (data) => {
129
87
  data.filesystems,
130
88
  unmarshalSchemaFilesystem
131
89
  ),
132
- lvm: data.lvm ? unmarshalSchemaLVM(data.lvm) : void 0,
133
90
  raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
134
91
  zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
135
92
  };
@@ -390,6 +347,7 @@ const unmarshalServerInstall = (data) => {
390
347
  return {
391
348
  hostname: data.hostname,
392
349
  osId: data.os_id,
350
+ partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,
393
351
  serviceUrl: data.service_url,
394
352
  serviceUser: data.service_user,
395
353
  sshKeyIds: data.ssh_key_ids,
@@ -600,9 +558,49 @@ const unmarshalSetServerPrivateNetworksResponse = (data) => {
600
558
  const marshalAddOptionServerRequest = (request, defaults) => ({
601
559
  expires_at: request.expiresAt
602
560
  });
561
+ const marshalSchemaPartition = (request, defaults) => ({
562
+ label: request.label,
563
+ number: request.number,
564
+ size: request.size
565
+ });
566
+ const marshalSchemaPool = (request, defaults) => ({
567
+ devices: request.devices,
568
+ filesystem_options: request.filesystemOptions,
569
+ name: request.name,
570
+ options: request.options,
571
+ type: request.type
572
+ });
573
+ const marshalSchemaDisk = (request, defaults) => ({
574
+ device: request.device,
575
+ partitions: request.partitions.map(
576
+ (elt) => marshalSchemaPartition(elt)
577
+ )
578
+ });
579
+ const marshalSchemaFilesystem = (request, defaults) => ({
580
+ device: request.device,
581
+ format: request.format,
582
+ mountpoint: request.mountpoint
583
+ });
584
+ const marshalSchemaRAID = (request, defaults) => ({
585
+ devices: request.devices,
586
+ level: request.level,
587
+ name: request.name
588
+ });
589
+ const marshalSchemaZFS = (request, defaults) => ({
590
+ pools: request.pools.map((elt) => marshalSchemaPool(elt))
591
+ });
592
+ const marshalSchema = (request, defaults) => ({
593
+ disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
594
+ filesystems: request.filesystems.map(
595
+ (elt) => marshalSchemaFilesystem(elt)
596
+ ),
597
+ raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
598
+ zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
599
+ });
603
600
  const marshalCreateServerRequestInstall = (request, defaults) => ({
604
601
  hostname: request.hostname,
605
602
  os_id: request.osId,
603
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
606
604
  password: request.password,
607
605
  service_password: request.servicePassword,
608
606
  service_user: request.serviceUser,
@@ -632,6 +630,7 @@ const marshalCreateServerRequest = (request, defaults) => ({
632
630
  const marshalInstallServerRequest = (request, defaults) => ({
633
631
  hostname: request.hostname,
634
632
  os_id: request.osId,
633
+ partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,
635
634
  password: request.password,
636
635
  service_password: request.servicePassword,
637
636
  service_user: request.serviceUser,
@@ -664,65 +663,6 @@ const marshalUpdateServerRequest = (request, defaults) => ({
664
663
  const marshalUpdateSettingRequest = (request, defaults) => ({
665
664
  enabled: request.enabled
666
665
  });
667
- const marshalSchemaLogicalVolume = (request, defaults) => ({
668
- mirror_number: request.mirrorNumber,
669
- name: request.name,
670
- size: request.size,
671
- striped_number: request.stripedNumber,
672
- type: request.type
673
- });
674
- const marshalSchemaPartition = (request, defaults) => ({
675
- label: request.label,
676
- number: request.number,
677
- size: request.size
678
- });
679
- const marshalSchemaVolumeGroup = (request, defaults) => ({
680
- logical_volumes: request.logicalVolumes.map(
681
- (elt) => marshalSchemaLogicalVolume(elt)
682
- ),
683
- physical_volumes: request.physicalVolumes,
684
- volume_group_name: request.volumeGroupName
685
- });
686
- const marshalSchemaPool = (request, defaults) => ({
687
- devices: request.devices,
688
- filesystem_options: request.filesystemOptions,
689
- name: request.name,
690
- options: request.options,
691
- type: request.type
692
- });
693
- const marshalSchemaDisk = (request, defaults) => ({
694
- device: request.device,
695
- partitions: request.partitions.map(
696
- (elt) => marshalSchemaPartition(elt)
697
- )
698
- });
699
- const marshalSchemaFilesystem = (request, defaults) => ({
700
- device: request.device,
701
- format: request.format,
702
- mountpoint: request.mountpoint
703
- });
704
- const marshalSchemaLVM = (request, defaults) => ({
705
- volume_groups: request.volumeGroups.map(
706
- (elt) => marshalSchemaVolumeGroup(elt)
707
- )
708
- });
709
- const marshalSchemaRAID = (request, defaults) => ({
710
- devices: request.devices,
711
- level: request.level,
712
- name: request.name
713
- });
714
- const marshalSchemaZFS = (request, defaults) => ({
715
- pools: request.pools.map((elt) => marshalSchemaPool(elt))
716
- });
717
- const marshalSchema = (request, defaults) => ({
718
- disks: request.disks.map((elt) => marshalSchemaDisk(elt)),
719
- filesystems: request.filesystems.map(
720
- (elt) => marshalSchemaFilesystem(elt)
721
- ),
722
- lvm: request.lvm !== void 0 ? marshalSchemaLVM(request.lvm) : void 0,
723
- raids: request.raids.map((elt) => marshalSchemaRAID(elt)),
724
- zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0
725
- });
726
666
  const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
727
667
  offer_id: request.offerId,
728
668
  os_id: request.osId,
@@ -7,9 +7,8 @@ export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc';
7
7
  export type ListSettingsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
8
8
  export type OfferStock = 'empty' | 'low' | 'available';
9
9
  export type OfferSubscriptionPeriod = 'unknown_subscription_period' | 'hourly' | 'monthly';
10
- export type SchemaFilesystemFormat = 'unknown_format' | 'fat32' | 'ext4' | 'swap' | 'zfs';
11
- export type SchemaLogicalVolumeType = 'unknown_raid_type' | 'striped' | 'mirror' | 'raid0' | 'raid1' | 'raid5' | 'raid6' | 'raid10';
12
- export type SchemaPartitionLabel = 'unknown_partition_label' | 'uefi' | 'legacy' | 'root' | 'boot' | 'swap' | 'data' | 'home' | 'raid' | 'lvm' | 'zfs';
10
+ export type SchemaFilesystemFormat = 'unknown_format' | 'fat32' | 'ext4' | 'swap' | 'zfs' | 'xfs';
11
+ export type SchemaPartitionLabel = 'unknown_partition_label' | 'uefi' | 'legacy' | 'root' | 'boot' | 'swap' | 'data' | 'home' | 'raid' | 'zfs';
13
12
  export type SchemaPoolType = 'unknown_type' | 'no_raid' | 'mirror' | 'raidz1' | 'raidz2';
14
13
  export type SchemaRAIDLevel = 'unknown_raid_level' | 'raid_level_0' | 'raid_level_1' | 'raid_level_5' | 'raid_level_6' | 'raid_level_10';
15
14
  export type ServerBootType = 'unknown_boot_type' | 'normal' | 'rescue';
@@ -19,23 +18,11 @@ export type ServerPingStatus = 'ping_status_unknown' | 'ping_status_up' | 'ping_
19
18
  export type ServerPrivateNetworkStatus = 'unknown' | 'attaching' | 'attached' | 'error' | 'detaching' | 'locked';
20
19
  export type ServerStatus = 'unknown' | 'delivering' | 'ready' | 'stopping' | 'stopped' | 'starting' | 'error' | 'deleting' | 'locked' | 'out_of_stock' | 'ordered' | 'resetting';
21
20
  export type SettingType = 'unknown' | 'smtp';
22
- export interface SchemaLogicalVolume {
23
- name: string;
24
- type: SchemaLogicalVolumeType;
25
- size: number;
26
- stripedNumber: number;
27
- mirrorNumber: number;
28
- }
29
21
  export interface SchemaPartition {
30
22
  label: SchemaPartitionLabel;
31
23
  number: number;
32
24
  size: number;
33
25
  }
34
- export interface SchemaVolumeGroup {
35
- volumeGroupName: string;
36
- physicalVolumes: string[];
37
- logicalVolumes: SchemaLogicalVolume[];
38
- }
39
26
  export interface SchemaPool {
40
27
  name: string;
41
28
  type: SchemaPoolType;
@@ -52,9 +39,6 @@ export interface SchemaFilesystem {
52
39
  format: SchemaFilesystemFormat;
53
40
  mountpoint: string;
54
41
  }
55
- export interface SchemaLVM {
56
- volumeGroups: SchemaVolumeGroup[];
57
- }
58
42
  export interface SchemaRAID {
59
43
  name: string;
60
44
  level: SchemaRAIDLevel;
@@ -79,7 +63,6 @@ export interface Schema {
79
63
  disks: SchemaDisk[];
80
64
  raids: SchemaRAID[];
81
65
  filesystems: SchemaFilesystem[];
82
- lvm?: SchemaLVM;
83
66
  zfs?: SchemaZFS;
84
67
  }
85
68
  export interface OSOSField {
@@ -216,6 +199,8 @@ export interface ServerInstall {
216
199
  serviceUser: string;
217
200
  /** Address of the installed service. */
218
201
  serviceUrl: string;
202
+ /** Partitioning schema. */
203
+ partitioningSchema?: Schema;
219
204
  }
220
205
  export interface ServerOption {
221
206
  /** ID of the option. */
@@ -285,6 +270,8 @@ export interface CreateServerRequestInstall {
285
270
  serviceUser?: string;
286
271
  /** Password used for the service to install. */
287
272
  servicePassword?: string;
273
+ /** Partitioning schema. */
274
+ partitioningSchema?: Schema;
288
275
  }
289
276
  export interface OS {
290
277
  /** ID of the OS. */
@@ -635,6 +622,8 @@ export type InstallServerRequest = {
635
622
  serviceUser?: string;
636
623
  /** Password used for the service to install. */
637
624
  servicePassword?: string;
625
+ /** Partitioning schema. */
626
+ partitioningSchema?: Schema;
638
627
  };
639
628
  export type ListOSRequest = {
640
629
  /** Zone to target. If none is passed will use default zone from the config. */
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api = require("../../../scw/api.cjs");
4
+ const marshalling = require("../../../helpers/marshalling.cjs");
5
+ require("../../../vendor/base64/index.cjs");
6
+ const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
7
+ const marshalling_gen = require("./marshalling.gen.cjs");
8
+ const jsonContentHeaders = {
9
+ "Content-Type": "application/json; charset=utf-8"
10
+ };
11
+ class PrivateNetworkAPI extends api.API {
12
+ /** Lists the available zones of the API. */
13
+ static LOCALITIES = [
14
+ "fr-par-1",
15
+ "fr-par-2",
16
+ "nl-ams-1",
17
+ "nl-ams-2",
18
+ "pl-waw-2",
19
+ "pl-waw-3"
20
+ ];
21
+ /**
22
+ * Add a server to a Private Network. Add an Elastic Metal server to a Private
23
+ * Network.
24
+ *
25
+ * @param request - The request
26
+ * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
27
+ * @returns A Promise of ServerPrivateNetwork
28
+ */
29
+ addServerPrivateNetwork = (request) => this.client.fetch(
30
+ {
31
+ body: JSON.stringify(
32
+ marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
33
+ request,
34
+ this.client.settings
35
+ )
36
+ ),
37
+ headers: jsonContentHeaders,
38
+ method: "POST",
39
+ path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks`
40
+ },
41
+ marshalling_gen.unmarshalServerPrivateNetwork
42
+ );
43
+ /**
44
+ * Set multiple Private Networks on a server. Configure multiple Private
45
+ * Networks on an Elastic Metal server.
46
+ *
47
+ * @param request - The request
48
+ * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
49
+ * @returns A Promise of SetServerPrivateNetworksResponse
50
+ */
51
+ setServerPrivateNetworks = (request) => this.client.fetch(
52
+ {
53
+ body: JSON.stringify(
54
+ marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
55
+ request,
56
+ this.client.settings
57
+ )
58
+ ),
59
+ headers: jsonContentHeaders,
60
+ method: "PUT",
61
+ path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks`
62
+ },
63
+ marshalling_gen.unmarshalSetServerPrivateNetworksResponse
64
+ );
65
+ pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
66
+ {
67
+ method: "GET",
68
+ path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
69
+ urlParams: marshalling.urlParams(
70
+ ["ipam_ip_ids", request.ipamIpIds],
71
+ ["order_by", request.orderBy],
72
+ ["organization_id", request.organizationId],
73
+ ["page", request.page],
74
+ [
75
+ "page_size",
76
+ request.pageSize ?? this.client.settings.defaultPageSize
77
+ ],
78
+ ["private_network_id", request.privateNetworkId],
79
+ ["project_id", request.projectId],
80
+ ["server_id", request.serverId]
81
+ )
82
+ },
83
+ marshalling_gen.unmarshalListServerPrivateNetworksResponse
84
+ );
85
+ /**
86
+ * List the Private Networks of a server. List the Private Networks of an
87
+ * Elastic Metal server.
88
+ *
89
+ * @param request - The request
90
+ * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
91
+ * @returns A Promise of ListServerPrivateNetworksResponse
92
+ */
93
+ listServerPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination(
94
+ "serverPrivateNetworks",
95
+ this.pageOfListServerPrivateNetworks,
96
+ request
97
+ );
98
+ /**
99
+ * Delete a Private Network.
100
+ *
101
+ * @param request - The request
102
+ * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
103
+ */
104
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
105
+ method: "DELETE",
106
+ path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}`
107
+ });
108
+ }
109
+ exports.PrivateNetworkAPI = PrivateNetworkAPI;