@scaleway/sdk-baremetal 1.3.0 → 2.1.1

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