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
10 changes: 8 additions & 2 deletions scaleway-async/scaleway_async/jobs/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async def create_job_definition(
description: str,
region: Optional[Region] = None,
name: Optional[str] = None,
local_storage_capacity: Optional[int] = None,
project_id: Optional[str] = None,
environment_variables: Optional[Dict[str, str]] = None,
job_timeout: Optional[str] = None,
Expand All @@ -65,7 +66,8 @@ async def create_job_definition(
:param region: Region to target. If none is passed will use default region from the config.
:param name: Name of the job definition.
:param cpu_limit: CPU limit of the job.
:param memory_limit: Memory limit of the job.
:param memory_limit: Memory limit of the job (in MiB).
:param local_storage_capacity: Local storage capacity of the job (in MiB).
:param image_uri: Image to use for the job.
:param command: Startup command.
:param project_id: UUID of the Scaleway Project containing the job.
Expand Down Expand Up @@ -103,6 +105,7 @@ async def create_job_definition(
description=description,
region=region,
name=name or random_name(prefix="job"),
local_storage_capacity=local_storage_capacity,
project_id=project_id,
environment_variables=environment_variables,
job_timeout=job_timeout,
Expand Down Expand Up @@ -235,6 +238,7 @@ async def update_job_definition(
name: Optional[str] = None,
cpu_limit: Optional[int] = None,
memory_limit: Optional[int] = None,
local_storage_capacity: Optional[int] = None,
image_uri: Optional[str] = None,
command: Optional[str] = None,
environment_variables: Optional[Dict[str, str]] = None,
Expand All @@ -248,7 +252,8 @@ async def update_job_definition(
:param job_definition_id: UUID of the job definition to update.
:param name: Name of the job definition.
:param cpu_limit: CPU limit of the job.
:param memory_limit: Memory limit of the job.
:param memory_limit: Memory limit of the job (in MiB).
:param local_storage_capacity: Local storage capacity of the job (in MiB).
:param image_uri: Image to use for the job.
:param command: Startup command.
:param environment_variables: Environment variables of the job.
Expand Down Expand Up @@ -280,6 +285,7 @@ async def update_job_definition(
name=name,
cpu_limit=cpu_limit,
memory_limit=memory_limit,
local_storage_capacity=local_storage_capacity,
image_uri=image_uri,
command=command,
environment_variables=environment_variables,
Expand Down
12 changes: 12 additions & 0 deletions scaleway-async/scaleway_async/jobs/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def unmarshal_JobDefinition(data: Any) -> JobDefinition:
field = data.get("job_timeout", None)
args["job_timeout"] = field

field = data.get("local_storage_capacity", None)
args["local_storage_capacity"] = field

field = data.get("memory_limit", None)
args["memory_limit"] = field

Expand Down Expand Up @@ -126,6 +129,9 @@ def unmarshal_JobRun(data: Any) -> JobRun:
field = data.get("job_definition_id", None)
args["job_definition_id"] = field

field = data.get("local_storage_capacity", None)
args["local_storage_capacity"] = field

field = data.get("memory_limit", None)
args["memory_limit"] = field

Expand Down Expand Up @@ -274,6 +280,9 @@ def marshal_CreateJobDefinitionRequest(
if request.job_timeout is not None:
output["job_timeout"] = request.job_timeout

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

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

Expand Down Expand Up @@ -346,6 +355,9 @@ def marshal_UpdateJobDefinitionRequest(
if request.job_timeout is not None:
output["job_timeout"] = request.job_timeout

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

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

Expand Down
18 changes: 16 additions & 2 deletions scaleway-async/scaleway_async/jobs/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class JobDefinition:

cron_schedule: Optional[CronSchedule]

local_storage_capacity: int

region: Region


Expand Down Expand Up @@ -122,6 +124,8 @@ class JobRun:

environment_variables: Dict[str, str]

local_storage_capacity: int

region: Region


Expand Down Expand Up @@ -176,7 +180,12 @@ class CreateJobDefinitionRequest:

memory_limit: int
"""
Memory limit of the job.
Memory limit of the job (in MiB).
"""

local_storage_capacity: Optional[int]
"""
Local storage capacity of the job (in MiB).
"""

image_uri: str
Expand Down Expand Up @@ -265,7 +274,12 @@ class UpdateJobDefinitionRequest:

memory_limit: Optional[int]
"""
Memory limit of the job.
Memory limit of the job (in MiB).
"""

local_storage_capacity: Optional[int]
"""
Local storage capacity of the job (in MiB).
"""

image_uri: Optional[str]
Expand Down
10 changes: 8 additions & 2 deletions scaleway/scaleway/jobs/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def create_job_definition(
description: str,
region: Optional[Region] = None,
name: Optional[str] = None,
local_storage_capacity: Optional[int] = None,
project_id: Optional[str] = None,
environment_variables: Optional[Dict[str, str]] = None,
job_timeout: Optional[str] = None,
Expand All @@ -65,7 +66,8 @@ def create_job_definition(
:param region: Region to target. If none is passed will use default region from the config.
:param name: Name of the job definition.
:param cpu_limit: CPU limit of the job.
:param memory_limit: Memory limit of the job.
:param memory_limit: Memory limit of the job (in MiB).
:param local_storage_capacity: Local storage capacity of the job (in MiB).
:param image_uri: Image to use for the job.
:param command: Startup command.
:param project_id: UUID of the Scaleway Project containing the job.
Expand Down Expand Up @@ -103,6 +105,7 @@ def create_job_definition(
description=description,
region=region,
name=name or random_name(prefix="job"),
local_storage_capacity=local_storage_capacity,
project_id=project_id,
environment_variables=environment_variables,
job_timeout=job_timeout,
Expand Down Expand Up @@ -235,6 +238,7 @@ def update_job_definition(
name: Optional[str] = None,
cpu_limit: Optional[int] = None,
memory_limit: Optional[int] = None,
local_storage_capacity: Optional[int] = None,
image_uri: Optional[str] = None,
command: Optional[str] = None,
environment_variables: Optional[Dict[str, str]] = None,
Expand All @@ -248,7 +252,8 @@ def update_job_definition(
:param job_definition_id: UUID of the job definition to update.
:param name: Name of the job definition.
:param cpu_limit: CPU limit of the job.
:param memory_limit: Memory limit of the job.
:param memory_limit: Memory limit of the job (in MiB).
:param local_storage_capacity: Local storage capacity of the job (in MiB).
:param image_uri: Image to use for the job.
:param command: Startup command.
:param environment_variables: Environment variables of the job.
Expand Down Expand Up @@ -280,6 +285,7 @@ def update_job_definition(
name=name,
cpu_limit=cpu_limit,
memory_limit=memory_limit,
local_storage_capacity=local_storage_capacity,
image_uri=image_uri,
command=command,
environment_variables=environment_variables,
Expand Down
12 changes: 12 additions & 0 deletions scaleway/scaleway/jobs/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def unmarshal_JobDefinition(data: Any) -> JobDefinition:
field = data.get("job_timeout", None)
args["job_timeout"] = field

field = data.get("local_storage_capacity", None)
args["local_storage_capacity"] = field

field = data.get("memory_limit", None)
args["memory_limit"] = field

Expand Down Expand Up @@ -126,6 +129,9 @@ def unmarshal_JobRun(data: Any) -> JobRun:
field = data.get("job_definition_id", None)
args["job_definition_id"] = field

field = data.get("local_storage_capacity", None)
args["local_storage_capacity"] = field

field = data.get("memory_limit", None)
args["memory_limit"] = field

Expand Down Expand Up @@ -274,6 +280,9 @@ def marshal_CreateJobDefinitionRequest(
if request.job_timeout is not None:
output["job_timeout"] = request.job_timeout

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

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

Expand Down Expand Up @@ -346,6 +355,9 @@ def marshal_UpdateJobDefinitionRequest(
if request.job_timeout is not None:
output["job_timeout"] = request.job_timeout

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

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

Expand Down
18 changes: 16 additions & 2 deletions scaleway/scaleway/jobs/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class JobDefinition:

cron_schedule: Optional[CronSchedule]

local_storage_capacity: int

region: Region


Expand Down Expand Up @@ -122,6 +124,8 @@ class JobRun:

environment_variables: Dict[str, str]

local_storage_capacity: int

region: Region


Expand Down Expand Up @@ -176,7 +180,12 @@ class CreateJobDefinitionRequest:

memory_limit: int
"""
Memory limit of the job.
Memory limit of the job (in MiB).
"""

local_storage_capacity: Optional[int]
"""
Local storage capacity of the job (in MiB).
"""

image_uri: str
Expand Down Expand Up @@ -265,7 +274,12 @@ class UpdateJobDefinitionRequest:

memory_limit: Optional[int]
"""
Memory limit of the job.
Memory limit of the job (in MiB).
"""

local_storage_capacity: Optional[int]
"""
Local storage capacity of the job (in MiB).
"""

image_uri: Optional[str]
Expand Down