File tree Expand file tree Collapse file tree 8 files changed +118
-0
lines changed
scaleway-async/scaleway_async/vpc/v2 Expand file tree Collapse file tree 8 files changed +118
-0
lines changed Original file line number Diff line number Diff line change 20
20
from .types import DeleteSubnetsRequest
21
21
from .types import DeleteSubnetsResponse
22
22
from .types import DeleteVPCRequest
23
+ from .types import EnableCustomRoutesPropagationRequest
23
24
from .types import EnableDHCPRequest
24
25
from .types import EnableRoutingRequest
25
26
from .types import GetAclRequest
61
62
"DeleteSubnetsRequest" ,
62
63
"DeleteSubnetsResponse" ,
63
64
"DeleteVPCRequest" ,
65
+ "EnableCustomRoutesPropagationRequest" ,
64
66
"EnableDHCPRequest" ,
65
67
"EnableRoutingRequest" ,
66
68
"GetAclRequest" ,
Original file line number Diff line number Diff line change @@ -708,6 +708,41 @@ async def enable_routing(
708
708
self ._throw_on_error (res )
709
709
return unmarshal_VPC (res .json ())
710
710
711
+ async def enable_custom_routes_propagation (
712
+ self ,
713
+ * ,
714
+ vpc_id : str ,
715
+ region : Optional [ScwRegion ] = None ,
716
+ ) -> VPC :
717
+ """
718
+ Enable custom routes propagation on a VPC.
719
+ Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
720
+ :param vpc_id: VPC ID.
721
+ :param region: Region to target. If none is passed will use default region from the config.
722
+ :return: :class:`VPC <VPC>`
723
+
724
+ Usage:
725
+ ::
726
+
727
+ result = await api.enable_custom_routes_propagation(
728
+ vpc_id="example",
729
+ )
730
+ """
731
+
732
+ param_region = validate_path_param (
733
+ "region" , region or self .client .default_region
734
+ )
735
+ param_vpc_id = validate_path_param ("vpc_id" , vpc_id )
736
+
737
+ res = self ._request (
738
+ "POST" ,
739
+ f"/vpc/v2/regions/{ param_region } /vpcs/{ param_vpc_id } /enable-custom-routes-propagation" ,
740
+ body = {},
741
+ )
742
+
743
+ self ._throw_on_error (res )
744
+ return unmarshal_VPC (res .json ())
745
+
711
746
async def list_subnets (
712
747
self ,
713
748
* ,
Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ def unmarshal_VPC(data: Any) -> VPC:
245
245
if field is not None :
246
246
args ["routing_enabled" ] = field
247
247
248
+ field = data .get ("custom_routes_propagation_enabled" , None )
249
+ if field is not None :
250
+ args ["custom_routes_propagation_enabled" ] = field
251
+
248
252
field = data .get ("created_at" , None )
249
253
if field is not None :
250
254
args ["created_at" ] = parser .isoparse (field ) if isinstance (field , str ) else field
Original file line number Diff line number Diff line change @@ -316,6 +316,11 @@ class VPC:
316
316
Defines whether the VPC routes traffic between its Private Networks.
317
317
"""
318
318
319
+ custom_routes_propagation_enabled : bool
320
+ """
321
+ Defines whether the VPC advertises custom routes between its Private Networks.
322
+ """
323
+
319
324
created_at : Optional [datetime ]
320
325
"""
321
326
Date the VPC was created.
@@ -516,6 +521,19 @@ class DeleteVPCRequest:
516
521
"""
517
522
518
523
524
+ @dataclass
525
+ class EnableCustomRoutesPropagationRequest :
526
+ vpc_id : str
527
+ """
528
+ VPC ID.
529
+ """
530
+
531
+ region : Optional [ScwRegion ]
532
+ """
533
+ Region to target. If none is passed will use default region from the config.
534
+ """
535
+
536
+
519
537
@dataclass
520
538
class EnableDHCPRequest :
521
539
private_network_id : str
Original file line number Diff line number Diff line change 20
20
from .types import DeleteSubnetsRequest
21
21
from .types import DeleteSubnetsResponse
22
22
from .types import DeleteVPCRequest
23
+ from .types import EnableCustomRoutesPropagationRequest
23
24
from .types import EnableDHCPRequest
24
25
from .types import EnableRoutingRequest
25
26
from .types import GetAclRequest
61
62
"DeleteSubnetsRequest" ,
62
63
"DeleteSubnetsResponse" ,
63
64
"DeleteVPCRequest" ,
65
+ "EnableCustomRoutesPropagationRequest" ,
64
66
"EnableDHCPRequest" ,
65
67
"EnableRoutingRequest" ,
66
68
"GetAclRequest" ,
Original file line number Diff line number Diff line change @@ -708,6 +708,41 @@ def enable_routing(
708
708
self ._throw_on_error (res )
709
709
return unmarshal_VPC (res .json ())
710
710
711
+ def enable_custom_routes_propagation (
712
+ self ,
713
+ * ,
714
+ vpc_id : str ,
715
+ region : Optional [ScwRegion ] = None ,
716
+ ) -> VPC :
717
+ """
718
+ Enable custom routes propagation on a VPC.
719
+ Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards.
720
+ :param vpc_id: VPC ID.
721
+ :param region: Region to target. If none is passed will use default region from the config.
722
+ :return: :class:`VPC <VPC>`
723
+
724
+ Usage:
725
+ ::
726
+
727
+ result = api.enable_custom_routes_propagation(
728
+ vpc_id="example",
729
+ )
730
+ """
731
+
732
+ param_region = validate_path_param (
733
+ "region" , region or self .client .default_region
734
+ )
735
+ param_vpc_id = validate_path_param ("vpc_id" , vpc_id )
736
+
737
+ res = self ._request (
738
+ "POST" ,
739
+ f"/vpc/v2/regions/{ param_region } /vpcs/{ param_vpc_id } /enable-custom-routes-propagation" ,
740
+ body = {},
741
+ )
742
+
743
+ self ._throw_on_error (res )
744
+ return unmarshal_VPC (res .json ())
745
+
711
746
def list_subnets (
712
747
self ,
713
748
* ,
Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ def unmarshal_VPC(data: Any) -> VPC:
245
245
if field is not None :
246
246
args ["routing_enabled" ] = field
247
247
248
+ field = data .get ("custom_routes_propagation_enabled" , None )
249
+ if field is not None :
250
+ args ["custom_routes_propagation_enabled" ] = field
251
+
248
252
field = data .get ("created_at" , None )
249
253
if field is not None :
250
254
args ["created_at" ] = parser .isoparse (field ) if isinstance (field , str ) else field
Original file line number Diff line number Diff line change @@ -316,6 +316,11 @@ class VPC:
316
316
Defines whether the VPC routes traffic between its Private Networks.
317
317
"""
318
318
319
+ custom_routes_propagation_enabled : bool
320
+ """
321
+ Defines whether the VPC advertises custom routes between its Private Networks.
322
+ """
323
+
319
324
created_at : Optional [datetime ]
320
325
"""
321
326
Date the VPC was created.
@@ -516,6 +521,19 @@ class DeleteVPCRequest:
516
521
"""
517
522
518
523
524
+ @dataclass
525
+ class EnableCustomRoutesPropagationRequest :
526
+ vpc_id : str
527
+ """
528
+ VPC ID.
529
+ """
530
+
531
+ region : Optional [ScwRegion ]
532
+ """
533
+ Region to target. If none is passed will use default region from the config.
534
+ """
535
+
536
+
519
537
@dataclass
520
538
class EnableDHCPRequest :
521
539
private_network_id : str
You can’t perform that action at this time.
0 commit comments