diff --git a/scaleway-async/scaleway_async/container/v1beta1/api.py b/scaleway-async/scaleway_async/container/v1beta1/api.py index 6f1d8a7ac..c42901ec2 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/api.py +++ b/scaleway-async/scaleway_async/container/v1beta1/api.py @@ -633,6 +633,7 @@ async def create_container( :param scaling_option: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. + - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :return: :class:`Container ` @@ -735,8 +736,8 @@ async def update_container( :param scaling_option: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. + - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. - :return: :class:`Container ` Usage: diff --git a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py index 97d792352..36f421564 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/marshalling.py +++ b/scaleway-async/scaleway_async/container/v1beta1/marshalling.py @@ -131,6 +131,12 @@ def unmarshal_ContainerScalingOption(data: Any) -> ContainerScalingOption: else: args["cpu_usage_threshold"] = None + field = data.get("memory_usage_threshold", None) + if field is not None: + args["memory_usage_threshold"] = field + else: + args["memory_usage_threshold"] = None + return ContainerScalingOption(**args) @@ -825,6 +831,9 @@ def marshal_ContainerScalingOption( request.concurrent_requests_threshold, ), OneOfPossibility("cpu_usage_threshold", request.cpu_usage_threshold), + OneOfPossibility( + "memory_usage_threshold", request.memory_usage_threshold + ), ] ), ) diff --git a/scaleway-async/scaleway_async/container/v1beta1/types.py b/scaleway-async/scaleway_async/container/v1beta1/types.py index 87c86d669..6b4b35c6d 100644 --- a/scaleway-async/scaleway_async/container/v1beta1/types.py +++ b/scaleway-async/scaleway_async/container/v1beta1/types.py @@ -228,6 +228,8 @@ class ContainerScalingOption: cpu_usage_threshold: Optional[int] + memory_usage_threshold: Optional[int] + @dataclass class SecretHashedValue: @@ -481,7 +483,7 @@ class Container: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. - +- memory_usage_threshold: Scale depending on the memory usage of a container instance. """ health_check: Optional[ContainerHealthCheckSpec] @@ -831,6 +833,7 @@ class CreateContainerRequest: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. +- memory_usage_threshold: Scale depending on the memory usage of a container instance. """ health_check: Optional[ContainerHealthCheckSpec] @@ -1509,6 +1512,7 @@ class UpdateContainerRequest: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. +- memory_usage_threshold: Scale depending on the memory usage of a container instance. """ health_check: Optional[ContainerHealthCheckSpec] diff --git a/scaleway/scaleway/container/v1beta1/api.py b/scaleway/scaleway/container/v1beta1/api.py index 4dd8462b2..a7fea8f9e 100644 --- a/scaleway/scaleway/container/v1beta1/api.py +++ b/scaleway/scaleway/container/v1beta1/api.py @@ -629,6 +629,7 @@ def create_container( :param scaling_option: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. + - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :return: :class:`Container ` @@ -731,6 +732,7 @@ def update_container( :param scaling_option: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. + - memory_usage_threshold: Scale depending on the memory usage of a container instance. :param health_check: Health check configuration of the container. :return: :class:`Container ` diff --git a/scaleway/scaleway/container/v1beta1/marshalling.py b/scaleway/scaleway/container/v1beta1/marshalling.py index 97d792352..36f421564 100644 --- a/scaleway/scaleway/container/v1beta1/marshalling.py +++ b/scaleway/scaleway/container/v1beta1/marshalling.py @@ -131,6 +131,12 @@ def unmarshal_ContainerScalingOption(data: Any) -> ContainerScalingOption: else: args["cpu_usage_threshold"] = None + field = data.get("memory_usage_threshold", None) + if field is not None: + args["memory_usage_threshold"] = field + else: + args["memory_usage_threshold"] = None + return ContainerScalingOption(**args) @@ -825,6 +831,9 @@ def marshal_ContainerScalingOption( request.concurrent_requests_threshold, ), OneOfPossibility("cpu_usage_threshold", request.cpu_usage_threshold), + OneOfPossibility( + "memory_usage_threshold", request.memory_usage_threshold + ), ] ), ) diff --git a/scaleway/scaleway/container/v1beta1/types.py b/scaleway/scaleway/container/v1beta1/types.py index 93f35f15f..6b4b35c6d 100644 --- a/scaleway/scaleway/container/v1beta1/types.py +++ b/scaleway/scaleway/container/v1beta1/types.py @@ -228,6 +228,8 @@ class ContainerScalingOption: cpu_usage_threshold: Optional[int] + memory_usage_threshold: Optional[int] + @dataclass class SecretHashedValue: @@ -481,6 +483,7 @@ class Container: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. +- memory_usage_threshold: Scale depending on the memory usage of a container instance. """ health_check: Optional[ContainerHealthCheckSpec] @@ -830,6 +833,7 @@ class CreateContainerRequest: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. +- memory_usage_threshold: Scale depending on the memory usage of a container instance. """ health_check: Optional[ContainerHealthCheckSpec] @@ -1508,6 +1512,7 @@ class UpdateContainerRequest: Possible values: - concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance. - cpu_usage_threshold: Scale depending on the CPU usage of a container instance. +- memory_usage_threshold: Scale depending on the memory usage of a container instance. """ health_check: Optional[ContainerHealthCheckSpec]