Skip to content

Commit

Permalink
feat(serverless_jobs): add started_at in JobRun (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Mar 29, 2024
1 parent 869b9fb commit 596e6b8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 42 deletions.
28 changes: 16 additions & 12 deletions scaleway-async/scaleway_async/jobs/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@ def unmarshal_JobRun(data: Any) -> JobRun:
if field is not None:
args["command"] = field

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

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

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -180,6 +168,22 @@ def unmarshal_JobRun(data: Any) -> JobRun:
if field is not None:
args["run_duration"] = field

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

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

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

field = data.get("started_at", None)
if field is not None:
args["started_at"] = parser.isoparse(field) if isinstance(field, str) else field

return JobRun(**args)


Expand Down
20 changes: 11 additions & 9 deletions scaleway-async/scaleway_async/jobs/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ class JobRun:

command: str

environment_variables: Dict[str, str]

local_storage_capacity: int

region: Region
"""
Region to target. If none is passed will use default region from the config.
"""

created_at: Optional[datetime]

updated_at: Optional[datetime]
Expand All @@ -130,6 +121,17 @@ class JobRun:

run_duration: Optional[str]

environment_variables: Dict[str, str]

local_storage_capacity: int

region: Region
"""
Region to target. If none is passed will use default region from the config.
"""

started_at: Optional[datetime]


@dataclass
class UpdateJobDefinitionRequestCronScheduleConfig:
Expand Down
28 changes: 16 additions & 12 deletions scaleway/scaleway/jobs/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@ def unmarshal_JobRun(data: Any) -> JobRun:
if field is not None:
args["command"] = field

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

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

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -180,6 +168,22 @@ def unmarshal_JobRun(data: Any) -> JobRun:
if field is not None:
args["run_duration"] = field

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

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

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

field = data.get("started_at", None)
if field is not None:
args["started_at"] = parser.isoparse(field) if isinstance(field, str) else field

return JobRun(**args)


Expand Down
20 changes: 11 additions & 9 deletions scaleway/scaleway/jobs/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ class JobRun:

command: str

environment_variables: Dict[str, str]

local_storage_capacity: int

region: Region
"""
Region to target. If none is passed will use default region from the config.
"""

created_at: Optional[datetime]

updated_at: Optional[datetime]
Expand All @@ -130,6 +121,17 @@ class JobRun:

run_duration: Optional[str]

environment_variables: Dict[str, str]

local_storage_capacity: int

region: Region
"""
Region to target. If none is passed will use default region from the config.
"""

started_at: Optional[datetime]


@dataclass
class UpdateJobDefinitionRequestCronScheduleConfig:
Expand Down

0 comments on commit 596e6b8

Please sign in to comment.