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 2020from .types import DeleteSubnetsRequest
2121from .types import DeleteSubnetsResponse
2222from .types import DeleteVPCRequest
23+ from .types import EnableCustomRoutesPropagationRequest
2324from .types import EnableDHCPRequest
2425from .types import EnableRoutingRequest
2526from .types import GetAclRequest
6162 "DeleteSubnetsRequest" ,
6263 "DeleteSubnetsResponse" ,
6364 "DeleteVPCRequest" ,
65+ "EnableCustomRoutesPropagationRequest" ,
6466 "EnableDHCPRequest" ,
6567 "EnableRoutingRequest" ,
6668 "GetAclRequest" ,
Original file line number Diff line number Diff line change @@ -708,6 +708,41 @@ async def enable_routing(
708708 self ._throw_on_error (res )
709709 return unmarshal_VPC (res .json ())
710710
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+
711746 async def list_subnets (
712747 self ,
713748 * ,
Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ def unmarshal_VPC(data: Any) -> VPC:
245245 if field is not None :
246246 args ["routing_enabled" ] = field
247247
248+ field = data .get ("custom_routes_propagation_enabled" , None )
249+ if field is not None :
250+ args ["custom_routes_propagation_enabled" ] = field
251+
248252 field = data .get ("created_at" , None )
249253 if field is not None :
250254 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:
316316 Defines whether the VPC routes traffic between its Private Networks.
317317 """
318318
319+ custom_routes_propagation_enabled : bool
320+ """
321+ Defines whether the VPC advertises custom routes between its Private Networks.
322+ """
323+
319324 created_at : Optional [datetime ]
320325 """
321326 Date the VPC was created.
@@ -516,6 +521,19 @@ class DeleteVPCRequest:
516521 """
517522
518523
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+
519537@dataclass
520538class EnableDHCPRequest :
521539 private_network_id : str
Original file line number Diff line number Diff line change 2020from .types import DeleteSubnetsRequest
2121from .types import DeleteSubnetsResponse
2222from .types import DeleteVPCRequest
23+ from .types import EnableCustomRoutesPropagationRequest
2324from .types import EnableDHCPRequest
2425from .types import EnableRoutingRequest
2526from .types import GetAclRequest
6162 "DeleteSubnetsRequest" ,
6263 "DeleteSubnetsResponse" ,
6364 "DeleteVPCRequest" ,
65+ "EnableCustomRoutesPropagationRequest" ,
6466 "EnableDHCPRequest" ,
6567 "EnableRoutingRequest" ,
6668 "GetAclRequest" ,
Original file line number Diff line number Diff line change @@ -708,6 +708,41 @@ def enable_routing(
708708 self ._throw_on_error (res )
709709 return unmarshal_VPC (res .json ())
710710
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+
711746 def list_subnets (
712747 self ,
713748 * ,
Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ def unmarshal_VPC(data: Any) -> VPC:
245245 if field is not None :
246246 args ["routing_enabled" ] = field
247247
248+ field = data .get ("custom_routes_propagation_enabled" , None )
249+ if field is not None :
250+ args ["custom_routes_propagation_enabled" ] = field
251+
248252 field = data .get ("created_at" , None )
249253 if field is not None :
250254 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:
316316 Defines whether the VPC routes traffic between its Private Networks.
317317 """
318318
319+ custom_routes_propagation_enabled : bool
320+ """
321+ Defines whether the VPC advertises custom routes between its Private Networks.
322+ """
323+
319324 created_at : Optional [datetime ]
320325 """
321326 Date the VPC was created.
@@ -516,6 +521,19 @@ class DeleteVPCRequest:
516521 """
517522
518523
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+
519537@dataclass
520538class EnableDHCPRequest :
521539 private_network_id : str
You can’t perform that action at this time.
0 commit comments