@scaleway/sdk-vpcgw 1.0.1

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