@scaleway/sdk-vpcgw 2.2.0 → 2.3.0

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