Skip to content

Commit 1327670

Browse files
committed
feat: update generated APIs
1 parent b7c29d2 commit 1327670

File tree

6 files changed

+178
-54
lines changed

6 files changed

+178
-54
lines changed

scaleway-async/scaleway_async/container/v1beta1/api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,8 @@ async def create_container(
612612
health_check: Optional[ContainerHealthCheckSpec] = None,
613613
tags: Optional[List[str]] = None,
614614
private_network_id: Optional[str] = None,
615+
command: Optional[List[str]] = None,
616+
args: Optional[List[str]] = None,
615617
) -> Container:
616618
"""
617619
Create a new container.
@@ -644,6 +646,8 @@ async def create_container(
644646
:param health_check: Health check configuration of the container.
645647
:param tags: Tags of the Serverless Container.
646648
:param private_network_id:
649+
: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.
650+
: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.
647651
:return: :class:`Container <Container>`
648652
649653
Usage:
@@ -687,6 +691,8 @@ async def create_container(
687691
health_check=health_check,
688692
tags=tags,
689693
private_network_id=private_network_id,
694+
command=command,
695+
args=args,
690696
),
691697
self.client,
692698
),
@@ -721,6 +727,8 @@ async def update_container(
721727
health_check: Optional[ContainerHealthCheckSpec] = None,
722728
tags: Optional[List[str]] = None,
723729
private_network_id: Optional[str] = None,
730+
command: Optional[List[str]] = None,
731+
args: Optional[List[str]] = None,
724732
) -> Container:
725733
"""
726734
Update an existing container.
@@ -753,6 +761,8 @@ async def update_container(
753761
:param health_check: Health check configuration of the container.
754762
:param tags: Tags of the Serverless Container.
755763
:param private_network_id:
764+
: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.
765+
: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.
756766
:return: :class:`Container <Container>`
757767
758768
Usage:
@@ -796,6 +806,8 @@ async def update_container(
796806
health_check=health_check,
797807
tags=tags,
798808
private_network_id=private_network_id,
809+
command=command,
810+
args=args,
799811
),
800812
self.client,
801813
),

scaleway-async/scaleway_async/container/v1beta1/marshalling.py

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,14 @@ def unmarshal_Container(data: Any) -> Container:
211211
if field is not None:
212212
args["registry_image"] = field
213213

214+
field = data.get("max_concurrency", None)
215+
if field is not None:
216+
args["max_concurrency"] = field
217+
218+
field = data.get("domain_name", None)
219+
if field is not None:
220+
args["domain_name"] = field
221+
214222
field = data.get("timeout", None)
215223
if field is not None:
216224
args["timeout"] = field
@@ -229,14 +237,6 @@ def unmarshal_Container(data: Any) -> Container:
229237
else:
230238
args["description"] = None
231239

232-
field = data.get("max_concurrency", None)
233-
if field is not None:
234-
args["max_concurrency"] = field
235-
236-
field = data.get("domain_name", None)
237-
if field is not None:
238-
args["domain_name"] = field
239-
240240
field = data.get("protocol", None)
241241
if field is not None:
242242
args["protocol"] = field
@@ -265,6 +265,12 @@ def unmarshal_Container(data: Any) -> Container:
265265
if field is not None:
266266
args["local_storage_limit"] = field
267267

268+
field = data.get("scaling_option", None)
269+
if field is not None:
270+
args["scaling_option"] = unmarshal_ContainerScalingOption(field)
271+
else:
272+
args["scaling_option"] = None
273+
268274
field = data.get("region", None)
269275
if field is not None:
270276
args["region"] = field
@@ -273,11 +279,13 @@ def unmarshal_Container(data: Any) -> Container:
273279
if field is not None:
274280
args["tags"] = field
275281

276-
field = data.get("scaling_option", None)
282+
field = data.get("command", None)
277283
if field is not None:
278-
args["scaling_option"] = unmarshal_ContainerScalingOption(field)
279-
else:
280-
args["scaling_option"] = None
284+
args["command"] = field
285+
286+
field = data.get("args", None)
287+
if field is not None:
288+
args["args"] = field
281289

282290
field = data.get("health_check", None)
283291
if field is not None:
@@ -963,6 +971,12 @@ def marshal_CreateContainerRequest(
963971
if request.private_network_id is not None:
964972
output["private_network_id"] = request.private_network_id
965973

974+
if request.command is not None:
975+
output["command"] = request.command
976+
977+
if request.args is not None:
978+
output["args"] = request.args
979+
966980
return output
967981

968982

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

1238+
if request.command is not None:
1239+
output["command"] = request.command
1240+
1241+
if request.args is not None:
1242+
output["args"] = request.args
1243+
12241244
return output
12251245

12261246

scaleway-async/scaleway_async/container/v1beta1/types.py

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -416,29 +416,29 @@ class Container:
416416
Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").
417417
"""
418418

419-
timeout: Optional[str]
419+
max_concurrency: int
420420
"""
421-
Processing time limit for the container.
421+
Number of maximum concurrent executions of the container.
422422
"""
423423

424-
error_message: Optional[str]
424+
domain_name: str
425425
"""
426-
Last error message of the container.
426+
Domain name attributed to the contaioner.
427427
"""
428428

429-
description: Optional[str]
429+
timeout: Optional[str]
430430
"""
431-
Description of the container.
431+
Processing time limit for the container.
432432
"""
433433

434-
max_concurrency: int
434+
error_message: Optional[str]
435435
"""
436-
Number of maximum concurrent executions of the container.
436+
Last error message of the container.
437437
"""
438438

439-
domain_name: str
439+
description: Optional[str]
440440
"""
441-
Domain name attributed to the contaioner.
441+
Description of the container.
442442
"""
443443

444444
protocol: ContainerProtocol
@@ -473,6 +473,14 @@ class Container:
473473
Local storage limit of the container (in MB).
474474
"""
475475

476+
scaling_option: Optional[ContainerScalingOption]
477+
"""
478+
Possible values:
479+
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
480+
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
481+
- memory_usage_threshold: Scale depending on the memory usage of a container instance.
482+
"""
483+
476484
region: ScwRegion
477485
"""
478486
Region in which the container will be deployed.
@@ -483,12 +491,14 @@ class Container:
483491
List of tags applied to the Serverless Container.
484492
"""
485493

486-
scaling_option: Optional[ContainerScalingOption]
494+
command: List[str]
487495
"""
488-
Possible values:
489-
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
490-
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
491-
- memory_usage_threshold: Scale depending on the memory usage of a container instance.
496+
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.
497+
"""
498+
499+
args: List[str]
500+
"""
501+
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.
492502
"""
493503

494504
health_check: Optional[ContainerHealthCheckSpec]
@@ -867,6 +877,16 @@ class CreateContainerRequest:
867877

868878
private_network_id: Optional[str]
869879

880+
command: Optional[List[str]]
881+
"""
882+
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.
883+
"""
884+
885+
args: Optional[List[str]]
886+
"""
887+
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.
888+
"""
889+
870890

871891
@dataclass
872892
class CreateCronRequest:
@@ -1555,6 +1575,16 @@ class UpdateContainerRequest:
15551575

15561576
private_network_id: Optional[str]
15571577

1578+
command: Optional[List[str]]
1579+
"""
1580+
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.
1581+
"""
1582+
1583+
args: Optional[List[str]]
1584+
"""
1585+
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.
1586+
"""
1587+
15581588

15591589
@dataclass
15601590
class UpdateCronRequest:

scaleway/scaleway/container/v1beta1/api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ def create_container(
608608
health_check: Optional[ContainerHealthCheckSpec] = None,
609609
tags: Optional[List[str]] = None,
610610
private_network_id: Optional[str] = None,
611+
command: Optional[List[str]] = None,
612+
args: Optional[List[str]] = None,
611613
) -> Container:
612614
"""
613615
Create a new container.
@@ -640,6 +642,8 @@ def create_container(
640642
:param health_check: Health check configuration of the container.
641643
:param tags: Tags of the Serverless Container.
642644
:param private_network_id:
645+
: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.
646+
: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.
643647
:return: :class:`Container <Container>`
644648
645649
Usage:
@@ -683,6 +687,8 @@ def create_container(
683687
health_check=health_check,
684688
tags=tags,
685689
private_network_id=private_network_id,
690+
command=command,
691+
args=args,
686692
),
687693
self.client,
688694
),
@@ -717,6 +723,8 @@ def update_container(
717723
health_check: Optional[ContainerHealthCheckSpec] = None,
718724
tags: Optional[List[str]] = None,
719725
private_network_id: Optional[str] = None,
726+
command: Optional[List[str]] = None,
727+
args: Optional[List[str]] = None,
720728
) -> Container:
721729
"""
722730
Update an existing container.
@@ -749,6 +757,8 @@ def update_container(
749757
:param health_check: Health check configuration of the container.
750758
:param tags: Tags of the Serverless Container.
751759
:param private_network_id:
760+
: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.
761+
: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.
752762
:return: :class:`Container <Container>`
753763
754764
Usage:
@@ -792,6 +802,8 @@ def update_container(
792802
health_check=health_check,
793803
tags=tags,
794804
private_network_id=private_network_id,
805+
command=command,
806+
args=args,
795807
),
796808
self.client,
797809
),

scaleway/scaleway/container/v1beta1/marshalling.py

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,14 @@ def unmarshal_Container(data: Any) -> Container:
211211
if field is not None:
212212
args["registry_image"] = field
213213

214+
field = data.get("max_concurrency", None)
215+
if field is not None:
216+
args["max_concurrency"] = field
217+
218+
field = data.get("domain_name", None)
219+
if field is not None:
220+
args["domain_name"] = field
221+
214222
field = data.get("timeout", None)
215223
if field is not None:
216224
args["timeout"] = field
@@ -229,14 +237,6 @@ def unmarshal_Container(data: Any) -> Container:
229237
else:
230238
args["description"] = None
231239

232-
field = data.get("max_concurrency", None)
233-
if field is not None:
234-
args["max_concurrency"] = field
235-
236-
field = data.get("domain_name", None)
237-
if field is not None:
238-
args["domain_name"] = field
239-
240240
field = data.get("protocol", None)
241241
if field is not None:
242242
args["protocol"] = field
@@ -265,6 +265,12 @@ def unmarshal_Container(data: Any) -> Container:
265265
if field is not None:
266266
args["local_storage_limit"] = field
267267

268+
field = data.get("scaling_option", None)
269+
if field is not None:
270+
args["scaling_option"] = unmarshal_ContainerScalingOption(field)
271+
else:
272+
args["scaling_option"] = None
273+
268274
field = data.get("region", None)
269275
if field is not None:
270276
args["region"] = field
@@ -273,11 +279,13 @@ def unmarshal_Container(data: Any) -> Container:
273279
if field is not None:
274280
args["tags"] = field
275281

276-
field = data.get("scaling_option", None)
282+
field = data.get("command", None)
277283
if field is not None:
278-
args["scaling_option"] = unmarshal_ContainerScalingOption(field)
279-
else:
280-
args["scaling_option"] = None
284+
args["command"] = field
285+
286+
field = data.get("args", None)
287+
if field is not None:
288+
args["args"] = field
281289

282290
field = data.get("health_check", None)
283291
if field is not None:
@@ -963,6 +971,12 @@ def marshal_CreateContainerRequest(
963971
if request.private_network_id is not None:
964972
output["private_network_id"] = request.private_network_id
965973

974+
if request.command is not None:
975+
output["command"] = request.command
976+
977+
if request.args is not None:
978+
output["args"] = request.args
979+
966980
return output
967981

968982

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

1238+
if request.command is not None:
1239+
output["command"] = request.command
1240+
1241+
if request.args is not None:
1242+
output["args"] = request.args
1243+
12241244
return output
12251245

12261246

0 commit comments

Comments
 (0)