Internal Jobs#
- class InternalJobStatusEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
str
,Enum
The state of a record object. The states which are available are a finite set.
- complete = 'complete'#
- waiting = 'waiting'#
- running = 'running'#
- error = 'error'#
- cancelled = 'cancelled'#
- pydantic model InternalJob[source]#
Bases:
BaseModel
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- Config:
extra: Extra = Extra.forbid
- Fields:
- field id: int [Required]#
- field name: str [Required]#
- field status: InternalJobStatusEnum [Required]#
- field added_date: datetime [Required]#
- field scheduled_date: datetime [Required]#
- field started_date: datetime | None = None#
- field last_updated: datetime | None = None#
- field ended_date: datetime | None = None#
- field runner_hostname: str | None = None#
- field runner_uuid: str | None = None#
- field repeat_delay: int | None = None#
- field serial_group: str | None = None#
- field progress: int [Required]#
- field progress_description: str | None = None#
- field function: str [Required]#
- field kwargs: Dict[str, Any] [Required]#
- field after_function: str | None = None#
- field after_function_kwargs: Dict[str, Any] | None = None#
- field result: Any = None#
- field user: str | None = None#
- watch(interval=2.0, timeout=None)[source]#
Watch an internal job for completion
Will poll every interval seconds until the job is finished (complete, error, cancelled, etc).
- Parameters:
interval (float) – Time (in seconds) between polls on the server
timeout (float | None) – Max amount of time (in seconds) to wait. If None, will wait forever.
- property duration: timedelta#
- property duration_str: str#
- pydantic model InternalJobQueryFilters[source]#
Bases:
QueryProjModelBase
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- Config:
extra: Extra = Extra.forbid
validate_assignment: bool = True
- Fields:
- Validators:
- field job_id: List[int] | None = None#
- field name: List[str] | None = None#
- field user: List[int | str] | None = None#
- field runner_hostname: List[str] | None = None#
- field status: List[InternalJobStatusEnum] | None = None#
- field last_updated_before: datetime | None = None#
- Validated by:
- field last_updated_after: datetime | None = None#
- Validated by:
- field added_before: datetime | None = None#
- Validated by:
- field added_after: datetime | None = None#
- Validated by:
- field scheduled_before: datetime | None = None#
- Validated by:
- field scheduled_after: datetime | None = None#
- Validated by:
- validator parse_dates » added_after, scheduled_before, last_updated_before, scheduled_after, added_before, last_updated_after[source]#
- field limit: int | None = None#
- Validated by:
validate_lists
- field cursor: int | None = None#
- Validated by:
validate_lists
- field include: List[str] | None = None#
- field exclude: List[str] | None = None#
- class InternalJobQueryIterator(client, query_filters)[source]#
Bases:
QueryIteratorBase
[InternalJob
]Iterator for internal job queries
This iterator transparently handles batching and pagination over the results of an internal job query.
Construct an iterator
- Parameters:
client – QCPortal client object used to contact/retrieve data from the server
query_filters (InternalJobQueryFilters) – The actual query information to send to the server
- reset()#
Starts retrieval of results from the beginning again