@scaleway/sdk-instance 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1170 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const marshalling_gen = require("./marshalling.gen.cjs");
5
+ const jsonContentHeaders = {
6
+ "Content-Type": "application/json; charset=utf-8"
7
+ };
8
+ class API extends sdkClient.API {
9
+ /** Lists the available zones of the API. */
10
+ static LOCALITIES = [
11
+ "fr-par-1",
12
+ "fr-par-2",
13
+ "fr-par-3",
14
+ "nl-ams-1",
15
+ "nl-ams-2",
16
+ "nl-ams-3",
17
+ "pl-waw-1",
18
+ "pl-waw-2",
19
+ "pl-waw-3"
20
+ ];
21
+ /**
22
+ * Get availability. Get availability for all Instance types.
23
+ *
24
+ * @param request - The request {@link GetServerTypesAvailabilityRequest}
25
+ * @returns A Promise of GetServerTypesAvailabilityResponse
26
+ */
27
+ getServerTypesAvailability = (request = {}) => this.client.fetch(
28
+ {
29
+ method: "GET",
30
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/products/servers/availability`,
31
+ urlParams: sdkClient.urlParams(
32
+ ["page", request.page],
33
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize]
34
+ )
35
+ },
36
+ marshalling_gen.unmarshalGetServerTypesAvailabilityResponse
37
+ );
38
+ /**
39
+ * List Instance types. List available Instance types and their technical details.
40
+ *
41
+ * @param request - The request {@link ListServersTypesRequest}
42
+ * @returns A Promise of ListServersTypesResponse
43
+ */
44
+ listServersTypes = (request = {}) => this.client.fetch(
45
+ {
46
+ method: "GET",
47
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/products/servers`,
48
+ urlParams: sdkClient.urlParams(
49
+ ["page", request.page],
50
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize]
51
+ )
52
+ },
53
+ marshalling_gen.unmarshalListServersTypesResponse
54
+ );
55
+ /**
56
+ * List volume types. List all volume types and their technical details.
57
+ *
58
+ * @param request - The request {@link ListVolumesTypesRequest}
59
+ * @returns A Promise of ListVolumesTypesResponse
60
+ */
61
+ listVolumesTypes = (request = {}) => this.client.fetch(
62
+ {
63
+ method: "GET",
64
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/products/volumes`,
65
+ urlParams: sdkClient.urlParams(
66
+ ["page", request.page],
67
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize]
68
+ )
69
+ },
70
+ marshalling_gen.unmarshalListVolumesTypesResponse
71
+ );
72
+ pageOfListServers = (request = {}) => this.client.fetch(
73
+ {
74
+ method: "GET",
75
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
76
+ urlParams: sdkClient.urlParams(
77
+ ["commercial_type", request.commercialType],
78
+ ["name", request.name],
79
+ ["order", request.order],
80
+ ["organization", request.organization],
81
+ ["page", request.page],
82
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
83
+ ["private_ip", request.privateIp],
84
+ ["private_network", request.privateNetwork],
85
+ [
86
+ "private_networks",
87
+ request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(",") : void 0
88
+ ],
89
+ ["private_nic_mac_address", request.privateNicMacAddress],
90
+ ["project", request.project],
91
+ [
92
+ "servers",
93
+ request.servers && request.servers.length > 0 ? request.servers.join(",") : void 0
94
+ ],
95
+ ["state", request.state],
96
+ [
97
+ "tags",
98
+ request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
99
+ ],
100
+ ["with_ip", request.withIp],
101
+ ["without_ip", request.withoutIp]
102
+ )
103
+ },
104
+ marshalling_gen.unmarshalListServersResponse
105
+ );
106
+ /**
107
+ * List all Instances. List all Instances in a specified Availability Zone, e.g. `fr-par-1`.
108
+ *
109
+ * @param request - The request {@link ListServersRequest}
110
+ * @returns A Promise of ListServersResponse
111
+ */
112
+ listServers = (request = {}) => sdkClient.enrichForPagination("servers", this.pageOfListServers, request);
113
+ _createServer = (request) => this.client.fetch(
114
+ {
115
+ body: JSON.stringify(
116
+ marshalling_gen.marshalCreateServerRequest(request, this.client.settings)
117
+ ),
118
+ headers: jsonContentHeaders,
119
+ method: "POST",
120
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
121
+ },
122
+ marshalling_gen.unmarshalCreateServerResponse
123
+ );
124
+ /**
125
+ * Delete an Instance. Delete the Instance with the specified ID.
126
+ *
127
+ * @param request - The request {@link DeleteServerRequest}
128
+ */
129
+ deleteServer = (request) => this.client.fetch({
130
+ method: "DELETE",
131
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
132
+ });
133
+ /**
134
+ * Get an Instance. Get the details of a specified Instance.
135
+ *
136
+ * @param request - The request {@link GetServerRequest}
137
+ * @returns A Promise of GetServerResponse
138
+ */
139
+ getServer = (request) => this.client.fetch(
140
+ {
141
+ method: "GET",
142
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
143
+ },
144
+ marshalling_gen.unmarshalGetServerResponse
145
+ );
146
+ _setServer = (request) => this.client.fetch(
147
+ {
148
+ body: JSON.stringify(
149
+ marshalling_gen.marshalSetServerRequest(request, this.client.settings)
150
+ ),
151
+ headers: jsonContentHeaders,
152
+ method: "PUT",
153
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("id", request.id)}`
154
+ },
155
+ marshalling_gen.unmarshalSetServerResponse
156
+ );
157
+ _updateServer = (request) => this.client.fetch(
158
+ {
159
+ body: JSON.stringify(
160
+ marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)
161
+ ),
162
+ headers: jsonContentHeaders,
163
+ method: "PATCH",
164
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
165
+ },
166
+ marshalling_gen.unmarshalUpdateServerResponse
167
+ );
168
+ /**
169
+ * List Instance actions. List all actions (e.g. power on, power off, reboot) that can currently be performed on an Instance.
170
+ *
171
+ * @param request - The request {@link ListServerActionsRequest}
172
+ * @returns A Promise of ListServerActionsResponse
173
+ */
174
+ listServerActions = (request) => this.client.fetch(
175
+ {
176
+ method: "GET",
177
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/action`
178
+ },
179
+ marshalling_gen.unmarshalListServerActionsResponse
180
+ );
181
+ /**
182
+ * Perform action. Perform an action on an Instance.
183
+ Available actions are:
184
+ * `poweron`: Start a stopped Instance.
185
+ * `poweroff`: Fully stop the Instance and release the hypervisor slot.
186
+ * `stop_in_place`: Stop the Instance, but keep the slot on the hypervisor.
187
+ * `reboot`: Stop the instance and restart it.
188
+ * `backup`: Create an image with all the volumes of an Instance.
189
+ * `terminate`: Delete the Instance along with its attached volumes, except for SBS volumes.
190
+ * `enable_routed_ip`: Migrate the Instance to the new network stack.
191
+
192
+ The `terminate` action will result in the deletion of `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type will only be detached.
193
+ If you want to preserve your volumes, you should detach them before the Instance deletion or `terminate` action.
194
+
195
+ The `backup` action can be done with:
196
+ * No `volumes` key in the body: an image is created with snapshots of all the server volumes, except for the `scratch` volumes types.
197
+ * `volumes` key in the body with a dictionary as value, in this dictionary volumes UUID as keys and empty dictionaries as values : an image is created with the snapshots of the volumes in `volumes` key. `scratch` volumes types can't be shapshotted.
198
+ *
199
+ * @param request - The request {@link ServerActionRequest}
200
+ * @returns A Promise of ServerActionResponse
201
+ */
202
+ serverAction = (request) => this.client.fetch(
203
+ {
204
+ body: JSON.stringify(
205
+ marshalling_gen.marshalServerActionRequest(request, this.client.settings)
206
+ ),
207
+ headers: jsonContentHeaders,
208
+ method: "POST",
209
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/action`
210
+ },
211
+ marshalling_gen.unmarshalServerActionResponse
212
+ );
213
+ /**
214
+ * List user data. List all user data keys registered on a specified Instance.
215
+ *
216
+ * @param request - The request {@link ListServerUserDataRequest}
217
+ * @returns A Promise of ListServerUserDataResponse
218
+ */
219
+ listServerUserData = (request) => this.client.fetch(
220
+ {
221
+ method: "GET",
222
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/user_data`
223
+ },
224
+ marshalling_gen.unmarshalListServerUserDataResponse
225
+ );
226
+ /**
227
+ * Delete user data. Delete the specified key from an Instance's user data.
228
+ *
229
+ * @param request - The request {@link DeleteServerUserDataRequest}
230
+ */
231
+ deleteServerUserData = (request) => this.client.fetch({
232
+ method: "DELETE",
233
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/user_data/${sdkClient.validatePathParam("key", request.key)}`
234
+ });
235
+ /**
236
+ * Get Instance compatible types. Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on:
237
+ * the CPU architecture
238
+ * the OS type
239
+ * the required l_ssd storage size
240
+ * the required scratch storage size
241
+ If the specified Instance offer is flagged as end of service, the best compatible offer is the first returned.
242
+ *
243
+ * @param request - The request {@link GetServerCompatibleTypesRequest}
244
+ * @returns A Promise of ServerCompatibleTypes
245
+ */
246
+ getServerCompatibleTypes = (request) => this.client.fetch(
247
+ {
248
+ method: "GET",
249
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/compatible-types`
250
+ },
251
+ marshalling_gen.unmarshalServerCompatibleTypes
252
+ );
253
+ attachServerVolume = (request) => this.client.fetch(
254
+ {
255
+ body: JSON.stringify(
256
+ marshalling_gen.marshalAttachServerVolumeRequest(request, this.client.settings)
257
+ ),
258
+ headers: jsonContentHeaders,
259
+ method: "POST",
260
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/attach-volume`
261
+ },
262
+ marshalling_gen.unmarshalAttachServerVolumeResponse
263
+ );
264
+ detachServerVolume = (request) => this.client.fetch(
265
+ {
266
+ body: JSON.stringify(
267
+ marshalling_gen.marshalDetachServerVolumeRequest(request, this.client.settings)
268
+ ),
269
+ headers: jsonContentHeaders,
270
+ method: "POST",
271
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/detach-volume`
272
+ },
273
+ marshalling_gen.unmarshalDetachServerVolumeResponse
274
+ );
275
+ /**
276
+ * Attach a filesystem volume to an Instance.
277
+ *
278
+ * @param request - The request {@link AttachServerFileSystemRequest}
279
+ * @returns A Promise of AttachServerFileSystemResponse
280
+ */
281
+ attachServerFileSystem = (request) => this.client.fetch(
282
+ {
283
+ body: JSON.stringify(
284
+ marshalling_gen.marshalAttachServerFileSystemRequest(request, this.client.settings)
285
+ ),
286
+ headers: jsonContentHeaders,
287
+ method: "POST",
288
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/attach-filesystem`
289
+ },
290
+ marshalling_gen.unmarshalAttachServerFileSystemResponse
291
+ );
292
+ /**
293
+ * Detach a filesystem volume to an Instance.
294
+ *
295
+ * @param request - The request {@link DetachServerFileSystemRequest}
296
+ * @returns A Promise of DetachServerFileSystemResponse
297
+ */
298
+ detachServerFileSystem = (request) => this.client.fetch(
299
+ {
300
+ body: JSON.stringify(
301
+ marshalling_gen.marshalDetachServerFileSystemRequest(request, this.client.settings)
302
+ ),
303
+ headers: jsonContentHeaders,
304
+ method: "POST",
305
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/detach-filesystem`
306
+ },
307
+ marshalling_gen.unmarshalDetachServerFileSystemResponse
308
+ );
309
+ pageOfListImages = (request = {}) => this.client.fetch(
310
+ {
311
+ method: "GET",
312
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images`,
313
+ urlParams: sdkClient.urlParams(
314
+ ["arch", request.arch],
315
+ ["name", request.name],
316
+ ["organization", request.organization],
317
+ ["page", request.page],
318
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
319
+ ["project", request.project],
320
+ ["public", request.public],
321
+ ["tags", request.tags]
322
+ )
323
+ },
324
+ marshalling_gen.unmarshalListImagesResponse
325
+ );
326
+ /**
327
+ * List Instance images. List all existing Instance images.
328
+ *
329
+ * @param request - The request {@link ListImagesRequest}
330
+ * @returns A Promise of ListImagesResponse
331
+ */
332
+ listImages = (request = {}) => sdkClient.enrichForPagination("images", this.pageOfListImages, request);
333
+ /**
334
+ * Get an Instance image. Get details of an image with the specified ID.
335
+ *
336
+ * @param request - The request {@link GetImageRequest}
337
+ * @returns A Promise of GetImageResponse
338
+ */
339
+ getImage = (request) => this.client.fetch(
340
+ {
341
+ method: "GET",
342
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${sdkClient.validatePathParam("imageId", request.imageId)}`
343
+ },
344
+ marshalling_gen.unmarshalGetImageResponse
345
+ );
346
+ /**
347
+ * Create an Instance image. Create an Instance image from the specified snapshot ID.
348
+ *
349
+ * @param request - The request {@link CreateImageRequest}
350
+ * @returns A Promise of CreateImageResponse
351
+ */
352
+ createImage = (request) => this.client.fetch(
353
+ {
354
+ body: JSON.stringify(
355
+ marshalling_gen.marshalCreateImageRequest(request, this.client.settings)
356
+ ),
357
+ headers: jsonContentHeaders,
358
+ method: "POST",
359
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images`
360
+ },
361
+ marshalling_gen.unmarshalCreateImageResponse
362
+ );
363
+ _setImage = (request) => this.client.fetch(
364
+ {
365
+ body: JSON.stringify(
366
+ marshalling_gen.marshalSetImageRequest(request, this.client.settings)
367
+ ),
368
+ headers: jsonContentHeaders,
369
+ method: "PUT",
370
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${sdkClient.validatePathParam("id", request.id)}`
371
+ },
372
+ marshalling_gen.unmarshalSetImageResponse
373
+ );
374
+ /**
375
+ * Update image. Update the properties of an image.
376
+ *
377
+ * @param request - The request {@link UpdateImageRequest}
378
+ * @returns A Promise of UpdateImageResponse
379
+ */
380
+ updateImage = (request) => this.client.fetch(
381
+ {
382
+ body: JSON.stringify(
383
+ marshalling_gen.marshalUpdateImageRequest(request, this.client.settings)
384
+ ),
385
+ headers: jsonContentHeaders,
386
+ method: "PATCH",
387
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${sdkClient.validatePathParam("imageId", request.imageId)}`
388
+ },
389
+ marshalling_gen.unmarshalUpdateImageResponse
390
+ );
391
+ /**
392
+ * Delete an Instance image. Delete the image with the specified ID.
393
+ *
394
+ * @param request - The request {@link DeleteImageRequest}
395
+ */
396
+ deleteImage = (request) => this.client.fetch({
397
+ method: "DELETE",
398
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${sdkClient.validatePathParam("imageId", request.imageId)}`
399
+ });
400
+ pageOfListSnapshots = (request = {}) => this.client.fetch(
401
+ {
402
+ method: "GET",
403
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`,
404
+ urlParams: sdkClient.urlParams(
405
+ ["base_volume_id", request.baseVolumeId],
406
+ ["name", request.name],
407
+ ["organization", request.organization],
408
+ ["page", request.page],
409
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
410
+ ["project", request.project],
411
+ ["tags", request.tags]
412
+ )
413
+ },
414
+ marshalling_gen.unmarshalListSnapshotsResponse
415
+ );
416
+ /**
417
+ * List snapshots. List all snapshots of an Organization in a specified Availability Zone.
418
+ *
419
+ * @param request - The request {@link ListSnapshotsRequest}
420
+ * @returns A Promise of ListSnapshotsResponse
421
+ */
422
+ listSnapshots = (request = {}) => sdkClient.enrichForPagination("snapshots", this.pageOfListSnapshots, request);
423
+ /**
424
+ * Create a snapshot from a specified volume or from a QCOW2 file. Create a snapshot from a specified volume or from a QCOW2 file in a specified Availability Zone.
425
+ *
426
+ * @param request - The request {@link CreateSnapshotRequest}
427
+ * @returns A Promise of CreateSnapshotResponse
428
+ */
429
+ createSnapshot = (request = {}) => this.client.fetch(
430
+ {
431
+ body: JSON.stringify(
432
+ marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)
433
+ ),
434
+ headers: jsonContentHeaders,
435
+ method: "POST",
436
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`
437
+ },
438
+ marshalling_gen.unmarshalCreateSnapshotResponse
439
+ );
440
+ /**
441
+ * Get a snapshot. Get details of a snapshot with the specified ID.
442
+ *
443
+ * @param request - The request {@link GetSnapshotRequest}
444
+ * @returns A Promise of GetSnapshotResponse
445
+ */
446
+ getSnapshot = (request) => this.client.fetch(
447
+ {
448
+ method: "GET",
449
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
450
+ },
451
+ marshalling_gen.unmarshalGetSnapshotResponse
452
+ );
453
+ _setSnapshot = (request) => this.client.fetch(
454
+ {
455
+ body: JSON.stringify(
456
+ marshalling_gen.marshalSetSnapshotRequest(request, this.client.settings)
457
+ ),
458
+ headers: jsonContentHeaders,
459
+ method: "PUT",
460
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
461
+ },
462
+ marshalling_gen.unmarshalSetSnapshotResponse
463
+ );
464
+ /**
465
+ * Update a snapshot. Update the properties of a snapshot.
466
+ *
467
+ * @param request - The request {@link UpdateSnapshotRequest}
468
+ * @returns A Promise of UpdateSnapshotResponse
469
+ */
470
+ updateSnapshot = (request) => this.client.fetch(
471
+ {
472
+ body: JSON.stringify(
473
+ marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)
474
+ ),
475
+ headers: jsonContentHeaders,
476
+ method: "PATCH",
477
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
478
+ },
479
+ marshalling_gen.unmarshalUpdateSnapshotResponse
480
+ );
481
+ /**
482
+ * Delete a snapshot. Delete the snapshot with the specified ID.
483
+ *
484
+ * @param request - The request {@link DeleteSnapshotRequest}
485
+ */
486
+ deleteSnapshot = (request) => this.client.fetch({
487
+ method: "DELETE",
488
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}`
489
+ });
490
+ /**
491
+ * Export a snapshot. Export a snapshot to a specified Object Storage bucket in the same region.
492
+ *
493
+ * @param request - The request {@link ExportSnapshotRequest}
494
+ * @returns A Promise of ExportSnapshotResponse
495
+ */
496
+ exportSnapshot = (request) => this.client.fetch(
497
+ {
498
+ body: JSON.stringify(
499
+ marshalling_gen.marshalExportSnapshotRequest(request, this.client.settings)
500
+ ),
501
+ headers: jsonContentHeaders,
502
+ method: "POST",
503
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${sdkClient.validatePathParam("snapshotId", request.snapshotId)}/export`
504
+ },
505
+ marshalling_gen.unmarshalExportSnapshotResponse
506
+ );
507
+ pageOfListVolumes = (request = {}) => this.client.fetch(
508
+ {
509
+ method: "GET",
510
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`,
511
+ urlParams: sdkClient.urlParams(
512
+ ["name", request.name],
513
+ ["organization", request.organization],
514
+ ["page", request.page],
515
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
516
+ ["project", request.project],
517
+ [
518
+ "tags",
519
+ request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
520
+ ],
521
+ ["volume_type", request.volumeType]
522
+ )
523
+ },
524
+ marshalling_gen.unmarshalListVolumesResponse
525
+ );
526
+ /**
527
+ * List volumes. List volumes in the specified Availability Zone. You can filter the output by volume type.
528
+ *
529
+ * @param request - The request {@link ListVolumesRequest}
530
+ * @returns A Promise of ListVolumesResponse
531
+ */
532
+ listVolumes = (request = {}) => sdkClient.enrichForPagination("volumes", this.pageOfListVolumes, request);
533
+ /**
534
+ * Create a volume. Create a volume of a specified type in an Availability Zone.
535
+ *
536
+ * @param request - The request {@link CreateVolumeRequest}
537
+ * @returns A Promise of CreateVolumeResponse
538
+ */
539
+ createVolume = (request = {}) => this.client.fetch(
540
+ {
541
+ body: JSON.stringify(
542
+ marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings)
543
+ ),
544
+ headers: jsonContentHeaders,
545
+ method: "POST",
546
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`
547
+ },
548
+ marshalling_gen.unmarshalCreateVolumeResponse
549
+ );
550
+ /**
551
+ * Get a volume. Get details of a volume with the specified ID.
552
+ *
553
+ * @param request - The request {@link GetVolumeRequest}
554
+ * @returns A Promise of GetVolumeResponse
555
+ */
556
+ getVolume = (request) => this.client.fetch(
557
+ {
558
+ method: "GET",
559
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${sdkClient.validatePathParam("volumeId", request.volumeId)}`
560
+ },
561
+ marshalling_gen.unmarshalGetVolumeResponse
562
+ );
563
+ /**
564
+ * Update a volume. Replace the name and/or size properties of a volume specified by its ID, with the specified value(s). Any volume name can be changed, however only `b_ssd` volumes can currently be increased in size.
565
+ *
566
+ * @param request - The request {@link UpdateVolumeRequest}
567
+ * @returns A Promise of UpdateVolumeResponse
568
+ */
569
+ updateVolume = (request) => this.client.fetch(
570
+ {
571
+ body: JSON.stringify(
572
+ marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings)
573
+ ),
574
+ headers: jsonContentHeaders,
575
+ method: "PATCH",
576
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${sdkClient.validatePathParam("volumeId", request.volumeId)}`
577
+ },
578
+ marshalling_gen.unmarshalUpdateVolumeResponse
579
+ );
580
+ /**
581
+ * Delete a volume. Delete the volume with the specified ID.
582
+ *
583
+ * @param request - The request {@link DeleteVolumeRequest}
584
+ */
585
+ deleteVolume = (request) => this.client.fetch({
586
+ method: "DELETE",
587
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${sdkClient.validatePathParam("volumeId", request.volumeId)}`
588
+ });
589
+ pageOfListSecurityGroups = (request = {}) => this.client.fetch(
590
+ {
591
+ method: "GET",
592
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups`,
593
+ urlParams: sdkClient.urlParams(
594
+ ["name", request.name],
595
+ ["organization", request.organization],
596
+ ["page", request.page],
597
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
598
+ ["project", request.project],
599
+ ["project_default", request.projectDefault],
600
+ [
601
+ "tags",
602
+ request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
603
+ ]
604
+ )
605
+ },
606
+ marshalling_gen.unmarshalListSecurityGroupsResponse
607
+ );
608
+ /**
609
+ * List security groups. List all existing security groups.
610
+ *
611
+ * @param request - The request {@link ListSecurityGroupsRequest}
612
+ * @returns A Promise of ListSecurityGroupsResponse
613
+ */
614
+ listSecurityGroups = (request = {}) => sdkClient.enrichForPagination(
615
+ "securityGroups",
616
+ this.pageOfListSecurityGroups,
617
+ request
618
+ );
619
+ /**
620
+ * Create a security group. Create a security group with a specified name and description.
621
+ *
622
+ * @param request - The request {@link CreateSecurityGroupRequest}
623
+ * @returns A Promise of CreateSecurityGroupResponse
624
+ */
625
+ createSecurityGroup = (request) => this.client.fetch(
626
+ {
627
+ body: JSON.stringify(
628
+ marshalling_gen.marshalCreateSecurityGroupRequest(request, this.client.settings)
629
+ ),
630
+ headers: jsonContentHeaders,
631
+ method: "POST",
632
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups`
633
+ },
634
+ marshalling_gen.unmarshalCreateSecurityGroupResponse
635
+ );
636
+ /**
637
+ * Get a security group. Get the details of a security group with the specified ID.
638
+ *
639
+ * @param request - The request {@link GetSecurityGroupRequest}
640
+ * @returns A Promise of GetSecurityGroupResponse
641
+ */
642
+ getSecurityGroup = (request) => this.client.fetch(
643
+ {
644
+ method: "GET",
645
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}`
646
+ },
647
+ marshalling_gen.unmarshalGetSecurityGroupResponse
648
+ );
649
+ /**
650
+ * Delete a security group. Delete a security group with the specified ID.
651
+ *
652
+ * @param request - The request {@link DeleteSecurityGroupRequest}
653
+ */
654
+ deleteSecurityGroup = (request) => this.client.fetch({
655
+ method: "DELETE",
656
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}`
657
+ });
658
+ _setSecurityGroup = (request) => this.client.fetch(
659
+ {
660
+ body: JSON.stringify(
661
+ marshalling_gen.marshalSetSecurityGroupRequest(request, this.client.settings)
662
+ ),
663
+ headers: jsonContentHeaders,
664
+ method: "PUT",
665
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("id", request.id)}`
666
+ },
667
+ marshalling_gen.unmarshalSetSecurityGroupResponse
668
+ );
669
+ /**
670
+ * Update a security group. Update the properties of security group.
671
+ *
672
+ * @param request - The request {@link UpdateSecurityGroupRequest}
673
+ * @returns A Promise of UpdateSecurityGroupResponse
674
+ */
675
+ updateSecurityGroup = (request) => this.client.fetch(
676
+ {
677
+ body: JSON.stringify(
678
+ marshalling_gen.marshalUpdateSecurityGroupRequest(request, this.client.settings)
679
+ ),
680
+ headers: jsonContentHeaders,
681
+ method: "PATCH",
682
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}`
683
+ },
684
+ marshalling_gen.unmarshalUpdateSecurityGroupResponse
685
+ );
686
+ /**
687
+ * Get default rules. Lists the default rules applied to all the security groups.
688
+ *
689
+ * @param request - The request {@link ListDefaultSecurityGroupRulesRequest}
690
+ * @returns A Promise of ListSecurityGroupRulesResponse
691
+ */
692
+ listDefaultSecurityGroupRules = (request = {}) => this.client.fetch(
693
+ {
694
+ method: "GET",
695
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/default/rules`
696
+ },
697
+ marshalling_gen.unmarshalListSecurityGroupRulesResponse
698
+ );
699
+ pageOfListSecurityGroupRules = (request) => this.client.fetch(
700
+ {
701
+ method: "GET",
702
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules`,
703
+ urlParams: sdkClient.urlParams(
704
+ ["page", request.page],
705
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize]
706
+ )
707
+ },
708
+ marshalling_gen.unmarshalListSecurityGroupRulesResponse
709
+ );
710
+ /**
711
+ * List rules. List the rules of the a specified security group ID.
712
+ *
713
+ * @param request - The request {@link ListSecurityGroupRulesRequest}
714
+ * @returns A Promise of ListSecurityGroupRulesResponse
715
+ */
716
+ listSecurityGroupRules = (request) => sdkClient.enrichForPagination("rules", this.pageOfListSecurityGroupRules, request);
717
+ /**
718
+ * Create rule. Create a rule in the specified security group ID.
719
+ *
720
+ * @param request - The request {@link CreateSecurityGroupRuleRequest}
721
+ * @returns A Promise of CreateSecurityGroupRuleResponse
722
+ */
723
+ createSecurityGroupRule = (request) => this.client.fetch(
724
+ {
725
+ body: JSON.stringify(
726
+ marshalling_gen.marshalCreateSecurityGroupRuleRequest(request, this.client.settings)
727
+ ),
728
+ headers: jsonContentHeaders,
729
+ method: "POST",
730
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules`
731
+ },
732
+ marshalling_gen.unmarshalCreateSecurityGroupRuleResponse
733
+ );
734
+ /**
735
+ * Update all the rules of a security group. Replaces the existing rules of the security group with the rules provided. This endpoint supports the update of existing rules, creation of new rules and deletion of existing rules when they are not passed in the request.
736
+ *
737
+ * @param request - The request {@link SetSecurityGroupRulesRequest}
738
+ * @returns A Promise of SetSecurityGroupRulesResponse
739
+ */
740
+ setSecurityGroupRules = (request) => this.client.fetch(
741
+ {
742
+ body: JSON.stringify(
743
+ marshalling_gen.marshalSetSecurityGroupRulesRequest(request, this.client.settings)
744
+ ),
745
+ headers: jsonContentHeaders,
746
+ method: "PUT",
747
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules`
748
+ },
749
+ marshalling_gen.unmarshalSetSecurityGroupRulesResponse
750
+ );
751
+ /**
752
+ * Delete rule. Delete a security group rule with the specified ID.
753
+ *
754
+ * @param request - The request {@link DeleteSecurityGroupRuleRequest}
755
+ */
756
+ deleteSecurityGroupRule = (request) => this.client.fetch({
757
+ method: "DELETE",
758
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${sdkClient.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}`
759
+ });
760
+ /**
761
+ * Get rule. Get details of a security group rule with the specified ID.
762
+ *
763
+ * @param request - The request {@link GetSecurityGroupRuleRequest}
764
+ * @returns A Promise of GetSecurityGroupRuleResponse
765
+ */
766
+ getSecurityGroupRule = (request) => this.client.fetch(
767
+ {
768
+ method: "GET",
769
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${sdkClient.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}`
770
+ },
771
+ marshalling_gen.unmarshalGetSecurityGroupRuleResponse
772
+ );
773
+ _setSecurityGroupRule = (request) => this.client.fetch(
774
+ {
775
+ body: JSON.stringify(
776
+ marshalling_gen.marshalSetSecurityGroupRuleRequest(request, this.client.settings)
777
+ ),
778
+ headers: jsonContentHeaders,
779
+ method: "PUT",
780
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${sdkClient.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}`
781
+ },
782
+ marshalling_gen.unmarshalSetSecurityGroupRuleResponse
783
+ );
784
+ /**
785
+ * Update security group rule. Update the properties of a rule from a specified security group.
786
+ *
787
+ * @param request - The request {@link UpdateSecurityGroupRuleRequest}
788
+ * @returns A Promise of UpdateSecurityGroupRuleResponse
789
+ */
790
+ updateSecurityGroupRule = (request) => this.client.fetch(
791
+ {
792
+ body: JSON.stringify(
793
+ marshalling_gen.marshalUpdateSecurityGroupRuleRequest(request, this.client.settings)
794
+ ),
795
+ headers: jsonContentHeaders,
796
+ method: "PATCH",
797
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${sdkClient.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${sdkClient.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}`
798
+ },
799
+ marshalling_gen.unmarshalUpdateSecurityGroupRuleResponse
800
+ );
801
+ pageOfListPlacementGroups = (request = {}) => this.client.fetch(
802
+ {
803
+ method: "GET",
804
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups`,
805
+ urlParams: sdkClient.urlParams(
806
+ ["name", request.name],
807
+ ["organization", request.organization],
808
+ ["page", request.page],
809
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
810
+ ["project", request.project],
811
+ [
812
+ "tags",
813
+ request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
814
+ ]
815
+ )
816
+ },
817
+ marshalling_gen.unmarshalListPlacementGroupsResponse
818
+ );
819
+ /**
820
+ * List placement groups. List all placement groups in a specified Availability Zone.
821
+ *
822
+ * @param request - The request {@link ListPlacementGroupsRequest}
823
+ * @returns A Promise of ListPlacementGroupsResponse
824
+ */
825
+ listPlacementGroups = (request = {}) => sdkClient.enrichForPagination(
826
+ "placementGroups",
827
+ this.pageOfListPlacementGroups,
828
+ request
829
+ );
830
+ /**
831
+ * Create a placement group. Create a new placement group in a specified Availability Zone.
832
+ *
833
+ * @param request - The request {@link CreatePlacementGroupRequest}
834
+ * @returns A Promise of CreatePlacementGroupResponse
835
+ */
836
+ createPlacementGroup = (request = {}) => this.client.fetch(
837
+ {
838
+ body: JSON.stringify(
839
+ marshalling_gen.marshalCreatePlacementGroupRequest(request, this.client.settings)
840
+ ),
841
+ headers: jsonContentHeaders,
842
+ method: "POST",
843
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups`
844
+ },
845
+ marshalling_gen.unmarshalCreatePlacementGroupResponse
846
+ );
847
+ /**
848
+ * Get a placement group. Get the specified placement group.
849
+ *
850
+ * @param request - The request {@link GetPlacementGroupRequest}
851
+ * @returns A Promise of GetPlacementGroupResponse
852
+ */
853
+ getPlacementGroup = (request) => this.client.fetch(
854
+ {
855
+ method: "GET",
856
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}`
857
+ },
858
+ marshalling_gen.unmarshalGetPlacementGroupResponse
859
+ );
860
+ /**
861
+ * Set placement group. Set all parameters of the specified placement group.
862
+ *
863
+ * @param request - The request {@link SetPlacementGroupRequest}
864
+ * @returns A Promise of SetPlacementGroupResponse
865
+ */
866
+ setPlacementGroup = (request) => this.client.fetch(
867
+ {
868
+ body: JSON.stringify(
869
+ marshalling_gen.marshalSetPlacementGroupRequest(request, this.client.settings)
870
+ ),
871
+ headers: jsonContentHeaders,
872
+ method: "PUT",
873
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}`
874
+ },
875
+ marshalling_gen.unmarshalSetPlacementGroupResponse
876
+ );
877
+ /**
878
+ * Update a placement group. Update one or more parameter of the specified placement group.
879
+ *
880
+ * @param request - The request {@link UpdatePlacementGroupRequest}
881
+ * @returns A Promise of UpdatePlacementGroupResponse
882
+ */
883
+ updatePlacementGroup = (request) => this.client.fetch(
884
+ {
885
+ body: JSON.stringify(
886
+ marshalling_gen.marshalUpdatePlacementGroupRequest(request, this.client.settings)
887
+ ),
888
+ headers: jsonContentHeaders,
889
+ method: "PATCH",
890
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}`
891
+ },
892
+ marshalling_gen.unmarshalUpdatePlacementGroupResponse
893
+ );
894
+ /**
895
+ * Delete the specified placement group.
896
+ *
897
+ * @param request - The request {@link DeletePlacementGroupRequest}
898
+ */
899
+ deletePlacementGroup = (request) => this.client.fetch({
900
+ method: "DELETE",
901
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}`
902
+ });
903
+ /**
904
+ * Get placement group servers. Get all Instances belonging to the specified placement group.
905
+ *
906
+ * @param request - The request {@link GetPlacementGroupServersRequest}
907
+ * @returns A Promise of GetPlacementGroupServersResponse
908
+ */
909
+ getPlacementGroupServers = (request) => this.client.fetch(
910
+ {
911
+ method: "GET",
912
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}/servers`
913
+ },
914
+ marshalling_gen.unmarshalGetPlacementGroupServersResponse
915
+ );
916
+ /**
917
+ * Set placement group servers. Set all Instances belonging to the specified placement group.
918
+ *
919
+ * @param request - The request {@link SetPlacementGroupServersRequest}
920
+ * @returns A Promise of SetPlacementGroupServersResponse
921
+ */
922
+ setPlacementGroupServers = (request) => this.client.fetch(
923
+ {
924
+ body: JSON.stringify(
925
+ marshalling_gen.marshalSetPlacementGroupServersRequest(request, this.client.settings)
926
+ ),
927
+ headers: jsonContentHeaders,
928
+ method: "PUT",
929
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}/servers`
930
+ },
931
+ marshalling_gen.unmarshalSetPlacementGroupServersResponse
932
+ );
933
+ /**
934
+ * Update placement group servers. Update all Instances belonging to the specified placement group.
935
+ *
936
+ * @param request - The request {@link UpdatePlacementGroupServersRequest}
937
+ * @returns A Promise of UpdatePlacementGroupServersResponse
938
+ */
939
+ updatePlacementGroupServers = (request) => this.client.fetch(
940
+ {
941
+ body: JSON.stringify(
942
+ marshalling_gen.marshalUpdatePlacementGroupServersRequest(
943
+ request,
944
+ this.client.settings
945
+ )
946
+ ),
947
+ headers: jsonContentHeaders,
948
+ method: "PATCH",
949
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${sdkClient.validatePathParam("placementGroupId", request.placementGroupId)}/servers`
950
+ },
951
+ marshalling_gen.unmarshalUpdatePlacementGroupServersResponse
952
+ );
953
+ pageOfListIps = (request = {}) => this.client.fetch(
954
+ {
955
+ method: "GET",
956
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
957
+ urlParams: sdkClient.urlParams(
958
+ ["name", request.name],
959
+ ["organization", request.organization],
960
+ ["page", request.page],
961
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
962
+ ["project", request.project],
963
+ [
964
+ "tags",
965
+ request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
966
+ ],
967
+ ["type", request.type]
968
+ )
969
+ },
970
+ marshalling_gen.unmarshalListIpsResponse
971
+ );
972
+ /**
973
+ * List all flexible IPs. List all flexible IPs in a specified zone.
974
+ *
975
+ * @param request - The request {@link ListIpsRequest}
976
+ * @returns A Promise of ListIpsResponse
977
+ */
978
+ listIps = (request = {}) => sdkClient.enrichForPagination("ips", this.pageOfListIps, request);
979
+ /**
980
+ * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified Instance.
981
+ *
982
+ * @param request - The request {@link CreateIpRequest}
983
+ * @returns A Promise of CreateIpResponse
984
+ */
985
+ createIp = (request = {}) => this.client.fetch(
986
+ {
987
+ body: JSON.stringify(
988
+ marshalling_gen.marshalCreateIpRequest(request, this.client.settings)
989
+ ),
990
+ headers: jsonContentHeaders,
991
+ method: "POST",
992
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
993
+ },
994
+ marshalling_gen.unmarshalCreateIpResponse
995
+ );
996
+ /**
997
+ * Get a flexible IP. Get details of an IP with the specified ID or address.
998
+ *
999
+ * @param request - The request {@link GetIpRequest}
1000
+ * @returns A Promise of GetIpResponse
1001
+ */
1002
+ getIp = (request) => this.client.fetch(
1003
+ {
1004
+ method: "GET",
1005
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ip", request.ip)}`
1006
+ },
1007
+ marshalling_gen.unmarshalGetIpResponse
1008
+ );
1009
+ /**
1010
+ * Update a flexible IP. Update a flexible IP in the specified zone with the specified ID.
1011
+ *
1012
+ * @param request - The request {@link UpdateIpRequest}
1013
+ * @returns A Promise of UpdateIpResponse
1014
+ */
1015
+ updateIp = (request) => this.client.fetch(
1016
+ {
1017
+ body: JSON.stringify(
1018
+ marshalling_gen.marshalUpdateIpRequest(request, this.client.settings)
1019
+ ),
1020
+ headers: jsonContentHeaders,
1021
+ method: "PATCH",
1022
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ip", request.ip)}`
1023
+ },
1024
+ marshalling_gen.unmarshalUpdateIpResponse
1025
+ );
1026
+ /**
1027
+ * Delete a flexible IP. Delete the IP with the specified ID.
1028
+ *
1029
+ * @param request - The request {@link DeleteIpRequest}
1030
+ */
1031
+ deleteIp = (request) => this.client.fetch({
1032
+ method: "DELETE",
1033
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${sdkClient.validatePathParam("ip", request.ip)}`
1034
+ });
1035
+ pageOfListPrivateNICs = (request) => this.client.fetch(
1036
+ {
1037
+ method: "GET",
1038
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private_nics`,
1039
+ urlParams: sdkClient.urlParams(
1040
+ ["page", request.page],
1041
+ ["per_page", request.perPage ?? this.client.settings.defaultPageSize],
1042
+ [
1043
+ "tags",
1044
+ request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0
1045
+ ]
1046
+ )
1047
+ },
1048
+ marshalling_gen.unmarshalListPrivateNICsResponse
1049
+ );
1050
+ /**
1051
+ * List all private NICs. List all private NICs of a specified Instance.
1052
+ *
1053
+ * @param request - The request {@link ListPrivateNICsRequest}
1054
+ * @returns A Promise of ListPrivateNICsResponse
1055
+ */
1056
+ listPrivateNICs = (request) => sdkClient.enrichForPagination("privateNics", this.pageOfListPrivateNICs, request);
1057
+ /**
1058
+ * Create a private NIC connecting an Instance to a Private Network.
1059
+ *
1060
+ * @param request - The request {@link CreatePrivateNICRequest}
1061
+ * @returns A Promise of CreatePrivateNICResponse
1062
+ */
1063
+ createPrivateNIC = (request) => this.client.fetch(
1064
+ {
1065
+ body: JSON.stringify(
1066
+ marshalling_gen.marshalCreatePrivateNICRequest(request, this.client.settings)
1067
+ ),
1068
+ headers: jsonContentHeaders,
1069
+ method: "POST",
1070
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private_nics`
1071
+ },
1072
+ marshalling_gen.unmarshalCreatePrivateNICResponse
1073
+ );
1074
+ /**
1075
+ * Get a private NIC. Get private NIC properties.
1076
+ *
1077
+ * @param request - The request {@link GetPrivateNICRequest}
1078
+ * @returns A Promise of GetPrivateNICResponse
1079
+ */
1080
+ getPrivateNIC = (request) => this.client.fetch(
1081
+ {
1082
+ method: "GET",
1083
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private_nics/${sdkClient.validatePathParam("privateNicId", request.privateNicId)}`
1084
+ },
1085
+ marshalling_gen.unmarshalGetPrivateNICResponse
1086
+ );
1087
+ /**
1088
+ * Update a private NIC. Update one or more parameter(s) of a specified private NIC.
1089
+ *
1090
+ * @param request - The request {@link UpdatePrivateNICRequest}
1091
+ * @returns A Promise of PrivateNIC
1092
+ */
1093
+ updatePrivateNIC = (request) => this.client.fetch(
1094
+ {
1095
+ body: JSON.stringify(
1096
+ marshalling_gen.marshalUpdatePrivateNICRequest(request, this.client.settings)
1097
+ ),
1098
+ headers: jsonContentHeaders,
1099
+ method: "PATCH",
1100
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private_nics/${sdkClient.validatePathParam("privateNicId", request.privateNicId)}`
1101
+ },
1102
+ marshalling_gen.unmarshalPrivateNIC
1103
+ );
1104
+ /**
1105
+ * Delete a private NIC.
1106
+ *
1107
+ * @param request - The request {@link DeletePrivateNICRequest}
1108
+ */
1109
+ deletePrivateNIC = (request) => this.client.fetch({
1110
+ method: "DELETE",
1111
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/private_nics/${sdkClient.validatePathParam("privateNicId", request.privateNicId)}`
1112
+ });
1113
+ getDashboard = (request = {}) => this.client.fetch(
1114
+ {
1115
+ method: "GET",
1116
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dashboard`,
1117
+ urlParams: sdkClient.urlParams(
1118
+ ["organization", request.organization],
1119
+ ["project", request.project]
1120
+ )
1121
+ },
1122
+ marshalling_gen.unmarshalGetDashboardResponse
1123
+ );
1124
+ /**
1125
+ * Get a volume or snapshot's migration plan. Given a volume or snapshot, returns the migration plan but does not perform the actual migration. To perform the migration, you have to call the [Migrate a volume and/or snapshots to SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage) endpoint afterward.
1126
+ The endpoint returns the resources that should be migrated together:
1127
+ - the volume and any snapshots created from the volume, if the call was made to plan a volume migration.
1128
+ - the base volume of the snapshot (if the volume is not deleted) and its related snapshots, if the call was made to plan a snapshot migration.
1129
+ The endpoint also returns the validation_key, which must be provided to the [Migrate a volume and/or snapshots to SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage) endpoint to confirm that all resources listed in the plan should be migrated.
1130
+ *
1131
+ * @param request - The request {@link PlanBlockMigrationRequest}
1132
+ * @returns A Promise of MigrationPlan
1133
+ */
1134
+ planBlockMigration = (request = {}) => this.client.fetch(
1135
+ {
1136
+ body: JSON.stringify(
1137
+ marshalling_gen.marshalPlanBlockMigrationRequest(request, this.client.settings)
1138
+ ),
1139
+ headers: jsonContentHeaders,
1140
+ method: "POST",
1141
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/plan`
1142
+ },
1143
+ marshalling_gen.unmarshalMigrationPlan
1144
+ );
1145
+ /**
1146
+ * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be used, the call to this endpoint must be preceded by a call to the [Get a volume or snapshot's migration plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint. To migrate all resources mentioned in the migration plan, the validation_key returned in the plan must be provided.
1147
+ *
1148
+ * @param request - The request {@link ApplyBlockMigrationRequest}
1149
+ */
1150
+ applyBlockMigration = (request) => this.client.fetch({
1151
+ body: JSON.stringify(
1152
+ marshalling_gen.marshalApplyBlockMigrationRequest(request, this.client.settings)
1153
+ ),
1154
+ headers: jsonContentHeaders,
1155
+ method: "POST",
1156
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`
1157
+ });
1158
+ checkBlockMigrationOrganizationQuotas = (request = {}) => this.client.fetch({
1159
+ body: JSON.stringify(
1160
+ marshalling_gen.marshalCheckBlockMigrationOrganizationQuotasRequest(
1161
+ request,
1162
+ this.client.settings
1163
+ )
1164
+ ),
1165
+ headers: jsonContentHeaders,
1166
+ method: "POST",
1167
+ path: `/instance/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/check-organization-quotas`
1168
+ });
1169
+ }
1170
+ exports.API = API;