@scaleway/sdk-vpc 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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v2/api.gen.js +267 -381
- package/dist/v2/index.gen.d.ts +1 -1
- package/dist/v2/index.gen.js +29 -27
- package/dist/v2/marshalling.gen.js +142 -220
- package/dist/v2/types.gen.d.ts +12 -0
- package/dist/v2/validation-rules.gen.js +12 -24
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ const api = new Vpc.v1.API(client)
|
|
|
83
83
|
## Support
|
|
84
84
|
|
|
85
85
|
We love feedback! Feel free to reach us on:
|
|
86
|
+
|
|
86
87
|
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
88
|
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
89
|
|
|
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
|
|
|
93
94
|
## License
|
|
94
95
|
|
|
95
96
|
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
-
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __exportAll = (all, no_symbols) => {
|
|
3
|
+
let target = {};
|
|
4
|
+
for (var name in all) __defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true
|
|
7
|
+
});
|
|
8
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
export { __exportAll };
|
package/dist/index.gen.js
CHANGED
package/dist/v2/api.gen.js
CHANGED
|
@@ -1,382 +1,268 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
marshalAddSubnetsRequest(request, this.client.settings)
|
|
268
|
-
),
|
|
269
|
-
headers: jsonContentHeaders,
|
|
270
|
-
method: "POST",
|
|
271
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
|
|
272
|
-
},
|
|
273
|
-
unmarshalAddSubnetsResponse
|
|
274
|
-
);
|
|
275
|
-
/**
|
|
276
|
-
* Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
|
|
277
|
-
*
|
|
278
|
-
* @param request - The request {@link DeleteSubnetsRequest}
|
|
279
|
-
* @returns A Promise of DeleteSubnetsResponse
|
|
280
|
-
*/
|
|
281
|
-
deleteSubnets = (request) => this.client.fetch(
|
|
282
|
-
{
|
|
283
|
-
body: JSON.stringify(
|
|
284
|
-
marshalDeleteSubnetsRequest(request, this.client.settings)
|
|
285
|
-
),
|
|
286
|
-
headers: jsonContentHeaders,
|
|
287
|
-
method: "DELETE",
|
|
288
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
|
|
289
|
-
},
|
|
290
|
-
unmarshalDeleteSubnetsResponse
|
|
291
|
-
);
|
|
292
|
-
/**
|
|
293
|
-
* Create a Route. Create a new custom Route.
|
|
294
|
-
*
|
|
295
|
-
* @param request - The request {@link CreateRouteRequest}
|
|
296
|
-
* @returns A Promise of Route
|
|
297
|
-
*/
|
|
298
|
-
createRoute = (request) => this.client.fetch(
|
|
299
|
-
{
|
|
300
|
-
body: JSON.stringify(
|
|
301
|
-
marshalCreateRouteRequest(request, this.client.settings)
|
|
302
|
-
),
|
|
303
|
-
headers: jsonContentHeaders,
|
|
304
|
-
method: "POST",
|
|
305
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
|
|
306
|
-
},
|
|
307
|
-
unmarshalRoute
|
|
308
|
-
);
|
|
309
|
-
/**
|
|
310
|
-
* Get a Route. Retrieve details of an existing Route, specified by its Route ID.
|
|
311
|
-
*
|
|
312
|
-
* @param request - The request {@link GetRouteRequest}
|
|
313
|
-
* @returns A Promise of Route
|
|
314
|
-
*/
|
|
315
|
-
getRoute = (request) => this.client.fetch(
|
|
316
|
-
{
|
|
317
|
-
method: "GET",
|
|
318
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
|
|
319
|
-
},
|
|
320
|
-
unmarshalRoute
|
|
321
|
-
);
|
|
322
|
-
/**
|
|
323
|
-
* Update Route. Update parameters of the specified Route.
|
|
324
|
-
*
|
|
325
|
-
* @param request - The request {@link UpdateRouteRequest}
|
|
326
|
-
* @returns A Promise of Route
|
|
327
|
-
*/
|
|
328
|
-
updateRoute = (request) => this.client.fetch(
|
|
329
|
-
{
|
|
330
|
-
body: JSON.stringify(
|
|
331
|
-
marshalUpdateRouteRequest(request, this.client.settings)
|
|
332
|
-
),
|
|
333
|
-
headers: jsonContentHeaders,
|
|
334
|
-
method: "PATCH",
|
|
335
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
|
|
336
|
-
},
|
|
337
|
-
unmarshalRoute
|
|
338
|
-
);
|
|
339
|
-
/**
|
|
340
|
-
* Delete a Route. Delete a Route specified by its Route ID.
|
|
341
|
-
*
|
|
342
|
-
* @param request - The request {@link DeleteRouteRequest}
|
|
343
|
-
*/
|
|
344
|
-
deleteRoute = (request) => this.client.fetch({
|
|
345
|
-
method: "DELETE",
|
|
346
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
|
|
347
|
-
});
|
|
348
|
-
/**
|
|
349
|
-
* Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
|
|
350
|
-
*
|
|
351
|
-
* @param request - The request {@link GetAclRequest}
|
|
352
|
-
* @returns A Promise of GetAclResponse
|
|
353
|
-
*/
|
|
354
|
-
getAcl = (request) => this.client.fetch(
|
|
355
|
-
{
|
|
356
|
-
method: "GET",
|
|
357
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
|
|
358
|
-
urlParams: urlParams(["is_ipv6", request.isIpv6])
|
|
359
|
-
},
|
|
360
|
-
unmarshalGetAclResponse
|
|
361
|
-
);
|
|
362
|
-
/**
|
|
363
|
-
* Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
|
|
364
|
-
*
|
|
365
|
-
* @param request - The request {@link SetAclRequest}
|
|
366
|
-
* @returns A Promise of SetAclResponse
|
|
367
|
-
*/
|
|
368
|
-
setAcl = (request) => this.client.fetch(
|
|
369
|
-
{
|
|
370
|
-
body: JSON.stringify(
|
|
371
|
-
marshalSetAclRequest(request, this.client.settings)
|
|
372
|
-
),
|
|
373
|
-
headers: jsonContentHeaders,
|
|
374
|
-
method: "PUT",
|
|
375
|
-
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
|
|
376
|
-
},
|
|
377
|
-
unmarshalSetAclResponse
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
export {
|
|
381
|
-
API
|
|
1
|
+
import { marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC } from "./marshalling.gen.js";
|
|
2
|
+
import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
|
+
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
4
|
+
/**
|
|
5
|
+
* VPC API.
|
|
6
|
+
|
|
7
|
+
This API allows you to manage your Virtual Private Clouds (VPCs) and Private Networks.
|
|
8
|
+
*/
|
|
9
|
+
var API$1 = class extends API {
|
|
10
|
+
/**
|
|
11
|
+
* Locality of this API.
|
|
12
|
+
* type ∈ {'zone','region','global','unspecified'}
|
|
13
|
+
*/
|
|
14
|
+
static LOCALITY = toApiLocality({ regions: [
|
|
15
|
+
"fr-par",
|
|
16
|
+
"nl-ams",
|
|
17
|
+
"pl-waw"
|
|
18
|
+
] });
|
|
19
|
+
pageOfListVPCs = (request = {}) => this.client.fetch({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`,
|
|
22
|
+
urlParams: urlParams(["is_default", request.isDefault], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["routing_enabled", request.routingEnabled], ["tags", request.tags])
|
|
23
|
+
}, unmarshalListVPCsResponse);
|
|
24
|
+
/**
|
|
25
|
+
* List VPCs. List existing VPCs in the specified region.
|
|
26
|
+
*
|
|
27
|
+
* @param request - The request {@link ListVPCsRequest}
|
|
28
|
+
* @returns A Promise of ListVPCsResponse
|
|
29
|
+
*/
|
|
30
|
+
listVPCs = (request = {}) => enrichForPagination("vpcs", this.pageOfListVPCs, request);
|
|
31
|
+
/**
|
|
32
|
+
* Create a VPC. Create a new VPC in the specified region.
|
|
33
|
+
*
|
|
34
|
+
* @param request - The request {@link CreateVPCRequest}
|
|
35
|
+
* @returns A Promise of VPC
|
|
36
|
+
*/
|
|
37
|
+
createVPC = (request) => this.client.fetch({
|
|
38
|
+
body: JSON.stringify(marshalCreateVPCRequest(request, this.client.settings)),
|
|
39
|
+
headers: jsonContentHeaders,
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`
|
|
42
|
+
}, unmarshalVPC);
|
|
43
|
+
/**
|
|
44
|
+
* Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.
|
|
45
|
+
*
|
|
46
|
+
* @param request - The request {@link GetVPCRequest}
|
|
47
|
+
* @returns A Promise of VPC
|
|
48
|
+
*/
|
|
49
|
+
getVPC = (request) => this.client.fetch({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
|
|
52
|
+
}, unmarshalVPC);
|
|
53
|
+
/**
|
|
54
|
+
* Update VPC. Update parameters including name and tags of the specified VPC.
|
|
55
|
+
*
|
|
56
|
+
* @param request - The request {@link UpdateVPCRequest}
|
|
57
|
+
* @returns A Promise of VPC
|
|
58
|
+
*/
|
|
59
|
+
updateVPC = (request) => this.client.fetch({
|
|
60
|
+
body: JSON.stringify(marshalUpdateVPCRequest(request, this.client.settings)),
|
|
61
|
+
headers: jsonContentHeaders,
|
|
62
|
+
method: "PATCH",
|
|
63
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
|
|
64
|
+
}, unmarshalVPC);
|
|
65
|
+
/**
|
|
66
|
+
* Delete a VPC. Delete a VPC specified by its VPC ID.
|
|
67
|
+
*
|
|
68
|
+
* @param request - The request {@link DeleteVPCRequest}
|
|
69
|
+
*/
|
|
70
|
+
deleteVPC = (request) => this.client.fetch({
|
|
71
|
+
method: "DELETE",
|
|
72
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}`
|
|
73
|
+
});
|
|
74
|
+
pageOfListPrivateNetworks = (request = {}) => this.client.fetch({
|
|
75
|
+
method: "GET",
|
|
76
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`,
|
|
77
|
+
urlParams: urlParams(["dhcp_enabled", request.dhcpEnabled], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["project_id", request.projectId], ["tags", request.tags], ["vpc_id", request.vpcId])
|
|
78
|
+
}, unmarshalListPrivateNetworksResponse);
|
|
79
|
+
/**
|
|
80
|
+
* List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
|
|
81
|
+
*
|
|
82
|
+
* @param request - The request {@link ListPrivateNetworksRequest}
|
|
83
|
+
* @returns A Promise of ListPrivateNetworksResponse
|
|
84
|
+
*/
|
|
85
|
+
listPrivateNetworks = (request = {}) => enrichForPagination("privateNetworks", this.pageOfListPrivateNetworks, request);
|
|
86
|
+
/**
|
|
87
|
+
* Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region.
|
|
88
|
+
*
|
|
89
|
+
* @param request - The request {@link CreatePrivateNetworkRequest}
|
|
90
|
+
* @returns A Promise of PrivateNetwork
|
|
91
|
+
*/
|
|
92
|
+
createPrivateNetwork = (request) => this.client.fetch({
|
|
93
|
+
body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, this.client.settings)),
|
|
94
|
+
headers: jsonContentHeaders,
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`
|
|
97
|
+
}, unmarshalPrivateNetwork);
|
|
98
|
+
/**
|
|
99
|
+
* Get a Private Network. Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object.
|
|
100
|
+
*
|
|
101
|
+
* @param request - The request {@link GetPrivateNetworkRequest}
|
|
102
|
+
* @returns A Promise of PrivateNetwork
|
|
103
|
+
*/
|
|
104
|
+
getPrivateNetwork = (request) => this.client.fetch({
|
|
105
|
+
method: "GET",
|
|
106
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
107
|
+
}, unmarshalPrivateNetwork);
|
|
108
|
+
/**
|
|
109
|
+
* Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID.
|
|
110
|
+
*
|
|
111
|
+
* @param request - The request {@link UpdatePrivateNetworkRequest}
|
|
112
|
+
* @returns A Promise of PrivateNetwork
|
|
113
|
+
*/
|
|
114
|
+
updatePrivateNetwork = (request) => this.client.fetch({
|
|
115
|
+
body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
|
|
116
|
+
headers: jsonContentHeaders,
|
|
117
|
+
method: "PATCH",
|
|
118
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
119
|
+
}, unmarshalPrivateNetwork);
|
|
120
|
+
/**
|
|
121
|
+
* Delete a Private Network. Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it.
|
|
122
|
+
*
|
|
123
|
+
* @param request - The request {@link DeletePrivateNetworkRequest}
|
|
124
|
+
*/
|
|
125
|
+
deletePrivateNetwork = (request) => this.client.fetch({
|
|
126
|
+
method: "DELETE",
|
|
127
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* Enable DHCP on a Private Network. Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards.
|
|
131
|
+
*
|
|
132
|
+
* @param request - The request {@link EnableDHCPRequest}
|
|
133
|
+
* @returns A Promise of PrivateNetwork
|
|
134
|
+
*/
|
|
135
|
+
enableDHCP = (request) => this.client.fetch({
|
|
136
|
+
body: "{}",
|
|
137
|
+
headers: jsonContentHeaders,
|
|
138
|
+
method: "POST",
|
|
139
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp`
|
|
140
|
+
}, unmarshalPrivateNetwork);
|
|
141
|
+
/**
|
|
142
|
+
* Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
|
|
143
|
+
*
|
|
144
|
+
* @param request - The request {@link EnableRoutingRequest}
|
|
145
|
+
* @returns A Promise of VPC
|
|
146
|
+
*/
|
|
147
|
+
enableRouting = (request) => this.client.fetch({
|
|
148
|
+
body: "{}",
|
|
149
|
+
headers: jsonContentHeaders,
|
|
150
|
+
method: "POST",
|
|
151
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-routing`
|
|
152
|
+
}, unmarshalVPC);
|
|
153
|
+
/**
|
|
154
|
+
* Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
|
|
155
|
+
*
|
|
156
|
+
* @param request - The request {@link EnableCustomRoutesPropagationRequest}
|
|
157
|
+
* @returns A Promise of VPC
|
|
158
|
+
*/
|
|
159
|
+
enableCustomRoutesPropagation = (request) => this.client.fetch({
|
|
160
|
+
body: "{}",
|
|
161
|
+
headers: jsonContentHeaders,
|
|
162
|
+
method: "POST",
|
|
163
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/enable-custom-routes-propagation`
|
|
164
|
+
}, unmarshalVPC);
|
|
165
|
+
pageOfListSubnets = (request = {}) => this.client.fetch({
|
|
166
|
+
method: "GET",
|
|
167
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`,
|
|
168
|
+
urlParams: urlParams(["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["subnet_ids", request.subnetIds], ["vpc_id", request.vpcId])
|
|
169
|
+
}, unmarshalListSubnetsResponse);
|
|
170
|
+
/**
|
|
171
|
+
* List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets.
|
|
172
|
+
*
|
|
173
|
+
* @param request - The request {@link ListSubnetsRequest}
|
|
174
|
+
* @returns A Promise of ListSubnetsResponse
|
|
175
|
+
*/
|
|
176
|
+
listSubnets = (request = {}) => enrichForPagination("subnets", this.pageOfListSubnets, request);
|
|
177
|
+
/**
|
|
178
|
+
* Add subnets to a Private Network. Add new subnets to an existing Private Network.
|
|
179
|
+
*
|
|
180
|
+
* @param request - The request {@link AddSubnetsRequest}
|
|
181
|
+
* @returns A Promise of AddSubnetsResponse
|
|
182
|
+
*/
|
|
183
|
+
addSubnets = (request) => this.client.fetch({
|
|
184
|
+
body: JSON.stringify(marshalAddSubnetsRequest(request, this.client.settings)),
|
|
185
|
+
headers: jsonContentHeaders,
|
|
186
|
+
method: "POST",
|
|
187
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
|
|
188
|
+
}, unmarshalAddSubnetsResponse);
|
|
189
|
+
/**
|
|
190
|
+
* Delete subnets from a Private Network. Delete the specified subnets from a Private Network.
|
|
191
|
+
*
|
|
192
|
+
* @param request - The request {@link DeleteSubnetsRequest}
|
|
193
|
+
* @returns A Promise of DeleteSubnetsResponse
|
|
194
|
+
*/
|
|
195
|
+
deleteSubnets = (request) => this.client.fetch({
|
|
196
|
+
body: JSON.stringify(marshalDeleteSubnetsRequest(request, this.client.settings)),
|
|
197
|
+
headers: jsonContentHeaders,
|
|
198
|
+
method: "DELETE",
|
|
199
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets`
|
|
200
|
+
}, unmarshalDeleteSubnetsResponse);
|
|
201
|
+
/**
|
|
202
|
+
* Create a Route. Create a new custom Route.
|
|
203
|
+
*
|
|
204
|
+
* @param request - The request {@link CreateRouteRequest}
|
|
205
|
+
* @returns A Promise of Route
|
|
206
|
+
*/
|
|
207
|
+
createRoute = (request) => this.client.fetch({
|
|
208
|
+
body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),
|
|
209
|
+
headers: jsonContentHeaders,
|
|
210
|
+
method: "POST",
|
|
211
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`
|
|
212
|
+
}, unmarshalRoute);
|
|
213
|
+
/**
|
|
214
|
+
* Get a Route. Retrieve details of an existing Route, specified by its Route ID.
|
|
215
|
+
*
|
|
216
|
+
* @param request - The request {@link GetRouteRequest}
|
|
217
|
+
* @returns A Promise of Route
|
|
218
|
+
*/
|
|
219
|
+
getRoute = (request) => this.client.fetch({
|
|
220
|
+
method: "GET",
|
|
221
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
|
|
222
|
+
}, unmarshalRoute);
|
|
223
|
+
/**
|
|
224
|
+
* Update Route. Update parameters of the specified Route.
|
|
225
|
+
*
|
|
226
|
+
* @param request - The request {@link UpdateRouteRequest}
|
|
227
|
+
* @returns A Promise of Route
|
|
228
|
+
*/
|
|
229
|
+
updateRoute = (request) => this.client.fetch({
|
|
230
|
+
body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),
|
|
231
|
+
headers: jsonContentHeaders,
|
|
232
|
+
method: "PATCH",
|
|
233
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
|
|
234
|
+
}, unmarshalRoute);
|
|
235
|
+
/**
|
|
236
|
+
* Delete a Route. Delete a Route specified by its Route ID.
|
|
237
|
+
*
|
|
238
|
+
* @param request - The request {@link DeleteRouteRequest}
|
|
239
|
+
*/
|
|
240
|
+
deleteRoute = (request) => this.client.fetch({
|
|
241
|
+
method: "DELETE",
|
|
242
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam("routeId", request.routeId)}`
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID.
|
|
246
|
+
*
|
|
247
|
+
* @param request - The request {@link GetAclRequest}
|
|
248
|
+
* @returns A Promise of GetAclResponse
|
|
249
|
+
*/
|
|
250
|
+
getAcl = (request) => this.client.fetch({
|
|
251
|
+
method: "GET",
|
|
252
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`,
|
|
253
|
+
urlParams: urlParams(["is_ipv6", request.isIpv6])
|
|
254
|
+
}, unmarshalGetAclResponse);
|
|
255
|
+
/**
|
|
256
|
+
* Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC.
|
|
257
|
+
*
|
|
258
|
+
* @param request - The request {@link SetAclRequest}
|
|
259
|
+
* @returns A Promise of SetAclResponse
|
|
260
|
+
*/
|
|
261
|
+
setAcl = (request) => this.client.fetch({
|
|
262
|
+
body: JSON.stringify(marshalSetAclRequest(request, this.client.settings)),
|
|
263
|
+
headers: jsonContentHeaders,
|
|
264
|
+
method: "PUT",
|
|
265
|
+
path: `/vpc/v2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam("vpcId", request.vpcId)}/acl-rules`
|
|
266
|
+
}, unmarshalSetAclResponse);
|
|
382
267
|
};
|
|
268
|
+
export { API$1 as 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 './marshalling.gen.js';
|
|
3
3
|
export type { AclRule, AclRuleProtocol, Action, AddSubnetsRequest, AddSubnetsResponse, CreatePrivateNetworkRequest, CreateRouteRequest, CreateVPCRequest, DeletePrivateNetworkRequest, DeleteRouteRequest, DeleteSubnetsRequest, DeleteSubnetsResponse, DeleteVPCRequest, EnableCustomRoutesPropagationRequest, EnableDHCPRequest, EnableRoutingRequest, GetAclRequest, GetAclResponse, GetPrivateNetworkRequest, GetRouteRequest, GetVPCRequest, ListPrivateNetworksRequest, ListPrivateNetworksRequestOrderBy, ListPrivateNetworksResponse, ListSubnetsRequest, ListSubnetsRequestOrderBy, ListSubnetsResponse, ListVPCsRequest, ListVPCsRequestOrderBy, ListVPCsResponse, PrivateNetwork, Route, RouteType, SetAclRequest, SetAclResponse, Subnet, UpdatePrivateNetworkRequest, UpdateRouteRequest, UpdateVPCRequest, VPC, } from './types.gen.js';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen.js';
|
package/dist/v2/index.gen.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAclRule, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC } from "./marshalling.gen.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
import { API } from "./api.gen.js";
|
|
4
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
5
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
API: () => API,
|
|
7
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
8
|
+
marshalAclRule: () => marshalAclRule,
|
|
9
|
+
marshalAddSubnetsRequest: () => marshalAddSubnetsRequest,
|
|
10
|
+
marshalCreatePrivateNetworkRequest: () => marshalCreatePrivateNetworkRequest,
|
|
11
|
+
marshalCreateRouteRequest: () => marshalCreateRouteRequest,
|
|
12
|
+
marshalCreateVPCRequest: () => marshalCreateVPCRequest,
|
|
13
|
+
marshalDeleteSubnetsRequest: () => marshalDeleteSubnetsRequest,
|
|
14
|
+
marshalSetAclRequest: () => marshalSetAclRequest,
|
|
15
|
+
marshalUpdatePrivateNetworkRequest: () => marshalUpdatePrivateNetworkRequest,
|
|
16
|
+
marshalUpdateRouteRequest: () => marshalUpdateRouteRequest,
|
|
17
|
+
marshalUpdateVPCRequest: () => marshalUpdateVPCRequest,
|
|
18
|
+
unmarshalAclRule: () => unmarshalAclRule,
|
|
19
|
+
unmarshalAddSubnetsResponse: () => unmarshalAddSubnetsResponse,
|
|
20
|
+
unmarshalDeleteSubnetsResponse: () => unmarshalDeleteSubnetsResponse,
|
|
21
|
+
unmarshalGetAclResponse: () => unmarshalGetAclResponse,
|
|
22
|
+
unmarshalListPrivateNetworksResponse: () => unmarshalListPrivateNetworksResponse,
|
|
23
|
+
unmarshalListSubnetsResponse: () => unmarshalListSubnetsResponse,
|
|
24
|
+
unmarshalListVPCsResponse: () => unmarshalListVPCsResponse,
|
|
25
|
+
unmarshalPrivateNetwork: () => unmarshalPrivateNetwork,
|
|
26
|
+
unmarshalRoute: () => unmarshalRoute,
|
|
27
|
+
unmarshalSetAclResponse: () => unmarshalSetAclResponse,
|
|
28
|
+
unmarshalVPC: () => unmarshalVPC
|
|
29
|
+
});
|
|
30
|
+
export { index_gen_exports };
|
|
@@ -1,260 +1,182 @@
|
|
|
1
|
-
import randomName from "@scaleway/random-name";
|
|
2
1
|
import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
16
|
-
vpcId: data.vpc_id
|
|
17
|
-
};
|
|
2
|
+
import randomName from "@scaleway/random-name";
|
|
3
|
+
var unmarshalSubnet = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`);
|
|
5
|
+
return {
|
|
6
|
+
createdAt: unmarshalDate(data.created_at),
|
|
7
|
+
id: data.id,
|
|
8
|
+
privateNetworkId: data.private_network_id,
|
|
9
|
+
projectId: data.project_id,
|
|
10
|
+
subnet: data.subnet,
|
|
11
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
12
|
+
vpcId: data.vpc_id
|
|
13
|
+
};
|
|
18
14
|
};
|
|
19
15
|
const unmarshalPrivateNetwork = (data) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
tags: data.tags,
|
|
36
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
37
|
-
vpcId: data.vpc_id
|
|
38
|
-
};
|
|
16
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
|
|
17
|
+
return {
|
|
18
|
+
createdAt: unmarshalDate(data.created_at),
|
|
19
|
+
defaultRoutePropagationEnabled: data.default_route_propagation_enabled,
|
|
20
|
+
dhcpEnabled: data.dhcp_enabled,
|
|
21
|
+
id: data.id,
|
|
22
|
+
name: data.name,
|
|
23
|
+
organizationId: data.organization_id,
|
|
24
|
+
projectId: data.project_id,
|
|
25
|
+
region: data.region,
|
|
26
|
+
subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
|
|
27
|
+
tags: data.tags,
|
|
28
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
29
|
+
vpcId: data.vpc_id
|
|
30
|
+
};
|
|
39
31
|
};
|
|
40
32
|
const unmarshalRoute = (data) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
58
|
-
vpcId: data.vpc_id
|
|
59
|
-
};
|
|
33
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);
|
|
34
|
+
return {
|
|
35
|
+
createdAt: unmarshalDate(data.created_at),
|
|
36
|
+
description: data.description,
|
|
37
|
+
destination: data.destination,
|
|
38
|
+
id: data.id,
|
|
39
|
+
isReadOnly: data.is_read_only,
|
|
40
|
+
nexthopPrivateNetworkId: data.nexthop_private_network_id,
|
|
41
|
+
nexthopResourceId: data.nexthop_resource_id,
|
|
42
|
+
nexthopVpcConnectorId: data.nexthop_vpc_connector_id,
|
|
43
|
+
region: data.region,
|
|
44
|
+
tags: data.tags,
|
|
45
|
+
type: data.type ? data.type : void 0,
|
|
46
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
47
|
+
vpcId: data.vpc_id
|
|
48
|
+
};
|
|
60
49
|
};
|
|
61
50
|
const unmarshalVPC = (data) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
routingEnabled: data.routing_enabled,
|
|
78
|
-
tags: data.tags,
|
|
79
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
80
|
-
};
|
|
51
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`);
|
|
52
|
+
return {
|
|
53
|
+
createdAt: unmarshalDate(data.created_at),
|
|
54
|
+
customRoutesPropagationEnabled: data.custom_routes_propagation_enabled,
|
|
55
|
+
id: data.id,
|
|
56
|
+
isDefault: data.is_default,
|
|
57
|
+
name: data.name,
|
|
58
|
+
organizationId: data.organization_id,
|
|
59
|
+
privateNetworkCount: data.private_network_count,
|
|
60
|
+
projectId: data.project_id,
|
|
61
|
+
region: data.region,
|
|
62
|
+
routingEnabled: data.routing_enabled,
|
|
63
|
+
tags: data.tags,
|
|
64
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
65
|
+
};
|
|
81
66
|
};
|
|
82
67
|
const unmarshalAddSubnetsResponse = (data) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
subnets: data.subnets
|
|
90
|
-
};
|
|
68
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`);
|
|
69
|
+
return { subnets: data.subnets };
|
|
91
70
|
};
|
|
92
71
|
const unmarshalDeleteSubnetsResponse = (data) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
subnets: data.subnets
|
|
100
|
-
};
|
|
72
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`);
|
|
73
|
+
return { subnets: data.subnets };
|
|
101
74
|
};
|
|
102
75
|
const unmarshalAclRule = (data) => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
source: data.source,
|
|
116
|
-
srcPortHigh: data.src_port_high,
|
|
117
|
-
srcPortLow: data.src_port_low
|
|
118
|
-
};
|
|
76
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AclRule' failed as data isn't a dictionary.`);
|
|
77
|
+
return {
|
|
78
|
+
action: data.action,
|
|
79
|
+
description: data.description,
|
|
80
|
+
destination: data.destination,
|
|
81
|
+
dstPortHigh: data.dst_port_high,
|
|
82
|
+
dstPortLow: data.dst_port_low,
|
|
83
|
+
protocol: data.protocol,
|
|
84
|
+
source: data.source,
|
|
85
|
+
srcPortHigh: data.src_port_high,
|
|
86
|
+
srcPortLow: data.src_port_low
|
|
87
|
+
};
|
|
119
88
|
};
|
|
120
89
|
const unmarshalGetAclResponse = (data) => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return {
|
|
127
|
-
defaultPolicy: data.default_policy,
|
|
128
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
|
|
129
|
-
};
|
|
90
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetAclResponse' failed as data isn't a dictionary.`);
|
|
91
|
+
return {
|
|
92
|
+
defaultPolicy: data.default_policy,
|
|
93
|
+
rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
|
|
94
|
+
};
|
|
130
95
|
};
|
|
131
96
|
const unmarshalListPrivateNetworksResponse = (data) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
privateNetworks: unmarshalArrayOfObject(
|
|
139
|
-
data.private_networks,
|
|
140
|
-
unmarshalPrivateNetwork
|
|
141
|
-
),
|
|
142
|
-
totalCount: data.total_count
|
|
143
|
-
};
|
|
97
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);
|
|
98
|
+
return {
|
|
99
|
+
privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),
|
|
100
|
+
totalCount: data.total_count
|
|
101
|
+
};
|
|
144
102
|
};
|
|
145
103
|
const unmarshalListSubnetsResponse = (data) => {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return {
|
|
152
|
-
subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
|
|
153
|
-
totalCount: data.total_count
|
|
154
|
-
};
|
|
104
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`);
|
|
105
|
+
return {
|
|
106
|
+
subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),
|
|
107
|
+
totalCount: data.total_count
|
|
108
|
+
};
|
|
155
109
|
};
|
|
156
110
|
const unmarshalListVPCsResponse = (data) => {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return {
|
|
163
|
-
totalCount: data.total_count,
|
|
164
|
-
vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
|
|
165
|
-
};
|
|
111
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`);
|
|
112
|
+
return {
|
|
113
|
+
totalCount: data.total_count,
|
|
114
|
+
vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)
|
|
115
|
+
};
|
|
166
116
|
};
|
|
167
117
|
const unmarshalSetAclResponse = (data) => {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return {
|
|
174
|
-
defaultPolicy: data.default_policy,
|
|
175
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
|
|
176
|
-
};
|
|
118
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetAclResponse' failed as data isn't a dictionary.`);
|
|
119
|
+
return {
|
|
120
|
+
defaultPolicy: data.default_policy,
|
|
121
|
+
rules: unmarshalArrayOfObject(data.rules, unmarshalAclRule)
|
|
122
|
+
};
|
|
177
123
|
};
|
|
178
|
-
const marshalAddSubnetsRequest = (request, defaults) => ({
|
|
179
|
-
subnets: request.subnets
|
|
180
|
-
});
|
|
124
|
+
const marshalAddSubnetsRequest = (request, defaults) => ({ subnets: request.subnets });
|
|
181
125
|
const marshalCreatePrivateNetworkRequest = (request, defaults) => ({
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
126
|
+
default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
|
|
127
|
+
name: request.name || randomName("pn"),
|
|
128
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
129
|
+
subnets: request.subnets,
|
|
130
|
+
tags: request.tags,
|
|
131
|
+
vpc_id: request.vpcId
|
|
188
132
|
});
|
|
189
133
|
const marshalCreateRouteRequest = (request, defaults) => ({
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
134
|
+
description: request.description,
|
|
135
|
+
destination: request.destination,
|
|
136
|
+
nexthop_private_network_id: request.nexthopPrivateNetworkId,
|
|
137
|
+
nexthop_resource_id: request.nexthopResourceId,
|
|
138
|
+
nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
|
|
139
|
+
tags: request.tags,
|
|
140
|
+
vpc_id: request.vpcId
|
|
196
141
|
});
|
|
197
142
|
const marshalCreateVPCRequest = (request, defaults) => ({
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
});
|
|
203
|
-
const marshalDeleteSubnetsRequest = (request, defaults) => ({
|
|
204
|
-
subnets: request.subnets
|
|
143
|
+
enable_routing: request.enableRouting,
|
|
144
|
+
name: request.name || randomName("vpc"),
|
|
145
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
146
|
+
tags: request.tags
|
|
205
147
|
});
|
|
148
|
+
const marshalDeleteSubnetsRequest = (request, defaults) => ({ subnets: request.subnets });
|
|
206
149
|
const marshalAclRule = (request, defaults) => ({
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
150
|
+
action: request.action,
|
|
151
|
+
description: request.description,
|
|
152
|
+
destination: request.destination,
|
|
153
|
+
dst_port_high: request.dstPortHigh,
|
|
154
|
+
dst_port_low: request.dstPortLow,
|
|
155
|
+
protocol: request.protocol,
|
|
156
|
+
source: request.source,
|
|
157
|
+
src_port_high: request.srcPortHigh,
|
|
158
|
+
src_port_low: request.srcPortLow
|
|
216
159
|
});
|
|
217
160
|
const marshalSetAclRequest = (request, defaults) => ({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
161
|
+
default_policy: request.defaultPolicy,
|
|
162
|
+
is_ipv6: request.isIpv6,
|
|
163
|
+
rules: request.rules.map((elt) => marshalAclRule(elt, defaults))
|
|
221
164
|
});
|
|
222
165
|
const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
166
|
+
default_route_propagation_enabled: request.defaultRoutePropagationEnabled,
|
|
167
|
+
name: request.name,
|
|
168
|
+
tags: request.tags
|
|
226
169
|
});
|
|
227
170
|
const marshalUpdateRouteRequest = (request, defaults) => ({
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
171
|
+
description: request.description,
|
|
172
|
+
destination: request.destination,
|
|
173
|
+
nexthop_private_network_id: request.nexthopPrivateNetworkId,
|
|
174
|
+
nexthop_resource_id: request.nexthopResourceId,
|
|
175
|
+
nexthop_vpc_connector_id: request.nexthopVpcConnectorId,
|
|
176
|
+
tags: request.tags
|
|
233
177
|
});
|
|
234
178
|
const marshalUpdateVPCRequest = (request, defaults) => ({
|
|
235
|
-
|
|
236
|
-
|
|
179
|
+
name: request.name,
|
|
180
|
+
tags: request.tags
|
|
237
181
|
});
|
|
238
|
-
export {
|
|
239
|
-
marshalAclRule,
|
|
240
|
-
marshalAddSubnetsRequest,
|
|
241
|
-
marshalCreatePrivateNetworkRequest,
|
|
242
|
-
marshalCreateRouteRequest,
|
|
243
|
-
marshalCreateVPCRequest,
|
|
244
|
-
marshalDeleteSubnetsRequest,
|
|
245
|
-
marshalSetAclRequest,
|
|
246
|
-
marshalUpdatePrivateNetworkRequest,
|
|
247
|
-
marshalUpdateRouteRequest,
|
|
248
|
-
marshalUpdateVPCRequest,
|
|
249
|
-
unmarshalAclRule,
|
|
250
|
-
unmarshalAddSubnetsResponse,
|
|
251
|
-
unmarshalDeleteSubnetsResponse,
|
|
252
|
-
unmarshalGetAclResponse,
|
|
253
|
-
unmarshalListPrivateNetworksResponse,
|
|
254
|
-
unmarshalListSubnetsResponse,
|
|
255
|
-
unmarshalListVPCsResponse,
|
|
256
|
-
unmarshalPrivateNetwork,
|
|
257
|
-
unmarshalRoute,
|
|
258
|
-
unmarshalSetAclResponse,
|
|
259
|
-
unmarshalVPC
|
|
260
|
-
};
|
|
182
|
+
export { marshalAclRule, marshalAddSubnetsRequest, marshalCreatePrivateNetworkRequest, marshalCreateRouteRequest, marshalCreateVPCRequest, marshalDeleteSubnetsRequest, marshalSetAclRequest, marshalUpdatePrivateNetworkRequest, marshalUpdateRouteRequest, marshalUpdateVPCRequest, unmarshalAclRule, unmarshalAddSubnetsResponse, unmarshalDeleteSubnetsResponse, unmarshalGetAclResponse, unmarshalListPrivateNetworksResponse, unmarshalListSubnetsResponse, unmarshalListVPCsResponse, unmarshalPrivateNetwork, unmarshalRoute, unmarshalSetAclResponse, unmarshalVPC };
|
package/dist/v2/types.gen.d.ts
CHANGED
|
@@ -114,6 +114,10 @@ export interface Route {
|
|
|
114
114
|
* ID of the nexthop private network.
|
|
115
115
|
*/
|
|
116
116
|
nexthopPrivateNetworkId?: string;
|
|
117
|
+
/**
|
|
118
|
+
* ID of the nexthop VPC connector.
|
|
119
|
+
*/
|
|
120
|
+
nexthopVpcConnectorId?: string;
|
|
117
121
|
/**
|
|
118
122
|
* Date the Route was created.
|
|
119
123
|
*/
|
|
@@ -299,6 +303,10 @@ export type CreateRouteRequest = {
|
|
|
299
303
|
* ID of the nexthop private network.
|
|
300
304
|
*/
|
|
301
305
|
nexthopPrivateNetworkId?: string;
|
|
306
|
+
/**
|
|
307
|
+
* ID of the nexthop VPC Connector.
|
|
308
|
+
*/
|
|
309
|
+
nexthopVpcConnectorId?: string;
|
|
302
310
|
};
|
|
303
311
|
export type CreateVPCRequest = {
|
|
304
312
|
/**
|
|
@@ -658,6 +666,10 @@ export type UpdateRouteRequest = {
|
|
|
658
666
|
* ID of the nexthop private network.
|
|
659
667
|
*/
|
|
660
668
|
nexthopPrivateNetworkId?: string;
|
|
669
|
+
/**
|
|
670
|
+
* ID of the nexthop VPC connector.
|
|
671
|
+
*/
|
|
672
|
+
nexthopVpcConnectorId?: string;
|
|
661
673
|
};
|
|
662
674
|
export type UpdateVPCRequest = {
|
|
663
675
|
/**
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
3
|
+
AclRule: () => AclRule,
|
|
4
|
+
Route: () => Route
|
|
5
|
+
});
|
|
1
6
|
const AclRule = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
dstPortLow: {
|
|
9
|
-
lessThanOrEqual: 65536
|
|
10
|
-
},
|
|
11
|
-
srcPortHigh: {
|
|
12
|
-
lessThanOrEqual: 65536
|
|
13
|
-
},
|
|
14
|
-
srcPortLow: {
|
|
15
|
-
lessThanOrEqual: 65536
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const Route = {
|
|
19
|
-
description: {
|
|
20
|
-
maxLength: 200
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
AclRule,
|
|
25
|
-
Route
|
|
7
|
+
description: { maxLength: 200 },
|
|
8
|
+
dstPortHigh: { lessThanOrEqual: 65536 },
|
|
9
|
+
dstPortLow: { lessThanOrEqual: 65536 },
|
|
10
|
+
srcPortHigh: { lessThanOrEqual: 65536 },
|
|
11
|
+
srcPortLow: { lessThanOrEqual: 65536 }
|
|
26
12
|
};
|
|
13
|
+
const Route = { description: { maxLength: 200 } };
|
|
14
|
+
export { validation_rules_gen_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-vpc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Scaleway SDK vpc",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@scaleway/random-name": "5.1.2",
|
|
30
|
-
"@scaleway/sdk-std": "2.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|