Skip to content

Commit f89bf79

Browse files
authored
feat(lb): support dhcp/ipam private network (#268)
1 parent 7361ac0 commit f89bf79

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

scaleway-async/scaleway_async/lb/v1/marshalling.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ def unmarshal_PrivateNetworkDHCPConfig(data: Any) -> PrivateNetworkDHCPConfig:
734734

735735
args: Dict[str, Any] = {}
736736

737+
field = data.get("ip_id", None)
738+
args["ip_id"] = field
739+
737740
return PrivateNetworkDHCPConfig(**args)
738741

739742

@@ -1376,7 +1379,9 @@ def marshal_PrivateNetworkDHCPConfig(
13761379
request: PrivateNetworkDHCPConfig,
13771380
defaults: ProfileDefaults,
13781381
) -> Dict[str, Any]:
1379-
return {}
1382+
return {
1383+
"ip_id": request.ip_id,
1384+
}
13801385

13811386

13821387
def marshal_PrivateNetworkIpamConfig(

scaleway-async/scaleway_async/lb/v1/types.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,11 +1395,12 @@ class PrivateNetwork:
13951395
Object containing an array of a local IP address for the Load Balancer on this Private Network.
13961396
13971397
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
1398+
:deprecated
13981399
"""
13991400

14001401
dhcp_config: Optional[PrivateNetworkDHCPConfig]
14011402
"""
1402-
Defines whether to let DHCP assign IP addresses.
1403+
Object containing DHCP-assigned IP addresses.
14031404
14041405
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
14051406
"""
@@ -1409,6 +1410,7 @@ class PrivateNetwork:
14091410
For internal use only.
14101411
14111412
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
1413+
:deprecated
14121414
"""
14131415

14141416
private_network_id: str
@@ -1434,7 +1436,7 @@ class PrivateNetwork:
14341436

14351437
@dataclass
14361438
class PrivateNetworkDHCPConfig:
1437-
pass
1439+
ip_id: str
14381440

14391441

14401442
@dataclass
@@ -1448,9 +1450,10 @@ class PrivateNetworkStaticConfig:
14481450
Private network. static config.
14491451
"""
14501452

1451-
ip_address: List[str]
1453+
ip_address: Optional[List[str]]
14521454
"""
14531455
Array of a local IP address for the Load Balancer on this Private Network.
1456+
:deprecated
14541457
"""
14551458

14561459

@@ -3088,6 +3091,7 @@ class AttachPrivateNetworkRequest:
30883091
Object containing an array of a local IP address for the Load Balancer on this Private Network.
30893092
30903093
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
3094+
:deprecated
30913095
"""
30923096

30933097
dhcp_config: Optional[PrivateNetworkDHCPConfig]
@@ -3102,6 +3106,7 @@ class AttachPrivateNetworkRequest:
31023106
For internal use only.
31033107
31043108
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
3109+
:deprecated
31053110
"""
31063111

31073112

@@ -4642,6 +4647,7 @@ class ZonedApiAttachPrivateNetworkRequest:
46424647
Object containing an array of a local IP address for the Load Balancer on this Private Network.
46434648
46444649
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
4650+
:deprecated
46454651
"""
46464652

46474653
dhcp_config: Optional[PrivateNetworkDHCPConfig]
@@ -4656,6 +4662,7 @@ class ZonedApiAttachPrivateNetworkRequest:
46564662
For internal use only.
46574663
46584664
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
4665+
:deprecated
46594666
"""
46604667

46614668

scaleway/scaleway/lb/v1/marshalling.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@ def unmarshal_PrivateNetworkDHCPConfig(data: Any) -> PrivateNetworkDHCPConfig:
734734

735735
args: Dict[str, Any] = {}
736736

737+
field = data.get("ip_id", None)
738+
args["ip_id"] = field
739+
737740
return PrivateNetworkDHCPConfig(**args)
738741

739742

@@ -1376,7 +1379,9 @@ def marshal_PrivateNetworkDHCPConfig(
13761379
request: PrivateNetworkDHCPConfig,
13771380
defaults: ProfileDefaults,
13781381
) -> Dict[str, Any]:
1379-
return {}
1382+
return {
1383+
"ip_id": request.ip_id,
1384+
}
13801385

13811386

13821387
def marshal_PrivateNetworkIpamConfig(

scaleway/scaleway/lb/v1/types.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,11 +1395,12 @@ class PrivateNetwork:
13951395
Object containing an array of a local IP address for the Load Balancer on this Private Network.
13961396
13971397
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
1398+
:deprecated
13981399
"""
13991400

14001401
dhcp_config: Optional[PrivateNetworkDHCPConfig]
14011402
"""
1402-
Defines whether to let DHCP assign IP addresses.
1403+
Object containing DHCP-assigned IP addresses.
14031404
14041405
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
14051406
"""
@@ -1409,6 +1410,7 @@ class PrivateNetwork:
14091410
For internal use only.
14101411
14111412
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
1413+
:deprecated
14121414
"""
14131415

14141416
private_network_id: str
@@ -1434,7 +1436,7 @@ class PrivateNetwork:
14341436

14351437
@dataclass
14361438
class PrivateNetworkDHCPConfig:
1437-
pass
1439+
ip_id: str
14381440

14391441

14401442
@dataclass
@@ -1448,9 +1450,10 @@ class PrivateNetworkStaticConfig:
14481450
Private network. static config.
14491451
"""
14501452

1451-
ip_address: List[str]
1453+
ip_address: Optional[List[str]]
14521454
"""
14531455
Array of a local IP address for the Load Balancer on this Private Network.
1456+
:deprecated
14541457
"""
14551458

14561459

@@ -3088,6 +3091,7 @@ class AttachPrivateNetworkRequest:
30883091
Object containing an array of a local IP address for the Load Balancer on this Private Network.
30893092
30903093
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
3094+
:deprecated
30913095
"""
30923096

30933097
dhcp_config: Optional[PrivateNetworkDHCPConfig]
@@ -3102,6 +3106,7 @@ class AttachPrivateNetworkRequest:
31023106
For internal use only.
31033107
31043108
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
3109+
:deprecated
31053110
"""
31063111

31073112

@@ -4642,6 +4647,7 @@ class ZonedApiAttachPrivateNetworkRequest:
46424647
Object containing an array of a local IP address for the Load Balancer on this Private Network.
46434648
46444649
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
4650+
:deprecated
46454651
"""
46464652

46474653
dhcp_config: Optional[PrivateNetworkDHCPConfig]
@@ -4656,6 +4662,7 @@ class ZonedApiAttachPrivateNetworkRequest:
46564662
For internal use only.
46574663
46584664
One-of ('config'): at most one of 'static_config', 'dhcp_config', 'ipam_config' could be set.
4665+
:deprecated
46594666
"""
46604667

46614668

0 commit comments

Comments
 (0)