Skip to content

Commit 1eb5131

Browse files
authored
feat(vpc): add dhcp_enabled field in private network message (#233)
1 parent e175c43 commit 1eb5131

File tree

6 files changed

+38
-0
lines changed

6 files changed

+38
-0
lines changed

scaleway-async/scaleway_async/vpc/v2/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ async def list_private_networks(
331331
project_id: Optional[str] = None,
332332
private_network_ids: Optional[List[str]] = None,
333333
vpc_id: Optional[str] = None,
334+
dhcp_enabled: Optional[bool] = None,
334335
) -> ListPrivateNetworksResponse:
335336
"""
336337
List Private Networks.
@@ -345,6 +346,7 @@ async def list_private_networks(
345346
:param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned.
346347
:param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.
347348
:param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
349+
:param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
348350
:return: :class:`ListPrivateNetworksResponse <ListPrivateNetworksResponse>`
349351
350352
Usage:
@@ -361,6 +363,7 @@ async def list_private_networks(
361363
"GET",
362364
f"/vpc/v2/regions/{param_region}/private-networks",
363365
params={
366+
"dhcp_enabled": dhcp_enabled,
364367
"name": name,
365368
"order_by": order_by,
366369
"organization_id": organization_id
@@ -390,6 +393,7 @@ async def list_private_networks_all(
390393
project_id: Optional[str] = None,
391394
private_network_ids: Optional[List[str]] = None,
392395
vpc_id: Optional[str] = None,
396+
dhcp_enabled: Optional[bool] = None,
393397
) -> List[PrivateNetwork]:
394398
"""
395399
List Private Networks.
@@ -404,6 +408,7 @@ async def list_private_networks_all(
404408
:param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned.
405409
:param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.
406410
:param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
411+
:param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
407412
:return: :class:`List[ListPrivateNetworksResponse] <List[ListPrivateNetworksResponse]>`
408413
409414
Usage:
@@ -427,6 +432,7 @@ async def list_private_networks_all(
427432
"project_id": project_id,
428433
"private_network_ids": private_network_ids,
429434
"vpc_id": vpc_id,
435+
"dhcp_enabled": dhcp_enabled,
430436
},
431437
)
432438

scaleway-async/scaleway_async/vpc/v2/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def unmarshal_PrivateNetwork(data: Any) -> PrivateNetwork:
6363
field = data.get("created_at", None)
6464
args["created_at"] = parser.isoparse(field) if type(field) is str else field
6565

66+
field = data.get("dhcp_enabled", None)
67+
args["dhcp_enabled"] = field
68+
6669
field = data.get("id", None)
6770
args["id"] = field
6871

scaleway-async/scaleway_async/vpc/v2/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ class PrivateNetwork:
112112
VPC the Private Network belongs to.
113113
"""
114114

115+
dhcp_enabled: bool
116+
"""
117+
Defines whether managed DHCP is enabled for this Private Network.
118+
"""
119+
115120

116121
@dataclass
117122
class SetSubnetsResponse:
@@ -379,6 +384,11 @@ class ListPrivateNetworksRequest:
379384
VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
380385
"""
381386

387+
dhcp_enabled: Optional[bool]
388+
"""
389+
DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
390+
"""
391+
382392

383393
@dataclass
384394
class CreatePrivateNetworkRequest:

scaleway/scaleway/vpc/v2/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ def list_private_networks(
331331
project_id: Optional[str] = None,
332332
private_network_ids: Optional[List[str]] = None,
333333
vpc_id: Optional[str] = None,
334+
dhcp_enabled: Optional[bool] = None,
334335
) -> ListPrivateNetworksResponse:
335336
"""
336337
List Private Networks.
@@ -345,6 +346,7 @@ def list_private_networks(
345346
:param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned.
346347
:param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.
347348
:param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
349+
:param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
348350
:return: :class:`ListPrivateNetworksResponse <ListPrivateNetworksResponse>`
349351
350352
Usage:
@@ -361,6 +363,7 @@ def list_private_networks(
361363
"GET",
362364
f"/vpc/v2/regions/{param_region}/private-networks",
363365
params={
366+
"dhcp_enabled": dhcp_enabled,
364367
"name": name,
365368
"order_by": order_by,
366369
"organization_id": organization_id
@@ -390,6 +393,7 @@ def list_private_networks_all(
390393
project_id: Optional[str] = None,
391394
private_network_ids: Optional[List[str]] = None,
392395
vpc_id: Optional[str] = None,
396+
dhcp_enabled: Optional[bool] = None,
393397
) -> List[PrivateNetwork]:
394398
"""
395399
List Private Networks.
@@ -404,6 +408,7 @@ def list_private_networks_all(
404408
:param project_id: Project ID to filter for. Only Private Networks belonging to this Project will be returned.
405409
:param private_network_ids: Private Network IDs to filter for. Only Private Networks with one of these IDs will be returned.
406410
:param vpc_id: VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
411+
:param dhcp_enabled: DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
407412
:return: :class:`List[ListPrivateNetworksResponse] <List[ListPrivateNetworksResponse]>`
408413
409414
Usage:
@@ -427,6 +432,7 @@ def list_private_networks_all(
427432
"project_id": project_id,
428433
"private_network_ids": private_network_ids,
429434
"vpc_id": vpc_id,
435+
"dhcp_enabled": dhcp_enabled,
430436
},
431437
)
432438

scaleway/scaleway/vpc/v2/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def unmarshal_PrivateNetwork(data: Any) -> PrivateNetwork:
6363
field = data.get("created_at", None)
6464
args["created_at"] = parser.isoparse(field) if type(field) is str else field
6565

66+
field = data.get("dhcp_enabled", None)
67+
args["dhcp_enabled"] = field
68+
6669
field = data.get("id", None)
6770
args["id"] = field
6871

scaleway/scaleway/vpc/v2/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ class PrivateNetwork:
112112
VPC the Private Network belongs to.
113113
"""
114114

115+
dhcp_enabled: bool
116+
"""
117+
Defines whether managed DHCP is enabled for this Private Network.
118+
"""
119+
115120

116121
@dataclass
117122
class SetSubnetsResponse:
@@ -379,6 +384,11 @@ class ListPrivateNetworksRequest:
379384
VPC ID to filter for. Only Private Networks belonging to this VPC will be returned.
380385
"""
381386

387+
dhcp_enabled: Optional[bool]
388+
"""
389+
DHCP status to filter for. When true, only Private Networks with managed DHCP enabled will be returned.
390+
"""
391+
382392

383393
@dataclass
384394
class CreatePrivateNetworkRequest:

0 commit comments

Comments
 (0)