job_info

Tools to process the results from the ParityOS cloud service.

class parityos.services.job_info.JobStatus(value)

Bases: Enum

SUBMITTED = 'Submitted'

Job has been submitted.

RUNNING = 'Running'

Job is running.

COMPLETED = 'Completed'

Job has completed.

FAILED = 'Failed'

Job has failed.

class parityos.services.job_info.JobInfo(id: str, description: str, status: JobStatus | str, submitted_at, started_at=None, finished_at=None, failure_reason: str = '')

Bases: object

Encapsulates the information about a service job.

Contains attributes which describe relevant times at which they were submitted, started, and eventually finished or failed (in which case, a reason for failure is also given).

id: str

UUID4 id of the job in the ParityOS cloud database.

description: str

A description for easier job identification.

status: JobStatus

Status of the submission. See JobStatus.

submitted_at: datetime

Time at which the job was submitted and queued for execution.

started_at: datetime | None

Time at which the job started being executed. Optional. Defaults to None.

finished_at: datetime | None

Time at which the job finished, regardless of job success or failure. Optional. Defaults to None.

failure_reason: str

Reason why the job failed, only non-empty if status is JobStatus.FAILED. Optional. Defaults to empty string.

duration: timedelta | None

The duration of the job if it has started and finished.