@scaleway/sdk-baremetal 2.7.1 → 2.9.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.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as Baremetalv1 from './v1/index.gen.js';
6
+ export * as Baremetalv3 from './v3/index.gen.js';
@@ -0,0 +1,3 @@
1
+ import { index_gen_exports } from "./v1/index.gen.js";
2
+ import { index_gen_exports as index_gen_exports$1 } from "./v3/index.gen.js";
3
+ export { index_gen_exports as Baremetalv1, index_gen_exports$1 as Baremetalv3 };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-baremetal";
7
+ readonly namespace: "baremetal";
8
+ readonly displayName: "Baremetal";
9
+ readonly versions: readonly ["v1", "v3"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-baremetal",
8
+ namespace: "baremetal",
9
+ displayName: "Baremetal",
10
+ versions: ["v1", "v3"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -0,0 +1,292 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client';
3
+ import type { AddOptionServerRequest, BMCAccess, BatchCreateServersRequest, BatchCreateServersResponse, 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, MigrateServerToMonthlyOfferRequest, OS, Offer, Option, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, RebootServerRequest, Schema, Server, ServerPrivateNetwork, SetServerPrivateNetworksResponse, Setting, StartBMCAccessRequest, StartServerRequest, StopBMCAccessRequest, StopServerRequest, UpdateIPRequest, UpdateServerRequest, UpdateSettingRequest, ValidatePartitioningSchemaRequest } from './types.gen.js';
4
+ /**
5
+ * Elastic Metal API.
6
+
7
+ This API allows you to manage your Elastic Metal servers.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
15
+ protected pageOfListServers: (request?: Readonly<ListServersRequest>) => Promise<ListServersResponse>;
16
+ /**
17
+ * List Elastic Metal servers for an Organization. List Elastic Metal servers for a specific Organization.
18
+ *
19
+ * @param request - The request {@link ListServersRequest}
20
+ * @returns A Promise of ListServersResponse
21
+ */
22
+ listServers: (request?: Readonly<ListServersRequest>) => Promise<ListServersResponse> & {
23
+ all: () => Promise<Server[]>;
24
+ [Symbol.asyncIterator]: () => AsyncGenerator<Server[], void, void>;
25
+ };
26
+ /**
27
+ * Get a specific Elastic Metal server. Get full details of an existing Elastic Metal server associated with the ID.
28
+ *
29
+ * @param request - The request {@link GetServerRequest}
30
+ * @returns A Promise of Server
31
+ */
32
+ getServer: (request: Readonly<GetServerRequest>) => Promise<Server>;
33
+ /**
34
+ * Waits for {@link Server} to be in a final state.
35
+ *
36
+ * @param request - The request {@link GetServerRequest}
37
+ * @param options - The waiting options
38
+ * @returns A Promise of Server
39
+ */
40
+ waitForServer: (request: Readonly<GetServerRequest>, options?: Readonly<WaitForOptions<Server>>) => Promise<Server>;
41
+ /**
42
+ * Create an Elastic Metal server. Create a new Elastic Metal server. Once the server is created, proceed with the [installation of an OS](#post-3e949e).
43
+ *
44
+ * @param request - The request {@link CreateServerRequest}
45
+ * @returns A Promise of Server
46
+ */
47
+ createServer: (request: Readonly<CreateServerRequest>) => Promise<Server>;
48
+ /**
49
+ * Create multiple Elastic Metal servers. Create multiple new Elastic Metal servers. Once the servers are created, proceed with the [installation of an OS](#post-3e949e).
50
+ *
51
+ * @param request - The request {@link BatchCreateServersRequest}
52
+ * @returns A Promise of BatchCreateServersResponse
53
+ */
54
+ batchCreateServers: (request?: Readonly<BatchCreateServersRequest>) => Promise<BatchCreateServersResponse>;
55
+ /**
56
+ * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated.
57
+ *
58
+ * @param request - The request {@link UpdateServerRequest}
59
+ * @returns A Promise of Server
60
+ */
61
+ updateServer: (request: Readonly<UpdateServerRequest>) => Promise<Server>;
62
+ /**
63
+ * Install an Elastic Metal server. Install an Operating System (OS) on the Elastic Metal server with a specific ID.
64
+ *
65
+ * @param request - The request {@link InstallServerRequest}
66
+ * @returns A Promise of Server
67
+ */
68
+ installServer: (request: Readonly<InstallServerRequest>) => Promise<Server>;
69
+ /**
70
+ * Return server metrics. Get the ping status of the server associated with the ID.
71
+ *
72
+ * @param request - The request {@link GetServerMetricsRequest}
73
+ * @returns A Promise of GetServerMetricsResponse
74
+ */
75
+ getServerMetrics: (request: Readonly<GetServerMetricsRequest>) => Promise<GetServerMetricsResponse>;
76
+ /**
77
+ * Delete an Elastic Metal server. Delete the server associated with the ID.
78
+ *
79
+ * @param request - The request {@link DeleteServerRequest}
80
+ * @returns A Promise of Server
81
+ */
82
+ deleteServer: (request: Readonly<DeleteServerRequest>) => Promise<Server>;
83
+ /**
84
+ * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated with the ID, use the `boot_type` `rescue` to reboot the server in rescue mode.
85
+ *
86
+ * @param request - The request {@link RebootServerRequest}
87
+ * @returns A Promise of Server
88
+ */
89
+ rebootServer: (request: Readonly<RebootServerRequest>) => Promise<Server>;
90
+ /**
91
+ * Start an Elastic Metal server. Start the server associated with the ID.
92
+ *
93
+ * @param request - The request {@link StartServerRequest}
94
+ * @returns A Promise of Server
95
+ */
96
+ startServer: (request: Readonly<StartServerRequest>) => Promise<Server>;
97
+ /**
98
+ * Stop an Elastic Metal server. Stop the server associated with the ID. The server remains allocated to your account and all data remains on the local storage of the server.
99
+ *
100
+ * @param request - The request {@link StopServerRequest}
101
+ * @returns A Promise of Server
102
+ */
103
+ stopServer: (request: Readonly<StopServerRequest>) => Promise<Server>;
104
+ protected pageOfListServerEvents: (request: Readonly<ListServerEventsRequest>) => Promise<ListServerEventsResponse>;
105
+ /**
106
+ * List server events. List event (i.e. start/stop/reboot) associated to the server ID.
107
+ *
108
+ * @param request - The request {@link ListServerEventsRequest}
109
+ * @returns A Promise of ListServerEventsResponse
110
+ */
111
+ listServerEvents: (request: Readonly<ListServerEventsRequest>) => Promise<ListServerEventsResponse> & {
112
+ all: () => Promise<import("./types.gen.js").ServerEvent[]>;
113
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ServerEvent[], void, void>;
114
+ };
115
+ /**
116
+ * Get default partitioning schema. Get the default partitioning schema for the given offer ID and OS ID.
117
+ *
118
+ * @param request - The request {@link GetDefaultPartitioningSchemaRequest}
119
+ * @returns A Promise of Schema
120
+ */
121
+ getDefaultPartitioningSchema: (request: Readonly<GetDefaultPartitioningSchemaRequest>) => Promise<Schema>;
122
+ /**
123
+ * Validate client partitioning schema. Validate the incoming partitioning schema from a user before installing the server. Return default ErrorCode if invalid.
124
+ *
125
+ * @param request - The request {@link ValidatePartitioningSchemaRequest}
126
+ */
127
+ validatePartitioningSchema: (request: Readonly<ValidatePartitioningSchemaRequest>) => Promise<void>;
128
+ /**
129
+ * Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
130
+ The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
131
+ You need first to create an option Remote Access. You will find the ID and the price with a call to listOffers (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92). Then add the option https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
132
+ After adding the BMC option, you need to Get Remote Access to get the login/password https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do not forget to delete the Option after use.
133
+ *
134
+ * @param request - The request {@link StartBMCAccessRequest}
135
+ * @returns A Promise of BMCAccess
136
+ */
137
+ startBMCAccess: (request: Readonly<StartBMCAccessRequest>) => Promise<BMCAccess>;
138
+ /**
139
+ * Get BMC access. Get the BMC (Baseboard Management Controller) access associated with the ID, including the URL and login information needed to connect.
140
+ *
141
+ * @param request - The request {@link GetBMCAccessRequest}
142
+ * @returns A Promise of BMCAccess
143
+ */
144
+ getBMCAccess: (request: Readonly<GetBMCAccessRequest>) => Promise<BMCAccess>;
145
+ /**
146
+ * Stop BMC access. Stop BMC (Baseboard Management Controller) access associated with the ID.
147
+ *
148
+ * @param request - The request {@link StopBMCAccessRequest}
149
+ */
150
+ stopBMCAccess: (request: Readonly<StopBMCAccessRequest>) => Promise<void>;
151
+ /**
152
+ * Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.
153
+ *
154
+ * @param request - The request {@link UpdateIPRequest}
155
+ * @returns A Promise of IP
156
+ */
157
+ updateIP: (request: Readonly<UpdateIPRequest>) => Promise<IP>;
158
+ /**
159
+ * Add server option. Add an option, such as Private Networks, to a specific server.
160
+ *
161
+ * @param request - The request {@link AddOptionServerRequest}
162
+ * @returns A Promise of Server
163
+ */
164
+ addOptionServer: (request: Readonly<AddOptionServerRequest>) => Promise<Server>;
165
+ /**
166
+ * Delete server option. Delete an option from a specific server.
167
+ *
168
+ * @param request - The request {@link DeleteOptionServerRequest}
169
+ * @returns A Promise of Server
170
+ */
171
+ deleteOptionServer: (request: Readonly<DeleteOptionServerRequest>) => Promise<Server>;
172
+ /**
173
+ * Migrate server offer. Migrate server with hourly offer to monthly offer.
174
+ *
175
+ * @param request - The request {@link MigrateServerToMonthlyOfferRequest}
176
+ * @returns A Promise of Server
177
+ */
178
+ migrateServerToMonthlyOffer: (request: Readonly<MigrateServerToMonthlyOfferRequest>) => Promise<Server>;
179
+ protected pageOfListOffers: (request?: Readonly<ListOffersRequest>) => Promise<ListOffersResponse>;
180
+ /**
181
+ * List offers. List all available Elastic Metal server configurations.
182
+ *
183
+ * @param request - The request {@link ListOffersRequest}
184
+ * @returns A Promise of ListOffersResponse
185
+ */
186
+ listOffers: (request?: Readonly<ListOffersRequest>) => Promise<ListOffersResponse> & {
187
+ all: () => Promise<Offer[]>;
188
+ [Symbol.asyncIterator]: () => AsyncGenerator<Offer[], void, void>;
189
+ };
190
+ /**
191
+ * Get offer. Get details of an offer identified by its offer ID.
192
+ *
193
+ * @param request - The request {@link GetOfferRequest}
194
+ * @returns A Promise of Offer
195
+ */
196
+ getOffer: (request: Readonly<GetOfferRequest>) => Promise<Offer>;
197
+ /**
198
+ * Get option. Return specific option for the ID.
199
+ *
200
+ * @param request - The request {@link GetOptionRequest}
201
+ * @returns A Promise of Option
202
+ */
203
+ getOption: (request: Readonly<GetOptionRequest>) => Promise<Option>;
204
+ protected pageOfListOptions: (request?: Readonly<ListOptionsRequest>) => Promise<ListOptionsResponse>;
205
+ /**
206
+ * List options. List all options matching with filters.
207
+ *
208
+ * @param request - The request {@link ListOptionsRequest}
209
+ * @returns A Promise of ListOptionsResponse
210
+ */
211
+ listOptions: (request?: Readonly<ListOptionsRequest>) => Promise<ListOptionsResponse> & {
212
+ all: () => Promise<Option[]>;
213
+ [Symbol.asyncIterator]: () => AsyncGenerator<Option[], void, void>;
214
+ };
215
+ protected pageOfListSettings: (request?: Readonly<ListSettingsRequest>) => Promise<ListSettingsResponse>;
216
+ /**
217
+ * List all settings. Return all settings for a Project ID.
218
+ *
219
+ * @param request - The request {@link ListSettingsRequest}
220
+ * @returns A Promise of ListSettingsResponse
221
+ */
222
+ listSettings: (request?: Readonly<ListSettingsRequest>) => Promise<ListSettingsResponse> & {
223
+ all: () => Promise<Setting[]>;
224
+ [Symbol.asyncIterator]: () => AsyncGenerator<Setting[], void, void>;
225
+ };
226
+ /**
227
+ * Update setting. Update a setting for a Project ID (enable or disable).
228
+ *
229
+ * @param request - The request {@link UpdateSettingRequest}
230
+ * @returns A Promise of Setting
231
+ */
232
+ updateSetting: (request: Readonly<UpdateSettingRequest>) => Promise<Setting>;
233
+ protected pageOfListOS: (request?: Readonly<ListOSRequest>) => Promise<ListOSResponse>;
234
+ /**
235
+ * List available OSes. List all OSes that are available for installation on Elastic Metal servers.
236
+ *
237
+ * @param request - The request {@link ListOSRequest}
238
+ * @returns A Promise of ListOSResponse
239
+ */
240
+ listOS: (request?: Readonly<ListOSRequest>) => Promise<ListOSResponse> & {
241
+ all: () => Promise<OS[]>;
242
+ [Symbol.asyncIterator]: () => AsyncGenerator<OS[], void, void>;
243
+ };
244
+ /**
245
+ * Get OS with an ID. Return the specific OS for the ID.
246
+ *
247
+ * @param request - The request {@link GetOSRequest}
248
+ * @returns A Promise of OS
249
+ */
250
+ getOS: (request: Readonly<GetOSRequest>) => Promise<OS>;
251
+ }
252
+ /**
253
+ * Elastic Metal - Private Network API.
254
+ */
255
+ export declare class PrivateNetworkAPI extends ParentAPI {
256
+ /**
257
+ * Locality of this API.
258
+ * type ∈ {'zone','region','global','unspecified'}
259
+ */
260
+ static readonly LOCALITY: ApiLocality;
261
+ /**
262
+ * Add a server to a Private Network.
263
+ *
264
+ * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
265
+ * @returns A Promise of ServerPrivateNetwork
266
+ */
267
+ addServerPrivateNetwork: (request: Readonly<PrivateNetworkApiAddServerPrivateNetworkRequest>) => Promise<ServerPrivateNetwork>;
268
+ /**
269
+ * Set multiple Private Networks on a server.
270
+ *
271
+ * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
272
+ * @returns A Promise of SetServerPrivateNetworksResponse
273
+ */
274
+ setServerPrivateNetworks: (request: Readonly<PrivateNetworkApiSetServerPrivateNetworksRequest>) => Promise<SetServerPrivateNetworksResponse>;
275
+ protected pageOfListServerPrivateNetworks: (request?: Readonly<PrivateNetworkApiListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse>;
276
+ /**
277
+ * List the Private Networks of a server.
278
+ *
279
+ * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
280
+ * @returns A Promise of ListServerPrivateNetworksResponse
281
+ */
282
+ listServerPrivateNetworks: (request?: Readonly<PrivateNetworkApiListServerPrivateNetworksRequest>) => Promise<ListServerPrivateNetworksResponse> & {
283
+ all: () => Promise<ServerPrivateNetwork[]>;
284
+ [Symbol.asyncIterator]: () => AsyncGenerator<ServerPrivateNetwork[], void, void>;
285
+ };
286
+ /**
287
+ * Delete a Private Network.
288
+ *
289
+ * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
290
+ */
291
+ deleteServerPrivateNetwork: (request: Readonly<PrivateNetworkApiDeleteServerPrivateNetworkRequest>) => Promise<void>;
292
+ }
@@ -0,0 +1,214 @@
1
+ import { SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalAddOptionServerRequest, marshalBatchCreateServersRequest, marshalCreateServerRequest, marshalInstallServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalRebootServerRequest, marshalStartBMCAccessRequest, marshalStartServerRequest, marshalUpdateIPRequest, marshalUpdateServerRequest, marshalUpdateSettingRequest, marshalValidatePartitioningSchemaRequest, unmarshalBMCAccess, unmarshalBatchCreateServersResponse, unmarshalGetServerMetricsResponse, unmarshalIP, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListOptionsResponse, unmarshalListServerEventsResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalListSettingsResponse, unmarshalOS, unmarshalOffer, unmarshalOption, unmarshalSchema, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse, unmarshalSetting } from "./marshalling.gen.js";
3
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v1/api.gen.ts
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
+ /**
7
+ * Elastic Metal API.
8
+
9
+ This API allows you to manage your Elastic Metal servers.
10
+ */
11
+ var API = class extends API$1 {
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListServers = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
17
+ urlParams: urlParams(["name", request.name], ["option_id", request.optionId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["status", request.status], ["tags", request.tags])
18
+ }, unmarshalListServersResponse);
19
+ this.listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
20
+ this.getServer = (request) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
23
+ }, unmarshalServer);
24
+ this.waitForServer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
25
+ this.createServer = (request) => this.client.fetch({
26
+ body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
30
+ }, unmarshalServer);
31
+ this.batchCreateServers = (request = {}) => this.client.fetch({
32
+ body: JSON.stringify(marshalBatchCreateServersRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "POST",
35
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/batch-create-servers`
36
+ }, unmarshalBatchCreateServersResponse);
37
+ this.updateServer = (request) => this.client.fetch({
38
+ body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
39
+ headers: jsonContentHeaders,
40
+ method: "PATCH",
41
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
42
+ }, unmarshalServer);
43
+ this.installServer = async (request) => this.client.fetch({
44
+ body: JSON.stringify(await marshalInstallServerRequest(request, this.client.settings)),
45
+ headers: jsonContentHeaders,
46
+ method: "POST",
47
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
48
+ }, unmarshalServer);
49
+ this.getServerMetrics = (request) => this.client.fetch({
50
+ method: "GET",
51
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/metrics`
52
+ }, unmarshalGetServerMetricsResponse);
53
+ this.deleteServer = (request) => this.client.fetch({
54
+ method: "DELETE",
55
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
56
+ }, unmarshalServer);
57
+ this.rebootServer = (request) => this.client.fetch({
58
+ body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
59
+ headers: jsonContentHeaders,
60
+ method: "POST",
61
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
62
+ }, unmarshalServer);
63
+ this.startServer = (request) => this.client.fetch({
64
+ body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
65
+ headers: jsonContentHeaders,
66
+ method: "POST",
67
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/start`
68
+ }, unmarshalServer);
69
+ this.stopServer = (request) => this.client.fetch({
70
+ body: "{}",
71
+ headers: jsonContentHeaders,
72
+ method: "POST",
73
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/stop`
74
+ }, unmarshalServer);
75
+ this.pageOfListServerEvents = (request) => this.client.fetch({
76
+ method: "GET",
77
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/events`,
78
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
79
+ }, unmarshalListServerEventsResponse);
80
+ this.listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
81
+ this.getDefaultPartitioningSchema = (request) => this.client.fetch({
82
+ method: "GET",
83
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
84
+ urlParams: urlParams(["offer_id", request.offerId], ["os_id", request.osId])
85
+ }, unmarshalSchema);
86
+ this.validatePartitioningSchema = (request) => this.client.fetch({
87
+ body: JSON.stringify(marshalValidatePartitioningSchemaRequest(request, this.client.settings)),
88
+ headers: jsonContentHeaders,
89
+ method: "POST",
90
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
91
+ });
92
+ this.startBMCAccess = (request) => this.client.fetch({
93
+ body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
94
+ headers: jsonContentHeaders,
95
+ method: "POST",
96
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
97
+ }, unmarshalBMCAccess);
98
+ this.getBMCAccess = (request) => this.client.fetch({
99
+ method: "GET",
100
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
101
+ }, unmarshalBMCAccess);
102
+ this.stopBMCAccess = (request) => this.client.fetch({
103
+ method: "DELETE",
104
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
105
+ });
106
+ this.updateIP = (request) => this.client.fetch({
107
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
108
+ headers: jsonContentHeaders,
109
+ method: "PATCH",
110
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/ips/${validatePathParam("ipId", request.ipId)}`
111
+ }, unmarshalIP);
112
+ this.addOptionServer = (request) => this.client.fetch({
113
+ body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
114
+ headers: jsonContentHeaders,
115
+ method: "POST",
116
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
117
+ }, unmarshalServer);
118
+ this.deleteOptionServer = (request) => this.client.fetch({
119
+ method: "DELETE",
120
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
121
+ }, unmarshalServer);
122
+ this.migrateServerToMonthlyOffer = (request) => this.client.fetch({
123
+ method: "POST",
124
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/migrate-offer-monthly`
125
+ }, unmarshalServer);
126
+ this.pageOfListOffers = (request = {}) => this.client.fetch({
127
+ method: "GET",
128
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
129
+ urlParams: urlParams(["name", request.name], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["subscription_period", request.subscriptionPeriod])
130
+ }, unmarshalListOffersResponse);
131
+ this.listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
132
+ this.getOffer = (request) => this.client.fetch({
133
+ method: "GET",
134
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`
135
+ }, unmarshalOffer);
136
+ this.getOption = (request) => this.client.fetch({
137
+ method: "GET",
138
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam("optionId", request.optionId)}`
139
+ }, unmarshalOption);
140
+ this.pageOfListOptions = (request = {}) => this.client.fetch({
141
+ method: "GET",
142
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`,
143
+ urlParams: urlParams(["name", request.name], ["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
144
+ }, unmarshalListOptionsResponse);
145
+ this.listOptions = (request = {}) => enrichForPagination("options", this.pageOfListOptions, request);
146
+ this.pageOfListSettings = (request = {}) => this.client.fetch({
147
+ method: "GET",
148
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`,
149
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
150
+ }, unmarshalListSettingsResponse);
151
+ this.listSettings = (request = {}) => enrichForPagination("settings", this.pageOfListSettings, request);
152
+ this.updateSetting = (request) => this.client.fetch({
153
+ body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
154
+ headers: jsonContentHeaders,
155
+ method: "PATCH",
156
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam("settingId", request.settingId)}`
157
+ }, unmarshalSetting);
158
+ this.pageOfListOS = (request = {}) => this.client.fetch({
159
+ method: "GET",
160
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
161
+ urlParams: urlParams(["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
162
+ }, unmarshalListOSResponse);
163
+ this.listOS = (request = {}) => enrichForPagination("os", this.pageOfListOS, request);
164
+ this.getOS = (request) => this.client.fetch({
165
+ method: "GET",
166
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`
167
+ }, unmarshalOS);
168
+ }
169
+ static {
170
+ this.LOCALITY = toApiLocality({ zones: [
171
+ "fr-par-1",
172
+ "fr-par-2",
173
+ "nl-ams-1",
174
+ "nl-ams-2",
175
+ "pl-waw-2",
176
+ "pl-waw-3"
177
+ ] });
178
+ }
179
+ };
180
+ /**
181
+ * Elastic Metal - Private Network API.
182
+ */
183
+ var PrivateNetworkAPI = class extends API$1 {
184
+ constructor(..._args2) {
185
+ super(..._args2);
186
+ this.addServerPrivateNetwork = (request) => this.client.fetch({
187
+ body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
188
+ headers: jsonContentHeaders,
189
+ method: "POST",
190
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
191
+ }, unmarshalServerPrivateNetwork);
192
+ this.setServerPrivateNetworks = (request) => this.client.fetch({
193
+ body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
194
+ headers: jsonContentHeaders,
195
+ method: "PUT",
196
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
197
+ }, unmarshalSetServerPrivateNetworksResponse);
198
+ this.pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
199
+ method: "GET",
200
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
201
+ urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["project_id", request.projectId], ["server_id", request.serverId])
202
+ }, unmarshalListServerPrivateNetworksResponse);
203
+ this.listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
204
+ this.deleteServerPrivateNetwork = (request) => this.client.fetch({
205
+ method: "DELETE",
206
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
207
+ });
208
+ }
209
+ static {
210
+ this.LOCALITY = toApiLocality({ zones: ["fr-par-2"] });
211
+ }
212
+ };
213
+ //#endregion
214
+ export { API, PrivateNetworkAPI };
@@ -0,0 +1,7 @@
1
+ import type { ServerInstallStatus, ServerPrivateNetworkStatus, ServerStatus } from './types.gen.js';
2
+ /** Lists transient statutes of the enum {@link ServerInstallStatus}. */
3
+ export declare const SERVER_INSTALL_TRANSIENT_STATUSES: ServerInstallStatus[];
4
+ /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
5
+ export declare const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[];
6
+ /** Lists transient statutes of the enum {@link ServerStatus}. */
7
+ export declare const SERVER_TRANSIENT_STATUSES: ServerStatus[];
@@ -0,0 +1,17 @@
1
+ //#region src/v1/content.gen.ts
2
+ /** Lists transient statutes of the enum {@link ServerInstallStatus}. */
3
+ const SERVER_INSTALL_TRANSIENT_STATUSES = ["to_install", "installing"];
4
+ /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
5
+ const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
6
+ /** Lists transient statutes of the enum {@link ServerStatus}. */
7
+ const SERVER_TRANSIENT_STATUSES = [
8
+ "delivering",
9
+ "stopping",
10
+ "starting",
11
+ "deleting",
12
+ "ordered",
13
+ "resetting",
14
+ "migrating"
15
+ ];
16
+ //#endregion
17
+ export { SERVER_INSTALL_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES };
@@ -0,0 +1,5 @@
1
+ export { API, PrivateNetworkAPI, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { AddOptionServerRequest, BMCAccess, BatchCreateServersRequest, BatchCreateServersRequestServerConfig, BatchCreateServersResponse, CPU, CertificationOption, CreateServerRequest, CreateServerRequestInstall, DeleteOptionServerRequest, DeleteServerRequest, Disk, GPU, 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, MemoryEccType, MigrateServerToMonthlyOfferRequest, 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.js';
5
+ export * as ValidationRules from './validation-rules.gen.js';