From 14de43f1f76ea552a7fca383a24dff586c1662c1 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Mon, 17 Aug 2026 11:11:20 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/k8s/v1/__init__.py | 2 + scaleway-async/scaleway_async/k8s/v1/api.py | 60 ++++++++++++++++--- .../scaleway_async/k8s/v1/marshalling.py | 21 ++++--- scaleway-async/scaleway_async/k8s/v1/types.py | 23 +++++++ scaleway/scaleway/k8s/v1/__init__.py | 2 + scaleway/scaleway/k8s/v1/api.py | 60 ++++++++++++++++--- scaleway/scaleway/k8s/v1/marshalling.py | 21 ++++--- scaleway/scaleway/k8s/v1/types.py | 23 +++++++ 8 files changed, 176 insertions(+), 36 deletions(-) diff --git a/scaleway-async/scaleway_async/k8s/v1/__init__.py b/scaleway-async/scaleway_async/k8s/v1/__init__.py index f0097d35d..c62adde16 100644 --- a/scaleway-async/scaleway_async/k8s/v1/__init__.py +++ b/scaleway-async/scaleway_async/k8s/v1/__init__.py @@ -57,6 +57,7 @@ from .types import GetNodeMetadataRequest from .types import GetNodeRequest from .types import GetPoolRequest +from .types import GetUserDataRequest from .types import GetVersionRequest from .types import ListClusterACLRulesRequest from .types import ListClusterACLRulesResponse @@ -148,6 +149,7 @@ "GetNodeMetadataRequest", "GetNodeRequest", "GetPoolRequest", + "GetUserDataRequest", "GetVersionRequest", "ListClusterACLRulesRequest", "ListClusterACLRulesResponse", diff --git a/scaleway-async/scaleway_async/k8s/v1/api.py b/scaleway-async/scaleway_async/k8s/v1/api.py index c700ba452..cb30c0ba1 100644 --- a/scaleway-async/scaleway_async/k8s/v1/api.py +++ b/scaleway-async/scaleway_async/k8s/v1/api.py @@ -1047,15 +1047,15 @@ async def create_pool( cluster_id: str, node_type: str, autoscaling: bool, - size: int, region: Optional[ScwRegion] = None, name: Optional[str] = None, placement_group_id: Optional[str] = None, + size: int, + autohealing: bool, + public_ip_disabled: bool, min_size: Optional[int] = None, max_size: Optional[int] = None, container_runtime: Optional[Runtime] = None, - autohealing: bool, - public_ip_disabled: bool, tags: Optional[list[str]] = None, kubelet_args: Optional[dict[str, str]] = None, upgrade_policy: Optional[CreatePoolRequestUpgradePolicy] = None, @@ -1067,6 +1067,7 @@ async def create_pool( taints: Optional[list[CoreV1Taint]] = None, startup_taints: Optional[list[CoreV1Taint]] = None, private_network_id: Optional[str] = None, + user_data: Optional[dict[str, str]] = None, ) -> Pool: """ Create a new Pool in a Cluster. @@ -1074,15 +1075,15 @@ async def create_pool( :param cluster_id: Cluster ID to which the pool will be attached. :param node_type: Node type is the type of Scaleway Instance wanted for the pool. Nodes with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST). 'external' is a special node type used to provision instances from other cloud providers in a Kosmos Cluster. :param autoscaling: Defines whether the autoscaling feature is enabled for the pool. - :param size: Size (number of nodes) of the pool. :param region: Region to target. If none is passed will use default region from the config. :param name: Pool name. :param placement_group_id: Placement group ID in which all the nodes of the pool will be created, placement groups are limited to 20 instances. + :param size: Size (number of nodes) of the pool. + :param autohealing: Defines whether the autohealing feature is enabled for the pool. + :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. :param min_size: Defines the minimum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. :param max_size: Defines the maximum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. :param container_runtime: Customization of the container runtime is available for each pool. - :param autohealing: Defines whether the autohealing feature is enabled for the pool. - :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. :param tags: Tags associated with the pool, see [managing tags](https://www.scaleway.com/en/docs/kubernetes/api-cli/managing-tags). :param kubelet_args: Kubelet arguments to be used by this pool. Note that this feature is experimental. :param upgrade_policy: Defines how node provisioning should behave during pool version upgrade. @@ -1097,6 +1098,7 @@ async def create_pool( :param taints: Kubernetes taints applied and reconciled on the nodes. :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. :return: :class:`Pool ` Usage: @@ -1125,15 +1127,15 @@ async def create_pool( cluster_id=cluster_id, node_type=node_type, autoscaling=autoscaling, - size=size, region=region, name=name or random_name(prefix="pool"), placement_group_id=placement_group_id, + size=size, + autohealing=autohealing, + public_ip_disabled=public_ip_disabled, min_size=min_size, max_size=max_size, container_runtime=container_runtime, - autohealing=autohealing, - public_ip_disabled=public_ip_disabled, tags=tags, kubelet_args=kubelet_args, upgrade_policy=upgrade_policy, @@ -1145,6 +1147,7 @@ async def create_pool( taints=taints, startup_taints=startup_taints, private_network_id=private_network_id, + user_data=user_data, ), self.client, ), @@ -1504,6 +1507,45 @@ async def set_pool_labels( self._throw_on_error(res) return unmarshal_Pool(res.json()) + async def get_user_data( + self, + *, + pool_id: str, + key: str, + region: Optional[ScwRegion] = None, + ) -> ScwFile: + """ + Get a pool related user data. + Retrieve specific user data content for a given pool. + Tip: add `?dl=1` at the end of the URL to directly retrieve the base64 decoded content of your user data. + :param pool_id: Pool the user data will be attached to. + :param key: User data key to retrieved. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`ScwFile ` + + Usage: + :: + + result = await api.get_user_data( + pool_id="example", + key="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_pool_id = validate_path_param("pool_id", pool_id) + param_key = validate_path_param("key", key) + + res = self._request( + "GET", + f"/k8s/v1/regions/{param_region}/pools/{param_pool_id}/user-data/{param_key}", + ) + + self._throw_on_error(res) + return unmarshal_ScwFile(res.json()) + async def get_node_metadata( self, *, diff --git a/scaleway-async/scaleway_async/k8s/v1/marshalling.py b/scaleway-async/scaleway_async/k8s/v1/marshalling.py index 7af4e050f..e39e13480 100644 --- a/scaleway-async/scaleway_async/k8s/v1/marshalling.py +++ b/scaleway-async/scaleway_async/k8s/v1/marshalling.py @@ -1766,15 +1766,21 @@ def marshal_CreatePoolRequest( if request.autoscaling is not None: output["autoscaling"] = request.autoscaling - if request.size is not None: - output["size"] = request.size - if request.name is not None: output["name"] = request.name if request.placement_group_id is not None: output["placement_group_id"] = request.placement_group_id + if request.size is not None: + output["size"] = request.size + + if request.autohealing is not None: + output["autohealing"] = request.autohealing + + if request.public_ip_disabled is not None: + output["public_ip_disabled"] = request.public_ip_disabled + if request.min_size is not None: output["min_size"] = request.min_size @@ -1784,12 +1790,6 @@ def marshal_CreatePoolRequest( if request.container_runtime is not None: output["container_runtime"] = request.container_runtime - if request.autohealing is not None: - output["autohealing"] = request.autohealing - - if request.public_ip_disabled is not None: - output["public_ip_disabled"] = request.public_ip_disabled - if request.tags is not None: output["tags"] = request.tags @@ -1833,6 +1833,9 @@ def marshal_CreatePoolRequest( if request.private_network_id is not None: output["private_network_id"] = request.private_network_id + if request.user_data is not None: + output["user_data"] = {key: value for key, value in request.user_data.items()} + return output diff --git a/scaleway-async/scaleway_async/k8s/v1/types.py b/scaleway-async/scaleway_async/k8s/v1/types.py index 504c0cfda..177043f22 100644 --- a/scaleway-async/scaleway_async/k8s/v1/types.py +++ b/scaleway-async/scaleway_async/k8s/v1/types.py @@ -1526,6 +1526,11 @@ class CreatePoolRequest: Private network where the nodes are attached. Should be member of the same VPC as the API Server. """ + user_data: Optional[dict[str, str]] = field(default_factory=dict) + """ + User data applied and reconciled with the pool. + """ + @dataclass class DeleteACLRuleRequest: @@ -1660,6 +1665,24 @@ class GetPoolRequest: """ +@dataclass +class GetUserDataRequest: + pool_id: str + """ + Pool the user data will be attached to. + """ + + key: str + """ + User data key to retrieved. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class GetVersionRequest: version_name: str diff --git a/scaleway/scaleway/k8s/v1/__init__.py b/scaleway/scaleway/k8s/v1/__init__.py index f0097d35d..c62adde16 100644 --- a/scaleway/scaleway/k8s/v1/__init__.py +++ b/scaleway/scaleway/k8s/v1/__init__.py @@ -57,6 +57,7 @@ from .types import GetNodeMetadataRequest from .types import GetNodeRequest from .types import GetPoolRequest +from .types import GetUserDataRequest from .types import GetVersionRequest from .types import ListClusterACLRulesRequest from .types import ListClusterACLRulesResponse @@ -148,6 +149,7 @@ "GetNodeMetadataRequest", "GetNodeRequest", "GetPoolRequest", + "GetUserDataRequest", "GetVersionRequest", "ListClusterACLRulesRequest", "ListClusterACLRulesResponse", diff --git a/scaleway/scaleway/k8s/v1/api.py b/scaleway/scaleway/k8s/v1/api.py index 00a18e471..a87f77f6c 100644 --- a/scaleway/scaleway/k8s/v1/api.py +++ b/scaleway/scaleway/k8s/v1/api.py @@ -1047,15 +1047,15 @@ def create_pool( cluster_id: str, node_type: str, autoscaling: bool, - size: int, region: Optional[ScwRegion] = None, name: Optional[str] = None, placement_group_id: Optional[str] = None, + size: int, + autohealing: bool, + public_ip_disabled: bool, min_size: Optional[int] = None, max_size: Optional[int] = None, container_runtime: Optional[Runtime] = None, - autohealing: bool, - public_ip_disabled: bool, tags: Optional[list[str]] = None, kubelet_args: Optional[dict[str, str]] = None, upgrade_policy: Optional[CreatePoolRequestUpgradePolicy] = None, @@ -1067,6 +1067,7 @@ def create_pool( taints: Optional[list[CoreV1Taint]] = None, startup_taints: Optional[list[CoreV1Taint]] = None, private_network_id: Optional[str] = None, + user_data: Optional[dict[str, str]] = None, ) -> Pool: """ Create a new Pool in a Cluster. @@ -1074,15 +1075,15 @@ def create_pool( :param cluster_id: Cluster ID to which the pool will be attached. :param node_type: Node type is the type of Scaleway Instance wanted for the pool. Nodes with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST). 'external' is a special node type used to provision instances from other cloud providers in a Kosmos Cluster. :param autoscaling: Defines whether the autoscaling feature is enabled for the pool. - :param size: Size (number of nodes) of the pool. :param region: Region to target. If none is passed will use default region from the config. :param name: Pool name. :param placement_group_id: Placement group ID in which all the nodes of the pool will be created, placement groups are limited to 20 instances. + :param size: Size (number of nodes) of the pool. + :param autohealing: Defines whether the autohealing feature is enabled for the pool. + :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. :param min_size: Defines the minimum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. :param max_size: Defines the maximum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. :param container_runtime: Customization of the container runtime is available for each pool. - :param autohealing: Defines whether the autohealing feature is enabled for the pool. - :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. :param tags: Tags associated with the pool, see [managing tags](https://www.scaleway.com/en/docs/kubernetes/api-cli/managing-tags). :param kubelet_args: Kubelet arguments to be used by this pool. Note that this feature is experimental. :param upgrade_policy: Defines how node provisioning should behave during pool version upgrade. @@ -1097,6 +1098,7 @@ def create_pool( :param taints: Kubernetes taints applied and reconciled on the nodes. :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. :return: :class:`Pool ` Usage: @@ -1125,15 +1127,15 @@ def create_pool( cluster_id=cluster_id, node_type=node_type, autoscaling=autoscaling, - size=size, region=region, name=name or random_name(prefix="pool"), placement_group_id=placement_group_id, + size=size, + autohealing=autohealing, + public_ip_disabled=public_ip_disabled, min_size=min_size, max_size=max_size, container_runtime=container_runtime, - autohealing=autohealing, - public_ip_disabled=public_ip_disabled, tags=tags, kubelet_args=kubelet_args, upgrade_policy=upgrade_policy, @@ -1145,6 +1147,7 @@ def create_pool( taints=taints, startup_taints=startup_taints, private_network_id=private_network_id, + user_data=user_data, ), self.client, ), @@ -1504,6 +1507,45 @@ def set_pool_labels( self._throw_on_error(res) return unmarshal_Pool(res.json()) + def get_user_data( + self, + *, + pool_id: str, + key: str, + region: Optional[ScwRegion] = None, + ) -> ScwFile: + """ + Get a pool related user data. + Retrieve specific user data content for a given pool. + Tip: add `?dl=1` at the end of the URL to directly retrieve the base64 decoded content of your user data. + :param pool_id: Pool the user data will be attached to. + :param key: User data key to retrieved. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`ScwFile ` + + Usage: + :: + + result = api.get_user_data( + pool_id="example", + key="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_pool_id = validate_path_param("pool_id", pool_id) + param_key = validate_path_param("key", key) + + res = self._request( + "GET", + f"/k8s/v1/regions/{param_region}/pools/{param_pool_id}/user-data/{param_key}", + ) + + self._throw_on_error(res) + return unmarshal_ScwFile(res.json()) + def get_node_metadata( self, *, diff --git a/scaleway/scaleway/k8s/v1/marshalling.py b/scaleway/scaleway/k8s/v1/marshalling.py index 7af4e050f..e39e13480 100644 --- a/scaleway/scaleway/k8s/v1/marshalling.py +++ b/scaleway/scaleway/k8s/v1/marshalling.py @@ -1766,15 +1766,21 @@ def marshal_CreatePoolRequest( if request.autoscaling is not None: output["autoscaling"] = request.autoscaling - if request.size is not None: - output["size"] = request.size - if request.name is not None: output["name"] = request.name if request.placement_group_id is not None: output["placement_group_id"] = request.placement_group_id + if request.size is not None: + output["size"] = request.size + + if request.autohealing is not None: + output["autohealing"] = request.autohealing + + if request.public_ip_disabled is not None: + output["public_ip_disabled"] = request.public_ip_disabled + if request.min_size is not None: output["min_size"] = request.min_size @@ -1784,12 +1790,6 @@ def marshal_CreatePoolRequest( if request.container_runtime is not None: output["container_runtime"] = request.container_runtime - if request.autohealing is not None: - output["autohealing"] = request.autohealing - - if request.public_ip_disabled is not None: - output["public_ip_disabled"] = request.public_ip_disabled - if request.tags is not None: output["tags"] = request.tags @@ -1833,6 +1833,9 @@ def marshal_CreatePoolRequest( if request.private_network_id is not None: output["private_network_id"] = request.private_network_id + if request.user_data is not None: + output["user_data"] = {key: value for key, value in request.user_data.items()} + return output diff --git a/scaleway/scaleway/k8s/v1/types.py b/scaleway/scaleway/k8s/v1/types.py index 504c0cfda..177043f22 100644 --- a/scaleway/scaleway/k8s/v1/types.py +++ b/scaleway/scaleway/k8s/v1/types.py @@ -1526,6 +1526,11 @@ class CreatePoolRequest: Private network where the nodes are attached. Should be member of the same VPC as the API Server. """ + user_data: Optional[dict[str, str]] = field(default_factory=dict) + """ + User data applied and reconciled with the pool. + """ + @dataclass class DeleteACLRuleRequest: @@ -1660,6 +1665,24 @@ class GetPoolRequest: """ +@dataclass +class GetUserDataRequest: + pool_id: str + """ + Pool the user data will be attached to. + """ + + key: str + """ + User data key to retrieved. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class GetVersionRequest: version_name: str