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