Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ async def create_pool(
startup_taints: Optional[list[CoreV1Taint]] = None,
private_network_id: Optional[str] = None,
user_data: Optional[dict[str, str]] = None,
max_termination_grace_period: Optional[str] = None,
) -> Pool:
"""
Create a new Pool in a Cluster.
Expand Down Expand Up @@ -1099,6 +1100,7 @@ async def create_pool(
:param startup_taints: Kubernetes taints applied at node creation but not reconciled afterwards.
:param private_network_id: Private network where the nodes are attached. Should be member of the same VPC as the API Server.
:param user_data: User data applied and reconciled with the pool.
:param max_termination_grace_period: Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
:return: :class:`Pool <Pool>`

Usage:
Expand Down Expand Up @@ -1148,6 +1150,7 @@ async def create_pool(
startup_taints=startup_taints,
private_network_id=private_network_id,
user_data=user_data,
max_termination_grace_period=max_termination_grace_period,
),
self.client,
),
Expand Down Expand Up @@ -1287,6 +1290,7 @@ async def update_pool(
kubelet_args: Optional[dict[str, str]] = None,
upgrade_policy: Optional[UpdatePoolRequestUpgradePolicy] = None,
security_group_id: Optional[str] = None,
max_termination_grace_period: Optional[str] = None,
) -> Pool:
"""
Update a Pool in a Cluster.
Expand All @@ -1302,6 +1306,7 @@ async def update_pool(
:param kubelet_args: New Kubelet arguments to be used by this pool. Note that this feature is experimental.
:param upgrade_policy: New upgrade policy for the pool.
:param security_group_id: Security group ID in which all the nodes of the pool will be moved.
:param max_termination_grace_period: New maximum amount of time before the API forces the drain and deletion of a `deleting` node.
:return: :class:`Pool <Pool>`

Usage:
Expand Down Expand Up @@ -1333,6 +1338,7 @@ async def update_pool(
kubelet_args=kubelet_args,
upgrade_policy=upgrade_policy,
security_group_id=security_group_id,
max_termination_grace_period=max_termination_grace_period,
),
self.client,
),
Expand Down
15 changes: 15 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,12 @@ def unmarshal_Pool(data: Any) -> Pool:
else:
args["error_message"] = None

field = data.get("max_termination_grace_period", None)
if field is not None:
args["max_termination_grace_period"] = field
else:
args["max_termination_grace_period"] = None

return Pool(**args)


Expand Down Expand Up @@ -1675,6 +1681,9 @@ def marshal_CreateClusterRequestPoolConfig(
if request.private_network_id is not None:
output["private_network_id"] = request.private_network_id

if request.max_termination_grace_period is not None:
output["max_termination_grace_period"] = request.max_termination_grace_period

return output


Expand Down Expand Up @@ -1864,6 +1873,9 @@ def marshal_CreatePoolRequest(
if request.user_data is not None:
output["user_data"] = {key: value for key, value in request.user_data.items()}

if request.max_termination_grace_period is not None:
output["max_termination_grace_period"] = request.max_termination_grace_period

return output


Expand Down Expand Up @@ -2123,6 +2135,9 @@ def marshal_UpdatePoolRequest(
if request.security_group_id is not None:
output["security_group_id"] = request.security_group_id

if request.max_termination_grace_period is not None:
output["max_termination_grace_period"] = request.max_termination_grace_period

return output


Expand Down
20 changes: 20 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ class CreateClusterRequestPoolConfig:
Private network where the nodes are attached. Should be member of the same VPC as the API Server.
"""

max_termination_grace_period: Optional[str] = None
"""
Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
"""


@dataclass
class CreatePoolRequestUpgradePolicy:
Expand Down Expand Up @@ -1141,6 +1146,11 @@ class Pool:
Details of the error, if any occurred when managing the pool.
"""

max_termination_grace_period: Optional[str] = None
"""
Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
"""


@dataclass
class NodeMetadataCoreV1Taint:
Expand Down Expand Up @@ -1537,6 +1547,11 @@ class CreatePoolRequest:
User data applied and reconciled with the pool.
"""

max_termination_grace_period: Optional[str] = None
"""
Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
"""


@dataclass
class DeleteACLRuleRequest:
Expand Down Expand Up @@ -2280,6 +2295,11 @@ class UpdatePoolRequest:
Security group ID in which all the nodes of the pool will be moved.
"""

max_termination_grace_period: Optional[str] = None
"""
New maximum amount of time before the API forces the drain and deletion of a `deleting` node.
"""


@dataclass
class UpgradeClusterRequest:
Expand Down
2 changes: 1 addition & 1 deletion scaleway-async/scaleway_async/mongodb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ async def apply_maintenance(
) -> Maintenance:
"""
Apply a maintenance of a MongoDB® Database Instance.
:param maintenance_id:
:param maintenance_id: ID of the maintenance.
:param region: Region to target. If none is passed will use default region from the config.
:return: :class:`Maintenance <Maintenance>`

Expand Down
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/mongodb/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,10 @@ class Version:
@dataclass
class ApplyMaintenanceRequest:
maintenance_id: str
"""
ID of the maintenance.
"""

region: Optional[ScwRegion] = None
"""
Region to target. If none is passed will use default region from the config.
Expand Down
6 changes: 6 additions & 0 deletions scaleway/scaleway/k8s/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ def create_pool(
startup_taints: Optional[list[CoreV1Taint]] = None,
private_network_id: Optional[str] = None,
user_data: Optional[dict[str, str]] = None,
max_termination_grace_period: Optional[str] = None,
) -> Pool:
"""
Create a new Pool in a Cluster.
Expand Down Expand Up @@ -1099,6 +1100,7 @@ def create_pool(
:param startup_taints: Kubernetes taints applied at node creation but not reconciled afterwards.
:param private_network_id: Private network where the nodes are attached. Should be member of the same VPC as the API Server.
:param user_data: User data applied and reconciled with the pool.
:param max_termination_grace_period: Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
:return: :class:`Pool <Pool>`

Usage:
Expand Down Expand Up @@ -1148,6 +1150,7 @@ def create_pool(
startup_taints=startup_taints,
private_network_id=private_network_id,
user_data=user_data,
max_termination_grace_period=max_termination_grace_period,
),
self.client,
),
Expand Down Expand Up @@ -1287,6 +1290,7 @@ def update_pool(
kubelet_args: Optional[dict[str, str]] = None,
upgrade_policy: Optional[UpdatePoolRequestUpgradePolicy] = None,
security_group_id: Optional[str] = None,
max_termination_grace_period: Optional[str] = None,
) -> Pool:
"""
Update a Pool in a Cluster.
Expand All @@ -1302,6 +1306,7 @@ def update_pool(
:param kubelet_args: New Kubelet arguments to be used by this pool. Note that this feature is experimental.
:param upgrade_policy: New upgrade policy for the pool.
:param security_group_id: Security group ID in which all the nodes of the pool will be moved.
:param max_termination_grace_period: New maximum amount of time before the API forces the drain and deletion of a `deleting` node.
:return: :class:`Pool <Pool>`

Usage:
Expand Down Expand Up @@ -1333,6 +1338,7 @@ def update_pool(
kubelet_args=kubelet_args,
upgrade_policy=upgrade_policy,
security_group_id=security_group_id,
max_termination_grace_period=max_termination_grace_period,
),
self.client,
),
Expand Down
15 changes: 15 additions & 0 deletions scaleway/scaleway/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,12 @@ def unmarshal_Pool(data: Any) -> Pool:
else:
args["error_message"] = None

field = data.get("max_termination_grace_period", None)
if field is not None:
args["max_termination_grace_period"] = field
else:
args["max_termination_grace_period"] = None

return Pool(**args)


Expand Down Expand Up @@ -1675,6 +1681,9 @@ def marshal_CreateClusterRequestPoolConfig(
if request.private_network_id is not None:
output["private_network_id"] = request.private_network_id

if request.max_termination_grace_period is not None:
output["max_termination_grace_period"] = request.max_termination_grace_period

return output


Expand Down Expand Up @@ -1864,6 +1873,9 @@ def marshal_CreatePoolRequest(
if request.user_data is not None:
output["user_data"] = {key: value for key, value in request.user_data.items()}

if request.max_termination_grace_period is not None:
output["max_termination_grace_period"] = request.max_termination_grace_period

return output


Expand Down Expand Up @@ -2123,6 +2135,9 @@ def marshal_UpdatePoolRequest(
if request.security_group_id is not None:
output["security_group_id"] = request.security_group_id

if request.max_termination_grace_period is not None:
output["max_termination_grace_period"] = request.max_termination_grace_period

return output


Expand Down
20 changes: 20 additions & 0 deletions scaleway/scaleway/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ class CreateClusterRequestPoolConfig:
Private network where the nodes are attached. Should be member of the same VPC as the API Server.
"""

max_termination_grace_period: Optional[str] = None
"""
Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
"""


@dataclass
class CreatePoolRequestUpgradePolicy:
Expand Down Expand Up @@ -1141,6 +1146,11 @@ class Pool:
Details of the error, if any occurred when managing the pool.
"""

max_termination_grace_period: Optional[str] = None
"""
Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
"""


@dataclass
class NodeMetadataCoreV1Taint:
Expand Down Expand Up @@ -1537,6 +1547,11 @@ class CreatePoolRequest:
User data applied and reconciled with the pool.
"""

max_termination_grace_period: Optional[str] = None
"""
Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour.
"""


@dataclass
class DeleteACLRuleRequest:
Expand Down Expand Up @@ -2280,6 +2295,11 @@ class UpdatePoolRequest:
Security group ID in which all the nodes of the pool will be moved.
"""

max_termination_grace_period: Optional[str] = None
"""
New maximum amount of time before the API forces the drain and deletion of a `deleting` node.
"""


@dataclass
class UpgradeClusterRequest:
Expand Down
2 changes: 1 addition & 1 deletion scaleway/scaleway/mongodb/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ def apply_maintenance(
) -> Maintenance:
"""
Apply a maintenance of a MongoDB® Database Instance.
:param maintenance_id:
:param maintenance_id: ID of the maintenance.
:param region: Region to target. If none is passed will use default region from the config.
:return: :class:`Maintenance <Maintenance>`

Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/mongodb/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,10 @@ class Version:
@dataclass
class ApplyMaintenanceRequest:
maintenance_id: str
"""
ID of the maintenance.
"""

region: Optional[ScwRegion] = None
"""
Region to target. If none is passed will use default region from the config.
Expand Down
Loading