File tree Expand file tree Collapse file tree 6 files changed +94
-0
lines changed
scaleway-async/scaleway_async/vpc/v2 Expand file tree Collapse file tree 6 files changed +94
-0
lines changed Original file line number Diff line number Diff line change 1414from .types import DeleteSubnetsResponse
1515from .types import DeleteVPCRequest
1616from .types import EnableDHCPRequest
17+ from .types import EnableRoutingRequest
1718from .types import GetPrivateNetworkRequest
1819from .types import GetVPCRequest
1920from .types import ListPrivateNetworksRequest
4243 "DeleteSubnetsResponse" ,
4344 "DeleteVPCRequest" ,
4445 "EnableDHCPRequest" ,
46+ "EnableRoutingRequest" ,
4547 "GetPrivateNetworkRequest" ,
4648 "GetVPCRequest" ,
4749 "ListPrivateNetworksRequest" ,
Original file line number Diff line number Diff line change @@ -697,6 +697,41 @@ async def enable_dhcp(
697697 self ._throw_on_error (res )
698698 return unmarshal_PrivateNetwork (res .json ())
699699
700+ async def enable_routing (
701+ self ,
702+ * ,
703+ vpc_id : str ,
704+ region : Optional [Region ] = None ,
705+ ) -> VPC :
706+ """
707+ Enable routing on a VPC.
708+ Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
709+ :param vpc_id:
710+ :param region: Region to target. If none is passed will use default region from the config.
711+ :return: :class:`VPC <VPC>`
712+
713+ Usage:
714+ ::
715+
716+ result = await api.enable_routing(
717+ vpc_id="example",
718+ )
719+ """
720+
721+ param_region = validate_path_param (
722+ "region" , region or self .client .default_region
723+ )
724+ param_vpc_id = validate_path_param ("vpc_id" , vpc_id )
725+
726+ res = self ._request (
727+ "POST" ,
728+ f"/vpc/v2/regions/{ param_region } /vpcs/{ param_vpc_id } /enable-routing" ,
729+ body = {},
730+ )
731+
732+ self ._throw_on_error (res )
733+ return unmarshal_VPC (res .json ())
734+
700735 async def set_subnets (
701736 self ,
702737 * ,
Original file line number Diff line number Diff line change @@ -320,6 +320,16 @@ class EnableDHCPRequest:
320320 """
321321
322322
323+ @dataclass
324+ class EnableRoutingRequest :
325+ vpc_id : str
326+
327+ region : Optional [Region ]
328+ """
329+ Region to target. If none is passed will use default region from the config.
330+ """
331+
332+
323333@dataclass
324334class GetPrivateNetworkRequest :
325335 private_network_id : str
Original file line number Diff line number Diff line change 1414from .types import DeleteSubnetsResponse
1515from .types import DeleteVPCRequest
1616from .types import EnableDHCPRequest
17+ from .types import EnableRoutingRequest
1718from .types import GetPrivateNetworkRequest
1819from .types import GetVPCRequest
1920from .types import ListPrivateNetworksRequest
4243 "DeleteSubnetsResponse" ,
4344 "DeleteVPCRequest" ,
4445 "EnableDHCPRequest" ,
46+ "EnableRoutingRequest" ,
4547 "GetPrivateNetworkRequest" ,
4648 "GetVPCRequest" ,
4749 "ListPrivateNetworksRequest" ,
Original file line number Diff line number Diff line change @@ -697,6 +697,41 @@ def enable_dhcp(
697697 self ._throw_on_error (res )
698698 return unmarshal_PrivateNetwork (res .json ())
699699
700+ def enable_routing (
701+ self ,
702+ * ,
703+ vpc_id : str ,
704+ region : Optional [Region ] = None ,
705+ ) -> VPC :
706+ """
707+ Enable routing on a VPC.
708+ Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards.
709+ :param vpc_id:
710+ :param region: Region to target. If none is passed will use default region from the config.
711+ :return: :class:`VPC <VPC>`
712+
713+ Usage:
714+ ::
715+
716+ result = api.enable_routing(
717+ vpc_id="example",
718+ )
719+ """
720+
721+ param_region = validate_path_param (
722+ "region" , region or self .client .default_region
723+ )
724+ param_vpc_id = validate_path_param ("vpc_id" , vpc_id )
725+
726+ res = self ._request (
727+ "POST" ,
728+ f"/vpc/v2/regions/{ param_region } /vpcs/{ param_vpc_id } /enable-routing" ,
729+ body = {},
730+ )
731+
732+ self ._throw_on_error (res )
733+ return unmarshal_VPC (res .json ())
734+
700735 def set_subnets (
701736 self ,
702737 * ,
Original file line number Diff line number Diff line change @@ -320,6 +320,16 @@ class EnableDHCPRequest:
320320 """
321321
322322
323+ @dataclass
324+ class EnableRoutingRequest :
325+ vpc_id : str
326+
327+ region : Optional [Region ]
328+ """
329+ Region to target. If none is passed will use default region from the config.
330+ """
331+
332+
323333@dataclass
324334class GetPrivateNetworkRequest :
325335 private_network_id : str
You can’t perform that action at this time.
0 commit comments