@scaleway/sdk-vpcgw 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,692 +1,491 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
- import { GATEWAY_TRANSIENT_STATUSES, GATEWAY_NETWORK_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListGatewaysResponse, unmarshalGateway, marshalCreateGatewayRequest, marshalUpdateGatewayRequest, marshalUpgradeGatewayRequest, unmarshalListGatewayNetworksResponse, unmarshalGatewayNetwork, marshalCreateGatewayNetworkRequest, marshalUpdateGatewayNetworkRequest, unmarshalListDHCPsResponse, unmarshalDHCP, marshalCreateDHCPRequest, marshalUpdateDHCPRequest, unmarshalListDHCPEntriesResponse, unmarshalDHCPEntry, marshalCreateDHCPEntryRequest, marshalUpdateDHCPEntryRequest, marshalSetDHCPEntriesRequest, unmarshalSetDHCPEntriesResponse, unmarshalListPATRulesResponse, unmarshalPATRule, marshalCreatePATRuleRequest, marshalUpdatePATRuleRequest, marshalSetPATRulesRequest, unmarshalSetPATRulesResponse, unmarshalListGatewayTypesResponse, unmarshalListIPsResponse, unmarshalIP, marshalCreateIPRequest, marshalUpdateIPRequest } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
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
- "nl-ams-3",
19
- "pl-waw-1",
20
- "pl-waw-2",
21
- "pl-waw-3"
22
- ]
23
- });
24
- pageOfListGateways = (request = {}) => this.client.fetch(
25
- {
26
- method: "GET",
27
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`,
28
- urlParams: urlParams(
29
- ["name", request.name],
30
- ["order_by", request.orderBy],
31
- ["organization_id", request.organizationId],
32
- ["page", request.page],
33
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
34
- ["private_network_id", request.privateNetworkId],
35
- ["project_id", request.projectId],
36
- ["status", request.status],
37
- ["tags", request.tags],
38
- ["type", request.type]
39
- )
40
- },
41
- unmarshalListGatewaysResponse
42
- );
43
- /**
44
- * List Public Gateways. List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date.
45
- *
46
- * @deprecated
47
- * @param request - The request {@link ListGatewaysRequest}
48
- * @returns A Promise of ListGatewaysResponse
49
- */
50
- listGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListGateways, request);
51
- /**
52
- * Get a Public Gateway. Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more.
53
- *
54
- * @deprecated
55
- * @param request - The request {@link GetGatewayRequest}
56
- * @returns A Promise of Gateway
57
- */
58
- getGateway = (request) => this.client.fetch(
59
- {
60
- method: "GET",
61
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
62
- },
63
- unmarshalGateway
64
- );
65
- /**
66
- * Waits for {@link Gateway} to be in a final state.
67
- *
68
- * @param request - The request {@link GetGatewayRequest}
69
- * @param options - The waiting options
70
- * @returns A Promise of Gateway
71
- */
72
- waitForGateway = (request, options) => waitForResource(
73
- options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
74
- this.getGateway,
75
- request,
76
- options
77
- );
78
- /**
79
- * Create a Public Gateway. Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion.
80
- *
81
- * @deprecated
82
- * @param request - The request {@link CreateGatewayRequest}
83
- * @returns A Promise of Gateway
84
- */
85
- createGateway = (request) => this.client.fetch(
86
- {
87
- body: JSON.stringify(
88
- marshalCreateGatewayRequest(request, this.client.settings)
89
- ),
90
- headers: jsonContentHeaders,
91
- method: "POST",
92
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`
93
- },
94
- unmarshalGateway
95
- );
96
- /**
97
- * Update a Public Gateway. Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**.
98
- *
99
- * @deprecated
100
- * @param request - The request {@link UpdateGatewayRequest}
101
- * @returns A Promise of Gateway
102
- */
103
- updateGateway = (request) => this.client.fetch(
104
- {
105
- body: JSON.stringify(
106
- marshalUpdateGatewayRequest(request, this.client.settings)
107
- ),
108
- headers: jsonContentHeaders,
109
- method: "PATCH",
110
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
111
- },
112
- unmarshalGateway
113
- );
114
- /**
115
- * Delete a Public Gateway. Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible.
116
- *
117
- * @deprecated
118
- * @param request - The request {@link DeleteGatewayRequest}
119
- */
120
- deleteGateway = (request) => this.client.fetch(
121
- {
122
- method: "DELETE",
123
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`,
124
- urlParams: urlParams(
125
- ["cleanup_dhcp", request.cleanupDhcp]
126
- )
127
- }
128
- );
129
- /**
130
- * Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.
131
- *
132
- * @deprecated
133
- * @param request - The request {@link UpgradeGatewayRequest}
134
- * @returns A Promise of Gateway
135
- */
136
- upgradeGateway = (request) => this.client.fetch(
137
- {
138
- body: JSON.stringify(
139
- marshalUpgradeGatewayRequest(request, this.client.settings)
140
- ),
141
- headers: jsonContentHeaders,
142
- method: "POST",
143
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/upgrade`
144
- },
145
- unmarshalGateway
146
- );
147
- /**
148
- * Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP mobility (move from NAT IP to routed IP). This is idempotent: repeated calls after the first will return no error but have no effect.
149
- *
150
- * @deprecated
151
- * @param request - The request {@link EnableIPMobilityRequest}
152
- */
153
- enableIPMobility = (request) => this.client.fetch(
154
- {
155
- body: "{}",
156
- headers: jsonContentHeaders,
157
- method: "POST",
158
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/enable-ip-mobility`
159
- }
160
- );
161
- pageOfListGatewayNetworks = (request = {}) => this.client.fetch(
162
- {
163
- method: "GET",
164
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
165
- urlParams: urlParams(
166
- ["dhcp_id", request.dhcpId],
167
- ["enable_masquerade", request.enableMasquerade],
168
- ["gateway_id", request.gatewayId],
169
- ["order_by", request.orderBy],
170
- ["page", request.page],
171
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
172
- ["private_network_id", request.privateNetworkId],
173
- ["status", request.status]
174
- )
175
- },
176
- unmarshalListGatewayNetworksResponse
177
- );
178
- /**
179
- * List Public Gateway connections to Private Networks. List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.
180
- *
181
- * @deprecated
182
- * @param request - The request {@link ListGatewayNetworksRequest}
183
- * @returns A Promise of ListGatewayNetworksResponse
184
- */
185
- listGatewayNetworks = (request = {}) => enrichForPagination("gatewayNetworks", this.pageOfListGatewayNetworks, request);
186
- /**
187
- * Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.
188
- *
189
- * @deprecated
190
- * @param request - The request {@link GetGatewayNetworkRequest}
191
- * @returns A Promise of GatewayNetwork
192
- */
193
- getGatewayNetwork = (request) => this.client.fetch(
194
- {
195
- method: "GET",
196
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
197
- },
198
- unmarshalGatewayNetwork
199
- );
200
- /**
201
- * Waits for {@link GatewayNetwork} to be in a final state.
202
- *
203
- * @param request - The request {@link GetGatewayNetworkRequest}
204
- * @param options - The waiting options
205
- * @returns A Promise of GatewayNetwork
206
- */
207
- waitForGatewayNetwork = (request, options) => waitForResource(
208
- options?.stop ?? ((res) => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))),
209
- this.getGatewayNetwork,
210
- request,
211
- options
212
- );
213
- /**
214
- * Attach a Public Gateway to a Private Network. Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including DHCP settings, whether to enable masquerade (dynamic NAT), and more.
215
- *
216
- * @deprecated
217
- * @param request - The request {@link CreateGatewayNetworkRequest}
218
- * @returns A Promise of GatewayNetwork
219
- */
220
- createGatewayNetwork = (request) => this.client.fetch(
221
- {
222
- body: JSON.stringify(
223
- marshalCreateGatewayNetworkRequest(request, this.client.settings)
224
- ),
225
- headers: jsonContentHeaders,
226
- method: "POST",
227
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
228
- },
229
- unmarshalGatewayNetwork
230
- );
231
- /**
232
- * Update a Public Gateway's connection to a Private Network. Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include DHCP settings and whether to enable traffic masquerade (dynamic NAT).
233
- *
234
- * @deprecated
235
- * @param request - The request {@link UpdateGatewayNetworkRequest}
236
- * @returns A Promise of GatewayNetwork
237
- */
238
- updateGatewayNetwork = (request) => this.client.fetch(
239
- {
240
- body: JSON.stringify(
241
- marshalUpdateGatewayNetworkRequest(request, this.client.settings)
242
- ),
243
- headers: jsonContentHeaders,
244
- method: "PATCH",
245
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
246
- },
247
- unmarshalGatewayNetwork
248
- );
249
- /**
250
- * Detach a Public Gateway from a Private Network. Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id.
251
- *
252
- * @deprecated
253
- * @param request - The request {@link DeleteGatewayNetworkRequest}
254
- */
255
- deleteGatewayNetwork = (request) => this.client.fetch(
256
- {
257
- method: "DELETE",
258
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`,
259
- urlParams: urlParams(
260
- ["cleanup_dhcp", request.cleanupDhcp]
261
- )
262
- }
263
- );
264
- pageOfListDHCPs = (request = {}) => this.client.fetch(
265
- {
266
- method: "GET",
267
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`,
268
- urlParams: urlParams(
269
- ["address", request.address],
270
- ["has_address", request.hasAddress],
271
- ["order_by", request.orderBy],
272
- ["organization_id", request.organizationId],
273
- ["page", request.page],
274
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
275
- ["project_id", request.projectId]
276
- )
277
- },
278
- unmarshalListDHCPsResponse
279
- );
280
- /**
281
- * List DHCP configurations. List DHCP configurations, optionally filtering by Organization, Project, Public Gateway IP address or more. The response is an array of DHCP configuration objects, each identified by a DHCP ID and containing configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID.
282
- *
283
- * @deprecated
284
- * @param request - The request {@link ListDHCPsRequest}
285
- * @returns A Promise of ListDHCPsResponse
286
- */
287
- listDHCPs = (request = {}) => enrichForPagination("dhcps", this.pageOfListDHCPs, request);
288
- /**
289
- * Get a DHCP configuration. Get a DHCP configuration object, identified by its DHCP ID. The response object contains configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID.
290
- *
291
- * @deprecated
292
- * @param request - The request {@link GetDHCPRequest}
293
- * @returns A Promise of DHCP
294
- */
295
- getDHCP = (request) => this.client.fetch(
296
- {
297
- method: "GET",
298
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
299
- },
300
- unmarshalDHCP
301
- );
302
- /**
303
- * Create a DHCP configuration. Create a new DHCP configuration object, containing settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. The response object includes the ID of the DHCP configuration object. You can use this ID as part of a call to `Create a Public Gateway connection to a Private Network` or `Update a Public Gateway connection to a Private Network` to directly apply this DHCP configuration.
304
- *
305
- * @deprecated
306
- * @param request - The request {@link CreateDHCPRequest}
307
- * @returns A Promise of DHCP
308
- */
309
- createDHCP = (request) => this.client.fetch(
310
- {
311
- body: JSON.stringify(
312
- marshalCreateDHCPRequest(request, this.client.settings)
313
- ),
314
- headers: jsonContentHeaders,
315
- method: "POST",
316
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`
317
- },
318
- unmarshalDHCP
319
- );
320
- /**
321
- * Update a DHCP configuration. Update a DHCP configuration object, identified by its DHCP ID.
322
- *
323
- * @deprecated
324
- * @param request - The request {@link UpdateDHCPRequest}
325
- * @returns A Promise of DHCP
326
- */
327
- updateDHCP = (request) => this.client.fetch(
328
- {
329
- body: JSON.stringify(
330
- marshalUpdateDHCPRequest(request, this.client.settings)
331
- ),
332
- headers: jsonContentHeaders,
333
- method: "PATCH",
334
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
335
- },
336
- unmarshalDHCP
337
- );
338
- /**
339
- * Delete a DHCP configuration. Delete a DHCP configuration object, identified by its DHCP ID. Note that you cannot delete a DHCP configuration object that is currently being used by a Gateway Network.
340
- *
341
- * @deprecated
342
- * @param request - The request {@link DeleteDHCPRequest}
343
- */
344
- deleteDHCP = (request) => this.client.fetch(
345
- {
346
- method: "DELETE",
347
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
348
- }
349
- );
350
- pageOfListDHCPEntries = (request = {}) => this.client.fetch(
351
- {
352
- method: "GET",
353
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`,
354
- urlParams: urlParams(
355
- ["gateway_network_id", request.gatewayNetworkId],
356
- ["hostname", request.hostname],
357
- ["ip_address", request.ipAddress],
358
- ["mac_address", request.macAddress],
359
- ["order_by", request.orderBy],
360
- ["page", request.page],
361
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
362
- ["type", request.type]
363
- )
364
- },
365
- unmarshalListDHCPEntriesResponse
366
- );
367
- /**
368
- * List DHCP entries. List DHCP entries, whether dynamically assigned and/or statically reserved. DHCP entries can be filtered by the Gateway Network they are on, their MAC address, IP address, type or hostname.
369
- *
370
- * @deprecated
371
- * @param request - The request {@link ListDHCPEntriesRequest}
372
- * @returns A Promise of ListDHCPEntriesResponse
373
- */
374
- listDHCPEntries = (request = {}) => enrichForPagination("dhcpEntries", this.pageOfListDHCPEntries, request);
375
- /**
376
- * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.
377
- *
378
- * @deprecated
379
- * @param request - The request {@link GetDHCPEntryRequest}
380
- * @returns A Promise of DHCPEntry
381
- */
382
- getDHCPEntry = (request) => this.client.fetch(
383
- {
384
- method: "GET",
385
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
386
- },
387
- unmarshalDHCPEntry
388
- );
389
- /**
390
- * Create a DHCP entry. Create a static DHCP reservation, specifying the Gateway Network for the reservation, the MAC address of the target device and the IP address to assign this device. The response is a DHCP entry object, confirming the ID and configuration details of the static DHCP reservation.
391
- *
392
- * @deprecated
393
- * @param request - The request {@link CreateDHCPEntryRequest}
394
- * @returns A Promise of DHCPEntry
395
- */
396
- createDHCPEntry = (request) => this.client.fetch(
397
- {
398
- body: JSON.stringify(
399
- marshalCreateDHCPEntryRequest(request, this.client.settings)
400
- ),
401
- headers: jsonContentHeaders,
402
- method: "POST",
403
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
404
- },
405
- unmarshalDHCPEntry
406
- );
407
- /**
408
- * Update a DHCP entry. Update the IP address for a DHCP entry, specified by its DHCP entry ID. You can update an existing DHCP entry of any type (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually updating the IP address the entry will necessarily be of type `reservation` after the update.
409
- *
410
- * @deprecated
411
- * @param request - The request {@link UpdateDHCPEntryRequest}
412
- * @returns A Promise of DHCPEntry
413
- */
414
- updateDHCPEntry = (request) => this.client.fetch(
415
- {
416
- body: JSON.stringify(
417
- marshalUpdateDHCPEntryRequest(request, this.client.settings)
418
- ),
419
- headers: jsonContentHeaders,
420
- method: "PATCH",
421
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
422
- },
423
- unmarshalDHCPEntry
424
- );
425
- /**
426
- * Set all DHCP reservations on a Gateway Network. Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries accordingly.
427
- *
428
- * @deprecated
429
- * @param request - The request {@link SetDHCPEntriesRequest}
430
- * @returns A Promise of SetDHCPEntriesResponse
431
- */
432
- setDHCPEntries = (request) => this.client.fetch(
433
- {
434
- body: JSON.stringify(
435
- marshalSetDHCPEntriesRequest(request, this.client.settings)
436
- ),
437
- headers: jsonContentHeaders,
438
- method: "PUT",
439
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
440
- },
441
- unmarshalSetDHCPEntriesResponse
442
- );
443
- /**
444
- * Delete a DHCP entry. Delete a static DHCP reservation, identified by its DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`, these are deleted automatically when their time-to-live expires.
445
- *
446
- * @deprecated
447
- * @param request - The request {@link DeleteDHCPEntryRequest}
448
- */
449
- deleteDHCPEntry = (request) => this.client.fetch(
450
- {
451
- method: "DELETE",
452
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
453
- }
454
- );
455
- pageOfListPATRules = (request = {}) => this.client.fetch(
456
- {
457
- method: "GET",
458
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,
459
- urlParams: urlParams(
460
- ["gateway_id", request.gatewayId],
461
- ["order_by", request.orderBy],
462
- ["page", request.page],
463
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
464
- ["private_ip", request.privateIp],
465
- ["protocol", request.protocol]
466
- )
467
- },
468
- unmarshalListPATRulesResponse
469
- );
470
- /**
471
- * List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.
472
- *
473
- * @deprecated
474
- * @param request - The request {@link ListPATRulesRequest}
475
- * @returns A Promise of ListPATRulesResponse
476
- */
477
- listPATRules = (request = {}) => enrichForPagination("patRules", this.pageOfListPATRules, request);
478
- /**
479
- * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.
480
- *
481
- * @deprecated
482
- * @param request - The request {@link GetPATRuleRequest}
483
- * @returns A Promise of PATRule
484
- */
485
- getPATRule = (request) => this.client.fetch(
486
- {
487
- method: "GET",
488
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
489
- },
490
- unmarshalPATRule
491
- );
492
- /**
493
- * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.
494
- *
495
- * @deprecated
496
- * @param request - The request {@link CreatePATRuleRequest}
497
- * @returns A Promise of PATRule
498
- */
499
- createPATRule = (request) => this.client.fetch(
500
- {
501
- body: JSON.stringify(
502
- marshalCreatePATRuleRequest(request, this.client.settings)
503
- ),
504
- headers: jsonContentHeaders,
505
- method: "POST",
506
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
507
- },
508
- unmarshalPATRule
509
- );
510
- /**
511
- * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.
512
- *
513
- * @deprecated
514
- * @param request - The request {@link UpdatePATRuleRequest}
515
- * @returns A Promise of PATRule
516
- */
517
- updatePATRule = (request) => this.client.fetch(
518
- {
519
- body: JSON.stringify(
520
- marshalUpdatePATRuleRequest(request, this.client.settings)
521
- ),
522
- headers: jsonContentHeaders,
523
- method: "PATCH",
524
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
525
- },
526
- unmarshalPATRule
527
- );
528
- /**
529
- * Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.
530
- *
531
- * @deprecated
532
- * @param request - The request {@link SetPATRulesRequest}
533
- * @returns A Promise of SetPATRulesResponse
534
- */
535
- setPATRules = (request) => this.client.fetch(
536
- {
537
- body: JSON.stringify(
538
- marshalSetPATRulesRequest(request, this.client.settings)
539
- ),
540
- headers: jsonContentHeaders,
541
- method: "PUT",
542
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
543
- },
544
- unmarshalSetPATRulesResponse
545
- );
546
- /**
547
- * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.
548
- *
549
- * @deprecated
550
- * @param request - The request {@link DeletePATRuleRequest}
551
- */
552
- deletePATRule = (request) => this.client.fetch(
553
- {
554
- method: "DELETE",
555
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
556
- }
557
- );
558
- /**
559
- * List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.
560
- *
561
- * @deprecated
562
- * @param request - The request {@link ListGatewayTypesRequest}
563
- * @returns A Promise of ListGatewayTypesResponse
564
- */
565
- listGatewayTypes = (request = {}) => this.client.fetch(
566
- {
567
- method: "GET",
568
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
569
- },
570
- unmarshalListGatewayTypesResponse
571
- );
572
- pageOfListIPs = (request = {}) => this.client.fetch(
573
- {
574
- method: "GET",
575
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
576
- urlParams: urlParams(
577
- ["is_free", request.isFree],
578
- ["order_by", request.orderBy],
579
- ["organization_id", request.organizationId],
580
- ["page", request.page],
581
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
582
- ["project_id", request.projectId],
583
- ["reverse", request.reverse],
584
- ["tags", request.tags]
585
- )
586
- },
587
- unmarshalListIPsResponse
588
- );
589
- /**
590
- * List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.
591
- *
592
- * @deprecated
593
- * @param request - The request {@link ListIPsRequest}
594
- * @returns A Promise of ListIPsResponse
595
- */
596
- listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
597
- /**
598
- * Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.
599
- *
600
- * @deprecated
601
- * @param request - The request {@link GetIPRequest}
602
- * @returns A Promise of IP
603
- */
604
- getIP = (request) => this.client.fetch(
605
- {
606
- method: "GET",
607
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
608
- },
609
- unmarshalIP
610
- );
611
- /**
612
- * Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.
613
- *
614
- * @deprecated
615
- * @param request - The request {@link CreateIPRequest}
616
- * @returns A Promise of IP
617
- */
618
- createIP = (request = {}) => this.client.fetch(
619
- {
620
- body: JSON.stringify(
621
- marshalCreateIPRequest(request, this.client.settings)
622
- ),
623
- headers: jsonContentHeaders,
624
- method: "POST",
625
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
626
- },
627
- unmarshalIP
628
- );
629
- /**
630
- * Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.
631
- *
632
- * @deprecated
633
- * @param request - The request {@link UpdateIPRequest}
634
- * @returns A Promise of IP
635
- */
636
- updateIP = (request) => this.client.fetch(
637
- {
638
- body: JSON.stringify(
639
- marshalUpdateIPRequest(request, this.client.settings)
640
- ),
641
- headers: jsonContentHeaders,
642
- method: "PATCH",
643
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
644
- },
645
- unmarshalIP
646
- );
647
- /**
648
- * Delete an IP. Delete a flexible IP address from your account. This action is irreversible.
649
- *
650
- * @deprecated
651
- * @param request - The request {@link DeleteIPRequest}
652
- */
653
- deleteIP = (request) => this.client.fetch(
654
- {
655
- method: "DELETE",
656
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
657
- }
658
- );
659
- /**
660
- * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.
661
- *
662
- * @deprecated
663
- * @param request - The request {@link RefreshSSHKeysRequest}
664
- * @returns A Promise of Gateway
665
- */
666
- refreshSSHKeys = (request) => this.client.fetch(
667
- {
668
- body: "{}",
669
- headers: jsonContentHeaders,
670
- method: "POST",
671
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
672
- },
673
- unmarshalGateway
674
- );
675
- /**
676
- * Put a Public Gateway in IPAM mode. Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent.
677
- *
678
- * @deprecated
679
- * @param request - The request {@link MigrateToV2Request}
680
- */
681
- migrateToV2 = (request) => this.client.fetch(
682
- {
683
- body: "{}",
684
- headers: jsonContentHeaders,
685
- method: "POST",
686
- path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/migrate-to-v2`
687
- }
688
- );
689
- }
690
- export {
691
- API
1
+ import { GATEWAY_NETWORK_TRANSIENT_STATUSES, GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCreateDHCPEntryRequest, marshalCreateDHCPRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePATRuleRequest, marshalSetDHCPEntriesRequest, marshalSetPATRulesRequest, marshalUpdateDHCPEntryRequest, marshalUpdateDHCPRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePATRuleRequest, marshalUpgradeGatewayRequest, unmarshalDHCP, unmarshalDHCPEntry, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListDHCPEntriesResponse, unmarshalListDHCPsResponse, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPATRulesResponse, unmarshalPATRule, unmarshalSetDHCPEntriesResponse, unmarshalSetPATRulesResponse } 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
+ * Public Gateways API.
7
+
8
+ This API allows you to manage your Public Gateways.
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
+ "nl-ams-3",
21
+ "pl-waw-1",
22
+ "pl-waw-2",
23
+ "pl-waw-3"
24
+ ] });
25
+ pageOfListGateways = (request = {}) => this.client.fetch({
26
+ method: "GET",
27
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`,
28
+ urlParams: urlParams(["name", request.name], ["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], ["status", request.status], ["tags", request.tags], ["type", request.type])
29
+ }, unmarshalListGatewaysResponse);
30
+ /**
31
+ * List Public Gateways. List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date.
32
+ *
33
+ * @deprecated
34
+ * @param request - The request {@link ListGatewaysRequest}
35
+ * @returns A Promise of ListGatewaysResponse
36
+ */
37
+ listGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListGateways, request);
38
+ /**
39
+ * Get a Public Gateway. Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more.
40
+ *
41
+ * @deprecated
42
+ * @param request - The request {@link GetGatewayRequest}
43
+ * @returns A Promise of Gateway
44
+ */
45
+ getGateway = (request) => this.client.fetch({
46
+ method: "GET",
47
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
48
+ }, unmarshalGateway);
49
+ /**
50
+ * Waits for {@link Gateway} to be in a final state.
51
+ *
52
+ * @param request - The request {@link GetGatewayRequest}
53
+ * @param options - The waiting options
54
+ * @returns A Promise of Gateway
55
+ */
56
+ waitForGateway = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options);
57
+ /**
58
+ * Create a Public Gateway. Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion.
59
+ *
60
+ * @deprecated
61
+ * @param request - The request {@link CreateGatewayRequest}
62
+ * @returns A Promise of Gateway
63
+ */
64
+ createGateway = (request) => this.client.fetch({
65
+ body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)),
66
+ headers: jsonContentHeaders,
67
+ method: "POST",
68
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`
69
+ }, unmarshalGateway);
70
+ /**
71
+ * Update a Public Gateway. Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**.
72
+ *
73
+ * @deprecated
74
+ * @param request - The request {@link UpdateGatewayRequest}
75
+ * @returns A Promise of Gateway
76
+ */
77
+ updateGateway = (request) => this.client.fetch({
78
+ body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)),
79
+ headers: jsonContentHeaders,
80
+ method: "PATCH",
81
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`
82
+ }, unmarshalGateway);
83
+ /**
84
+ * Delete a Public Gateway. Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible.
85
+ *
86
+ * @deprecated
87
+ * @param request - The request {@link DeleteGatewayRequest}
88
+ */
89
+ deleteGateway = (request) => this.client.fetch({
90
+ method: "DELETE",
91
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`,
92
+ urlParams: urlParams(["cleanup_dhcp", request.cleanupDhcp])
93
+ });
94
+ /**
95
+ * Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.
96
+ *
97
+ * @deprecated
98
+ * @param request - The request {@link UpgradeGatewayRequest}
99
+ * @returns A Promise of Gateway
100
+ */
101
+ upgradeGateway = (request) => this.client.fetch({
102
+ body: JSON.stringify(marshalUpgradeGatewayRequest(request, this.client.settings)),
103
+ headers: jsonContentHeaders,
104
+ method: "POST",
105
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/upgrade`
106
+ }, unmarshalGateway);
107
+ /**
108
+ * Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP mobility (move from NAT IP to routed IP). This is idempotent: repeated calls after the first will return no error but have no effect.
109
+ *
110
+ * @deprecated
111
+ * @param request - The request {@link EnableIPMobilityRequest}
112
+ */
113
+ enableIPMobility = (request) => this.client.fetch({
114
+ body: "{}",
115
+ headers: jsonContentHeaders,
116
+ method: "POST",
117
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/enable-ip-mobility`
118
+ });
119
+ pageOfListGatewayNetworks = (request = {}) => this.client.fetch({
120
+ method: "GET",
121
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
122
+ urlParams: urlParams(["dhcp_id", request.dhcpId], ["enable_masquerade", request.enableMasquerade], ["gateway_id", request.gatewayId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["status", request.status])
123
+ }, unmarshalListGatewayNetworksResponse);
124
+ /**
125
+ * List Public Gateway connections to Private Networks. List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.
126
+ *
127
+ * @deprecated
128
+ * @param request - The request {@link ListGatewayNetworksRequest}
129
+ * @returns A Promise of ListGatewayNetworksResponse
130
+ */
131
+ listGatewayNetworks = (request = {}) => enrichForPagination("gatewayNetworks", this.pageOfListGatewayNetworks, request);
132
+ /**
133
+ * Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.
134
+ *
135
+ * @deprecated
136
+ * @param request - The request {@link GetGatewayNetworkRequest}
137
+ * @returns A Promise of GatewayNetwork
138
+ */
139
+ getGatewayNetwork = (request) => this.client.fetch({
140
+ method: "GET",
141
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
142
+ }, unmarshalGatewayNetwork);
143
+ /**
144
+ * Waits for {@link GatewayNetwork} to be in a final state.
145
+ *
146
+ * @param request - The request {@link GetGatewayNetworkRequest}
147
+ * @param options - The waiting options
148
+ * @returns A Promise of GatewayNetwork
149
+ */
150
+ waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options);
151
+ /**
152
+ * Attach a Public Gateway to a Private Network. Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including DHCP settings, whether to enable masquerade (dynamic NAT), and more.
153
+ *
154
+ * @deprecated
155
+ * @param request - The request {@link CreateGatewayNetworkRequest}
156
+ * @returns A Promise of GatewayNetwork
157
+ */
158
+ createGatewayNetwork = (request) => this.client.fetch({
159
+ body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)),
160
+ headers: jsonContentHeaders,
161
+ method: "POST",
162
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
163
+ }, unmarshalGatewayNetwork);
164
+ /**
165
+ * Update a Public Gateway's connection to a Private Network. Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include DHCP settings and whether to enable traffic masquerade (dynamic NAT).
166
+ *
167
+ * @deprecated
168
+ * @param request - The request {@link UpdateGatewayNetworkRequest}
169
+ * @returns A Promise of GatewayNetwork
170
+ */
171
+ updateGatewayNetwork = (request) => this.client.fetch({
172
+ body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)),
173
+ headers: jsonContentHeaders,
174
+ method: "PATCH",
175
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`
176
+ }, unmarshalGatewayNetwork);
177
+ /**
178
+ * Detach a Public Gateway from a Private Network. Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id.
179
+ *
180
+ * @deprecated
181
+ * @param request - The request {@link DeleteGatewayNetworkRequest}
182
+ */
183
+ deleteGatewayNetwork = (request) => this.client.fetch({
184
+ method: "DELETE",
185
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`,
186
+ urlParams: urlParams(["cleanup_dhcp", request.cleanupDhcp])
187
+ });
188
+ pageOfListDHCPs = (request = {}) => this.client.fetch({
189
+ method: "GET",
190
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`,
191
+ urlParams: urlParams(["address", request.address], ["has_address", request.hasAddress], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
192
+ }, unmarshalListDHCPsResponse);
193
+ /**
194
+ * List DHCP configurations. List DHCP configurations, optionally filtering by Organization, Project, Public Gateway IP address or more. The response is an array of DHCP configuration objects, each identified by a DHCP ID and containing configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID.
195
+ *
196
+ * @deprecated
197
+ * @param request - The request {@link ListDHCPsRequest}
198
+ * @returns A Promise of ListDHCPsResponse
199
+ */
200
+ listDHCPs = (request = {}) => enrichForPagination("dhcps", this.pageOfListDHCPs, request);
201
+ /**
202
+ * Get a DHCP configuration. Get a DHCP configuration object, identified by its DHCP ID. The response object contains configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID.
203
+ *
204
+ * @deprecated
205
+ * @param request - The request {@link GetDHCPRequest}
206
+ * @returns A Promise of DHCP
207
+ */
208
+ getDHCP = (request) => this.client.fetch({
209
+ method: "GET",
210
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
211
+ }, unmarshalDHCP);
212
+ /**
213
+ * Create a DHCP configuration. Create a new DHCP configuration object, containing settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. The response object includes the ID of the DHCP configuration object. You can use this ID as part of a call to `Create a Public Gateway connection to a Private Network` or `Update a Public Gateway connection to a Private Network` to directly apply this DHCP configuration.
214
+ *
215
+ * @deprecated
216
+ * @param request - The request {@link CreateDHCPRequest}
217
+ * @returns A Promise of DHCP
218
+ */
219
+ createDHCP = (request) => this.client.fetch({
220
+ body: JSON.stringify(marshalCreateDHCPRequest(request, this.client.settings)),
221
+ headers: jsonContentHeaders,
222
+ method: "POST",
223
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`
224
+ }, unmarshalDHCP);
225
+ /**
226
+ * Update a DHCP configuration. Update a DHCP configuration object, identified by its DHCP ID.
227
+ *
228
+ * @deprecated
229
+ * @param request - The request {@link UpdateDHCPRequest}
230
+ * @returns A Promise of DHCP
231
+ */
232
+ updateDHCP = (request) => this.client.fetch({
233
+ body: JSON.stringify(marshalUpdateDHCPRequest(request, this.client.settings)),
234
+ headers: jsonContentHeaders,
235
+ method: "PATCH",
236
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
237
+ }, unmarshalDHCP);
238
+ /**
239
+ * Delete a DHCP configuration. Delete a DHCP configuration object, identified by its DHCP ID. Note that you cannot delete a DHCP configuration object that is currently being used by a Gateway Network.
240
+ *
241
+ * @deprecated
242
+ * @param request - The request {@link DeleteDHCPRequest}
243
+ */
244
+ deleteDHCP = (request) => this.client.fetch({
245
+ method: "DELETE",
246
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
247
+ });
248
+ pageOfListDHCPEntries = (request = {}) => this.client.fetch({
249
+ method: "GET",
250
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`,
251
+ urlParams: urlParams(["gateway_network_id", request.gatewayNetworkId], ["hostname", request.hostname], ["ip_address", request.ipAddress], ["mac_address", request.macAddress], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["type", request.type])
252
+ }, unmarshalListDHCPEntriesResponse);
253
+ /**
254
+ * List DHCP entries. List DHCP entries, whether dynamically assigned and/or statically reserved. DHCP entries can be filtered by the Gateway Network they are on, their MAC address, IP address, type or hostname.
255
+ *
256
+ * @deprecated
257
+ * @param request - The request {@link ListDHCPEntriesRequest}
258
+ * @returns A Promise of ListDHCPEntriesResponse
259
+ */
260
+ listDHCPEntries = (request = {}) => enrichForPagination("dhcpEntries", this.pageOfListDHCPEntries, request);
261
+ /**
262
+ * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.
263
+ *
264
+ * @deprecated
265
+ * @param request - The request {@link GetDHCPEntryRequest}
266
+ * @returns A Promise of DHCPEntry
267
+ */
268
+ getDHCPEntry = (request) => this.client.fetch({
269
+ method: "GET",
270
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
271
+ }, unmarshalDHCPEntry);
272
+ /**
273
+ * Create a DHCP entry. Create a static DHCP reservation, specifying the Gateway Network for the reservation, the MAC address of the target device and the IP address to assign this device. The response is a DHCP entry object, confirming the ID and configuration details of the static DHCP reservation.
274
+ *
275
+ * @deprecated
276
+ * @param request - The request {@link CreateDHCPEntryRequest}
277
+ * @returns A Promise of DHCPEntry
278
+ */
279
+ createDHCPEntry = (request) => this.client.fetch({
280
+ body: JSON.stringify(marshalCreateDHCPEntryRequest(request, this.client.settings)),
281
+ headers: jsonContentHeaders,
282
+ method: "POST",
283
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
284
+ }, unmarshalDHCPEntry);
285
+ /**
286
+ * Update a DHCP entry. Update the IP address for a DHCP entry, specified by its DHCP entry ID. You can update an existing DHCP entry of any type (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually updating the IP address the entry will necessarily be of type `reservation` after the update.
287
+ *
288
+ * @deprecated
289
+ * @param request - The request {@link UpdateDHCPEntryRequest}
290
+ * @returns A Promise of DHCPEntry
291
+ */
292
+ updateDHCPEntry = (request) => this.client.fetch({
293
+ body: JSON.stringify(marshalUpdateDHCPEntryRequest(request, this.client.settings)),
294
+ headers: jsonContentHeaders,
295
+ method: "PATCH",
296
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
297
+ }, unmarshalDHCPEntry);
298
+ /**
299
+ * Set all DHCP reservations on a Gateway Network. Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries accordingly.
300
+ *
301
+ * @deprecated
302
+ * @param request - The request {@link SetDHCPEntriesRequest}
303
+ * @returns A Promise of SetDHCPEntriesResponse
304
+ */
305
+ setDHCPEntries = (request) => this.client.fetch({
306
+ body: JSON.stringify(marshalSetDHCPEntriesRequest(request, this.client.settings)),
307
+ headers: jsonContentHeaders,
308
+ method: "PUT",
309
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
310
+ }, unmarshalSetDHCPEntriesResponse);
311
+ /**
312
+ * Delete a DHCP entry. Delete a static DHCP reservation, identified by its DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`, these are deleted automatically when their time-to-live expires.
313
+ *
314
+ * @deprecated
315
+ * @param request - The request {@link DeleteDHCPEntryRequest}
316
+ */
317
+ deleteDHCPEntry = (request) => this.client.fetch({
318
+ method: "DELETE",
319
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
320
+ });
321
+ pageOfListPATRules = (request = {}) => this.client.fetch({
322
+ method: "GET",
323
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,
324
+ urlParams: urlParams(["gateway_id", request.gatewayId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_ip", request.privateIp], ["protocol", request.protocol])
325
+ }, unmarshalListPATRulesResponse);
326
+ /**
327
+ * List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.
328
+ *
329
+ * @deprecated
330
+ * @param request - The request {@link ListPATRulesRequest}
331
+ * @returns A Promise of ListPATRulesResponse
332
+ */
333
+ listPATRules = (request = {}) => enrichForPagination("patRules", this.pageOfListPATRules, request);
334
+ /**
335
+ * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.
336
+ *
337
+ * @deprecated
338
+ * @param request - The request {@link GetPATRuleRequest}
339
+ * @returns A Promise of PATRule
340
+ */
341
+ getPATRule = (request) => this.client.fetch({
342
+ method: "GET",
343
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
344
+ }, unmarshalPATRule);
345
+ /**
346
+ * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.
347
+ *
348
+ * @deprecated
349
+ * @param request - The request {@link CreatePATRuleRequest}
350
+ * @returns A Promise of PATRule
351
+ */
352
+ createPATRule = (request) => this.client.fetch({
353
+ body: JSON.stringify(marshalCreatePATRuleRequest(request, this.client.settings)),
354
+ headers: jsonContentHeaders,
355
+ method: "POST",
356
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
357
+ }, unmarshalPATRule);
358
+ /**
359
+ * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.
360
+ *
361
+ * @deprecated
362
+ * @param request - The request {@link UpdatePATRuleRequest}
363
+ * @returns A Promise of PATRule
364
+ */
365
+ updatePATRule = (request) => this.client.fetch({
366
+ body: JSON.stringify(marshalUpdatePATRuleRequest(request, this.client.settings)),
367
+ headers: jsonContentHeaders,
368
+ method: "PATCH",
369
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
370
+ }, unmarshalPATRule);
371
+ /**
372
+ * Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.
373
+ *
374
+ * @deprecated
375
+ * @param request - The request {@link SetPATRulesRequest}
376
+ * @returns A Promise of SetPATRulesResponse
377
+ */
378
+ setPATRules = (request) => this.client.fetch({
379
+ body: JSON.stringify(marshalSetPATRulesRequest(request, this.client.settings)),
380
+ headers: jsonContentHeaders,
381
+ method: "PUT",
382
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`
383
+ }, unmarshalSetPATRulesResponse);
384
+ /**
385
+ * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.
386
+ *
387
+ * @deprecated
388
+ * @param request - The request {@link DeletePATRuleRequest}
389
+ */
390
+ deletePATRule = (request) => this.client.fetch({
391
+ method: "DELETE",
392
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
393
+ });
394
+ /**
395
+ * List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.
396
+ *
397
+ * @deprecated
398
+ * @param request - The request {@link ListGatewayTypesRequest}
399
+ * @returns A Promise of ListGatewayTypesResponse
400
+ */
401
+ listGatewayTypes = (request = {}) => this.client.fetch({
402
+ method: "GET",
403
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types`
404
+ }, unmarshalListGatewayTypesResponse);
405
+ pageOfListIPs = (request = {}) => this.client.fetch({
406
+ method: "GET",
407
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`,
408
+ urlParams: urlParams(["is_free", request.isFree], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["reverse", request.reverse], ["tags", request.tags])
409
+ }, unmarshalListIPsResponse);
410
+ /**
411
+ * List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response.
412
+ *
413
+ * @deprecated
414
+ * @param request - The request {@link ListIPsRequest}
415
+ * @returns A Promise of ListIPsResponse
416
+ */
417
+ listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
418
+ /**
419
+ * Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata.
420
+ *
421
+ * @deprecated
422
+ * @param request - The request {@link GetIPRequest}
423
+ * @returns A Promise of IP
424
+ */
425
+ getIP = (request) => this.client.fetch({
426
+ method: "GET",
427
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
428
+ }, unmarshalIP);
429
+ /**
430
+ * Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project.
431
+ *
432
+ * @deprecated
433
+ * @param request - The request {@link CreateIPRequest}
434
+ * @returns A Promise of IP
435
+ */
436
+ createIP = (request = {}) => this.client.fetch({
437
+ body: JSON.stringify(marshalCreateIPRequest(request, this.client.settings)),
438
+ headers: jsonContentHeaders,
439
+ method: "POST",
440
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`
441
+ }, unmarshalIP);
442
+ /**
443
+ * Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to.
444
+ *
445
+ * @deprecated
446
+ * @param request - The request {@link UpdateIPRequest}
447
+ * @returns A Promise of IP
448
+ */
449
+ updateIP = (request) => this.client.fetch({
450
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
451
+ headers: jsonContentHeaders,
452
+ method: "PATCH",
453
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
454
+ }, unmarshalIP);
455
+ /**
456
+ * Delete an IP. Delete a flexible IP address from your account. This action is irreversible.
457
+ *
458
+ * @deprecated
459
+ * @param request - The request {@link DeleteIPRequest}
460
+ */
461
+ deleteIP = (request) => this.client.fetch({
462
+ method: "DELETE",
463
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
464
+ });
465
+ /**
466
+ * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.
467
+ *
468
+ * @deprecated
469
+ * @param request - The request {@link RefreshSSHKeysRequest}
470
+ * @returns A Promise of Gateway
471
+ */
472
+ refreshSSHKeys = (request) => this.client.fetch({
473
+ body: "{}",
474
+ headers: jsonContentHeaders,
475
+ method: "POST",
476
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys`
477
+ }, unmarshalGateway);
478
+ /**
479
+ * Put a Public Gateway in IPAM mode. Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent.
480
+ *
481
+ * @deprecated
482
+ * @param request - The request {@link MigrateToV2Request}
483
+ */
484
+ migrateToV2 = (request) => this.client.fetch({
485
+ body: "{}",
486
+ headers: jsonContentHeaders,
487
+ method: "POST",
488
+ path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/migrate-to-v2`
489
+ });
692
490
  };
491
+ export { API$1 as API };