File tree Expand file tree Collapse file tree 4 files changed +94
-0
lines changed
scaleway-async/scaleway_async/vpc/v2 Expand file tree Collapse file tree 4 files changed +94
-0
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,40 @@ async def migrate_zonal_private_networks(
647
647
self ._throw_on_error (res )
648
648
return None
649
649
650
+ async def enable_dhcp (
651
+ self ,
652
+ * ,
653
+ private_network_id : str ,
654
+ region : Optional [Region ] = None ,
655
+ ) -> PrivateNetwork :
656
+ """
657
+ Enable DHCP on a Private Network.
658
+ Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards.
659
+ :param region: Region to target. If none is passed will use default region from the config.
660
+ :param private_network_id: Private Network ID.
661
+ :return: :class:`PrivateNetwork <PrivateNetwork>`
662
+
663
+ Usage:
664
+ ::
665
+
666
+ result = await api.enable_dhcp(private_network_id="example")
667
+ """
668
+
669
+ param_region = validate_path_param (
670
+ "region" , region or self .client .default_region
671
+ )
672
+ param_private_network_id = validate_path_param (
673
+ "private_network_id" , private_network_id
674
+ )
675
+
676
+ res = self ._request (
677
+ "POST" ,
678
+ f"/vpc/v2/regions/{ param_region } /private-networks/{ param_private_network_id } /enable-dhcp" ,
679
+ )
680
+
681
+ self ._throw_on_error (res )
682
+ return unmarshal_PrivateNetwork (res .json ())
683
+
650
684
async def set_subnets (
651
685
self ,
652
686
* ,
Original file line number Diff line number Diff line change @@ -499,6 +499,19 @@ class MigrateZonalPrivateNetworksRequest:
499
499
"""
500
500
501
501
502
+ @dataclass
503
+ class EnableDHCPRequest :
504
+ region : Optional [Region ]
505
+ """
506
+ Region to target. If none is passed will use default region from the config.
507
+ """
508
+
509
+ private_network_id : str
510
+ """
511
+ Private Network ID.
512
+ """
513
+
514
+
502
515
@dataclass
503
516
class SetSubnetsRequest :
504
517
region : Optional [Region ]
Original file line number Diff line number Diff line change @@ -647,6 +647,40 @@ def migrate_zonal_private_networks(
647
647
self ._throw_on_error (res )
648
648
return None
649
649
650
+ def enable_dhcp (
651
+ self ,
652
+ * ,
653
+ private_network_id : str ,
654
+ region : Optional [Region ] = None ,
655
+ ) -> PrivateNetwork :
656
+ """
657
+ Enable DHCP on a Private Network.
658
+ Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards.
659
+ :param region: Region to target. If none is passed will use default region from the config.
660
+ :param private_network_id: Private Network ID.
661
+ :return: :class:`PrivateNetwork <PrivateNetwork>`
662
+
663
+ Usage:
664
+ ::
665
+
666
+ result = api.enable_dhcp(private_network_id="example")
667
+ """
668
+
669
+ param_region = validate_path_param (
670
+ "region" , region or self .client .default_region
671
+ )
672
+ param_private_network_id = validate_path_param (
673
+ "private_network_id" , private_network_id
674
+ )
675
+
676
+ res = self ._request (
677
+ "POST" ,
678
+ f"/vpc/v2/regions/{ param_region } /private-networks/{ param_private_network_id } /enable-dhcp" ,
679
+ )
680
+
681
+ self ._throw_on_error (res )
682
+ return unmarshal_PrivateNetwork (res .json ())
683
+
650
684
def set_subnets (
651
685
self ,
652
686
* ,
Original file line number Diff line number Diff line change @@ -499,6 +499,19 @@ class MigrateZonalPrivateNetworksRequest:
499
499
"""
500
500
501
501
502
+ @dataclass
503
+ class EnableDHCPRequest :
504
+ region : Optional [Region ]
505
+ """
506
+ Region to target. If none is passed will use default region from the config.
507
+ """
508
+
509
+ private_network_id : str
510
+ """
511
+ Private Network ID.
512
+ """
513
+
514
+
502
515
@dataclass
503
516
class SetSubnetsRequest :
504
517
region : Optional [Region ]
You can’t perform that action at this time.
0 commit comments