Skip to content
Merged
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
12 changes: 12 additions & 0 deletions scaleway-async/scaleway_async/container/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ async def create_container(
health_check: Optional[ContainerHealthCheckSpec] = None,
tags: Optional[List[str]] = None,
private_network_id: Optional[str] = None,
command: Optional[List[str]] = None,
args: Optional[List[str]] = None,
) -> Container:
"""
Create a new container.
Expand Down Expand Up @@ -644,6 +646,8 @@ async def create_container(
:param health_check: Health check configuration of the container.
:param tags: Tags of the Serverless Container.
:param private_network_id:
:param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
:param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
:return: :class:`Container <Container>`

Usage:
Expand Down Expand Up @@ -687,6 +691,8 @@ async def create_container(
health_check=health_check,
tags=tags,
private_network_id=private_network_id,
command=command,
args=args,
),
self.client,
),
Expand Down Expand Up @@ -721,6 +727,8 @@ async def update_container(
health_check: Optional[ContainerHealthCheckSpec] = None,
tags: Optional[List[str]] = None,
private_network_id: Optional[str] = None,
command: Optional[List[str]] = None,
args: Optional[List[str]] = None,
) -> Container:
"""
Update an existing container.
Expand Down Expand Up @@ -753,6 +761,8 @@ async def update_container(
:param health_check: Health check configuration of the container.
:param tags: Tags of the Serverless Container.
:param private_network_id:
:param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
:param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
:return: :class:`Container <Container>`

Usage:
Expand Down Expand Up @@ -796,6 +806,8 @@ async def update_container(
health_check=health_check,
tags=tags,
private_network_id=private_network_id,
command=command,
args=args,
),
self.client,
),
Expand Down
44 changes: 32 additions & 12 deletions scaleway-async/scaleway_async/container/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ def unmarshal_Container(data: Any) -> Container:
if field is not None:
args["registry_image"] = field

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

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

field = data.get("timeout", None)
if field is not None:
args["timeout"] = field
Expand All @@ -229,14 +237,6 @@ def unmarshal_Container(data: Any) -> Container:
else:
args["description"] = None

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

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

field = data.get("protocol", None)
if field is not None:
args["protocol"] = field
Expand Down Expand Up @@ -265,6 +265,12 @@ def unmarshal_Container(data: Any) -> Container:
if field is not None:
args["local_storage_limit"] = field

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

field = data.get("region", None)
if field is not None:
args["region"] = field
Expand All @@ -273,11 +279,13 @@ def unmarshal_Container(data: Any) -> Container:
if field is not None:
args["tags"] = field

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

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

field = data.get("health_check", None)
if field is not None:
Expand Down Expand Up @@ -963,6 +971,12 @@ def marshal_CreateContainerRequest(
if request.private_network_id is not None:
output["private_network_id"] = request.private_network_id

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

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

return output


Expand Down Expand Up @@ -1221,6 +1235,12 @@ def marshal_UpdateContainerRequest(
if request.private_network_id is not None:
output["private_network_id"] = request.private_network_id

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

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

return output


Expand Down
60 changes: 45 additions & 15 deletions scaleway-async/scaleway_async/container/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,29 +416,29 @@ class Container:
Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
"""

timeout: Optional[str]
max_concurrency: int
"""
Processing time limit for the container.
Number of maximum concurrent executions of the container.
"""

error_message: Optional[str]
domain_name: str
"""
Last error message of the container.
Domain name attributed to the contaioner.
"""

description: Optional[str]
timeout: Optional[str]
"""
Description of the container.
Processing time limit for the container.
"""

max_concurrency: int
error_message: Optional[str]
"""
Number of maximum concurrent executions of the container.
Last error message of the container.
"""

domain_name: str
description: Optional[str]
"""
Domain name attributed to the contaioner.
Description of the container.
"""

protocol: ContainerProtocol
Expand Down Expand Up @@ -473,6 +473,14 @@ class Container:
Local storage limit of the container (in MB).
"""

scaling_option: Optional[ContainerScalingOption]
"""
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.
"""

region: ScwRegion
"""
Region in which the container will be deployed.
Expand All @@ -483,12 +491,14 @@ class Container:
List of tags applied to the Serverless Container.
"""

scaling_option: Optional[ContainerScalingOption]
command: List[str]
"""
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.
Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
"""

args: List[str]
"""
Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
"""

health_check: Optional[ContainerHealthCheckSpec]
Expand Down Expand Up @@ -867,6 +877,16 @@ class CreateContainerRequest:

private_network_id: Optional[str]

command: Optional[List[str]]
"""
Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
"""

args: Optional[List[str]]
"""
Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
"""


@dataclass
class CreateCronRequest:
Expand Down Expand Up @@ -1555,6 +1575,16 @@ class UpdateContainerRequest:

private_network_id: Optional[str]

command: Optional[List[str]]
"""
Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
"""

args: Optional[List[str]]
"""
Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
"""


@dataclass
class UpdateCronRequest:
Expand Down
12 changes: 12 additions & 0 deletions scaleway/scaleway/container/v1beta1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ def create_container(
health_check: Optional[ContainerHealthCheckSpec] = None,
tags: Optional[List[str]] = None,
private_network_id: Optional[str] = None,
command: Optional[List[str]] = None,
args: Optional[List[str]] = None,
) -> Container:
"""
Create a new container.
Expand Down Expand Up @@ -640,6 +642,8 @@ def create_container(
:param health_check: Health check configuration of the container.
:param tags: Tags of the Serverless Container.
:param private_network_id:
:param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
:param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
:return: :class:`Container <Container>`

Usage:
Expand Down Expand Up @@ -683,6 +687,8 @@ def create_container(
health_check=health_check,
tags=tags,
private_network_id=private_network_id,
command=command,
args=args,
),
self.client,
),
Expand Down Expand Up @@ -717,6 +723,8 @@ def update_container(
health_check: Optional[ContainerHealthCheckSpec] = None,
tags: Optional[List[str]] = None,
private_network_id: Optional[str] = None,
command: Optional[List[str]] = None,
args: Optional[List[str]] = None,
) -> Container:
"""
Update an existing container.
Expand Down Expand Up @@ -749,6 +757,8 @@ def update_container(
:param health_check: Health check configuration of the container.
:param tags: Tags of the Serverless Container.
:param private_network_id:
:param command: Command executed when the container starts. This overrides the default command defined in the container image. This is usually the main executable, or entry point script to run.
:param args: Arguments passed to the command specified in the "command" field. These override the default arguments from the container image, and behave like command-line parameters.
:return: :class:`Container <Container>`

Usage:
Expand Down Expand Up @@ -792,6 +802,8 @@ def update_container(
health_check=health_check,
tags=tags,
private_network_id=private_network_id,
command=command,
args=args,
),
self.client,
),
Expand Down
44 changes: 32 additions & 12 deletions scaleway/scaleway/container/v1beta1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ def unmarshal_Container(data: Any) -> Container:
if field is not None:
args["registry_image"] = field

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

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

field = data.get("timeout", None)
if field is not None:
args["timeout"] = field
Expand All @@ -229,14 +237,6 @@ def unmarshal_Container(data: Any) -> Container:
else:
args["description"] = None

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

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

field = data.get("protocol", None)
if field is not None:
args["protocol"] = field
Expand Down Expand Up @@ -265,6 +265,12 @@ def unmarshal_Container(data: Any) -> Container:
if field is not None:
args["local_storage_limit"] = field

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

field = data.get("region", None)
if field is not None:
args["region"] = field
Expand All @@ -273,11 +279,13 @@ def unmarshal_Container(data: Any) -> Container:
if field is not None:
args["tags"] = field

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

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

field = data.get("health_check", None)
if field is not None:
Expand Down Expand Up @@ -963,6 +971,12 @@ def marshal_CreateContainerRequest(
if request.private_network_id is not None:
output["private_network_id"] = request.private_network_id

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

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

return output


Expand Down Expand Up @@ -1221,6 +1235,12 @@ def marshal_UpdateContainerRequest(
if request.private_network_id is not None:
output["private_network_id"] = request.private_network_id

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

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

return output


Expand Down
Loading