@scaleway/sdk 2.46.0 → 2.48.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.
- package/dist/api/baremetal/v1/api.gen.cjs +36 -1
- package/dist/api/baremetal/v1/api.gen.d.ts +17 -1
- package/dist/api/baremetal/v1/api.gen.js +37 -2
- package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
- package/dist/api/baremetal/v1/marshalling.gen.cjs +200 -0
- package/dist/api/baremetal/v1/marshalling.gen.d.ts +4 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +200 -0
- package/dist/api/baremetal/v1/types.gen.d.ts +74 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +1 -0
- package/dist/api/billing/v2alpha1/types.gen.d.ts +2 -0
- package/dist/api/billing/v2beta1/marshalling.gen.cjs +1 -0
- package/dist/api/billing/v2beta1/marshalling.gen.js +1 -0
- package/dist/api/billing/v2beta1/types.gen.d.ts +2 -0
- package/dist/api/edge_services/v1alpha1/api.gen.cjs +636 -0
- package/dist/api/edge_services/v1alpha1/api.gen.d.ts +5 -1
- package/dist/api/edge_services/v1alpha1/api.gen.js +636 -0
- package/dist/api/edge_services/v1alpha1/content.gen.cjs +8 -0
- package/dist/api/edge_services/v1alpha1/content.gen.js +8 -0
- package/dist/api/edge_services/v1alpha1/index.gen.cjs +7 -0
- package/dist/api/edge_services/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/edge_services/v1alpha1/index.gen.js +7 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +474 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.d.ts +5 -2
- package/dist/api/edge_services/v1alpha1/marshalling.gen.js +474 -0
- package/dist/api/edge_services/v1alpha1/types.gen.d.ts +51 -28
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +2 -0
- package/dist/api/index.d.ts +65 -35
- package/dist/api/inference/v1beta1/api.gen.cjs +306 -0
- package/dist/api/inference/v1beta1/api.gen.js +306 -0
- package/dist/api/inference/v1beta1/content.gen.cjs +8 -0
- package/dist/api/inference/v1beta1/content.gen.js +8 -0
- package/dist/api/inference/v1beta1/index.gen.cjs +8 -0
- package/dist/api/inference/v1beta1/index.gen.js +8 -0
- package/dist/api/inference/v1beta1/marshalling.gen.cjs +273 -0
- package/dist/api/inference/v1beta1/marshalling.gen.js +273 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.cjs +56 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.js +56 -0
- package/dist/api/k8s/v1/marshalling.gen.cjs +1 -0
- package/dist/api/k8s/v1/marshalling.gen.js +1 -0
- package/dist/api/k8s/v1/types.gen.d.ts +2 -0
- package/dist/api/k8s/v1/validation-rules.gen.cjs +63 -0
- package/dist/api/k8s/v1/validation-rules.gen.d.ts +60 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +64 -1
- package/dist/api/mnq/index.gen.cjs +4 -0
- package/dist/api/mnq/index.gen.js +4 -0
- package/dist/api/qaas/v1alpha1/api.gen.cjs +527 -0
- package/dist/api/qaas/v1alpha1/api.gen.js +527 -0
- package/dist/api/qaas/v1alpha1/content.gen.cjs +19 -0
- package/dist/api/qaas/v1alpha1/content.gen.js +19 -0
- package/dist/api/qaas/v1alpha1/index.gen.cjs +10 -0
- package/dist/api/qaas/v1alpha1/index.gen.js +10 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.cjs +320 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.js +320 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.cjs +14 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/tem/index.gen.cjs +4 -0
- package/dist/api/tem/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/api.gen.cjs +32 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +17 -1
- package/dist/api/tem/v1alpha1/api.gen.js +33 -1
- package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +36 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +3 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +36 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +51 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +11 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +10 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +11 -0
- package/dist/api/webhosting/index.gen.cjs +6 -0
- package/dist/api/webhosting/index.gen.js +6 -0
- package/dist/api/webhosting/v1/api.gen.cjs +620 -0
- package/dist/api/webhosting/v1/api.gen.js +620 -0
- package/dist/api/webhosting/v1/content.gen.cjs +14 -0
- package/dist/api/webhosting/v1/content.gen.js +14 -0
- package/dist/api/webhosting/v1/index.gen.cjs +15 -0
- package/dist/api/webhosting/v1/index.gen.js +15 -0
- package/dist/api/webhosting/v1/marshalling.gen.cjs +391 -0
- package/dist/api/webhosting/v1/marshalling.gen.js +391 -0
- package/dist/api/webhosting/v1/types.gen.d.ts +5 -0
- package/dist/api/webhosting/v1/validation-rules.gen.cjs +82 -0
- package/dist/api/webhosting/v1/validation-rules.gen.js +82 -0
- package/dist/index.cjs +92 -70
- package/dist/index.js +92 -70
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
- package/dist/api/account/index.d.ts +0 -2
- package/dist/api/applesilicon/index.d.ts +0 -1
- package/dist/api/baremetal/index.d.ts +0 -1
- package/dist/api/billing/index.d.ts +0 -2
- package/dist/api/block/index.d.ts +0 -1
- package/dist/api/cockpit/index.d.ts +0 -2
- package/dist/api/container/index.d.ts +0 -1
- package/dist/api/dedibox/index.d.ts +0 -1
- package/dist/api/document_db/index.d.ts +0 -1
- package/dist/api/domain/index.d.ts +0 -1
- package/dist/api/edge_services/index.d.ts +0 -1
- package/dist/api/flexibleip/index.d.ts +0 -1
- package/dist/api/function/index.d.ts +0 -1
- package/dist/api/iam/index.d.ts +0 -1
- package/dist/api/instance/index.d.ts +0 -1
- package/dist/api/iot/index.d.ts +0 -1
- package/dist/api/ipam/index.d.ts +0 -1
- package/dist/api/ipfs/index.d.ts +0 -1
- package/dist/api/jobs/index.d.ts +0 -1
- package/dist/api/k8s/index.d.ts +0 -1
- package/dist/api/key_manager/index.d.ts +0 -1
- package/dist/api/lb/index.d.ts +0 -1
- package/dist/api/llm_inference/index.d.ts +0 -1
- package/dist/api/marketplace/index.d.ts +0 -1
- package/dist/api/mnq/index.d.ts +0 -1
- package/dist/api/rdb/index.d.ts +0 -1
- package/dist/api/redis/index.d.ts +0 -1
- package/dist/api/registry/index.d.ts +0 -1
- package/dist/api/secret/index.d.ts +0 -2
- package/dist/api/serverless_sqldb/index.d.ts +0 -1
- package/dist/api/tem/index.d.ts +0 -1
- package/dist/api/test/index.d.ts +0 -1
- package/dist/api/vpc/index.d.ts +0 -2
- package/dist/api/vpcgw/index.d.ts +0 -1
- package/dist/api/webhosting/index.d.ts +0 -1
- /package/dist/api/account/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/account/{index.js → index.gen.js} +0 -0
- /package/dist/api/applesilicon/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/applesilicon/{index.js → index.gen.js} +0 -0
- /package/dist/api/baremetal/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/baremetal/{index.js → index.gen.js} +0 -0
- /package/dist/api/billing/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/billing/{index.js → index.gen.js} +0 -0
- /package/dist/api/block/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/block/{index.js → index.gen.js} +0 -0
- /package/dist/api/cockpit/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/cockpit/{index.js → index.gen.js} +0 -0
- /package/dist/api/container/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/container/{index.js → index.gen.js} +0 -0
- /package/dist/api/dedibox/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/dedibox/{index.js → index.gen.js} +0 -0
- /package/dist/api/document_db/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/document_db/{index.js → index.gen.js} +0 -0
- /package/dist/api/domain/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/domain/{index.js → index.gen.js} +0 -0
- /package/dist/api/{flexibleip/index.cjs → edge_services/index.gen.cjs} +0 -0
- /package/dist/api/{flexibleip/index.js → edge_services/index.gen.js} +0 -0
- /package/dist/api/{iam/index.cjs → flexibleip/index.gen.cjs} +0 -0
- /package/dist/api/{iam/index.js → flexibleip/index.gen.js} +0 -0
- /package/dist/api/function/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/function/{index.js → index.gen.js} +0 -0
- /package/dist/api/{ipfs/index.cjs → iam/index.gen.cjs} +0 -0
- /package/dist/api/{ipfs/index.js → iam/index.gen.js} +0 -0
- /package/dist/api/{llm_inference/index.cjs → inference/index.gen.cjs} +0 -0
- /package/dist/api/{llm_inference/index.js → inference/index.gen.js} +0 -0
- /package/dist/api/instance/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/instance/{index.js → index.gen.js} +0 -0
- /package/dist/api/iot/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/iot/{index.js → index.gen.js} +0 -0
- /package/dist/api/ipam/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/ipam/{index.js → index.gen.js} +0 -0
- /package/dist/api/{jobs/index.cjs → ipfs/index.gen.cjs} +0 -0
- /package/dist/api/{jobs/index.js → ipfs/index.gen.js} +0 -0
- /package/dist/api/{key_manager/index.cjs → jobs/index.gen.cjs} +0 -0
- /package/dist/api/{key_manager/index.js → jobs/index.gen.js} +0 -0
- /package/dist/api/k8s/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/k8s/{index.js → index.gen.js} +0 -0
- /package/dist/api/{serverless_sqldb/index.cjs → key_manager/index.gen.cjs} +0 -0
- /package/dist/api/{serverless_sqldb/index.js → key_manager/index.gen.js} +0 -0
- /package/dist/api/lb/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/lb/{index.js → index.gen.js} +0 -0
- /package/dist/api/{mnq/index.cjs → llm_inference/index.gen.cjs} +0 -0
- /package/dist/api/{mnq/index.js → llm_inference/index.gen.js} +0 -0
- /package/dist/api/marketplace/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/marketplace/{index.js → index.gen.js} +0 -0
- /package/dist/api/{tem/index.cjs → qaas/index.gen.cjs} +0 -0
- /package/dist/api/{tem/index.js → qaas/index.gen.js} +0 -0
- /package/dist/api/rdb/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/rdb/{index.js → index.gen.js} +0 -0
- /package/dist/api/redis/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/redis/{index.js → index.gen.js} +0 -0
- /package/dist/api/registry/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/registry/{index.js → index.gen.js} +0 -0
- /package/dist/api/secret/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/secret/{index.js → index.gen.js} +0 -0
- /package/dist/api/{webhosting/index.cjs → serverless_sqldb/index.gen.cjs} +0 -0
- /package/dist/api/{webhosting/index.js → serverless_sqldb/index.gen.js} +0 -0
- /package/dist/api/test/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/test/{index.js → index.gen.js} +0 -0
- /package/dist/api/vpc/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/vpc/{index.js → index.gen.js} +0 -0
- /package/dist/api/vpcgw/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/vpcgw/{index.js → index.gen.js} +0 -0
|
@@ -16,7 +16,9 @@ class API extends api.API {
|
|
|
16
16
|
"fr-par-1",
|
|
17
17
|
"fr-par-2",
|
|
18
18
|
"nl-ams-1",
|
|
19
|
-
"nl-ams-2"
|
|
19
|
+
"nl-ams-2",
|
|
20
|
+
"pl-waw-2",
|
|
21
|
+
"pl-waw-3"
|
|
20
22
|
];
|
|
21
23
|
pageOfListServers = (request = {}) => this.client.fetch(
|
|
22
24
|
{
|
|
@@ -232,6 +234,39 @@ class API extends api.API {
|
|
|
232
234
|
* @returns A Promise of ListServerEventsResponse
|
|
233
235
|
*/
|
|
234
236
|
listServerEvents = (request) => resourcePaginator.enrichForPagination("events", this.pageOfListServerEvents, request);
|
|
237
|
+
/**
|
|
238
|
+
* Get default partitioning schema. Get the default partitioning schema for
|
|
239
|
+
* the given offer ID and OS ID.
|
|
240
|
+
*
|
|
241
|
+
* @param request - The request {@link GetDefaultPartitioningSchemaRequest}
|
|
242
|
+
* @returns A Promise of Schema
|
|
243
|
+
*/
|
|
244
|
+
getDefaultPartitioningSchema = (request) => this.client.fetch(
|
|
245
|
+
{
|
|
246
|
+
method: "GET",
|
|
247
|
+
path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
|
|
248
|
+
urlParams: marshalling.urlParams(
|
|
249
|
+
["offer_id", request.offerId],
|
|
250
|
+
["os_id", request.osId]
|
|
251
|
+
)
|
|
252
|
+
},
|
|
253
|
+
marshalling_gen.unmarshalSchema
|
|
254
|
+
);
|
|
255
|
+
/**
|
|
256
|
+
* Validate client partitioning schema. Validate the incoming partitioning
|
|
257
|
+
* schema from a user before installing the server. Return default ErrorCode
|
|
258
|
+
* if invalid.
|
|
259
|
+
*
|
|
260
|
+
* @param request - The request {@link ValidatePartitioningSchemaRequest}
|
|
261
|
+
*/
|
|
262
|
+
validatePartitioningSchema = (request) => this.client.fetch({
|
|
263
|
+
body: JSON.stringify(
|
|
264
|
+
marshalling_gen.marshalValidatePartitioningSchemaRequest(request, this.client.settings)
|
|
265
|
+
),
|
|
266
|
+
headers: jsonContentHeaders,
|
|
267
|
+
method: "POST",
|
|
268
|
+
path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
|
|
269
|
+
});
|
|
235
270
|
/**
|
|
236
271
|
* Start BMC access. Start BMC (Baseboard Management Controller) access
|
|
237
272
|
* associated with the ID. The BMC (Baseboard Management Controller) access is
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { WaitForOptions, Zone } from '../../../bridge';
|
|
3
|
-
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, DeleteOptionServerRequest, DeleteServerRequest, GetBMCAccessRequest, GetOSRequest, GetOfferRequest, GetOptionRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, IP, InstallServerRequest, ListOSRequest, ListOSResponse, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListServerEventsRequest, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersRequest, ListServersResponse, ListSettingsRequest, ListSettingsResponse, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest } from './types.gen';
|
|
3
|
+
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, DeleteOptionServerRequest, DeleteServerRequest, GetBMCAccessRequest, GetDefaultPartitioningSchemaRequest, GetOSRequest, GetOfferRequest, GetOptionRequest, GetServerMetricsRequest, GetServerMetricsResponse, GetServerRequest, IP, InstallServerRequest, ListOSRequest, ListOSResponse, ListOffersRequest, ListOffersResponse, ListOptionsRequest, ListOptionsResponse, ListServerEventsRequest, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersRequest, ListServersResponse, ListSettingsRequest, ListSettingsResponse, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Elastic Metal API.
|
|
6
6
|
*
|
|
@@ -114,6 +114,22 @@ export declare class API extends ParentAPI {
|
|
|
114
114
|
all: () => Promise<import("./types.gen").ServerEvent[]>;
|
|
115
115
|
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").ServerEvent[], void, void>;
|
|
116
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Get default partitioning schema. Get the default partitioning schema for
|
|
119
|
+
* the given offer ID and OS ID.
|
|
120
|
+
*
|
|
121
|
+
* @param request - The request {@link GetDefaultPartitioningSchemaRequest}
|
|
122
|
+
* @returns A Promise of Schema
|
|
123
|
+
*/
|
|
124
|
+
getDefaultPartitioningSchema: (request: Readonly<GetDefaultPartitioningSchemaRequest>) => Promise<Schema>;
|
|
125
|
+
/**
|
|
126
|
+
* Validate client partitioning schema. Validate the incoming partitioning
|
|
127
|
+
* schema from a user before installing the server. Return default ErrorCode
|
|
128
|
+
* if invalid.
|
|
129
|
+
*
|
|
130
|
+
* @param request - The request {@link ValidatePartitioningSchemaRequest}
|
|
131
|
+
*/
|
|
132
|
+
validatePartitioningSchema: (request: Readonly<ValidatePartitioningSchemaRequest>) => Promise<void>;
|
|
117
133
|
/**
|
|
118
134
|
* Start BMC access. Start BMC (Baseboard Management Controller) access
|
|
119
135
|
* associated with the ID. The BMC (Baseboard Management Controller) access is
|
|
@@ -4,7 +4,7 @@ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
6
6
|
import { SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
7
|
-
import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS } from "./marshalling.gen.js";
|
|
7
|
+
import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, unmarshalSchema, marshalValidatePartitioningSchemaRequest, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS } from "./marshalling.gen.js";
|
|
8
8
|
const jsonContentHeaders = {
|
|
9
9
|
"Content-Type": "application/json; charset=utf-8"
|
|
10
10
|
};
|
|
@@ -14,7 +14,9 @@ class API extends API$1 {
|
|
|
14
14
|
"fr-par-1",
|
|
15
15
|
"fr-par-2",
|
|
16
16
|
"nl-ams-1",
|
|
17
|
-
"nl-ams-2"
|
|
17
|
+
"nl-ams-2",
|
|
18
|
+
"pl-waw-2",
|
|
19
|
+
"pl-waw-3"
|
|
18
20
|
];
|
|
19
21
|
pageOfListServers = (request = {}) => this.client.fetch(
|
|
20
22
|
{
|
|
@@ -230,6 +232,39 @@ class API extends API$1 {
|
|
|
230
232
|
* @returns A Promise of ListServerEventsResponse
|
|
231
233
|
*/
|
|
232
234
|
listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
|
|
235
|
+
/**
|
|
236
|
+
* Get default partitioning schema. Get the default partitioning schema for
|
|
237
|
+
* the given offer ID and OS ID.
|
|
238
|
+
*
|
|
239
|
+
* @param request - The request {@link GetDefaultPartitioningSchemaRequest}
|
|
240
|
+
* @returns A Promise of Schema
|
|
241
|
+
*/
|
|
242
|
+
getDefaultPartitioningSchema = (request) => this.client.fetch(
|
|
243
|
+
{
|
|
244
|
+
method: "GET",
|
|
245
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
|
|
246
|
+
urlParams: urlParams(
|
|
247
|
+
["offer_id", request.offerId],
|
|
248
|
+
["os_id", request.osId]
|
|
249
|
+
)
|
|
250
|
+
},
|
|
251
|
+
unmarshalSchema
|
|
252
|
+
);
|
|
253
|
+
/**
|
|
254
|
+
* Validate client partitioning schema. Validate the incoming partitioning
|
|
255
|
+
* schema from a user before installing the server. Return default ErrorCode
|
|
256
|
+
* if invalid.
|
|
257
|
+
*
|
|
258
|
+
* @param request - The request {@link ValidatePartitioningSchemaRequest}
|
|
259
|
+
*/
|
|
260
|
+
validatePartitioningSchema = (request) => this.client.fetch({
|
|
261
|
+
body: JSON.stringify(
|
|
262
|
+
marshalValidatePartitioningSchemaRequest(request, this.client.settings)
|
|
263
|
+
),
|
|
264
|
+
headers: jsonContentHeaders,
|
|
265
|
+
method: "POST",
|
|
266
|
+
path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
|
|
267
|
+
});
|
|
233
268
|
/**
|
|
234
269
|
* Start BMC access. Start BMC (Baseboard Management Controller) access
|
|
235
270
|
* associated with the ID. The BMC (Baseboard Management Controller) access is
|
|
@@ -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, 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, Server, ServerBootType, ServerEvent, ServerInstall, ServerInstallStatus, ServerOption, ServerOptionOptionStatus, ServerPingStatus, ServerPrivateNetwork, ServerPrivateNetworkStatus, ServerRescueServer, ServerStatus, SetServerPrivateNetworksResponse, Setting, SettingType, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, } 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, 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';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -3,6 +3,139 @@ 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
|
+
const unmarshalSchemaPartition = (data) => {
|
|
21
|
+
if (!json.isJSONObject(data)) {
|
|
22
|
+
throw new TypeError(
|
|
23
|
+
`Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
label: data.label,
|
|
28
|
+
number: data.number,
|
|
29
|
+
size: data.size
|
|
30
|
+
};
|
|
31
|
+
};
|
|
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
|
+
const unmarshalSchemaPool = (data) => {
|
|
48
|
+
if (!json.isJSONObject(data)) {
|
|
49
|
+
throw new TypeError(
|
|
50
|
+
`Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
devices: data.devices,
|
|
55
|
+
filesystemOptions: data.filesystem_options,
|
|
56
|
+
name: data.name,
|
|
57
|
+
options: data.options,
|
|
58
|
+
type: data.type
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const unmarshalSchemaDisk = (data) => {
|
|
62
|
+
if (!json.isJSONObject(data)) {
|
|
63
|
+
throw new TypeError(
|
|
64
|
+
`Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
device: data.device,
|
|
69
|
+
partitions: marshalling.unmarshalArrayOfObject(
|
|
70
|
+
data.partitions,
|
|
71
|
+
unmarshalSchemaPartition
|
|
72
|
+
)
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const unmarshalSchemaFilesystem = (data) => {
|
|
76
|
+
if (!json.isJSONObject(data)) {
|
|
77
|
+
throw new TypeError(
|
|
78
|
+
`Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
device: data.device,
|
|
83
|
+
format: data.format,
|
|
84
|
+
mountpoint: data.mountpoint
|
|
85
|
+
};
|
|
86
|
+
};
|
|
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
|
+
const unmarshalSchemaRAID = (data) => {
|
|
101
|
+
if (!json.isJSONObject(data)) {
|
|
102
|
+
throw new TypeError(
|
|
103
|
+
`Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
devices: data.devices,
|
|
108
|
+
level: data.level,
|
|
109
|
+
name: data.name
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const unmarshalSchemaZFS = (data) => {
|
|
113
|
+
if (!json.isJSONObject(data)) {
|
|
114
|
+
throw new TypeError(
|
|
115
|
+
`Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
pools: marshalling.unmarshalArrayOfObject(data.pools, unmarshalSchemaPool)
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const unmarshalSchema = (data) => {
|
|
123
|
+
if (!json.isJSONObject(data)) {
|
|
124
|
+
throw new TypeError(
|
|
125
|
+
`Unmarshalling the type 'Schema' failed as data isn't a dictionary.`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
|
|
130
|
+
filesystems: marshalling.unmarshalArrayOfObject(
|
|
131
|
+
data.filesystems,
|
|
132
|
+
unmarshalSchemaFilesystem
|
|
133
|
+
),
|
|
134
|
+
lvm: data.lvm ? unmarshalSchemaLVM(data.lvm) : void 0,
|
|
135
|
+
raids: marshalling.unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
|
|
136
|
+
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
|
|
137
|
+
};
|
|
138
|
+
};
|
|
6
139
|
const unmarshalIP = (data) => {
|
|
7
140
|
if (!json.isJSONObject(data)) {
|
|
8
141
|
throw new TypeError(
|
|
@@ -533,17 +666,83 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
533
666
|
const marshalUpdateSettingRequest = (request, defaults) => ({
|
|
534
667
|
enabled: request.enabled
|
|
535
668
|
});
|
|
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
|
+
const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
|
|
729
|
+
offer_id: request.offerId,
|
|
730
|
+
os_id: request.osId,
|
|
731
|
+
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0
|
|
732
|
+
});
|
|
536
733
|
exports.marshalAddOptionServerRequest = marshalAddOptionServerRequest;
|
|
537
734
|
exports.marshalCreateServerRequest = marshalCreateServerRequest;
|
|
538
735
|
exports.marshalInstallServerRequest = marshalInstallServerRequest;
|
|
539
736
|
exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;
|
|
540
737
|
exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;
|
|
541
738
|
exports.marshalRebootServerRequest = marshalRebootServerRequest;
|
|
739
|
+
exports.marshalSchema = marshalSchema;
|
|
542
740
|
exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;
|
|
543
741
|
exports.marshalStartServerRequest = marshalStartServerRequest;
|
|
544
742
|
exports.marshalUpdateIPRequest = marshalUpdateIPRequest;
|
|
545
743
|
exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
|
|
546
744
|
exports.marshalUpdateSettingRequest = marshalUpdateSettingRequest;
|
|
745
|
+
exports.marshalValidatePartitioningSchemaRequest = marshalValidatePartitioningSchemaRequest;
|
|
547
746
|
exports.unmarshalBMCAccess = unmarshalBMCAccess;
|
|
548
747
|
exports.unmarshalGetServerMetricsResponse = unmarshalGetServerMetricsResponse;
|
|
549
748
|
exports.unmarshalIP = unmarshalIP;
|
|
@@ -557,6 +756,7 @@ exports.unmarshalListSettingsResponse = unmarshalListSettingsResponse;
|
|
|
557
756
|
exports.unmarshalOS = unmarshalOS;
|
|
558
757
|
exports.unmarshalOffer = unmarshalOffer;
|
|
559
758
|
exports.unmarshalOption = unmarshalOption;
|
|
759
|
+
exports.unmarshalSchema = unmarshalSchema;
|
|
560
760
|
exports.unmarshalServer = unmarshalServer;
|
|
561
761
|
exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;
|
|
562
762
|
exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, GetServerMetricsResponse, IP, InstallServerRequest, ListOSResponse, ListOffersResponse, ListOptionsResponse, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersResponse, ListSettingsResponse, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest } from './types.gen';
|
|
2
|
+
import type { AddOptionServerRequest, BMCAccess, CreateServerRequest, GetServerMetricsResponse, IP, InstallServerRequest, ListOSResponse, ListOffersResponse, ListOptionsResponse, ListServerEventsResponse, ListServerPrivateNetworksResponse, ListServersResponse, ListSettingsResponse, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen';
|
|
3
|
+
export declare const unmarshalSchema: (data: unknown) => Schema;
|
|
3
4
|
export declare const unmarshalIP: (data: unknown) => IP;
|
|
4
5
|
export declare const unmarshalOS: (data: unknown) => OS;
|
|
5
6
|
export declare const unmarshalOffer: (data: unknown) => Offer;
|
|
@@ -28,3 +29,5 @@ export declare const marshalStartServerRequest: (request: StartServerRequest, de
|
|
|
28
29
|
export declare const marshalUpdateIPRequest: (request: UpdateIPRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
29
30
|
export declare const marshalUpdateServerRequest: (request: UpdateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
30
31
|
export declare const marshalUpdateSettingRequest: (request: UpdateSettingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
32
|
+
export declare const marshalSchema: (request: Schema, defaults: DefaultValues) => Record<string, unknown>;
|
|
33
|
+
export declare const marshalValidatePartitioningSchemaRequest: (request: ValidatePartitioningSchemaRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -1,6 +1,139 @@
|
|
|
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
|
+
const unmarshalSchemaPartition = (data) => {
|
|
19
|
+
if (!isJSONObject(data)) {
|
|
20
|
+
throw new TypeError(
|
|
21
|
+
`Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
label: data.label,
|
|
26
|
+
number: data.number,
|
|
27
|
+
size: data.size
|
|
28
|
+
};
|
|
29
|
+
};
|
|
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
|
+
const unmarshalSchemaPool = (data) => {
|
|
46
|
+
if (!isJSONObject(data)) {
|
|
47
|
+
throw new TypeError(
|
|
48
|
+
`Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
devices: data.devices,
|
|
53
|
+
filesystemOptions: data.filesystem_options,
|
|
54
|
+
name: data.name,
|
|
55
|
+
options: data.options,
|
|
56
|
+
type: data.type
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const unmarshalSchemaDisk = (data) => {
|
|
60
|
+
if (!isJSONObject(data)) {
|
|
61
|
+
throw new TypeError(
|
|
62
|
+
`Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
device: data.device,
|
|
67
|
+
partitions: unmarshalArrayOfObject(
|
|
68
|
+
data.partitions,
|
|
69
|
+
unmarshalSchemaPartition
|
|
70
|
+
)
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const unmarshalSchemaFilesystem = (data) => {
|
|
74
|
+
if (!isJSONObject(data)) {
|
|
75
|
+
throw new TypeError(
|
|
76
|
+
`Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
device: data.device,
|
|
81
|
+
format: data.format,
|
|
82
|
+
mountpoint: data.mountpoint
|
|
83
|
+
};
|
|
84
|
+
};
|
|
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
|
+
const unmarshalSchemaRAID = (data) => {
|
|
99
|
+
if (!isJSONObject(data)) {
|
|
100
|
+
throw new TypeError(
|
|
101
|
+
`Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
devices: data.devices,
|
|
106
|
+
level: data.level,
|
|
107
|
+
name: data.name
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const unmarshalSchemaZFS = (data) => {
|
|
111
|
+
if (!isJSONObject(data)) {
|
|
112
|
+
throw new TypeError(
|
|
113
|
+
`Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
pools: unmarshalArrayOfObject(data.pools, unmarshalSchemaPool)
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
const unmarshalSchema = (data) => {
|
|
121
|
+
if (!isJSONObject(data)) {
|
|
122
|
+
throw new TypeError(
|
|
123
|
+
`Unmarshalling the type 'Schema' failed as data isn't a dictionary.`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
disks: unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),
|
|
128
|
+
filesystems: unmarshalArrayOfObject(
|
|
129
|
+
data.filesystems,
|
|
130
|
+
unmarshalSchemaFilesystem
|
|
131
|
+
),
|
|
132
|
+
lvm: data.lvm ? unmarshalSchemaLVM(data.lvm) : void 0,
|
|
133
|
+
raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),
|
|
134
|
+
zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0
|
|
135
|
+
};
|
|
136
|
+
};
|
|
4
137
|
const unmarshalIP = (data) => {
|
|
5
138
|
if (!isJSONObject(data)) {
|
|
6
139
|
throw new TypeError(
|
|
@@ -531,6 +664,70 @@ const marshalUpdateServerRequest = (request, defaults) => ({
|
|
|
531
664
|
const marshalUpdateSettingRequest = (request, defaults) => ({
|
|
532
665
|
enabled: request.enabled
|
|
533
666
|
});
|
|
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
|
+
const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({
|
|
727
|
+
offer_id: request.offerId,
|
|
728
|
+
os_id: request.osId,
|
|
729
|
+
partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0
|
|
730
|
+
});
|
|
534
731
|
export {
|
|
535
732
|
marshalAddOptionServerRequest,
|
|
536
733
|
marshalCreateServerRequest,
|
|
@@ -538,11 +735,13 @@ export {
|
|
|
538
735
|
marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
|
|
539
736
|
marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
|
|
540
737
|
marshalRebootServerRequest,
|
|
738
|
+
marshalSchema,
|
|
541
739
|
marshalStartBMCAccessRequest,
|
|
542
740
|
marshalStartServerRequest,
|
|
543
741
|
marshalUpdateIPRequest,
|
|
544
742
|
marshalUpdateServerRequest,
|
|
545
743
|
marshalUpdateSettingRequest,
|
|
744
|
+
marshalValidatePartitioningSchemaRequest,
|
|
546
745
|
unmarshalBMCAccess,
|
|
547
746
|
unmarshalGetServerMetricsResponse,
|
|
548
747
|
unmarshalIP,
|
|
@@ -556,6 +755,7 @@ export {
|
|
|
556
755
|
unmarshalOS,
|
|
557
756
|
unmarshalOffer,
|
|
558
757
|
unmarshalOption,
|
|
758
|
+
unmarshalSchema,
|
|
559
759
|
unmarshalServer,
|
|
560
760
|
unmarshalServerPrivateNetwork,
|
|
561
761
|
unmarshalSetServerPrivateNetworksResponse,
|