@scaleway/sdk-vpcgw 1.2.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +67 -73
- package/dist/v1/index.gen.d.ts +2 -2
- package/dist/v1/marshalling.gen.d.ts +1 -1
- package/dist/v1/marshalling.gen.js +22 -24
- package/dist/v2/api.gen.d.ts +2 -2
- package/dist/v2/api.gen.js +28 -40
- package/dist/v2/index.gen.d.ts +2 -2
- package/dist/v2/marshalling.gen.d.ts +1 -1
- package/dist/v2/marshalling.gen.js +3 -11
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -6
- package/dist/v1/api.gen.cjs +0 -698
- package/dist/v1/content.gen.cjs +0 -15
- package/dist/v1/index.gen.cjs +0 -38
- package/dist/v1/marshalling.gen.cjs +0 -440
- package/dist/v2/api.gen.cjs +0 -507
- package/dist/v2/content.gen.cjs +0 -15
- package/dist/v2/index.gen.cjs +0 -32
- package/dist/v2/marshalling.gen.cjs +0 -288
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-vpcgw
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-vpcgw)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-vpcgw)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Vpcgw API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-vpcgw @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-vpcgw @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-vpcgw @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Vpcgw } from '@scaleway/sdk-vpcgw'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Vpcgw.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Vpcgw } from '@scaleway/sdk-vpcgw'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Vpcgw.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Vpcgw API Documentation](https://www.scaleway.com/en/developers/api/vpcgw/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { CreateDHCPEntryRequest, CreateDHCPRequest, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePATRuleRequest, DeleteDHCPEntryRequest, DeleteDHCPRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePATRuleRequest, DHCP, DHCPEntry, EnableIPMobilityRequest, Gateway, GatewayNetwork, GetDHCPEntryRequest, GetDHCPRequest, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPATRuleRequest, IP, ListDHCPEntriesRequest, ListDHCPEntriesResponse, ListDHCPsRequest, ListDHCPsResponse, ListGatewayNetworksRequest, ListGatewayNetworksResponse, ListGatewaysRequest, ListGatewaysResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListIPsRequest, ListIPsResponse, ListPATRulesRequest, ListPATRulesResponse, MigrateToV2Request, PATRule, RefreshSSHKeysRequest, SetDHCPEntriesRequest, SetDHCPEntriesResponse, SetPATRulesRequest, SetPATRulesResponse, UpdateDHCPEntryRequest, UpdateDHCPRequest, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, UpgradeGatewayRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Public Gateways API.
|
|
6
6
|
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -30,10 +30,7 @@ class API extends API$1 {
|
|
|
30
30
|
["order_by", request.orderBy],
|
|
31
31
|
["organization_id", request.organizationId],
|
|
32
32
|
["page", request.page],
|
|
33
|
-
[
|
|
34
|
-
"page_size",
|
|
35
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
36
|
-
],
|
|
33
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
37
34
|
["private_network_id", request.privateNetworkId],
|
|
38
35
|
["project_id", request.projectId],
|
|
39
36
|
["status", request.status],
|
|
@@ -73,9 +70,7 @@ class API extends API$1 {
|
|
|
73
70
|
* @returns A Promise of Gateway
|
|
74
71
|
*/
|
|
75
72
|
waitForGateway = (request, options) => waitForResource(
|
|
76
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
77
|
-
!GATEWAY_TRANSIENT_STATUSES.includes(res.status)
|
|
78
|
-
)),
|
|
73
|
+
options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
|
|
79
74
|
this.getGateway,
|
|
80
75
|
request,
|
|
81
76
|
options
|
|
@@ -122,11 +117,15 @@ class API extends API$1 {
|
|
|
122
117
|
* @deprecated
|
|
123
118
|
* @param request - The request {@link DeleteGatewayRequest}
|
|
124
119
|
*/
|
|
125
|
-
deleteGateway = (request) => this.client.fetch(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
120
|
+
deleteGateway = (request) => this.client.fetch(
|
|
121
|
+
{
|
|
122
|
+
method: "DELETE",
|
|
123
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`,
|
|
124
|
+
urlParams: urlParams(
|
|
125
|
+
["cleanup_dhcp", request.cleanupDhcp]
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
);
|
|
130
129
|
/**
|
|
131
130
|
* Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update.
|
|
132
131
|
*
|
|
@@ -151,12 +150,14 @@ class API extends API$1 {
|
|
|
151
150
|
* @deprecated
|
|
152
151
|
* @param request - The request {@link EnableIPMobilityRequest}
|
|
153
152
|
*/
|
|
154
|
-
enableIPMobility = (request) => this.client.fetch(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
enableIPMobility = (request) => this.client.fetch(
|
|
154
|
+
{
|
|
155
|
+
body: "{}",
|
|
156
|
+
headers: jsonContentHeaders,
|
|
157
|
+
method: "POST",
|
|
158
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/enable-ip-mobility`
|
|
159
|
+
}
|
|
160
|
+
);
|
|
160
161
|
pageOfListGatewayNetworks = (request = {}) => this.client.fetch(
|
|
161
162
|
{
|
|
162
163
|
method: "GET",
|
|
@@ -167,10 +168,7 @@ class API extends API$1 {
|
|
|
167
168
|
["gateway_id", request.gatewayId],
|
|
168
169
|
["order_by", request.orderBy],
|
|
169
170
|
["page", request.page],
|
|
170
|
-
[
|
|
171
|
-
"page_size",
|
|
172
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
173
|
-
],
|
|
171
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
174
172
|
["private_network_id", request.privateNetworkId],
|
|
175
173
|
["status", request.status]
|
|
176
174
|
)
|
|
@@ -184,11 +182,7 @@ class API extends API$1 {
|
|
|
184
182
|
* @param request - The request {@link ListGatewayNetworksRequest}
|
|
185
183
|
* @returns A Promise of ListGatewayNetworksResponse
|
|
186
184
|
*/
|
|
187
|
-
listGatewayNetworks = (request = {}) => enrichForPagination(
|
|
188
|
-
"gatewayNetworks",
|
|
189
|
-
this.pageOfListGatewayNetworks,
|
|
190
|
-
request
|
|
191
|
-
);
|
|
185
|
+
listGatewayNetworks = (request = {}) => enrichForPagination("gatewayNetworks", this.pageOfListGatewayNetworks, request);
|
|
192
186
|
/**
|
|
193
187
|
* Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings.
|
|
194
188
|
*
|
|
@@ -211,9 +205,7 @@ class API extends API$1 {
|
|
|
211
205
|
* @returns A Promise of GatewayNetwork
|
|
212
206
|
*/
|
|
213
207
|
waitForGatewayNetwork = (request, options) => waitForResource(
|
|
214
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
215
|
-
!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status)
|
|
216
|
-
)),
|
|
208
|
+
options?.stop ?? ((res) => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))),
|
|
217
209
|
this.getGatewayNetwork,
|
|
218
210
|
request,
|
|
219
211
|
options
|
|
@@ -260,11 +252,15 @@ class API extends API$1 {
|
|
|
260
252
|
* @deprecated
|
|
261
253
|
* @param request - The request {@link DeleteGatewayNetworkRequest}
|
|
262
254
|
*/
|
|
263
|
-
deleteGatewayNetwork = (request) => this.client.fetch(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
255
|
+
deleteGatewayNetwork = (request) => this.client.fetch(
|
|
256
|
+
{
|
|
257
|
+
method: "DELETE",
|
|
258
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`,
|
|
259
|
+
urlParams: urlParams(
|
|
260
|
+
["cleanup_dhcp", request.cleanupDhcp]
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
);
|
|
268
264
|
pageOfListDHCPs = (request = {}) => this.client.fetch(
|
|
269
265
|
{
|
|
270
266
|
method: "GET",
|
|
@@ -275,10 +271,7 @@ class API extends API$1 {
|
|
|
275
271
|
["order_by", request.orderBy],
|
|
276
272
|
["organization_id", request.organizationId],
|
|
277
273
|
["page", request.page],
|
|
278
|
-
[
|
|
279
|
-
"page_size",
|
|
280
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
281
|
-
],
|
|
274
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
282
275
|
["project_id", request.projectId]
|
|
283
276
|
)
|
|
284
277
|
},
|
|
@@ -348,10 +341,12 @@ class API extends API$1 {
|
|
|
348
341
|
* @deprecated
|
|
349
342
|
* @param request - The request {@link DeleteDHCPRequest}
|
|
350
343
|
*/
|
|
351
|
-
deleteDHCP = (request) => this.client.fetch(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
344
|
+
deleteDHCP = (request) => this.client.fetch(
|
|
345
|
+
{
|
|
346
|
+
method: "DELETE",
|
|
347
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam("dhcpId", request.dhcpId)}`
|
|
348
|
+
}
|
|
349
|
+
);
|
|
355
350
|
pageOfListDHCPEntries = (request = {}) => this.client.fetch(
|
|
356
351
|
{
|
|
357
352
|
method: "GET",
|
|
@@ -363,10 +358,7 @@ class API extends API$1 {
|
|
|
363
358
|
["mac_address", request.macAddress],
|
|
364
359
|
["order_by", request.orderBy],
|
|
365
360
|
["page", request.page],
|
|
366
|
-
[
|
|
367
|
-
"page_size",
|
|
368
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
369
|
-
],
|
|
361
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
370
362
|
["type", request.type]
|
|
371
363
|
)
|
|
372
364
|
},
|
|
@@ -454,10 +446,12 @@ class API extends API$1 {
|
|
|
454
446
|
* @deprecated
|
|
455
447
|
* @param request - The request {@link DeleteDHCPEntryRequest}
|
|
456
448
|
*/
|
|
457
|
-
deleteDHCPEntry = (request) => this.client.fetch(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
449
|
+
deleteDHCPEntry = (request) => this.client.fetch(
|
|
450
|
+
{
|
|
451
|
+
method: "DELETE",
|
|
452
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam("dhcpEntryId", request.dhcpEntryId)}`
|
|
453
|
+
}
|
|
454
|
+
);
|
|
461
455
|
pageOfListPATRules = (request = {}) => this.client.fetch(
|
|
462
456
|
{
|
|
463
457
|
method: "GET",
|
|
@@ -466,10 +460,7 @@ class API extends API$1 {
|
|
|
466
460
|
["gateway_id", request.gatewayId],
|
|
467
461
|
["order_by", request.orderBy],
|
|
468
462
|
["page", request.page],
|
|
469
|
-
[
|
|
470
|
-
"page_size",
|
|
471
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
472
|
-
],
|
|
463
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
473
464
|
["private_ip", request.privateIp],
|
|
474
465
|
["protocol", request.protocol]
|
|
475
466
|
)
|
|
@@ -558,10 +549,12 @@ class API extends API$1 {
|
|
|
558
549
|
* @deprecated
|
|
559
550
|
* @param request - The request {@link DeletePATRuleRequest}
|
|
560
551
|
*/
|
|
561
|
-
deletePATRule = (request) => this.client.fetch(
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
552
|
+
deletePATRule = (request) => this.client.fetch(
|
|
553
|
+
{
|
|
554
|
+
method: "DELETE",
|
|
555
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
556
|
+
}
|
|
557
|
+
);
|
|
565
558
|
/**
|
|
566
559
|
* List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type.
|
|
567
560
|
*
|
|
@@ -585,10 +578,7 @@ class API extends API$1 {
|
|
|
585
578
|
["order_by", request.orderBy],
|
|
586
579
|
["organization_id", request.organizationId],
|
|
587
580
|
["page", request.page],
|
|
588
|
-
[
|
|
589
|
-
"page_size",
|
|
590
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
591
|
-
],
|
|
581
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
592
582
|
["project_id", request.projectId],
|
|
593
583
|
["reverse", request.reverse],
|
|
594
584
|
["tags", request.tags]
|
|
@@ -660,10 +650,12 @@ class API extends API$1 {
|
|
|
660
650
|
* @deprecated
|
|
661
651
|
* @param request - The request {@link DeleteIPRequest}
|
|
662
652
|
*/
|
|
663
|
-
deleteIP = (request) => this.client.fetch(
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
653
|
+
deleteIP = (request) => this.client.fetch(
|
|
654
|
+
{
|
|
655
|
+
method: "DELETE",
|
|
656
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
657
|
+
}
|
|
658
|
+
);
|
|
667
659
|
/**
|
|
668
660
|
* Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself.
|
|
669
661
|
*
|
|
@@ -686,12 +678,14 @@ class API extends API$1 {
|
|
|
686
678
|
* @deprecated
|
|
687
679
|
* @param request - The request {@link MigrateToV2Request}
|
|
688
680
|
*/
|
|
689
|
-
migrateToV2 = (request) => this.client.fetch(
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
681
|
+
migrateToV2 = (request) => this.client.fetch(
|
|
682
|
+
{
|
|
683
|
+
body: "{}",
|
|
684
|
+
headers: jsonContentHeaders,
|
|
685
|
+
method: "POST",
|
|
686
|
+
path: `/vpc-gw/v1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/migrate-to-v2`
|
|
687
|
+
}
|
|
688
|
+
);
|
|
695
689
|
}
|
|
696
690
|
export {
|
|
697
691
|
API
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { CreateDHCPEntryRequest, CreateDHCPRequest, CreateGatewayNetworkRequest, CreateGatewayNetworkRequestIpamConfig, CreateGatewayRequest, CreateIPRequest, CreatePATRuleRequest,
|
|
4
|
+
export type { CreateDHCPEntryRequest, CreateDHCPRequest, CreateGatewayNetworkRequest, CreateGatewayNetworkRequestIpamConfig, CreateGatewayRequest, CreateIPRequest, CreatePATRuleRequest, DeleteDHCPEntryRequest, DeleteDHCPRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePATRuleRequest, DHCP, DHCPEntry, DHCPEntryType, EnableIPMobilityRequest, Gateway, GatewayNetwork, GatewayNetworkStatus, GatewayStatus, GatewayType, GetDHCPEntryRequest, GetDHCPRequest, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPATRuleRequest, IP, IpamConfig, ListDHCPEntriesRequest, ListDHCPEntriesRequestOrderBy, ListDHCPEntriesResponse, ListDHCPsRequest, ListDHCPsRequestOrderBy, ListDHCPsResponse, ListGatewayNetworksRequest, ListGatewayNetworksRequestOrderBy, ListGatewayNetworksResponse, ListGatewaysRequest, ListGatewaysRequestOrderBy, ListGatewaysResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListIPsRequest, ListIPsRequestOrderBy, ListIPsResponse, ListPATRulesRequest, ListPATRulesRequestOrderBy, ListPATRulesResponse, MigrateToV2Request, PATRule, PATRuleProtocol, RefreshSSHKeysRequest, SetDHCPEntriesRequest, SetDHCPEntriesRequestEntry, SetDHCPEntriesResponse, SetPATRulesRequest, SetPATRulesRequestRule, SetPATRulesResponse, UpdateDHCPEntryRequest, UpdateDHCPRequest, UpdateGatewayNetworkRequest, UpdateGatewayNetworkRequestIpamConfig, UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, UpgradeGatewayRequest, } from './types.gen.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { CreateDHCPEntryRequest, CreateDHCPRequest, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePATRuleRequest, DHCP, DHCPEntry, Gateway, GatewayNetwork, IP, ListDHCPEntriesResponse, ListDHCPsResponse, ListGatewayNetworksResponse,
|
|
2
|
+
import type { CreateDHCPEntryRequest, CreateDHCPRequest, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePATRuleRequest, DHCP, DHCPEntry, Gateway, GatewayNetwork, IP, ListDHCPEntriesResponse, ListDHCPsResponse, ListGatewayNetworksResponse, ListGatewaysResponse, ListGatewayTypesResponse, ListIPsResponse, ListPATRulesResponse, PATRule, SetDHCPEntriesRequest, SetDHCPEntriesResponse, SetPATRulesRequest, SetPATRulesResponse, UpdateDHCPEntryRequest, UpdateDHCPRequest, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePATRuleRequest, UpgradeGatewayRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalDHCP: (data: unknown) => DHCP;
|
|
4
4
|
export declare const unmarshalGatewayNetwork: (data: unknown) => GatewayNetwork;
|
|
5
5
|
export declare const unmarshalIP: (data: unknown) => IP;
|
|
@@ -121,10 +121,7 @@ const unmarshalGateway = (data) => {
|
|
|
121
121
|
bastionPort: data.bastion_port,
|
|
122
122
|
canUpgradeTo: data.can_upgrade_to,
|
|
123
123
|
createdAt: unmarshalDate(data.created_at),
|
|
124
|
-
gatewayNetworks: unmarshalArrayOfObject(
|
|
125
|
-
data.gateway_networks,
|
|
126
|
-
unmarshalGatewayNetwork
|
|
127
|
-
),
|
|
124
|
+
gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
|
|
128
125
|
id: data.id,
|
|
129
126
|
ip: data.ip ? unmarshalIP(data.ip) : void 0,
|
|
130
127
|
ipMobilityEnabled: data.ip_mobility_enabled,
|
|
@@ -189,10 +186,7 @@ const unmarshalListGatewayNetworksResponse = (data) => {
|
|
|
189
186
|
);
|
|
190
187
|
}
|
|
191
188
|
return {
|
|
192
|
-
gatewayNetworks: unmarshalArrayOfObject(
|
|
193
|
-
data.gateway_networks,
|
|
194
|
-
unmarshalGatewayNetwork
|
|
195
|
-
),
|
|
189
|
+
gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
|
|
196
190
|
totalCount: data.total_count
|
|
197
191
|
};
|
|
198
192
|
};
|
|
@@ -290,17 +284,21 @@ const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
|
|
|
290
284
|
gateway_id: request.gatewayId,
|
|
291
285
|
private_network_id: request.privateNetworkId,
|
|
292
286
|
...resolveOneOf([
|
|
293
|
-
{
|
|
287
|
+
{
|
|
288
|
+
param: "dhcp_id",
|
|
289
|
+
value: request.dhcpId
|
|
290
|
+
},
|
|
294
291
|
{
|
|
295
292
|
param: "dhcp",
|
|
296
293
|
value: request.dhcp !== void 0 ? marshalCreateDHCPRequest(request.dhcp, defaults) : void 0
|
|
297
294
|
},
|
|
298
|
-
{
|
|
295
|
+
{
|
|
296
|
+
param: "address",
|
|
297
|
+
value: request.address
|
|
298
|
+
},
|
|
299
299
|
{
|
|
300
300
|
param: "ipam_config",
|
|
301
|
-
value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig(
|
|
302
|
-
request.ipamConfig
|
|
303
|
-
) : void 0
|
|
301
|
+
value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig(request.ipamConfig) : void 0
|
|
304
302
|
}
|
|
305
303
|
])
|
|
306
304
|
});
|
|
@@ -331,9 +329,7 @@ const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
|
|
|
331
329
|
mac_address: request.macAddress
|
|
332
330
|
});
|
|
333
331
|
const marshalSetDHCPEntriesRequest = (request, defaults) => ({
|
|
334
|
-
dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map(
|
|
335
|
-
(elt) => marshalSetDHCPEntriesRequestEntry(elt)
|
|
336
|
-
) : void 0,
|
|
332
|
+
dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map((elt) => marshalSetDHCPEntriesRequestEntry(elt)) : void 0,
|
|
337
333
|
gateway_network_id: request.gatewayNetworkId
|
|
338
334
|
});
|
|
339
335
|
const marshalSetPATRulesRequestRule = (request, defaults) => ({
|
|
@@ -344,9 +340,7 @@ const marshalSetPATRulesRequestRule = (request, defaults) => ({
|
|
|
344
340
|
});
|
|
345
341
|
const marshalSetPATRulesRequest = (request, defaults) => ({
|
|
346
342
|
gateway_id: request.gatewayId,
|
|
347
|
-
pat_rules: request.patRules.map(
|
|
348
|
-
(elt) => marshalSetPATRulesRequestRule(elt)
|
|
349
|
-
)
|
|
343
|
+
pat_rules: request.patRules.map((elt) => marshalSetPATRulesRequestRule(elt))
|
|
350
344
|
});
|
|
351
345
|
const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
|
|
352
346
|
ip_address: request.ipAddress
|
|
@@ -374,13 +368,17 @@ const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
|
|
|
374
368
|
enable_dhcp: request.enableDhcp,
|
|
375
369
|
enable_masquerade: request.enableMasquerade,
|
|
376
370
|
...resolveOneOf([
|
|
377
|
-
{
|
|
378
|
-
|
|
371
|
+
{
|
|
372
|
+
param: "dhcp_id",
|
|
373
|
+
value: request.dhcpId
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
param: "address",
|
|
377
|
+
value: request.address
|
|
378
|
+
},
|
|
379
379
|
{
|
|
380
380
|
param: "ipam_config",
|
|
381
|
-
value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig(
|
|
382
|
-
request.ipamConfig
|
|
383
|
-
) : void 0
|
|
381
|
+
value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig(request.ipamConfig) : void 0
|
|
384
382
|
}
|
|
385
383
|
])
|
|
386
384
|
});
|
package/dist/v2/api.gen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { AddBastionAllowedIPsRequest, AddBastionAllowedIPsResponse, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, DeleteBastionAllowedIPsRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePatRuleRequest, Gateway, GatewayNetwork, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPatRuleRequest, IP, ListGatewayNetworksRequest, ListGatewayNetworksResponse, ListGatewaysRequest, ListGatewaysResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListIPsRequest, ListIPsResponse, ListPatRulesRequest, ListPatRulesResponse, PatRule, RefreshSSHKeysRequest, SetBastionAllowedIPsRequest, SetBastionAllowedIPsResponse, SetPatRulesRequest, SetPatRulesResponse, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Public Gateways API.
|
|
6
6
|
|
package/dist/v2/api.gen.js
CHANGED
|
@@ -31,10 +31,7 @@ class API extends API$1 {
|
|
|
31
31
|
["order_by", request.orderBy],
|
|
32
32
|
["organization_id", request.organizationId],
|
|
33
33
|
["page", request.page],
|
|
34
|
-
[
|
|
35
|
-
"page_size",
|
|
36
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
37
|
-
],
|
|
34
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
38
35
|
["private_network_ids", request.privateNetworkIds],
|
|
39
36
|
["project_id", request.projectId],
|
|
40
37
|
["status", request.status],
|
|
@@ -72,9 +69,7 @@ class API extends API$1 {
|
|
|
72
69
|
* @returns A Promise of Gateway
|
|
73
70
|
*/
|
|
74
71
|
waitForGateway = (request, options) => waitForResource(
|
|
75
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
76
|
-
!GATEWAY_TRANSIENT_STATUSES.includes(res.status)
|
|
77
|
-
)),
|
|
72
|
+
options?.stop ?? ((res) => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
|
|
78
73
|
this.getGateway,
|
|
79
74
|
request,
|
|
80
75
|
options
|
|
@@ -123,7 +118,9 @@ class API extends API$1 {
|
|
|
123
118
|
{
|
|
124
119
|
method: "DELETE",
|
|
125
120
|
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}`,
|
|
126
|
-
urlParams: urlParams(
|
|
121
|
+
urlParams: urlParams(
|
|
122
|
+
["delete_ip", request.deleteIp]
|
|
123
|
+
)
|
|
127
124
|
},
|
|
128
125
|
unmarshalGateway
|
|
129
126
|
);
|
|
@@ -153,10 +150,7 @@ class API extends API$1 {
|
|
|
153
150
|
["masquerade_enabled", request.masqueradeEnabled],
|
|
154
151
|
["order_by", request.orderBy],
|
|
155
152
|
["page", request.page],
|
|
156
|
-
[
|
|
157
|
-
"page_size",
|
|
158
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
159
|
-
],
|
|
153
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
160
154
|
["private_network_ids", request.privateNetworkIds],
|
|
161
155
|
["status", request.status]
|
|
162
156
|
)
|
|
@@ -169,11 +163,7 @@ class API extends API$1 {
|
|
|
169
163
|
* @param request - The request {@link ListGatewayNetworksRequest}
|
|
170
164
|
* @returns A Promise of ListGatewayNetworksResponse
|
|
171
165
|
*/
|
|
172
|
-
listGatewayNetworks = (request = {}) => enrichForPagination(
|
|
173
|
-
"gatewayNetworks",
|
|
174
|
-
this.pageOfListGatewayNetworks,
|
|
175
|
-
request
|
|
176
|
-
);
|
|
166
|
+
listGatewayNetworks = (request = {}) => enrichForPagination("gatewayNetworks", this.pageOfListGatewayNetworks, request);
|
|
177
167
|
/**
|
|
178
168
|
* 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.
|
|
179
169
|
*
|
|
@@ -195,9 +185,7 @@ class API extends API$1 {
|
|
|
195
185
|
* @returns A Promise of GatewayNetwork
|
|
196
186
|
*/
|
|
197
187
|
waitForGatewayNetwork = (request, options) => waitForResource(
|
|
198
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
199
|
-
!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status)
|
|
200
|
-
)),
|
|
188
|
+
options?.stop ?? ((res) => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))),
|
|
201
189
|
this.getGatewayNetwork,
|
|
202
190
|
request,
|
|
203
191
|
options
|
|
@@ -257,10 +245,7 @@ class API extends API$1 {
|
|
|
257
245
|
["gateway_ids", request.gatewayIds],
|
|
258
246
|
["order_by", request.orderBy],
|
|
259
247
|
["page", request.page],
|
|
260
|
-
[
|
|
261
|
-
"page_size",
|
|
262
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
263
|
-
],
|
|
248
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
264
249
|
["private_ips", request.privateIps],
|
|
265
250
|
["protocol", request.protocol]
|
|
266
251
|
)
|
|
@@ -343,10 +328,12 @@ class API extends API$1 {
|
|
|
343
328
|
*
|
|
344
329
|
* @param request - The request {@link DeletePatRuleRequest}
|
|
345
330
|
*/
|
|
346
|
-
deletePatRule = (request) => this.client.fetch(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
331
|
+
deletePatRule = (request) => this.client.fetch(
|
|
332
|
+
{
|
|
333
|
+
method: "DELETE",
|
|
334
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam("patRuleId", request.patRuleId)}`
|
|
335
|
+
}
|
|
336
|
+
);
|
|
350
337
|
/**
|
|
351
338
|
* 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.
|
|
352
339
|
*
|
|
@@ -369,10 +356,7 @@ class API extends API$1 {
|
|
|
369
356
|
["order_by", request.orderBy],
|
|
370
357
|
["organization_id", request.organizationId],
|
|
371
358
|
["page", request.page],
|
|
372
|
-
[
|
|
373
|
-
"page_size",
|
|
374
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
375
|
-
],
|
|
359
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
376
360
|
["project_id", request.projectId],
|
|
377
361
|
["reverse", request.reverse],
|
|
378
362
|
["tags", request.tags]
|
|
@@ -439,10 +423,12 @@ class API extends API$1 {
|
|
|
439
423
|
*
|
|
440
424
|
* @param request - The request {@link DeleteIPRequest}
|
|
441
425
|
*/
|
|
442
|
-
deleteIP = (request) => this.client.fetch(
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
426
|
+
deleteIP = (request) => this.client.fetch(
|
|
427
|
+
{
|
|
428
|
+
method: "DELETE",
|
|
429
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
430
|
+
}
|
|
431
|
+
);
|
|
446
432
|
/**
|
|
447
433
|
* 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.
|
|
448
434
|
*
|
|
@@ -497,10 +483,12 @@ class API extends API$1 {
|
|
|
497
483
|
*
|
|
498
484
|
* @param request - The request {@link DeleteBastionAllowedIPsRequest}
|
|
499
485
|
*/
|
|
500
|
-
deleteBastionAllowedIPs = (request) => this.client.fetch(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
486
|
+
deleteBastionAllowedIPs = (request) => this.client.fetch(
|
|
487
|
+
{
|
|
488
|
+
method: "DELETE",
|
|
489
|
+
path: `/vpc-gw/v2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam("gatewayId", request.gatewayId)}/bastion-allowed-ips/${validatePathParam("ipRange", request.ipRange)}`
|
|
490
|
+
}
|
|
491
|
+
);
|
|
504
492
|
}
|
|
505
493
|
export {
|
|
506
494
|
API
|
package/dist/v2/index.gen.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { AddBastionAllowedIPsRequest, AddBastionAllowedIPsResponse, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, DeleteBastionAllowedIPsRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePatRuleRequest, Gateway, GatewayNetwork, GatewayNetworkStatus, GatewayStatus, GatewayType, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPatRuleRequest, IP, ListGatewayNetworksRequest, ListGatewayNetworksRequestOrderBy, ListGatewayNetworksResponse,
|
|
4
|
+
export type { AddBastionAllowedIPsRequest, AddBastionAllowedIPsResponse, CreateGatewayNetworkRequest, CreateGatewayRequest, CreateIPRequest, CreatePatRuleRequest, DeleteBastionAllowedIPsRequest, DeleteGatewayNetworkRequest, DeleteGatewayRequest, DeleteIPRequest, DeletePatRuleRequest, Gateway, GatewayNetwork, GatewayNetworkStatus, GatewayStatus, GatewayType, GetGatewayNetworkRequest, GetGatewayRequest, GetIPRequest, GetPatRuleRequest, IP, ListGatewayNetworksRequest, ListGatewayNetworksRequestOrderBy, ListGatewayNetworksResponse, ListGatewaysRequest, ListGatewaysRequestOrderBy, ListGatewaysResponse, ListGatewayTypesRequest, ListGatewayTypesResponse, ListIPsRequest, ListIPsRequestOrderBy, ListIPsResponse, ListPatRulesRequest, ListPatRulesRequestOrderBy, ListPatRulesResponse, PatRule, PatRuleProtocol, RefreshSSHKeysRequest, SetBastionAllowedIPsRequest, SetBastionAllowedIPsResponse, SetPatRulesRequest, SetPatRulesRequestRule, SetPatRulesResponse, UpdateGatewayNetworkRequest, UpdateGatewayRequest, UpdateIPRequest, UpdatePatRuleRequest, UpgradeGatewayRequest, } from './types.gen.js';
|