File tree 6 files changed +94
-0
lines changed
scaleway-async/scaleway_async/vpc/v2 6 files changed +94
-0
lines changed Original file line number Diff line number Diff line change 14
14
from .types import DeleteSubnetsResponse
15
15
from .types import DeleteVPCRequest
16
16
from .types import EnableDHCPRequest
17
+ from .types import EnableRoutingRequest
17
18
from .types import GetPrivateNetworkRequest
18
19
from .types import GetVPCRequest
19
20
from .types import ListPrivateNetworksRequest
42
43
"DeleteSubnetsResponse" ,
43
44
"DeleteVPCRequest" ,
44
45
"EnableDHCPRequest" ,
46
+ "EnableRoutingRequest" ,
45
47
"GetPrivateNetworkRequest" ,
46
48
"GetVPCRequest" ,
47
49
"ListPrivateNetworksRequest" ,
Original file line number Diff line number Diff line change @@ -697,6 +697,41 @@ async def enable_dhcp(
697
697
self ._throw_on_error (res )
698
698
return unmarshal_PrivateNetwork (res .json ())
699
699
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
+
700
735
async def set_subnets (
701
736
self ,
702
737
* ,
Original file line number Diff line number Diff line change @@ -320,6 +320,16 @@ class EnableDHCPRequest:
320
320
"""
321
321
322
322
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
+
323
333
@dataclass
324
334
class GetPrivateNetworkRequest :
325
335
private_network_id : str
Original file line number Diff line number Diff line change 14
14
from .types import DeleteSubnetsResponse
15
15
from .types import DeleteVPCRequest
16
16
from .types import EnableDHCPRequest
17
+ from .types import EnableRoutingRequest
17
18
from .types import GetPrivateNetworkRequest
18
19
from .types import GetVPCRequest
19
20
from .types import ListPrivateNetworksRequest
42
43
"DeleteSubnetsResponse" ,
43
44
"DeleteVPCRequest" ,
44
45
"EnableDHCPRequest" ,
46
+ "EnableRoutingRequest" ,
45
47
"GetPrivateNetworkRequest" ,
46
48
"GetVPCRequest" ,
47
49
"ListPrivateNetworksRequest" ,
Original file line number Diff line number Diff line change @@ -697,6 +697,41 @@ def enable_dhcp(
697
697
self ._throw_on_error (res )
698
698
return unmarshal_PrivateNetwork (res .json ())
699
699
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
+
700
735
def set_subnets (
701
736
self ,
702
737
* ,
Original file line number Diff line number Diff line change @@ -320,6 +320,16 @@ class EnableDHCPRequest:
320
320
"""
321
321
322
322
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
+
323
333
@dataclass
324
334
class GetPrivateNetworkRequest :
325
335
private_network_id : str
You can’t perform that action at this time.
0 commit comments