@scaleway/sdk-baremetal 2.2.0 → 2.3.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,600 +1,403 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
1
  import { SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { 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, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
2
+ import { marshalAddOptionServerRequest, marshalCreateServerRequest, marshalInstallServerRequest, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, marshalRebootServerRequest, marshalStartBMCAccessRequest, marshalStartServerRequest, marshalUpdateIPRequest, marshalUpdateServerRequest, marshalUpdateSettingRequest, marshalValidatePartitioningSchemaRequest, unmarshalBMCAccess, unmarshalGetServerMetricsResponse, unmarshalIP, unmarshalListOSResponse, unmarshalListOffersResponse, unmarshalListOptionsResponse, unmarshalListServerEventsResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalListSettingsResponse, unmarshalOS, unmarshalOffer, unmarshalOption, unmarshalSchema, unmarshalServer, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse, unmarshalSetting } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Elastic Metal API.
7
+
8
+ This API allows you to manage your Elastic Metal servers.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Locality of this API.
13
+ * type ∈ {'zone','region','global','unspecified'}
14
+ */
15
+ static LOCALITY = toApiLocality({ zones: [
16
+ "fr-par-1",
17
+ "fr-par-2",
18
+ "nl-ams-1",
19
+ "nl-ams-2",
20
+ "pl-waw-2",
21
+ "pl-waw-3"
22
+ ] });
23
+ pageOfListServers = (request = {}) => this.client.fetch({
24
+ method: "GET",
25
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
26
+ 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])
27
+ }, unmarshalListServersResponse);
28
+ /**
29
+ * List Elastic Metal servers for an Organization. List Elastic Metal servers for a specific Organization.
30
+ *
31
+ * @param request - The request {@link ListServersRequest}
32
+ * @returns A Promise of ListServersResponse
33
+ */
34
+ listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
35
+ /**
36
+ * Get a specific Elastic Metal server. Get full details of an existing Elastic Metal server associated with the ID.
37
+ *
38
+ * @param request - The request {@link GetServerRequest}
39
+ * @returns A Promise of Server
40
+ */
41
+ getServer = (request) => this.client.fetch({
42
+ method: "GET",
43
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
44
+ }, unmarshalServer);
45
+ /**
46
+ * Waits for {@link Server} to be in a final state.
47
+ *
48
+ * @param request - The request {@link GetServerRequest}
49
+ * @param options - The waiting options
50
+ * @returns A Promise of Server
51
+ */
52
+ waitForServer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
53
+ /**
54
+ * 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).
55
+ *
56
+ * @param request - The request {@link CreateServerRequest}
57
+ * @returns A Promise of Server
58
+ */
59
+ createServer = (request) => this.client.fetch({
60
+ body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: "POST",
63
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
64
+ }, unmarshalServer);
65
+ /**
66
+ * 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.
67
+ *
68
+ * @param request - The request {@link UpdateServerRequest}
69
+ * @returns A Promise of Server
70
+ */
71
+ updateServer = (request) => this.client.fetch({
72
+ body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
73
+ headers: jsonContentHeaders,
74
+ method: "PATCH",
75
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
76
+ }, unmarshalServer);
77
+ /**
78
+ * Install an Elastic Metal server. Install an Operating System (OS) on the Elastic Metal server with a specific ID.
79
+ *
80
+ * @param request - The request {@link InstallServerRequest}
81
+ * @returns A Promise of Server
82
+ */
83
+ installServer = async (request) => this.client.fetch({
84
+ body: JSON.stringify(await marshalInstallServerRequest(request, this.client.settings)),
85
+ headers: jsonContentHeaders,
86
+ method: "POST",
87
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
88
+ }, unmarshalServer);
89
+ /**
90
+ * Return server metrics. Get the ping status of the server associated with the ID.
91
+ *
92
+ * @param request - The request {@link GetServerMetricsRequest}
93
+ * @returns A Promise of GetServerMetricsResponse
94
+ */
95
+ getServerMetrics = (request) => this.client.fetch({
96
+ method: "GET",
97
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/metrics`
98
+ }, unmarshalGetServerMetricsResponse);
99
+ /**
100
+ * Delete an Elastic Metal server. Delete the server associated with the ID.
101
+ *
102
+ * @param request - The request {@link DeleteServerRequest}
103
+ * @returns A Promise of Server
104
+ */
105
+ deleteServer = (request) => this.client.fetch({
106
+ method: "DELETE",
107
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
108
+ }, unmarshalServer);
109
+ /**
110
+ * 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.
111
+ *
112
+ * @param request - The request {@link RebootServerRequest}
113
+ * @returns A Promise of Server
114
+ */
115
+ rebootServer = (request) => this.client.fetch({
116
+ body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
117
+ headers: jsonContentHeaders,
118
+ method: "POST",
119
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
120
+ }, unmarshalServer);
121
+ /**
122
+ * Start an Elastic Metal server. Start the server associated with the ID.
123
+ *
124
+ * @param request - The request {@link StartServerRequest}
125
+ * @returns A Promise of Server
126
+ */
127
+ startServer = (request) => this.client.fetch({
128
+ body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
129
+ headers: jsonContentHeaders,
130
+ method: "POST",
131
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/start`
132
+ }, unmarshalServer);
133
+ /**
134
+ * 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.
135
+ *
136
+ * @param request - The request {@link StopServerRequest}
137
+ * @returns A Promise of Server
138
+ */
139
+ stopServer = (request) => this.client.fetch({
140
+ body: "{}",
141
+ headers: jsonContentHeaders,
142
+ method: "POST",
143
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/stop`
144
+ }, unmarshalServer);
145
+ pageOfListServerEvents = (request) => this.client.fetch({
146
+ method: "GET",
147
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/events`,
148
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
149
+ }, unmarshalListServerEventsResponse);
150
+ /**
151
+ * List server events. List event (i.e. start/stop/reboot) associated to the server ID.
152
+ *
153
+ * @param request - The request {@link ListServerEventsRequest}
154
+ * @returns A Promise of ListServerEventsResponse
155
+ */
156
+ listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
157
+ /**
158
+ * Get default partitioning schema. Get the default partitioning schema for the given offer ID and OS ID.
159
+ *
160
+ * @param request - The request {@link GetDefaultPartitioningSchemaRequest}
161
+ * @returns A Promise of Schema
162
+ */
163
+ getDefaultPartitioningSchema = (request) => this.client.fetch({
164
+ method: "GET",
165
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
166
+ urlParams: urlParams(["offer_id", request.offerId], ["os_id", request.osId])
167
+ }, unmarshalSchema);
168
+ /**
169
+ * Validate client partitioning schema. Validate the incoming partitioning schema from a user before installing the server. Return default ErrorCode if invalid.
170
+ *
171
+ * @param request - The request {@link ValidatePartitioningSchemaRequest}
172
+ */
173
+ validatePartitioningSchema = (request) => this.client.fetch({
174
+ body: JSON.stringify(marshalValidatePartitioningSchemaRequest(request, this.client.settings)),
175
+ headers: jsonContentHeaders,
176
+ method: "POST",
177
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
178
+ });
179
+ /**
180
+ * Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
181
+ The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
182
+ 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.
183
+ 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.
184
+ *
185
+ * @param request - The request {@link StartBMCAccessRequest}
186
+ * @returns A Promise of BMCAccess
187
+ */
188
+ startBMCAccess = (request) => this.client.fetch({
189
+ body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
190
+ headers: jsonContentHeaders,
191
+ method: "POST",
192
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
193
+ }, unmarshalBMCAccess);
194
+ /**
195
+ * Get BMC access. Get the BMC (Baseboard Management Controller) access associated with the ID, including the URL and login information needed to connect.
196
+ *
197
+ * @param request - The request {@link GetBMCAccessRequest}
198
+ * @returns A Promise of BMCAccess
199
+ */
200
+ getBMCAccess = (request) => this.client.fetch({
201
+ method: "GET",
202
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
203
+ }, unmarshalBMCAccess);
204
+ /**
205
+ * Stop BMC access. Stop BMC (Baseboard Management Controller) access associated with the ID.
206
+ *
207
+ * @param request - The request {@link StopBMCAccessRequest}
208
+ */
209
+ stopBMCAccess = (request) => this.client.fetch({
210
+ method: "DELETE",
211
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
212
+ });
213
+ /**
214
+ * 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.
215
+ *
216
+ * @param request - The request {@link UpdateIPRequest}
217
+ * @returns A Promise of IP
218
+ */
219
+ updateIP = (request) => this.client.fetch({
220
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
221
+ headers: jsonContentHeaders,
222
+ method: "PATCH",
223
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/ips/${validatePathParam("ipId", request.ipId)}`
224
+ }, unmarshalIP);
225
+ /**
226
+ * Add server option. Add an option, such as Private Networks, to a specific server.
227
+ *
228
+ * @param request - The request {@link AddOptionServerRequest}
229
+ * @returns A Promise of Server
230
+ */
231
+ addOptionServer = (request) => this.client.fetch({
232
+ body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
233
+ headers: jsonContentHeaders,
234
+ method: "POST",
235
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
236
+ }, unmarshalServer);
237
+ /**
238
+ * Delete server option. Delete an option from a specific server.
239
+ *
240
+ * @param request - The request {@link DeleteOptionServerRequest}
241
+ * @returns A Promise of Server
242
+ */
243
+ deleteOptionServer = (request) => this.client.fetch({
244
+ method: "DELETE",
245
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
246
+ }, unmarshalServer);
247
+ /**
248
+ * Migrate server offer. Migrate server with hourly offer to monthly offer.
249
+ *
250
+ * @param request - The request {@link MigrateServerToMonthlyOfferRequest}
251
+ * @returns A Promise of Server
252
+ */
253
+ migrateServerToMonthlyOffer = (request) => this.client.fetch({
254
+ method: "POST",
255
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/migrate-offer-monthly`
256
+ }, unmarshalServer);
257
+ pageOfListOffers = (request = {}) => this.client.fetch({
258
+ method: "GET",
259
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
260
+ urlParams: urlParams(["name", request.name], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["subscription_period", request.subscriptionPeriod])
261
+ }, unmarshalListOffersResponse);
262
+ /**
263
+ * List offers. List all available Elastic Metal server configurations.
264
+ *
265
+ * @param request - The request {@link ListOffersRequest}
266
+ * @returns A Promise of ListOffersResponse
267
+ */
268
+ listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
269
+ /**
270
+ * Get offer. Get details of an offer identified by its offer ID.
271
+ *
272
+ * @param request - The request {@link GetOfferRequest}
273
+ * @returns A Promise of Offer
274
+ */
275
+ getOffer = (request) => this.client.fetch({
276
+ method: "GET",
277
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`
278
+ }, unmarshalOffer);
279
+ /**
280
+ * Get option. Return specific option for the ID.
281
+ *
282
+ * @param request - The request {@link GetOptionRequest}
283
+ * @returns A Promise of Option
284
+ */
285
+ getOption = (request) => this.client.fetch({
286
+ method: "GET",
287
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam("optionId", request.optionId)}`
288
+ }, unmarshalOption);
289
+ pageOfListOptions = (request = {}) => this.client.fetch({
290
+ method: "GET",
291
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`,
292
+ urlParams: urlParams(["name", request.name], ["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
293
+ }, unmarshalListOptionsResponse);
294
+ /**
295
+ * List options. List all options matching with filters.
296
+ *
297
+ * @param request - The request {@link ListOptionsRequest}
298
+ * @returns A Promise of ListOptionsResponse
299
+ */
300
+ listOptions = (request = {}) => enrichForPagination("options", this.pageOfListOptions, request);
301
+ pageOfListSettings = (request = {}) => this.client.fetch({
302
+ method: "GET",
303
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`,
304
+ 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])
305
+ }, unmarshalListSettingsResponse);
306
+ /**
307
+ * List all settings. Return all settings for a Project ID.
308
+ *
309
+ * @param request - The request {@link ListSettingsRequest}
310
+ * @returns A Promise of ListSettingsResponse
311
+ */
312
+ listSettings = (request = {}) => enrichForPagination("settings", this.pageOfListSettings, request);
313
+ /**
314
+ * Update setting. Update a setting for a Project ID (enable or disable).
315
+ *
316
+ * @param request - The request {@link UpdateSettingRequest}
317
+ * @returns A Promise of Setting
318
+ */
319
+ updateSetting = (request) => this.client.fetch({
320
+ body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
321
+ headers: jsonContentHeaders,
322
+ method: "PATCH",
323
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam("settingId", request.settingId)}`
324
+ }, unmarshalSetting);
325
+ pageOfListOS = (request = {}) => this.client.fetch({
326
+ method: "GET",
327
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
328
+ urlParams: urlParams(["offer_id", request.offerId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
329
+ }, unmarshalListOSResponse);
330
+ /**
331
+ * List available OSes. List all OSes that are available for installation on Elastic Metal servers.
332
+ *
333
+ * @param request - The request {@link ListOSRequest}
334
+ * @returns A Promise of ListOSResponse
335
+ */
336
+ listOS = (request = {}) => enrichForPagination("os", this.pageOfListOS, request);
337
+ /**
338
+ * Get OS with an ID. Return the specific OS for the ID.
339
+ *
340
+ * @param request - The request {@link GetOSRequest}
341
+ * @returns A Promise of OS
342
+ */
343
+ getOS = (request) => this.client.fetch({
344
+ method: "GET",
345
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`
346
+ }, unmarshalOS);
6
347
  };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- zones: [
14
- "fr-par-1",
15
- "fr-par-2",
16
- "nl-ams-1",
17
- "nl-ams-2",
18
- "pl-waw-2",
19
- "pl-waw-3"
20
- ]
21
- });
22
- pageOfListServers = (request = {}) => this.client.fetch(
23
- {
24
- method: "GET",
25
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
26
- urlParams: urlParams(
27
- ["name", request.name],
28
- ["option_id", request.optionId],
29
- ["order_by", request.orderBy],
30
- ["organization_id", request.organizationId],
31
- ["page", request.page],
32
- [
33
- "page_size",
34
- request.pageSize ?? this.client.settings.defaultPageSize
35
- ],
36
- ["project_id", request.projectId],
37
- ["status", request.status],
38
- ["tags", request.tags]
39
- )
40
- },
41
- unmarshalListServersResponse
42
- );
43
- /**
44
- * List Elastic Metal servers for an Organization. List Elastic Metal servers for a specific Organization.
45
- *
46
- * @param request - The request {@link ListServersRequest}
47
- * @returns A Promise of ListServersResponse
48
- */
49
- listServers = (request = {}) => enrichForPagination("servers", this.pageOfListServers, request);
50
- /**
51
- * Get a specific Elastic Metal server. Get full details of an existing Elastic Metal server associated with the ID.
52
- *
53
- * @param request - The request {@link GetServerRequest}
54
- * @returns A Promise of Server
55
- */
56
- getServer = (request) => this.client.fetch(
57
- {
58
- method: "GET",
59
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
60
- },
61
- unmarshalServer
62
- );
63
- /**
64
- * Waits for {@link Server} to be in a final state.
65
- *
66
- * @param request - The request {@link GetServerRequest}
67
- * @param options - The waiting options
68
- * @returns A Promise of Server
69
- */
70
- waitForServer = (request, options) => waitForResource(
71
- options?.stop ?? ((res) => Promise.resolve(
72
- !SERVER_TRANSIENT_STATUSES.includes(res.status)
73
- )),
74
- this.getServer,
75
- request,
76
- options
77
- );
78
- /**
79
- * 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).
80
- *
81
- * @param request - The request {@link CreateServerRequest}
82
- * @returns A Promise of Server
83
- */
84
- createServer = (request) => this.client.fetch(
85
- {
86
- body: JSON.stringify(
87
- marshalCreateServerRequest(request, this.client.settings)
88
- ),
89
- headers: jsonContentHeaders,
90
- method: "POST",
91
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
92
- },
93
- unmarshalServer
94
- );
95
- /**
96
- * 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.
97
- *
98
- * @param request - The request {@link UpdateServerRequest}
99
- * @returns A Promise of Server
100
- */
101
- updateServer = (request) => this.client.fetch(
102
- {
103
- body: JSON.stringify(
104
- marshalUpdateServerRequest(request, this.client.settings)
105
- ),
106
- headers: jsonContentHeaders,
107
- method: "PATCH",
108
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
109
- },
110
- unmarshalServer
111
- );
112
- /**
113
- * Install an Elastic Metal server. Install an Operating System (OS) on the Elastic Metal server with a specific ID.
114
- *
115
- * @param request - The request {@link InstallServerRequest}
116
- * @returns A Promise of Server
117
- */
118
- installServer = async (request) => this.client.fetch(
119
- {
120
- body: JSON.stringify(
121
- await marshalInstallServerRequest(request, this.client.settings)
122
- ),
123
- headers: jsonContentHeaders,
124
- method: "POST",
125
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/install`
126
- },
127
- unmarshalServer
128
- );
129
- /**
130
- * Return server metrics. Get the ping status of the server associated with the ID.
131
- *
132
- * @param request - The request {@link GetServerMetricsRequest}
133
- * @returns A Promise of GetServerMetricsResponse
134
- */
135
- getServerMetrics = (request) => this.client.fetch(
136
- {
137
- method: "GET",
138
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/metrics`
139
- },
140
- unmarshalGetServerMetricsResponse
141
- );
142
- /**
143
- * Delete an Elastic Metal server. Delete the server associated with the ID.
144
- *
145
- * @param request - The request {@link DeleteServerRequest}
146
- * @returns A Promise of Server
147
- */
148
- deleteServer = (request) => this.client.fetch(
149
- {
150
- method: "DELETE",
151
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}`
152
- },
153
- unmarshalServer
154
- );
155
- /**
156
- * 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.
157
- *
158
- * @param request - The request {@link RebootServerRequest}
159
- * @returns A Promise of Server
160
- */
161
- rebootServer = (request) => this.client.fetch(
162
- {
163
- body: JSON.stringify(
164
- marshalRebootServerRequest(request, this.client.settings)
165
- ),
166
- headers: jsonContentHeaders,
167
- method: "POST",
168
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/reboot`
169
- },
170
- unmarshalServer
171
- );
172
- /**
173
- * Start an Elastic Metal server. Start the server associated with the ID.
174
- *
175
- * @param request - The request {@link StartServerRequest}
176
- * @returns A Promise of Server
177
- */
178
- startServer = (request) => this.client.fetch(
179
- {
180
- body: JSON.stringify(
181
- marshalStartServerRequest(request, this.client.settings)
182
- ),
183
- headers: jsonContentHeaders,
184
- method: "POST",
185
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/start`
186
- },
187
- unmarshalServer
188
- );
189
- /**
190
- * 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.
191
- *
192
- * @param request - The request {@link StopServerRequest}
193
- * @returns A Promise of Server
194
- */
195
- stopServer = (request) => this.client.fetch(
196
- {
197
- body: "{}",
198
- headers: jsonContentHeaders,
199
- method: "POST",
200
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/stop`
201
- },
202
- unmarshalServer
203
- );
204
- pageOfListServerEvents = (request) => this.client.fetch(
205
- {
206
- method: "GET",
207
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/events`,
208
- urlParams: urlParams(
209
- ["order_by", request.orderBy],
210
- ["page", request.page],
211
- [
212
- "page_size",
213
- request.pageSize ?? this.client.settings.defaultPageSize
214
- ]
215
- )
216
- },
217
- unmarshalListServerEventsResponse
218
- );
219
- /**
220
- * List server events. List event (i.e. start/stop/reboot) associated to the server ID.
221
- *
222
- * @param request - The request {@link ListServerEventsRequest}
223
- * @returns A Promise of ListServerEventsResponse
224
- */
225
- listServerEvents = (request) => enrichForPagination("events", this.pageOfListServerEvents, request);
226
- /**
227
- * Get default partitioning schema. Get the default partitioning schema for the given offer ID and OS ID.
228
- *
229
- * @param request - The request {@link GetDefaultPartitioningSchemaRequest}
230
- * @returns A Promise of Schema
231
- */
232
- getDefaultPartitioningSchema = (request) => this.client.fetch(
233
- {
234
- method: "GET",
235
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,
236
- urlParams: urlParams(
237
- ["offer_id", request.offerId],
238
- ["os_id", request.osId]
239
- )
240
- },
241
- unmarshalSchema
242
- );
243
- /**
244
- * Validate client partitioning schema. Validate the incoming partitioning schema from a user before installing the server. Return default ErrorCode if invalid.
245
- *
246
- * @param request - The request {@link ValidatePartitioningSchemaRequest}
247
- */
248
- validatePartitioningSchema = (request) => this.client.fetch({
249
- body: JSON.stringify(
250
- marshalValidatePartitioningSchemaRequest(request, this.client.settings)
251
- ),
252
- headers: jsonContentHeaders,
253
- method: "POST",
254
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`
255
- });
256
- /**
257
- * Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID.
258
- The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
259
- 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.
260
- 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.
261
- *
262
- * @param request - The request {@link StartBMCAccessRequest}
263
- * @returns A Promise of BMCAccess
264
- */
265
- startBMCAccess = (request) => this.client.fetch(
266
- {
267
- body: JSON.stringify(
268
- marshalStartBMCAccessRequest(request, this.client.settings)
269
- ),
270
- headers: jsonContentHeaders,
271
- method: "POST",
272
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
273
- },
274
- unmarshalBMCAccess
275
- );
276
- /**
277
- * Get BMC access. Get the BMC (Baseboard Management Controller) access associated with the ID, including the URL and login information needed to connect.
278
- *
279
- * @param request - The request {@link GetBMCAccessRequest}
280
- * @returns A Promise of BMCAccess
281
- */
282
- getBMCAccess = (request) => this.client.fetch(
283
- {
284
- method: "GET",
285
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
286
- },
287
- unmarshalBMCAccess
288
- );
289
- /**
290
- * Stop BMC access. Stop BMC (Baseboard Management Controller) access associated with the ID.
291
- *
292
- * @param request - The request {@link StopBMCAccessRequest}
293
- */
294
- stopBMCAccess = (request) => this.client.fetch({
295
- method: "DELETE",
296
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/bmc-access`
297
- });
298
- /**
299
- * Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address.
300
- *
301
- * @param request - The request {@link UpdateIPRequest}
302
- * @returns A Promise of IP
303
- */
304
- updateIP = (request) => this.client.fetch(
305
- {
306
- body: JSON.stringify(
307
- marshalUpdateIPRequest(request, this.client.settings)
308
- ),
309
- headers: jsonContentHeaders,
310
- method: "PATCH",
311
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/ips/${validatePathParam("ipId", request.ipId)}`
312
- },
313
- unmarshalIP
314
- );
315
- /**
316
- * Add server option. Add an option, such as Private Networks, to a specific server.
317
- *
318
- * @param request - The request {@link AddOptionServerRequest}
319
- * @returns A Promise of Server
320
- */
321
- addOptionServer = (request) => this.client.fetch(
322
- {
323
- body: JSON.stringify(
324
- marshalAddOptionServerRequest(request, this.client.settings)
325
- ),
326
- headers: jsonContentHeaders,
327
- method: "POST",
328
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
329
- },
330
- unmarshalServer
331
- );
332
- /**
333
- * Delete server option. Delete an option from a specific server.
334
- *
335
- * @param request - The request {@link DeleteOptionServerRequest}
336
- * @returns A Promise of Server
337
- */
338
- deleteOptionServer = (request) => this.client.fetch(
339
- {
340
- method: "DELETE",
341
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/options/${validatePathParam("optionId", request.optionId)}`
342
- },
343
- unmarshalServer
344
- );
345
- /**
346
- * Migrate server offer. Migrate server with hourly offer to monthly offer.
347
- *
348
- * @param request - The request {@link MigrateServerToMonthlyOfferRequest}
349
- * @returns A Promise of Server
350
- */
351
- migrateServerToMonthlyOffer = (request) => this.client.fetch(
352
- {
353
- method: "POST",
354
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/migrate-offer-monthly`
355
- },
356
- unmarshalServer
357
- );
358
- pageOfListOffers = (request = {}) => this.client.fetch(
359
- {
360
- method: "GET",
361
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
362
- urlParams: urlParams(
363
- ["name", request.name],
364
- ["page", request.page],
365
- [
366
- "page_size",
367
- request.pageSize ?? this.client.settings.defaultPageSize
368
- ],
369
- ["subscription_period", request.subscriptionPeriod]
370
- )
371
- },
372
- unmarshalListOffersResponse
373
- );
374
- /**
375
- * List offers. List all available Elastic Metal server configurations.
376
- *
377
- * @param request - The request {@link ListOffersRequest}
378
- * @returns A Promise of ListOffersResponse
379
- */
380
- listOffers = (request = {}) => enrichForPagination("offers", this.pageOfListOffers, request);
381
- /**
382
- * Get offer. Get details of an offer identified by its offer ID.
383
- *
384
- * @param request - The request {@link GetOfferRequest}
385
- * @returns A Promise of Offer
386
- */
387
- getOffer = (request) => this.client.fetch(
388
- {
389
- method: "GET",
390
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam("offerId", request.offerId)}`
391
- },
392
- unmarshalOffer
393
- );
394
- /**
395
- * Get option. Return specific option for the ID.
396
- *
397
- * @param request - The request {@link GetOptionRequest}
398
- * @returns A Promise of Option
399
- */
400
- getOption = (request) => this.client.fetch(
401
- {
402
- method: "GET",
403
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam("optionId", request.optionId)}`
404
- },
405
- unmarshalOption
406
- );
407
- pageOfListOptions = (request = {}) => this.client.fetch(
408
- {
409
- method: "GET",
410
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`,
411
- urlParams: urlParams(
412
- ["name", request.name],
413
- ["offer_id", request.offerId],
414
- ["page", request.page],
415
- [
416
- "page_size",
417
- request.pageSize ?? this.client.settings.defaultPageSize
418
- ]
419
- )
420
- },
421
- unmarshalListOptionsResponse
422
- );
423
- /**
424
- * List options. List all options matching with filters.
425
- *
426
- * @param request - The request {@link ListOptionsRequest}
427
- * @returns A Promise of ListOptionsResponse
428
- */
429
- listOptions = (request = {}) => enrichForPagination("options", this.pageOfListOptions, request);
430
- pageOfListSettings = (request = {}) => this.client.fetch(
431
- {
432
- method: "GET",
433
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`,
434
- urlParams: urlParams(
435
- ["order_by", request.orderBy],
436
- ["page", request.page],
437
- [
438
- "page_size",
439
- request.pageSize ?? this.client.settings.defaultPageSize
440
- ],
441
- [
442
- "project_id",
443
- request.projectId ?? this.client.settings.defaultProjectId
444
- ]
445
- )
446
- },
447
- unmarshalListSettingsResponse
448
- );
449
- /**
450
- * List all settings. Return all settings for a Project ID.
451
- *
452
- * @param request - The request {@link ListSettingsRequest}
453
- * @returns A Promise of ListSettingsResponse
454
- */
455
- listSettings = (request = {}) => enrichForPagination("settings", this.pageOfListSettings, request);
456
- /**
457
- * Update setting. Update a setting for a Project ID (enable or disable).
458
- *
459
- * @param request - The request {@link UpdateSettingRequest}
460
- * @returns A Promise of Setting
461
- */
462
- updateSetting = (request) => this.client.fetch(
463
- {
464
- body: JSON.stringify(
465
- marshalUpdateSettingRequest(request, this.client.settings)
466
- ),
467
- headers: jsonContentHeaders,
468
- method: "PATCH",
469
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam("settingId", request.settingId)}`
470
- },
471
- unmarshalSetting
472
- );
473
- pageOfListOS = (request = {}) => this.client.fetch(
474
- {
475
- method: "GET",
476
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
477
- urlParams: urlParams(
478
- ["offer_id", request.offerId],
479
- ["page", request.page],
480
- [
481
- "page_size",
482
- request.pageSize ?? this.client.settings.defaultPageSize
483
- ]
484
- )
485
- },
486
- unmarshalListOSResponse
487
- );
488
- /**
489
- * List available OSes. List all OSes that are available for installation on Elastic Metal servers.
490
- *
491
- * @param request - The request {@link ListOSRequest}
492
- * @returns A Promise of ListOSResponse
493
- */
494
- listOS = (request = {}) => enrichForPagination("os", this.pageOfListOS, request);
495
- /**
496
- * Get OS with an ID. Return the specific OS for the ID.
497
- *
498
- * @param request - The request {@link GetOSRequest}
499
- * @returns A Promise of OS
500
- */
501
- getOS = (request) => this.client.fetch(
502
- {
503
- method: "GET",
504
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam("osId", request.osId)}`
505
- },
506
- unmarshalOS
507
- );
508
- }
509
- class PrivateNetworkAPI extends API$1 {
510
- /**
511
- * Locality of this API.
512
- * type ∈ {'zone','region','global','unspecified'}
513
- */
514
- static LOCALITY = toApiLocality({
515
- zones: ["fr-par-2"]
516
- });
517
- /**
518
- * Add a server to a Private Network.
519
- *
520
- * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
521
- * @returns A Promise of ServerPrivateNetwork
522
- */
523
- addServerPrivateNetwork = (request) => this.client.fetch(
524
- {
525
- body: JSON.stringify(
526
- marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
527
- request,
528
- this.client.settings
529
- )
530
- ),
531
- headers: jsonContentHeaders,
532
- method: "POST",
533
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
534
- },
535
- unmarshalServerPrivateNetwork
536
- );
537
- /**
538
- * Set multiple Private Networks on a server.
539
- *
540
- * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
541
- * @returns A Promise of SetServerPrivateNetworksResponse
542
- */
543
- setServerPrivateNetworks = (request) => this.client.fetch(
544
- {
545
- body: JSON.stringify(
546
- marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
547
- request,
548
- this.client.settings
549
- )
550
- ),
551
- headers: jsonContentHeaders,
552
- method: "PUT",
553
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
554
- },
555
- unmarshalSetServerPrivateNetworksResponse
556
- );
557
- pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
558
- {
559
- method: "GET",
560
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
561
- urlParams: urlParams(
562
- ["order_by", request.orderBy],
563
- ["organization_id", request.organizationId],
564
- ["page", request.page],
565
- [
566
- "page_size",
567
- request.pageSize ?? this.client.settings.defaultPageSize
568
- ],
569
- ["private_network_id", request.privateNetworkId],
570
- ["project_id", request.projectId],
571
- ["server_id", request.serverId]
572
- )
573
- },
574
- unmarshalListServerPrivateNetworksResponse
575
- );
576
- /**
577
- * List the Private Networks of a server.
578
- *
579
- * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
580
- * @returns A Promise of ListServerPrivateNetworksResponse
581
- */
582
- listServerPrivateNetworks = (request = {}) => enrichForPagination(
583
- "serverPrivateNetworks",
584
- this.pageOfListServerPrivateNetworks,
585
- request
586
- );
587
- /**
588
- * Delete a Private Network.
589
- *
590
- * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
591
- */
592
- deleteServerPrivateNetwork = (request) => this.client.fetch({
593
- method: "DELETE",
594
- path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
595
- });
596
- }
597
- export {
598
- API,
599
- PrivateNetworkAPI
348
+ /**
349
+ * Elastic Metal - Private Network API.
350
+ */
351
+ var PrivateNetworkAPI = class extends API {
352
+ /**
353
+ * Locality of this API.
354
+ * type ∈ {'zone','region','global','unspecified'}
355
+ */
356
+ static LOCALITY = toApiLocality({ zones: ["fr-par-2"] });
357
+ /**
358
+ * Add a server to a Private Network.
359
+ *
360
+ * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
361
+ * @returns A Promise of ServerPrivateNetwork
362
+ */
363
+ addServerPrivateNetwork = (request) => this.client.fetch({
364
+ body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
365
+ headers: jsonContentHeaders,
366
+ method: "POST",
367
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
368
+ }, unmarshalServerPrivateNetwork);
369
+ /**
370
+ * Set multiple Private Networks on a server.
371
+ *
372
+ * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
373
+ * @returns A Promise of SetServerPrivateNetworksResponse
374
+ */
375
+ setServerPrivateNetworks = (request) => this.client.fetch({
376
+ body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
377
+ headers: jsonContentHeaders,
378
+ method: "PUT",
379
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
380
+ }, unmarshalSetServerPrivateNetworksResponse);
381
+ pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
382
+ method: "GET",
383
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
384
+ 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])
385
+ }, unmarshalListServerPrivateNetworksResponse);
386
+ /**
387
+ * List the Private Networks of a server.
388
+ *
389
+ * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
390
+ * @returns A Promise of ListServerPrivateNetworksResponse
391
+ */
392
+ listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
393
+ /**
394
+ * Delete a Private Network.
395
+ *
396
+ * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
397
+ */
398
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
399
+ method: "DELETE",
400
+ path: `/baremetal/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
401
+ });
600
402
  };
403
+ export { API$1 as API, PrivateNetworkAPI };