@scaleway/sdk-vpc 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,648 @@
1
+ import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
+ export type AclRuleProtocol = 'ANY' | 'TCP' | 'UDP' | 'ICMP';
3
+ export type Action = 'unknown_action' | 'accept' | 'drop';
4
+ export type ListPrivateNetworksRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
5
+ export type ListSubnetsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
6
+ export type ListVPCsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
7
+ export interface Subnet {
8
+ /**
9
+ * ID of the subnet.
10
+ */
11
+ id: string;
12
+ /**
13
+ * Subnet creation date.
14
+ */
15
+ createdAt?: Date;
16
+ /**
17
+ * Subnet last modification date.
18
+ */
19
+ updatedAt?: Date;
20
+ /**
21
+ * Subnet CIDR.
22
+ */
23
+ subnet: string;
24
+ /**
25
+ * Scaleway Project the subnet belongs to.
26
+ */
27
+ projectId: string;
28
+ /**
29
+ * Private Network the subnet belongs to.
30
+ */
31
+ privateNetworkId: string;
32
+ /**
33
+ * VPC the subnet belongs to.
34
+ */
35
+ vpcId: string;
36
+ }
37
+ export interface PrivateNetwork {
38
+ /**
39
+ * Private Network ID.
40
+ */
41
+ id: string;
42
+ /**
43
+ * Private Network name.
44
+ */
45
+ name: string;
46
+ /**
47
+ * Scaleway Organization the Private Network belongs to.
48
+ */
49
+ organizationId: string;
50
+ /**
51
+ * Scaleway Project the Private Network belongs to.
52
+ */
53
+ projectId: string;
54
+ /**
55
+ * Region in which the Private Network is available.
56
+ */
57
+ region: ScwRegion;
58
+ /**
59
+ * Tags of the Private Network.
60
+ */
61
+ tags: string[];
62
+ /**
63
+ * Date the Private Network was created.
64
+ */
65
+ createdAt?: Date;
66
+ /**
67
+ * Date the Private Network was last modified.
68
+ */
69
+ updatedAt?: Date;
70
+ /**
71
+ * Private Network subnets.
72
+ */
73
+ subnets: Subnet[];
74
+ /**
75
+ * VPC the Private Network belongs to.
76
+ */
77
+ vpcId: string;
78
+ /**
79
+ * Defines whether managed DHCP is enabled for this Private Network.
80
+ */
81
+ dhcpEnabled: boolean;
82
+ }
83
+ export interface Route {
84
+ /**
85
+ * Route ID.
86
+ */
87
+ id: string;
88
+ /**
89
+ * Route description.
90
+ */
91
+ description: string;
92
+ /**
93
+ * Tags of the Route.
94
+ */
95
+ tags: string[];
96
+ /**
97
+ * VPC the Route belongs to.
98
+ */
99
+ vpcId: string;
100
+ /**
101
+ * Destination of the Route.
102
+ */
103
+ destination: string;
104
+ /**
105
+ * ID of the nexthop resource.
106
+ */
107
+ nexthopResourceId?: string;
108
+ /**
109
+ * ID of the nexthop private network.
110
+ */
111
+ nexthopPrivateNetworkId?: string;
112
+ /**
113
+ * Date the Route was created.
114
+ */
115
+ createdAt?: Date;
116
+ /**
117
+ * Date the Route was last modified.
118
+ */
119
+ updatedAt?: Date;
120
+ /**
121
+ * Defines whether the route can be modified or deleted by the user.
122
+ */
123
+ isReadOnly: boolean;
124
+ /**
125
+ * Region of the Route.
126
+ */
127
+ region: ScwRegion;
128
+ }
129
+ export interface AclRule {
130
+ /**
131
+ * Protocol to which this rule applies.
132
+ */
133
+ protocol: AclRuleProtocol;
134
+ /**
135
+ * Source IP range to which this rule applies (CIDR notation with subnet mask).
136
+ */
137
+ source: string;
138
+ /**
139
+ * Starting port of the source port range to which this rule applies (inclusive).
140
+ */
141
+ srcPortLow: number;
142
+ /**
143
+ * Ending port of the source port range to which this rule applies (inclusive).
144
+ */
145
+ srcPortHigh: number;
146
+ /**
147
+ * Destination IP range to which this rule applies (CIDR notation with subnet mask).
148
+ */
149
+ destination: string;
150
+ /**
151
+ * Starting port of the destination port range to which this rule applies (inclusive).
152
+ */
153
+ dstPortLow: number;
154
+ /**
155
+ * Ending port of the destination port range to which this rule applies (inclusive).
156
+ */
157
+ dstPortHigh: number;
158
+ /**
159
+ * Policy to apply to the packet.
160
+ */
161
+ action: Action;
162
+ /**
163
+ * Rule description.
164
+ */
165
+ description?: string;
166
+ }
167
+ export interface VPC {
168
+ /**
169
+ * VPC ID.
170
+ */
171
+ id: string;
172
+ /**
173
+ * VPC name.
174
+ */
175
+ name: string;
176
+ /**
177
+ * Scaleway Organization the VPC belongs to.
178
+ */
179
+ organizationId: string;
180
+ /**
181
+ * Scaleway Project the VPC belongs to.
182
+ */
183
+ projectId: string;
184
+ /**
185
+ * Region of the VPC.
186
+ */
187
+ region: ScwRegion;
188
+ /**
189
+ * Tags for the VPC.
190
+ */
191
+ tags: string[];
192
+ /**
193
+ * Defines whether the VPC is the default one for its Project.
194
+ */
195
+ isDefault: boolean;
196
+ /**
197
+ * Date the VPC was created.
198
+ */
199
+ createdAt?: Date;
200
+ /**
201
+ * Date the VPC was last modified.
202
+ */
203
+ updatedAt?: Date;
204
+ /**
205
+ * Number of Private Networks within this VPC.
206
+ */
207
+ privateNetworkCount: number;
208
+ /**
209
+ * Defines whether the VPC routes traffic between its Private Networks.
210
+ */
211
+ routingEnabled: boolean;
212
+ }
213
+ export type AddSubnetsRequest = {
214
+ /**
215
+ * Region to target. If none is passed will use default region from the config.
216
+ */
217
+ region?: ScwRegion;
218
+ /**
219
+ * Private Network ID.
220
+ */
221
+ privateNetworkId: string;
222
+ /**
223
+ * Private Network subnets CIDR.
224
+ */
225
+ subnets?: string[];
226
+ };
227
+ export interface AddSubnetsResponse {
228
+ subnets: string[];
229
+ }
230
+ export type CreatePrivateNetworkRequest = {
231
+ /**
232
+ * Region to target. If none is passed will use default region from the config.
233
+ */
234
+ region?: ScwRegion;
235
+ /**
236
+ * Name for the Private Network.
237
+ */
238
+ name?: string;
239
+ /**
240
+ * Scaleway Project in which to create the Private Network.
241
+ */
242
+ projectId?: string;
243
+ /**
244
+ * Tags for the Private Network.
245
+ */
246
+ tags?: string[];
247
+ /**
248
+ * Private Network subnets CIDR.
249
+ */
250
+ subnets?: string[];
251
+ /**
252
+ * VPC in which to create the Private Network.
253
+ */
254
+ vpcId?: string;
255
+ };
256
+ export type CreateRouteRequest = {
257
+ /**
258
+ * Region to target. If none is passed will use default region from the config.
259
+ */
260
+ region?: ScwRegion;
261
+ /**
262
+ * Route description.
263
+ */
264
+ description: string;
265
+ /**
266
+ * Tags of the Route.
267
+ */
268
+ tags?: string[];
269
+ /**
270
+ * VPC the Route belongs to.
271
+ */
272
+ vpcId: string;
273
+ /**
274
+ * Destination of the Route.
275
+ */
276
+ destination: string;
277
+ /**
278
+ * ID of the nexthop resource.
279
+ */
280
+ nexthopResourceId?: string;
281
+ /**
282
+ * ID of the nexthop private network.
283
+ */
284
+ nexthopPrivateNetworkId?: string;
285
+ };
286
+ export type CreateVPCRequest = {
287
+ /**
288
+ * Region to target. If none is passed will use default region from the config.
289
+ */
290
+ region?: ScwRegion;
291
+ /**
292
+ * Name for the VPC.
293
+ */
294
+ name?: string;
295
+ /**
296
+ * Scaleway Project in which to create the VPC.
297
+ */
298
+ projectId?: string;
299
+ /**
300
+ * Tags for the VPC.
301
+ */
302
+ tags?: string[];
303
+ /**
304
+ * Enable routing between Private Networks in the VPC.
305
+ */
306
+ enableRouting: boolean;
307
+ };
308
+ export type DeletePrivateNetworkRequest = {
309
+ /**
310
+ * Region to target. If none is passed will use default region from the config.
311
+ */
312
+ region?: ScwRegion;
313
+ /**
314
+ * Private Network ID.
315
+ */
316
+ privateNetworkId: string;
317
+ };
318
+ export type DeleteRouteRequest = {
319
+ /**
320
+ * Region to target. If none is passed will use default region from the config.
321
+ */
322
+ region?: ScwRegion;
323
+ /**
324
+ * Route ID.
325
+ */
326
+ routeId: string;
327
+ };
328
+ export type DeleteSubnetsRequest = {
329
+ /**
330
+ * Region to target. If none is passed will use default region from the config.
331
+ */
332
+ region?: ScwRegion;
333
+ /**
334
+ * Private Network ID.
335
+ */
336
+ privateNetworkId: string;
337
+ /**
338
+ * Private Network subnets CIDR.
339
+ */
340
+ subnets?: string[];
341
+ };
342
+ export interface DeleteSubnetsResponse {
343
+ subnets: string[];
344
+ }
345
+ export type DeleteVPCRequest = {
346
+ /**
347
+ * Region to target. If none is passed will use default region from the config.
348
+ */
349
+ region?: ScwRegion;
350
+ /**
351
+ * VPC ID.
352
+ */
353
+ vpcId: string;
354
+ };
355
+ export type EnableDHCPRequest = {
356
+ /**
357
+ * Region to target. If none is passed will use default region from the config.
358
+ */
359
+ region?: ScwRegion;
360
+ /**
361
+ * Private Network ID.
362
+ */
363
+ privateNetworkId: string;
364
+ };
365
+ export type EnableRoutingRequest = {
366
+ /**
367
+ * Region to target. If none is passed will use default region from the config.
368
+ */
369
+ region?: ScwRegion;
370
+ /**
371
+ * VPC ID.
372
+ */
373
+ vpcId: string;
374
+ };
375
+ export type GetAclRequest = {
376
+ /**
377
+ * Region to target. If none is passed will use default region from the config.
378
+ */
379
+ region?: ScwRegion;
380
+ /**
381
+ * ID of the Network ACL's VPC.
382
+ */
383
+ vpcId: string;
384
+ /**
385
+ * Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
386
+ */
387
+ isIpv6: boolean;
388
+ };
389
+ export interface GetAclResponse {
390
+ rules: AclRule[];
391
+ defaultPolicy: Action;
392
+ }
393
+ export type GetPrivateNetworkRequest = {
394
+ /**
395
+ * Region to target. If none is passed will use default region from the config.
396
+ */
397
+ region?: ScwRegion;
398
+ /**
399
+ * Private Network ID.
400
+ */
401
+ privateNetworkId: string;
402
+ };
403
+ export type GetRouteRequest = {
404
+ /**
405
+ * Region to target. If none is passed will use default region from the config.
406
+ */
407
+ region?: ScwRegion;
408
+ /**
409
+ * Route ID.
410
+ */
411
+ routeId: string;
412
+ };
413
+ export type GetVPCRequest = {
414
+ /**
415
+ * Region to target. If none is passed will use default region from the config.
416
+ */
417
+ region?: ScwRegion;
418
+ /**
419
+ * VPC ID.
420
+ */
421
+ vpcId: string;
422
+ };
423
+ export type ListPrivateNetworksRequest = {
424
+ /**
425
+ * Region to target. If none is passed will use default region from the config.
426
+ */
427
+ region?: ScwRegion;
428
+ /**
429
+ * Sort order of the returned Private Networks.
430
+ */
431
+ orderBy?: ListPrivateNetworksRequestOrderBy;
432
+ /**
433
+ * Page number to return, from the paginated results.
434
+ */
435
+ page?: number;
436
+ /**
437
+ * Maximum number of Private Networks to return per page.
438
+ */
439
+ pageSize?: number;
440
+ /**
441
+ * Name to filter for. Only Private Networks with names containing this string will be returned.
442
+ */
443
+ name?: string;
444
+ /**
445
+ * Tags to filter for. Only Private Networks with one or more matching tags will be returned.
446
+ */
447
+ tags?: string[];
448
+ /**
449
+ * Organization ID to filter for. Only Private Networks belonging to this Organization will be returned.
450
+ */
451
+ organizationId?: string;
452
+ /**
453
+ * Project ID to filter for. Only Private Networks belonging to this Project will be returned.
454
+ */
455
+ projectId?: string;
456
+ /**
457
+ * Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.
458
+ */
459
+ privateNetworkIds?: string[];
460
+ /**
461
+ * VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
462
+ */
463
+ vpcId?: string;
464
+ /**
465
+ * DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
466
+ */
467
+ dhcpEnabled?: boolean;
468
+ };
469
+ export interface ListPrivateNetworksResponse {
470
+ privateNetworks: PrivateNetwork[];
471
+ totalCount: number;
472
+ }
473
+ export type ListSubnetsRequest = {
474
+ /**
475
+ * Region to target. If none is passed will use default region from the config.
476
+ */
477
+ region?: ScwRegion;
478
+ /**
479
+ * Sort order of the returned subnets.
480
+ */
481
+ orderBy?: ListSubnetsRequestOrderBy;
482
+ /**
483
+ * Page number to return, from the paginated results.
484
+ */
485
+ page?: number;
486
+ /**
487
+ * Maximum number of Private Networks to return per page.
488
+ */
489
+ pageSize?: number;
490
+ /**
491
+ * Organization ID to filter for. Only subnets belonging to this Organization will be returned.
492
+ */
493
+ organizationId?: string;
494
+ /**
495
+ * Project ID to filter for. Only subnets belonging to this Project will be returned.
496
+ */
497
+ projectId?: string;
498
+ /**
499
+ * Subnet IDs to filter for. Only subnets matching the specified IDs will be returned.
500
+ */
501
+ subnetIds?: string[];
502
+ /**
503
+ * VPC ID to filter for. Only subnets belonging to this VPC will be returned.
504
+ */
505
+ vpcId?: string;
506
+ };
507
+ export interface ListSubnetsResponse {
508
+ subnets: Subnet[];
509
+ totalCount: number;
510
+ }
511
+ export type ListVPCsRequest = {
512
+ /**
513
+ * Region to target. If none is passed will use default region from the config.
514
+ */
515
+ region?: ScwRegion;
516
+ /**
517
+ * Sort order of the returned VPCs.
518
+ */
519
+ orderBy?: ListVPCsRequestOrderBy;
520
+ /**
521
+ * Page number to return, from the paginated results.
522
+ */
523
+ page?: number;
524
+ /**
525
+ * Maximum number of VPCs to return per page.
526
+ */
527
+ pageSize?: number;
528
+ /**
529
+ * Name to filter for. Only VPCs with names containing this string will be returned.
530
+ */
531
+ name?: string;
532
+ /**
533
+ * Tags to filter for. Only VPCs with one or more matching tags will be returned.
534
+ */
535
+ tags?: string[];
536
+ /**
537
+ * Organization ID to filter for. Only VPCs belonging to this Organization will be returned.
538
+ */
539
+ organizationId?: string;
540
+ /**
541
+ * Project ID to filter for. Only VPCs belonging to this Project will be returned.
542
+ */
543
+ projectId?: string;
544
+ /**
545
+ * Defines whether to filter only for VPCs which are the default one for their Project.
546
+ */
547
+ isDefault?: boolean;
548
+ /**
549
+ * Defines whether to filter only for VPCs which route traffic between their Private Networks.
550
+ */
551
+ routingEnabled?: boolean;
552
+ };
553
+ export interface ListVPCsResponse {
554
+ vpcs: VPC[];
555
+ totalCount: number;
556
+ }
557
+ export type SetAclRequest = {
558
+ /**
559
+ * Region to target. If none is passed will use default region from the config.
560
+ */
561
+ region?: ScwRegion;
562
+ /**
563
+ * ID of the Network ACL's VPC.
564
+ */
565
+ vpcId: string;
566
+ /**
567
+ * List of Network ACL rules.
568
+ */
569
+ rules: AclRule[];
570
+ /**
571
+ * Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
572
+ */
573
+ isIpv6: boolean;
574
+ /**
575
+ * Action to take for packets which do not match any rules.
576
+ */
577
+ defaultPolicy: Action;
578
+ };
579
+ export interface SetAclResponse {
580
+ rules: AclRule[];
581
+ defaultPolicy: Action;
582
+ }
583
+ export type UpdatePrivateNetworkRequest = {
584
+ /**
585
+ * Region to target. If none is passed will use default region from the config.
586
+ */
587
+ region?: ScwRegion;
588
+ /**
589
+ * Private Network ID.
590
+ */
591
+ privateNetworkId: string;
592
+ /**
593
+ * Name for the Private Network.
594
+ */
595
+ name?: string;
596
+ /**
597
+ * Tags for the Private Network.
598
+ */
599
+ tags?: string[];
600
+ };
601
+ export type UpdateRouteRequest = {
602
+ /**
603
+ * Region to target. If none is passed will use default region from the config.
604
+ */
605
+ region?: ScwRegion;
606
+ /**
607
+ * Route ID.
608
+ */
609
+ routeId: string;
610
+ /**
611
+ * Route description.
612
+ */
613
+ description?: string;
614
+ /**
615
+ * Tags of the Route.
616
+ */
617
+ tags?: string[];
618
+ /**
619
+ * Destination of the Route.
620
+ */
621
+ destination?: string;
622
+ /**
623
+ * ID of the nexthop resource.
624
+ */
625
+ nexthopResourceId?: string;
626
+ /**
627
+ * ID of the nexthop private network.
628
+ */
629
+ nexthopPrivateNetworkId?: string;
630
+ };
631
+ export type UpdateVPCRequest = {
632
+ /**
633
+ * Region to target. If none is passed will use default region from the config.
634
+ */
635
+ region?: ScwRegion;
636
+ /**
637
+ * VPC ID.
638
+ */
639
+ vpcId: string;
640
+ /**
641
+ * Name for the VPC.
642
+ */
643
+ name?: string;
644
+ /**
645
+ * Tags for the VPC.
646
+ */
647
+ tags?: string[];
648
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const AclRule = {
4
+ description: {
5
+ maxLength: 200
6
+ },
7
+ dstPortHigh: {
8
+ lessThanOrEqual: 65536
9
+ },
10
+ dstPortLow: {
11
+ lessThanOrEqual: 65536
12
+ },
13
+ srcPortHigh: {
14
+ lessThanOrEqual: 65536
15
+ },
16
+ srcPortLow: {
17
+ lessThanOrEqual: 65536
18
+ }
19
+ };
20
+ const Route = {
21
+ description: {
22
+ maxLength: 200
23
+ }
24
+ };
25
+ exports.AclRule = AclRule;
26
+ exports.Route = Route;
@@ -0,0 +1,22 @@
1
+ export declare const AclRule: {
2
+ description: {
3
+ maxLength: number;
4
+ };
5
+ dstPortHigh: {
6
+ lessThanOrEqual: number;
7
+ };
8
+ dstPortLow: {
9
+ lessThanOrEqual: number;
10
+ };
11
+ srcPortHigh: {
12
+ lessThanOrEqual: number;
13
+ };
14
+ srcPortLow: {
15
+ lessThanOrEqual: number;
16
+ };
17
+ };
18
+ export declare const Route: {
19
+ description: {
20
+ maxLength: number;
21
+ };
22
+ };
@@ -0,0 +1,26 @@
1
+ const AclRule = {
2
+ description: {
3
+ maxLength: 200
4
+ },
5
+ dstPortHigh: {
6
+ lessThanOrEqual: 65536
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
26
+ };