roboto.experimental.sessions.record#
Module Contents#
- class roboto.experimental.sessions.record.CompletionPolicy(/, **data)#
Bases:
pydantic.BaseModelWhen Roboto marks a session complete on its own.
A session’s completion policy is set when the session is created and can be changed with an update. Roboto marks the session complete once
inactivity_minuteshave passed since a file was last added to it, or since the policy was changed, whichever is later. A session that no file has been added to yet is not completed this way. Adding a file to a session Roboto completed puts it back in progress, and Roboto marks it complete again after the same inactivity.- Parameters:
data (Any)
- inactivity_minutes: int#
Minutes without a new file after which Roboto marks the session complete.
- model_config#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- roboto.experimental.sessions.record.MAX_INACTIVITY_MINUTES = 10080#
one week.
- Type:
Longest inactivity a
CompletionPolicymay wait for
- class roboto.experimental.sessions.record.PendingIngestionFile(/, **data)#
Bases:
pydantic.BaseModelA file in a session that is ingestable and not ingested yet.
- Parameters:
data (Any)
- file_id: str#
ID of the file.
- ingestion_status: roboto.domain.files.IngestionStatus#
not at all, or partly.
- Type:
How much of the file’s current version is ingested
- last_run: roboto.experimental.ingestion_runs.IngestionRun | None = None#
The latest time an ingestion rule’s trigger ran on the file.
Nonewhen none has.
- relative_path: str#
Path of the file within its dataset, device, or org.
- uploaded: datetime.datetime | None = None#
When the file’s current version was uploaded.
- class roboto.experimental.sessions.record.SessionFileRecord(/, **data)#
Bases:
pydantic.BaseModelWire-format row for one file a Session holds, and the part of the file it holds.
Time window contract (
min_wall_clock_timestamp_nsandmax_wall_clock_timestamp_ns):Set together or both
None; a window with only one bound is rejected on write.When both are
None, the Session holds the file’s whole recorded time window.When both are set,
min_wall_clock_timestamp_ns <= max_wall_clock_timestamp_ns. Consumers iterating session data must keep only the file’s data inside the closed interval[min_wall_clock_timestamp_ns, max_wall_clock_timestamp_ns].Values are nanoseconds since the Unix epoch, measured the same way as the parent Session’s own bounds. A caller states this window in the file’s own timestamps, on
SessionFile; the platform adds the anchor covering the data the window names and reports the sum here, alongside theunix_epoch_offset_nsit added.
Data range contract (
data_range):Nonemeans the Session holds the whole file.(start, end):startis the first covered position;endis one past the last, with0 <= start < end. Values are in the file’s own units: stored-row positions (counted from 0), or nanoseconds of media time for video.Used when one file is shared by several sessions; the range names the slice of the file that belongs to this session.
- Parameters:
data (Any)
- created: datetime.datetime | None = None#
When this file was added to the session.
- created_by: str#
User ID or service account that added this file to the session.
- data_range: tuple[int, int] | None = None#
The slice of the file the Session holds, as
(start, end)in the file’s own units, orNonewhen it holds the whole file.startis the first covered position;endis one past the last.
- fs_node_id: str#
Identifier of the file.
- max_wall_clock_timestamp_ns: int | None = None#
Upper bound (inclusive) of the part of the file the Session holds, in Unix-epoch nanoseconds.
Nonemeans the Session holds the file up to the end of its recorded time window; paired withmin_wall_clock_timestamp_ns.
- min_wall_clock_timestamp_ns: int | None = None#
Lower bound (inclusive) of the part of the file the Session holds, in Unix-epoch nanoseconds.
Nonemeans the Session holds the file from the beginning of its recorded time window; paired withmax_wall_clock_timestamp_ns.
- model_config#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- modified: datetime.datetime | None = None#
When this file’s place in the session was last modified.
- modified_by: str#
User ID or service account that last modified this file’s place in the session.
- session_id: str#
Identifier of the session holding this file.
- unix_epoch_offset_ns: int | None = None#
Wall-clock instant of stored time 0 for the file’s data the Session holds, in nanoseconds since the Unix epoch: what the platform added to the file’s own timestamps to reach
min_wall_clock_timestamp_nsandmax_wall_clock_timestamp_ns, and what to subtract to read any other instant back in the file’s own timestamps.Nonewhen that data includes nothing registered, and when it sits at more than one instant, which leaves no single offset to report.
- class roboto.experimental.sessions.record.SessionFileView(/, **data)#
Bases:
pydantic.BaseModelOne row of the
GET /v1/sessions/id/<session_id>/filesresponse: a file’s place in a Session joined with display fields of the file itself.These fields come from the session’s composition:
file_id, the optional time windowmin_wall_clock_timestamp_ns/max_wall_clock_timestamp_nsin Unix-epoch nanoseconds, the optionaldata_rangeslice (the window and the slice both under the contracts documented onSessionFileRecord), and theunix_epoch_offset_nsthe platform added to reach that window. Every other field is read from the file itself when the files are listed, and describes the file rather than its place in the session:createdis when the file was created, not when it joined the session. None of those fields is part of a write.- Parameters:
data (Any)
- created: datetime.datetime | None = None#
When the file was created.
- data_range: tuple[int, int] | None = None#
The slice of the file the Session holds, as
(start, end)in the file’s own units, orNonewhen it holds the whole file.startis the first covered position;endis one past the last.
- dataset_id: str | None = None#
ID of the dataset that contains the file.
- file_id: str#
Stable, unique identifier of the file.
- ingestable: bool | None = None#
its path matched one of its org’s ingestion rules when its current version was created, or it has since been partly or fully ingested.
- Type:
Whether the file is meant to be ingested
- ingestion_status: roboto.domain.files.IngestionStatus | None = None#
How much of the contributing file has been ingested.
- max_wall_clock_timestamp_ns: int | None = None#
Upper bound (inclusive) of the part of the file the Session holds, in Unix-epoch nanoseconds.
Nonemeans the Session holds the file up to the end of its recorded time window; paired withmin_wall_clock_timestamp_ns.
- min_wall_clock_timestamp_ns: int | None = None#
Lower bound (inclusive) of the part of the file the Session holds, in Unix-epoch nanoseconds.
Nonemeans the Session holds the file from the beginning of its recorded time window; paired withmax_wall_clock_timestamp_ns.
- model_config#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- modified: datetime.datetime | None = None#
When the file was last modified.
- name: str | None = None#
Name of the file (the final segment of
relative_path).
- origination: str | None = None#
Provenance of the file, e.g. an invocation id or upload source.
- relative_path: str | None = None#
Path of the file within its dataset.
- size: int | None = None#
Size of the file in bytes.
- tags: list[str]#
Tags on the file.
- unix_epoch_offset_ns: int | None = None#
Wall-clock instant of stored time 0 for the file’s data the Session holds, in nanoseconds since the Unix epoch: what the platform added to the file’s own timestamps to reach
min_wall_clock_timestamp_nsandmax_wall_clock_timestamp_ns, and what to subtract to read any other instant back in the file’s own timestamps.Nonewhen that data includes nothing registered, and when it sits at more than one instant, which leaves no single offset to report.
- class roboto.experimental.sessions.record.SessionIngestionState#
Bases:
roboto.compat.StrEnumWhere a session’s ingestion stands.
- InProgress = 'in_progress'#
The session is in progress, so it is not announced ingested.
- Ingested = 'ingested'#
The session is complete and every ingestable file in it is ingested.
- Processing = 'processing'#
The session is complete and at least one of its ingestable files is not ingested yet.
- class roboto.experimental.sessions.record.SessionIngestionStatus(/, **data)#
Bases:
pydantic.BaseModelWhere a session stands in ingestion, with the files it is still waiting for.
Response of
GET /v1/sessions/id/<session_id>/ingestion.- Parameters:
data (Any)
- failed_file_count: int = 0#
Pending files whose latest ingestion run failed, or finished without ingesting the file. Counts only the files in
pending_files, so at most 100.
- ingested_file_count: int = 0#
How many ingestable files are ingested.
- ingestion_count: int#
How many times the session has been announced ingested.
- not_ingestable_file_count: int = 0#
How many files are not ingestable. The session never waits for them.
- pending_file_count: int = 0#
How many ingestable files are not ingested yet, leaving out skipped ones.
- pending_files: list[PendingIngestionFile]#
Ingestable files not ingested yet, which keep a complete session from being announced. Holds at most the first 100, ordered by path;
pending_file_countcounts them all.
- session_id: str#
ID of the session.
- skipped_file_count: int = 0#
How many ingestable files not ingested the session was told to stop waiting for.
- skipped_files: list[SkippedIngestionFile]#
Ingestable files not ingested that the session was told to stop waiting for. At most the first 100;
skipped_file_countcounts them all.
- state: SessionIngestionState#
Whether the session is in progress, waiting for files to be ingested, or ingested.
- class roboto.experimental.sessions.record.SessionIngestionSummary(/, **data)#
Bases:
pydantic.BaseModelWhere one session’s ingestion stands, in counts: what a sessions list shows per row.
Response item of
POST /v1/sessions/ingestion/summaries.- Parameters:
data (Any)
- failed_file_count: int = 0#
Pending files whose latest ingestion run failed, or finished without ingesting the file. Counted among the first 100 pending files, as
SessionIngestionStatus.pending_fileslists them.
- ingested_file_count: int = 0#
How many ingestable files are ingested.
- not_ingestable_file_count: int = 0#
How many files are not ingestable. The session never waits for them.
- pending_file_count: int = 0#
How many ingestable files are not ingested yet, leaving out skipped ones.
- session_id: str#
ID of the session.
- skipped_file_count: int = 0#
Ingestable files not ingested that the session no longer waits for.
- state: SessionIngestionState#
Whether the session is in progress, waiting for files to be ingested, or ingested.
- class roboto.experimental.sessions.record.SessionRecord(/, **data)#
Bases:
pydantic.BaseModelWire-format row for a session: an operational time window of a Device such as a drone flight, a vehicle drive, or a robot run.
A Session unifies the recordings and auxiliary data produced during its window; it may span many files or cover only a slice of one.
min_timestamp_nsandmax_timestamp_nsspan every file the Session holds: each file supplies the time window stated for it or, without one, the time span of the data the Session takes from it. The platform recomputes them in the same write as any change to the Session’s files or to the anchors of their data, so the row never disagrees with its contents.- Parameters:
data (Any)
- completed_at: datetime.datetime | None = None#
When the session was last marked complete.
Noneif it never was. Adding a file to a complete session puts it back in progress and keeps this value, so checkstatusto tell whether the session is complete now.
- completed_by: str | None = None#
User ID or service account that last marked the session complete.
Noneif it never was.
- completes_at: datetime.datetime | None = None#
When Roboto will mark the session complete unless another file is added first.
Nonewhile the session is complete, has no completion policy, or has no files.
- completion_policy: CompletionPolicy | None = None#
the session is marked complete only by request.
- Type:
When Roboto marks the session complete on its own.
None
- created: datetime.datetime | None = None#
When the session was created.
- created_by: str#
User ID or service account that created the session.
- custom_fields: dict[str, Any]#
Values for the custom fields defined on Sessions in this org.
Every
Readycustom field defined for(org_id, Session)appears as a key; values that have not been set surface asNonerather than being absent. Empty when no custom fields are defined for the org.
- description: str | None = None#
Optional description of the Session.
- ingested_at: datetime.datetime | None = None#
When the session was last announced ingested.
Noneuntil the first announcement.
- ingestion_count: int = 0#
How many times the session has been announced ingested. Each announcement fires a
session.ingestedevent. A session is announced again when it is put back in progress and marked complete again, or when its ingestable files change while it is complete, once they are all ingested again. A file uploaded again, removed, or deleted changes them; editing a file’s tags, metadata, or description does not.
- max_timestamp_ns: int | None = None#
Latest time covered by the Session, in Unix-epoch nanoseconds.
Nonewhile none of its files supplies a time: the Session holds no files, or only files added without a time window whose topic data has no time span registered yet.
- metadata: dict[str, Any]#
User-supplied metadata.
Sessions cannot be filtered or sorted by
metadatakeys; for queryable structured attributes, define a custom field on theSessionentity type.
- min_timestamp_ns: int | None = None#
Earliest time covered by the Session, in Unix-epoch nanoseconds.
Nonewhile none of its files supplies a time: the Session holds no files, or only files added without a time window whose topic data has no time span registered yet.
- model_config#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- modified: datetime.datetime | None = None#
When the Session was last modified.
- modified_by: str#
User ID or service account that last modified the Session.
- name: str | None#
A short, human-readable name for the Session. If provided, must be 120 characters or less.
- org_id: str#
Organization that owns the Session.
- session_id: str#
Stable, unique identifier for the Session.
- status: SessionStatus#
Whether the session is in progress or complete. Adding a file to a complete session puts it back in progress.
- tags: list[str]#
User-supplied tags.
Sessions can be filtered by tag membership (e.g.,
tags CONTAINS '<tag>') but are not sortable by tag.
- class roboto.experimental.sessions.record.SessionStatus#
Bases:
roboto.compat.StrEnumWhether a session is still receiving files.
- Complete = 'complete'#
All of the session’s files have been added. Roboto announces
session.ingestedonce every ingestable file in it is ingested.
- InProgress = 'in_progress'#
Files may still be added. Roboto does not announce the session ingested.
- class roboto.experimental.sessions.record.SkipWaitingResponse(/, **data)#
Bases:
pydantic.BaseModelResponse of
POST /v1/sessions/id/<session_id>/ingestion/skip.- Parameters:
data (Any)
- ingestion: SessionIngestionStatus#
Where the session stands in ingestion after the skip.
- not_in_session: list[str]#
Requested file ids that are not in the session, so nothing was skipped for them.
- class roboto.experimental.sessions.record.SkippedIngestionFile(/, **data)#
Bases:
pydantic.BaseModelA file in a session that is ingestable and not ingested, which the session no longer waits for.
The skip covers the upload of the file that was current when it was made: editing the file’s tags, metadata, or description keeps it, and uploading the file again ends it.
- Parameters:
data (Any)
- file_id: str#
ID of the file.
- relative_path: str#
Path of the file within its dataset, device, or org.
- skipped_at: datetime.datetime | None = None#
When the session was told to stop waiting for the file.
- skipped_by: str | None = None#
User ID or service account that told the session to stop waiting for the file.