Internal Jobs#

class InternalJobStatusEnum[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'#
__init__(*args, **kwds)#
class InternalJob[source]#

Bases: BaseModel

id: int#
name: str#
status: InternalJobStatusEnum#
added_date: datetime#
scheduled_date: datetime#
started_date: datetime | None#
last_updated: datetime | None#
ended_date: datetime | None#
runner_hostname: str | None#
runner_uuid: str | None#
repeat_delay: int | None#
serial_group: str | None#
progress: int#
progress_description: str | None#
function: str#
kwargs: dict[str, Any]#
after_function: str | None#
after_function_kwargs: dict[str, Any] | None#
result: Any#
user: str | None#
__init__(client=None, refresh_url=None, **kwargs)[source]#

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

refresh()[source]#

Updates the data of this object with information from the server

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#
model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

class InternalJobQueryFilters[source]#

Bases: QueryProjModelBase

Fields#

Field

Type

Required

Default

added_after

datetime | None

No

None

added_before

datetime | None

No

None

cursor

int | None

No

None

exclude

list[str] | None

No

None

include

list[str] | None

No

None

job_id

list[int] | None

No

None

last_updated_after

datetime | None

No

None

last_updated_before

datetime | None

No

None

limit

int | None

No

None

name

list[str] | None

No

None

runner_hostname

list[str] | None

No

None

scheduled_after

datetime | None

No

None

scheduled_before

datetime | None

No

None

status

list[InternalJobStatusEnum] | None

No

None

user

list[int | str] | None

No

None

job_id: list[int] | None#
name: list[str] | None#
user: list[int | str] | None#
runner_hostname: list[str] | None#
status: list[InternalJobStatusEnum] | None#
last_updated_before: datetime | None#
last_updated_after: datetime | None#
added_before: datetime | None#
added_after: datetime | None#
scheduled_before: datetime | None#
scheduled_after: datetime | None#
classmethod parse_dates(v)[source]#
classmethod validate_lists(v)#
limit#
cursor#
include#
exclude#
class InternalJobQueryIterator[source]#

Bases: QueryIteratorBase[InternalJob]

Iterator for internal job queries

This iterator transparently handles batching and pagination over the results of an internal job query.

__init__(client, query_filters)[source]#

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