@scaleway/sdk 2.48.0 → 2.49.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.
@@ -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. */
@@ -616,21 +616,13 @@ class API extends api.API {
616
616
  getCurrentPlan = (request = {}) => this.client.fetch(
617
617
  {
618
618
  method: "GET",
619
- path: `/edge-services/v1alpha1/current-plan`,
620
- urlParams: marshalling.urlParams([
621
- "project_id",
622
- request.projectId ?? this.client.settings.defaultProjectId
623
- ])
619
+ path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
624
620
  },
625
621
  marshalling_gen.unmarshalPlan
626
622
  );
627
623
  deleteCurrentPlan = (request = {}) => this.client.fetch({
628
624
  method: "DELETE",
629
- path: `/edge-services/v1alpha1/current-plan`,
630
- urlParams: marshalling.urlParams([
631
- "project_id",
632
- request.projectId ?? this.client.settings.defaultProjectId
633
- ])
625
+ path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
634
626
  });
635
627
  }
636
628
  exports.API = API;
@@ -614,21 +614,13 @@ class API extends API$1 {
614
614
  getCurrentPlan = (request = {}) => this.client.fetch(
615
615
  {
616
616
  method: "GET",
617
- path: `/edge-services/v1alpha1/current-plan`,
618
- urlParams: urlParams([
619
- "project_id",
620
- request.projectId ?? this.client.settings.defaultProjectId
621
- ])
617
+ path: `/edge-services/v1alpha1/current-plan/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
622
618
  },
623
619
  unmarshalPlan
624
620
  );
625
621
  deleteCurrentPlan = (request = {}) => this.client.fetch({
626
622
  method: "DELETE",
627
- path: `/edge-services/v1alpha1/current-plan`,
628
- urlParams: urlParams([
629
- "project_id",
630
- request.projectId ?? this.client.settings.defaultProjectId
631
- ])
623
+ path: `/edge-services/v1alpha1/current-plan/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
632
624
  });
633
625
  }
634
626
  export {
@@ -50,6 +50,9 @@ const CreateSSHKeyRequest = {
50
50
  }
51
51
  };
52
52
  const CreateUserRequestMember = {
53
+ email: {
54
+ ignoreEmpty: true
55
+ },
53
56
  password: {
54
57
  ignoreEmpty: true,
55
58
  maxLength: 72
@@ -48,6 +48,9 @@ export declare const CreateSSHKeyRequest: {
48
48
  };
49
49
  };
50
50
  export declare const CreateUserRequestMember: {
51
+ email: {
52
+ ignoreEmpty: boolean;
53
+ };
51
54
  password: {
52
55
  ignoreEmpty: boolean;
53
56
  maxLength: number;
@@ -48,6 +48,9 @@ const CreateSSHKeyRequest = {
48
48
  }
49
49
  };
50
50
  const CreateUserRequestMember = {
51
+ email: {
52
+ ignoreEmpty: true
53
+ },
51
54
  password: {
52
55
  ignoreEmpty: true,
53
56
  maxLength: 72
@@ -190,15 +190,14 @@ class API extends api.API {
190
190
  * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but
191
191
  * keep the slot on the hypervisor. `reboot`: Stop the instance and restart
192
192
  * it. `backup`: Create an image with all the volumes of an Instance.
193
- * `terminate`: Delete the Instance along with all attached volumes.
194
- * `enable_routed_ip`: Migrate the Instance to the new network stack.
193
+ * `terminate`: Delete the Instance along with its attached volumes, except
194
+ * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
195
+ * network stack.
195
196
  *
196
- * Keep in mind that terminating an Instance will result in the deletion of
197
- * all attached volumes, including local and block storage. If you want to
198
- * preserve your local volumes, you should use the `archive` action instead of
199
- * `terminate`. Similarly, if you want to keep your block storage volumes, you
200
- * must first detach them before issuing the `terminate` command. For more
201
- * information, read the [Volumes](#path-volumes-list-volumes) documentation.
197
+ * Keep in mind that `terminate` an Instance will result in the deletion of
198
+ * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
199
+ * will only be detached. If you want to preserve your volumes, you should
200
+ * detach them before the Instance deletion or `terminate` action.
202
201
  *
203
202
  * @param request - The request {@link ServerActionRequest}
204
203
  * @returns A Promise of ServerActionResponse
@@ -74,15 +74,14 @@ export declare class API extends ParentAPI {
74
74
  * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but
75
75
  * keep the slot on the hypervisor. `reboot`: Stop the instance and restart
76
76
  * it. `backup`: Create an image with all the volumes of an Instance.
77
- * `terminate`: Delete the Instance along with all attached volumes.
78
- * `enable_routed_ip`: Migrate the Instance to the new network stack.
79
- *
80
- * Keep in mind that terminating an Instance will result in the deletion of
81
- * all attached volumes, including local and block storage. If you want to
82
- * preserve your local volumes, you should use the `archive` action instead of
83
- * `terminate`. Similarly, if you want to keep your block storage volumes, you
84
- * must first detach them before issuing the `terminate` command. For more
85
- * information, read the [Volumes](#path-volumes-list-volumes) documentation.
77
+ * `terminate`: Delete the Instance along with its attached volumes, except
78
+ * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
79
+ * network stack.
80
+ *
81
+ * Keep in mind that `terminate` an Instance will result in the deletion of
82
+ * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
83
+ * will only be detached. If you want to preserve your volumes, you should
84
+ * detach them before the Instance deletion or `terminate` action.
86
85
  *
87
86
  * @param request - The request {@link ServerActionRequest}
88
87
  * @returns A Promise of ServerActionResponse
@@ -188,15 +188,14 @@ class API extends API$1 {
188
188
  * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but
189
189
  * keep the slot on the hypervisor. `reboot`: Stop the instance and restart
190
190
  * it. `backup`: Create an image with all the volumes of an Instance.
191
- * `terminate`: Delete the Instance along with all attached volumes.
192
- * `enable_routed_ip`: Migrate the Instance to the new network stack.
191
+ * `terminate`: Delete the Instance along with its attached volumes, except
192
+ * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
193
+ * network stack.
193
194
  *
194
- * Keep in mind that terminating an Instance will result in the deletion of
195
- * all attached volumes, including local and block storage. If you want to
196
- * preserve your local volumes, you should use the `archive` action instead of
197
- * `terminate`. Similarly, if you want to keep your block storage volumes, you
198
- * must first detach them before issuing the `terminate` command. For more
199
- * information, read the [Volumes](#path-volumes-list-volumes) documentation.
195
+ * Keep in mind that `terminate` an Instance will result in the deletion of
196
+ * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
197
+ * will only be detached. If you want to preserve your volumes, you should
198
+ * detach them before the Instance deletion or `terminate` action.
200
199
  *
201
200
  * @param request - The request {@link ServerActionRequest}
202
201
  * @returns A Promise of ServerActionResponse
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "v2.47.0";
3
+ const version = "v2.48.0";
4
4
  const userAgent = `scaleway-sdk-js/${version}`;
5
5
  exports.userAgent = userAgent;
6
6
  exports.version = version;
@@ -1,2 +1,2 @@
1
- export declare const version = "v2.47.0";
2
- export declare const userAgent = "scaleway-sdk-js/v2.47.0";
1
+ export declare const version = "v2.48.0";
2
+ export declare const userAgent = "scaleway-sdk-js/v2.48.0";
@@ -1,4 +1,4 @@
1
- const version = "v2.47.0";
1
+ const version = "v2.48.0";
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
  export {
4
4
  userAgent,
@@ -65,12 +65,25 @@ const unmarshalTimeSeries = (data) => {
65
65
  };
66
66
  };
67
67
  const unmarshalDecimal = (data) => {
68
- if (!(typeof data === "string")) {
68
+ if (!(typeof data === "object")) {
69
69
  throw new TypeError(
70
- `Unmarshalling the type 'Decimal' failed as data isn't a string.`
70
+ `Unmarshalling the type 'Decimal' failed as data isn't an object.`
71
71
  );
72
72
  }
73
- return new customTypes.Decimal(data);
73
+ if (data === null) {
74
+ return null;
75
+ }
76
+ if (!("value" in data)) {
77
+ throw new TypeError(
78
+ `Unmarshalling the type 'Decimal' failed as data object does not have a 'value' key.`
79
+ );
80
+ }
81
+ if (!(typeof data.value === "string")) {
82
+ throw new TypeError(
83
+ `Unmarshalling the type 'Decimal' failed as 'value' is not a string.`
84
+ );
85
+ }
86
+ return new customTypes.Decimal(data.value);
74
87
  };
75
88
  const marshalScwFile = (obj) => ({
76
89
  content: obj.content,
@@ -96,7 +109,9 @@ const marshalTimeSeries = (obj) => ({
96
109
  name: obj.name,
97
110
  points: obj.points.map((elt) => marshalTimeSeriesPoint(elt))
98
111
  });
99
- const marshalDecimal = (obj) => obj.toString();
112
+ const marshalDecimal = (obj) => ({
113
+ value: obj.toString()
114
+ });
100
115
  exports.marshalBlobToScwFile = marshalBlobToScwFile;
101
116
  exports.marshalDecimal = marshalDecimal;
102
117
  exports.marshalMoney = marshalMoney;
@@ -39,7 +39,7 @@ export declare const unmarshalTimeSeries: (data: unknown) => TimeSeries;
39
39
  *
40
40
  * @internal
41
41
  */
42
- export declare const unmarshalDecimal: (data: unknown) => Decimal;
42
+ export declare const unmarshalDecimal: (data: unknown) => Decimal | null;
43
43
  /**
44
44
  * Marshals {@link ScwFile}.
45
45
  *
@@ -75,4 +75,6 @@ export declare const marshalTimeSeries: (obj: TimeSeries) => Record<string, unkn
75
75
  *
76
76
  * @internal
77
77
  */
78
- export declare const marshalDecimal: (obj: Decimal) => string;
78
+ export declare const marshalDecimal: (obj: Decimal) => {
79
+ value: string;
80
+ };
@@ -63,12 +63,25 @@ const unmarshalTimeSeries = (data) => {
63
63
  };
64
64
  };
65
65
  const unmarshalDecimal = (data) => {
66
- if (!(typeof data === "string")) {
66
+ if (!(typeof data === "object")) {
67
67
  throw new TypeError(
68
- `Unmarshalling the type 'Decimal' failed as data isn't a string.`
68
+ `Unmarshalling the type 'Decimal' failed as data isn't an object.`
69
69
  );
70
70
  }
71
- return new Decimal(data);
71
+ if (data === null) {
72
+ return null;
73
+ }
74
+ if (!("value" in data)) {
75
+ throw new TypeError(
76
+ `Unmarshalling the type 'Decimal' failed as data object does not have a 'value' key.`
77
+ );
78
+ }
79
+ if (!(typeof data.value === "string")) {
80
+ throw new TypeError(
81
+ `Unmarshalling the type 'Decimal' failed as 'value' is not a string.`
82
+ );
83
+ }
84
+ return new Decimal(data.value);
72
85
  };
73
86
  const marshalScwFile = (obj) => ({
74
87
  content: obj.content,
@@ -94,7 +107,9 @@ const marshalTimeSeries = (obj) => ({
94
107
  name: obj.name,
95
108
  points: obj.points.map((elt) => marshalTimeSeriesPoint(elt))
96
109
  });
97
- const marshalDecimal = (obj) => obj.toString();
110
+ const marshalDecimal = (obj) => ({
111
+ value: obj.toString()
112
+ });
98
113
  export {
99
114
  marshalBlobToScwFile,
100
115
  marshalDecimal,
@@ -6,5 +6,6 @@ class Decimal {
6
6
  this.str = v;
7
7
  }
8
8
  toString = () => this.str;
9
+ marshal = () => ({ value: this.str });
9
10
  }
10
11
  exports.Decimal = Decimal;
@@ -70,4 +70,5 @@ export declare class Decimal {
70
70
  private readonly str;
71
71
  constructor(v: string);
72
72
  toString: () => string;
73
+ marshal: () => object;
73
74
  }
@@ -4,6 +4,7 @@ class Decimal {
4
4
  this.str = v;
5
5
  }
6
6
  toString = () => this.str;
7
+ marshal = () => ({ value: this.str });
7
8
  }
8
9
  export {
9
10
  Decimal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "2.48.0",
3
+ "version": "2.49.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -39,5 +39,5 @@
39
39
  "bundledDependencies": [
40
40
  "@scaleway/random-name"
41
41
  ],
42
- "gitHead": "fc282e715003bf6a78a375724ad1469c5c45aee8"
42
+ "gitHead": "0ab8ab3769eca4e9be107caa8f51f5b8d5a71cb7"
43
43
  }