Job#

pydantic model safir.uws.Job#

A single UWS job with deserialized parameters.

Parameters:

data (Any)

Fields:
field creation_time: Annotated[UtcDatetime, Field(title='Creation time', description='When the job was created', examples=['2024-10-29T23:57:55+00:00'])] [Required]#

When the job was created

field destruction_time: Annotated[UtcDatetime, Field(title='Destruction time', description='At this time, the job will be aborted if it is still running, its results will be deleted, and it will either change phase to ARCHIVED or all record of the job will be discarded', examples=['2024-11-29T23:57:55+00:00'])] [Required]#

At this time, the job will be aborted if it is still running, its results will be deleted, and it will either change phase to ARCHIVED or all record of the job will be discarded

field end_time: Annotated[UtcDatetime | None, Field(title='End time', description='When the job stopped executing (if it has)', examples=['2024-10-30T00:08:45+00:00', None])] = None#

When the job stopped executing (if it has)

field errors: Annotated[list[JobError], Field(title='Error', description='Error information if the job failed')] = []#

Error information if the job failed

field execution_duration: Annotated[SecondsTimedelta | None, Field(title='Maximum execution duration', description='Allowed maximum execution duration. This is specified in elapsed wall clock time (not CPU time). If null, the execution time is unlimited. If the job runs for longer than this time period, it will be aborted.'), PlainSerializer(lambda t: ..., return_type=int)] = None#

Allowed maximum execution duration. This is specified in elapsed wall clock time (not CPU time). If null, the execution time is unlimited. If the job runs for longer than this time period, it will be aborted.

Constraints:
  • func = <function JobBase.<lambda> at 0x7fa7ee15dd00>

  • return_type = <class ‘int’>

  • when_used = always

field id: Annotated[str, Field(title='Job ID', description='Unique identifier of the job', examples=['47183']), BeforeValidator(lambda v: ...)] [Required]#

Unique identifier of the job

Constraints:
  • func = <function SerializedJob.<lambda> at 0x7fa7ee15dbc0>

  • json_schema_input_type = PydanticUndefined

field json_parameters: Annotated[dict[str, Any], Field(title='Job parameters', description='May be any JSON-serialized object. Stored opaquely and returned as part of the job record.', examples=[{'ids': ['data-id'], 'stencils': [{'type': 'circle', 'center': [1.1, 2.1], 'radius': 0.001}]}])] [Required]#

May be any JSON-serialized object. Stored opaquely and returned as part of the job record.

field message_id: Annotated[str | None, Field(title='Work queue message ID', description='Internal message identifier for the work queuing system. Only meaningful to the service that stored this ID.', examples=['e621a175-e3bf-4a61-98d7-483cb5fb9ec2'])] = None#

Internal message identifier for the work queuing system. Only meaningful to the service that stored this ID.

field owner: Annotated[str, Field(title='Job owner', description='Identity of the owner of the job', examples=['someuser'])] [Required]#

Identity of the owner of the job

field parameters: Annotated[TypeVar(P, bound= ParametersModel)] [Required]#

Job parameters converted to their Pydantic model. Use json_parameters for the serialized form sent over the wire.

field phase: Annotated[ExecutionPhase, Field(title='Execution phase', description='Current execution phase of the job', examples=[ExecutionPhase.PENDING, ExecutionPhase.EXECUTING, ExecutionPhase.COMPLETED])] [Required]#

Current execution phase of the job

field quote: Annotated[UtcDatetime | None, Field(title='Expected completion time', description='Expected completion time of the job if it were started now, or null to indicate that the expected duration is not known. If later than the destruction time, indicates that the job is not possible due to resource constraints.')] = None#

Expected completion time of the job if it were started now, or null to indicate that the expected duration is not known. If later than the destruction time, indicates that the job is not possible due to resource constraints.

field results: Annotated[list[JobResult], Field(title='Job results', description='Results of the job, if it has finished')] = []#

Results of the job, if it has finished

field run_id: Annotated[str | None, Field(title='Client-provided run ID', description='The run ID allows the client to add a unique identifier to all jobs that are part of a single operation, which may aid in tracing issues through a complex system or identifying which operation a job is part of', examples=['daily-2024-10-29'])] = None#

The run ID allows the client to add a unique identifier to all jobs that are part of a single operation, which may aid in tracing issues through a complex system or identifying which operation a job is part of

field service: Annotated[str, Field(title='Service', description='Service responsible for this job', examples=['vo-cutouts'])] [Required]#

Service responsible for this job

field start_time: Annotated[UtcDatetime | None, Field(title='Start time', description='When the job started executing (if it has)', examples=['2024-10-30T00:00:21+00:00', None])] = None#

When the job started executing (if it has)

classmethod from_serialized_job(job, parameters_type)#

Convert from a serialized job returned by Wobbly.

Parameters:
Returns:

Job with the correct parameters model.

Return type:

Job

Raises:

pydantic.ValidationError – Raised if the serialized parameters cannot be validated.

to_job_description(base_url)#

Convert to the Pydantic XML model used for the summary of jobs.

Parameters:

base_url (str) – Base URL for the full jobs.

Return type:

ShortJobDescription

to_serialized_job()#

Convert to a serialized job suitable for sending to Wobbly.

Return type:

SerializedJob

to_xml_model(job_summary_type)#

Convert to a Pydantic XML model.

Parameters:

job_summary_type (type[TypeVar(S, bound= JobSummary)]) – XML model class for the job summary.

Returns:

XML model corresponding to this job.

Return type:

vo_models.uws.models.JobSummary