Skip to content

Commit e65e6f2

Browse files
authored
feat(kapsule): expose public_ip_disabled field (#319)
1 parent 0a00a67 commit e65e6f2

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

scaleway-async/scaleway_async/k8s/v1/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ async def create_pool(
858858
container_runtime: Runtime,
859859
autohealing: bool,
860860
root_volume_type: PoolVolumeType,
861+
public_ip_disabled: bool,
861862
region: Optional[Region] = None,
862863
name: Optional[str] = None,
863864
placement_group_id: Optional[str] = None,
@@ -889,6 +890,7 @@ async def create_pool(
889890
:param zone: Zone in which the pool's nodes will be spawned.
890891
:param root_volume_type: Defines the system volume disk type. Two different types of volume (`volume_type`) are provided: `l_ssd` is a local block storage which means your system is stored locally on your node's hypervisor. `b_ssd` is a remote block storage which means your system is stored on a centralized and resilient cluster.
891892
:param root_volume_size: System volume disk size.
893+
:param public_ip_disabled: Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
892894
:return: :class:`Pool <Pool>`
893895
894896
Usage:
@@ -902,6 +904,7 @@ async def create_pool(
902904
container_runtime=unknown_runtime,
903905
autohealing=True,
904906
root_volume_type=default_volume_type,
907+
public_ip_disabled=True,
905908
)
906909
"""
907910

@@ -922,6 +925,7 @@ async def create_pool(
922925
container_runtime=container_runtime,
923926
autohealing=autohealing,
924927
root_volume_type=root_volume_type,
928+
public_ip_disabled=public_ip_disabled,
925929
region=region,
926930
name=name or random_name(prefix="pool"),
927931
placement_group_id=placement_group_id,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ def unmarshal_Pool(data: Any) -> Pool:
406406
field = data.get("placement_group_id", None)
407407
args["placement_group_id"] = field
408408

409+
field = data.get("public_ip_disabled", None)
410+
args["public_ip_disabled"] = field
411+
409412
field = data.get("region", None)
410413
args["region"] = field
411414

@@ -794,6 +797,9 @@ def marshal_CreateClusterRequestPoolConfig(
794797
if request.placement_group_id is not None:
795798
output["placement_group_id"] = request.placement_group_id
796799

800+
if request.public_ip_disabled is not None:
801+
output["public_ip_disabled"] = request.public_ip_disabled
802+
797803
if request.root_volume_size is not None:
798804
output["root_volume_size"] = request.root_volume_size
799805

@@ -1057,6 +1063,9 @@ def marshal_CreatePoolRequest(
10571063
if request.placement_group_id is not None:
10581064
output["placement_group_id"] = request.placement_group_id
10591065

1066+
if request.public_ip_disabled is not None:
1067+
output["public_ip_disabled"] = request.public_ip_disabled
1068+
10601069
if request.root_volume_size is not None:
10611070
output["root_volume_size"] = request.root_volume_size
10621071

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ class CreateClusterRequestPoolConfig:
695695
System volume disk size.
696696
"""
697697

698+
public_ip_disabled: bool
699+
"""
700+
Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
701+
"""
702+
698703

699704
@dataclass
700705
class CreateClusterRequestPoolConfigUpgradePolicy:
@@ -1051,6 +1056,11 @@ class Pool:
10511056
System volume disk size.
10521057
"""
10531058

1059+
public_ip_disabled: bool
1060+
"""
1061+
Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
1062+
"""
1063+
10541064
region: Region
10551065
"""
10561066
Cluster region of the pool.
@@ -1722,6 +1732,11 @@ class CreatePoolRequest:
17221732
System volume disk size.
17231733
"""
17241734

1735+
public_ip_disabled: bool
1736+
"""
1737+
Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
1738+
"""
1739+
17251740

17261741
@dataclass
17271742
class GetPoolRequest:

scaleway/scaleway/k8s/v1/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ def create_pool(
858858
container_runtime: Runtime,
859859
autohealing: bool,
860860
root_volume_type: PoolVolumeType,
861+
public_ip_disabled: bool,
861862
region: Optional[Region] = None,
862863
name: Optional[str] = None,
863864
placement_group_id: Optional[str] = None,
@@ -889,6 +890,7 @@ def create_pool(
889890
:param zone: Zone in which the pool's nodes will be spawned.
890891
:param root_volume_type: Defines the system volume disk type. Two different types of volume (`volume_type`) are provided: `l_ssd` is a local block storage which means your system is stored locally on your node's hypervisor. `b_ssd` is a remote block storage which means your system is stored on a centralized and resilient cluster.
891892
:param root_volume_size: System volume disk size.
893+
:param public_ip_disabled: Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
892894
:return: :class:`Pool <Pool>`
893895
894896
Usage:
@@ -902,6 +904,7 @@ def create_pool(
902904
container_runtime=unknown_runtime,
903905
autohealing=True,
904906
root_volume_type=default_volume_type,
907+
public_ip_disabled=True,
905908
)
906909
"""
907910

@@ -922,6 +925,7 @@ def create_pool(
922925
container_runtime=container_runtime,
923926
autohealing=autohealing,
924927
root_volume_type=root_volume_type,
928+
public_ip_disabled=public_ip_disabled,
925929
region=region,
926930
name=name or random_name(prefix="pool"),
927931
placement_group_id=placement_group_id,

scaleway/scaleway/k8s/v1/marshalling.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ def unmarshal_Pool(data: Any) -> Pool:
406406
field = data.get("placement_group_id", None)
407407
args["placement_group_id"] = field
408408

409+
field = data.get("public_ip_disabled", None)
410+
args["public_ip_disabled"] = field
411+
409412
field = data.get("region", None)
410413
args["region"] = field
411414

@@ -794,6 +797,9 @@ def marshal_CreateClusterRequestPoolConfig(
794797
if request.placement_group_id is not None:
795798
output["placement_group_id"] = request.placement_group_id
796799

800+
if request.public_ip_disabled is not None:
801+
output["public_ip_disabled"] = request.public_ip_disabled
802+
797803
if request.root_volume_size is not None:
798804
output["root_volume_size"] = request.root_volume_size
799805

@@ -1057,6 +1063,9 @@ def marshal_CreatePoolRequest(
10571063
if request.placement_group_id is not None:
10581064
output["placement_group_id"] = request.placement_group_id
10591065

1066+
if request.public_ip_disabled is not None:
1067+
output["public_ip_disabled"] = request.public_ip_disabled
1068+
10601069
if request.root_volume_size is not None:
10611070
output["root_volume_size"] = request.root_volume_size
10621071

scaleway/scaleway/k8s/v1/types.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ class CreateClusterRequestPoolConfig:
695695
System volume disk size.
696696
"""
697697

698+
public_ip_disabled: bool
699+
"""
700+
Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
701+
"""
702+
698703

699704
@dataclass
700705
class CreateClusterRequestPoolConfigUpgradePolicy:
@@ -1051,6 +1056,11 @@ class Pool:
10511056
System volume disk size.
10521057
"""
10531058

1059+
public_ip_disabled: bool
1060+
"""
1061+
Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
1062+
"""
1063+
10541064
region: Region
10551065
"""
10561066
Cluster region of the pool.
@@ -1722,6 +1732,11 @@ class CreatePoolRequest:
17221732
System volume disk size.
17231733
"""
17241734

1735+
public_ip_disabled: bool
1736+
"""
1737+
Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway.
1738+
"""
1739+
17251740

17261741
@dataclass
17271742
class GetPoolRequest:

0 commit comments

Comments
 (0)