Tasks and Services#
The RecordTask and RecordService
objects attached to a record are documented under Base Record Models.
The models below are the supporting types, most of which are used by compute managers rather than directly by users.
- class TaskClaimBody[source]#
Bases:
RestModelBaseFields# Field
Type
Required
Default
Yes
Yes
Yes
dict[Annotated[str,StringConstraints(strip_whitespace=None, to_upper=None, to_lower=True, strict=None, min_length=None, max_length=None, pattern=None, ascii_only=None)],list[str]]Yes
Validators# Validator
Mode
Fields
after
after
- name_data: ManagerName#
Name information about this manager
- programs: dict[Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=True, strict=None, min_length=None, max_length=None, pattern=None, ascii_only=None)], list[str]]#
Subset of programs to claim tasks for
- Validated by:
- class TaskReturnBody[source]#
Bases:
RestModelBaseFields# Field
Type
Required
Default
Yes
Yes
- name_data: ManagerName#
Name information about this manager
- class ServiceSubtaskRecord[source]#
Bases:
BaseRecordFields# Field
Type
Required
Default
Alias
No
NonecommentsNo
Nonecompute_historyYes
Yes
No
NoneNo
{}Yes
Yes
Yes
Yes
Yes
Yes
No
Nonedict[str,NativeFile] |NoneNo
Nonenative_filesYes
Literal[‘servicesubtask’]No
'servicesubtask'Yes
Yes
No
NoneserviceYes
No
NoneNo
Nonetask- __init__(client=None, base_url_prefix=None, **kwargs)#
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.
- Parameters:
base_url_prefix (str | None)
- property children_errors: list[BaseRecord]#
Returns errored child records
- property children_status: dict[RecordStatusEnum, int]#
Returns a dictionary of the status of all children of this record
- property comments: list[RecordComment] | None#
- property compute_history: list[ComputeHistory]#
- fetch_children(include=None, force_fetch=False)#
Fetches all children of this record recursively
- classmethod fetch_children_multi(records, include=None, force_fetch=False)#
Fetches all children of the given records
This tries to work efficiently, fetching larger batches of children that can span multiple records
- Parameters:
records (Iterable[BaseRecord | None])
force_fetch (bool)
- get_cache_dict(**kwargs)#
Returns a dictionary of the record meant for caching
When a record is stored in the cache, it is stored without child records (which are in the cache under their own keys). This function returns a dictionary that excludes those children.
kwargs are passed directly to the pydantic dict() function.
- classmethod get_subclass(record_type)#
Obtain a subclass of this class given its record_type
- Parameters:
record_type (str)
- Return type:
- 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
- property native_files: dict[str, NativeFile] | None#
- propagate_client(client, base_url_prefix)#
Propagates a client and related information to this record to any fields within this record that need it
This is expected to be called from derived class propagate_client functions as well
- Parameters:
base_url_prefix (str | None)
- property provenance: Provenance | None#
- property service: RecordService | None#
- sync_to_cache(detach=False)#
Syncs this record to the cache
If detach is True, then the record will be removed from the cache
- Parameters:
detach (bool)
- property task: RecordTask | None#
- id#
- is_service#
- name#
- description#
- tags#
- properties#
- extras#
- status#
- manager_name#
- created_on#
- modified_on#
- creator_user#
- compute_history_#
- task_#
- service_#
- comments_#
- native_files_#