Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.experimental.ingestion_rules

Request and response models for an org’s ingestion rules, which decide which uploaded files are ingested and with which action.

A rule has path patterns and the action that ingests matching files. A file whose path a rule matches when it is uploaded is ingestable, and while the rule’s auto_ingest is on, Roboto runs that action on it. There is no client class yet: call the /v1/ingestion-rules endpoints with RobotoClient.

Usage

List the org’s rules:

from roboto.experimental.ingestion_rules import IngestionRuleRecord
from roboto.http import RobotoClient
rules = (
    RobotoClient.defaulted()
    .get("v1/ingestion-rules")
    .to_record_list(IngestionRuleRecord, json_path=["data", "items"])
)

Submodules

Package Contents

CreateIngestionRuleRequest

class roboto.experimental.ingestion_rules.CreateIngestionRuleRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to create an ingestion rule.

Parameters

data Any

Attributes

CreateIngestionRuleRequest.auto_ingest

auto_ingest bool = True #

CreateIngestionRuleRequest.description

description str | None = None #

CreateIngestionRuleRequest.exclude_patterns

exclude_patterns list[str] = None #

CreateIngestionRuleRequest.include_patterns

include_patterns list[str] #

CreateIngestionRuleRequest.invocation

How each matching upload is ingested. Its invocation_input selects only inputs beyond the uploaded file, which the rule’s trigger always passes first. Required when auto_ingest is on.

CreateIngestionRuleRequest.name

name str #

DefaultIngestionRuleRecord

class roboto.experimental.ingestion_rules.DefaultIngestionRuleRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Wire format of one of the rules every new org starts with, and whether the caller’s org already has it.

POST /v1/ingestion-rules/defaults creates the ones not already_present.

Parameters

data Any

Attributes

DefaultIngestionRuleRecord.already_present

already_present bool #

Whether the org has a rule with this name, or a rule with one of these include patterns.

DefaultIngestionRuleRecord.exclude_patterns

exclude_patterns list[str] = None #

DefaultIngestionRuleRecord.include_patterns

include_patterns list[str] #

DefaultIngestionRuleRecord.invocation

DefaultIngestionRuleRecord.name

name str #

ExistingFilesPreview

class roboto.experimental.ingestion_rules.ExistingFilesPreview(/, **data)#View Source

Bases: pydantic.BaseModel

Files already uploaded that a rule matches, that are not ingested, and whose current upload no rule’s trigger has run on: ones uploaded, or uploaded again, before the rule existed or while its auto-ingest was off. Editing a file’s metadata or tags does not make it one of these.

Response of GET /v1/ingestion-rules/<rule_id>/existing-files.

Parameters

data Any

Attributes

ExistingFilesPreview.complete_session_count

complete_session_count int = 0 #

Complete sessions holding any of these files. After a session’s files are ingested, it is announced as fully ingested again, and the triggers on session.ingested start for it.

ExistingFilesPreview.count

count int #

ExistingFilesPreview.count_is_lower_bound

count_is_lower_bound bool = False #

Whether there may be more than count; counting stops after a fixed number of files.

ExistingFilesPreview.sample_paths

sample_paths list[str] = None #

Up to 10 of the files’ paths. Empty for a caller who is not an org admin.

IngestFileOutcome

class roboto.experimental.ingestion_rules.IngestFileOutcome#View Source

Bases: roboto.compat.StrEnum

What POST /v1/ingestion-rules/ingest did with one file.

Attributes

IngestFileOutcome.AlreadyRunning

AlreadyRunning = 'already_running' #

An ingestion run on the file is still queued or running, so no new one was started.

IngestFileOutcome.AutoIngestOff

AutoIngestOff = 'auto_ingest_off' #

Rules match the file, but none of them auto-ingests.

IngestFileOutcome.NoMatchingRule

NoMatchingRule = 'no_matching_rule' #

No rule in the file’s org matches its path.

IngestFileOutcome.NotFound

NotFound = 'not_found' #

No such file in the caller’s org, the caller may not edit it, or it is not in a dataset (rules apply only to dataset files).

IngestFileOutcome.NotStarted

NotStarted = 'not_started' #

A matching rule’s trigger declined the file (it is disabled, say).

IngestFileOutcome.Started

Started = 'started' #

A matching rule’s trigger started ingesting the file.

IngestFileResult

class roboto.experimental.ingestion_rules.IngestFileResult(/, **data)#View Source

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

Attributes

IngestFileResult.__class_vars__

__class_vars__ #

The names of the class variables defined on the model.

IngestFileResult.__private_attributes__

__private_attributes__ #

Metadata about the private attributes of the model.

IngestFileResult.__signature__

__signature__ #

The synthesized __init__ [Signature][inspect.Signature] of the model.

IngestFileResult.__pydantic_complete__

__pydantic_complete__ #

Whether model building is completed, or if there are still undefined fields.

IngestFileResult.__pydantic_core_schema__

__pydantic_core_schema__ #

The core schema of the model.

IngestFileResult.__pydantic_custom_init__

__pydantic_custom_init__ #

Whether the model has a custom __init__ function.

IngestFileResult.__pydantic_decorators__

__pydantic_decorators__ #

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

IngestFileResult.__pydantic_generic_metadata__

__pydantic_generic_metadata__ #

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

IngestFileResult.__pydantic_parent_namespace__

__pydantic_parent_namespace__ #

Parent namespace of the model, used for automatic rebuilding of models.

IngestFileResult.__pydantic_post_init__

__pydantic_post_init__ #

The name of the post-init method for the model, if defined.

IngestFileResult.__pydantic_root_model__

__pydantic_root_model__ #

Whether the model is a [RootModel][pydantic.root_model.RootModel].

IngestFileResult.__pydantic_serializer__

__pydantic_serializer__ #

The pydantic-core SchemaSerializer used to dump instances of the model.

IngestFileResult.__pydantic_validator__

__pydantic_validator__ #

The pydantic-core SchemaValidator used to validate instances of the model.

IngestFileResult.__pydantic_fields__

__pydantic_fields__ #

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

IngestFileResult.__pydantic_computed_fields__

__pydantic_computed_fields__ #

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

IngestFileResult.__pydantic_extra__

__pydantic_extra__ #

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

IngestFileResult.__pydantic_fields_set__

__pydantic_fields_set__ #

The names of fields explicitly set during instantiation.

IngestFileResult.__pydantic_private__

__pydantic_private__ #

Values of private attributes set on the model instance.

Parameters

data Any

Attributes

IngestFileResult.file_id

file_id str #

IngestFileResult.invocation_id

invocation_id str | None = None #

The invocation started, when outcome is started.

IngestFileResult.outcome

IngestFileResult.rule_id

rule_id str | None = None #

The rule whose trigger ran, or would have.

IngestFilesRequest

class roboto.experimental.ingestion_rules.IngestFilesRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to ingest existing files now with the org’s rules that match them.

Parameters

data Any

Attributes

IngestFilesRequest.file_ids

file_ids list[str] = None #

IngestFilesResponse

class roboto.experimental.ingestion_rules.IngestFilesResponse(/, **data)#View Source

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

Attributes

IngestFilesResponse.__class_vars__

__class_vars__ #

The names of the class variables defined on the model.

IngestFilesResponse.__private_attributes__

__private_attributes__ #

Metadata about the private attributes of the model.

IngestFilesResponse.__signature__

__signature__ #

The synthesized __init__ [Signature][inspect.Signature] of the model.

IngestFilesResponse.__pydantic_complete__

__pydantic_complete__ #

Whether model building is completed, or if there are still undefined fields.

IngestFilesResponse.__pydantic_core_schema__

__pydantic_core_schema__ #

The core schema of the model.

IngestFilesResponse.__pydantic_custom_init__

__pydantic_custom_init__ #

Whether the model has a custom __init__ function.

IngestFilesResponse.__pydantic_decorators__

__pydantic_decorators__ #

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

IngestFilesResponse.__pydantic_generic_metadata__

__pydantic_generic_metadata__ #

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

IngestFilesResponse.__pydantic_parent_namespace__

__pydantic_parent_namespace__ #

Parent namespace of the model, used for automatic rebuilding of models.

IngestFilesResponse.__pydantic_post_init__

__pydantic_post_init__ #

The name of the post-init method for the model, if defined.

IngestFilesResponse.__pydantic_root_model__

__pydantic_root_model__ #

Whether the model is a [RootModel][pydantic.root_model.RootModel].

IngestFilesResponse.__pydantic_serializer__

__pydantic_serializer__ #

The pydantic-core SchemaSerializer used to dump instances of the model.

IngestFilesResponse.__pydantic_validator__

__pydantic_validator__ #

The pydantic-core SchemaValidator used to validate instances of the model.

IngestFilesResponse.__pydantic_fields__

__pydantic_fields__ #

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

IngestFilesResponse.__pydantic_computed_fields__

__pydantic_computed_fields__ #

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

IngestFilesResponse.__pydantic_extra__

__pydantic_extra__ #

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

IngestFilesResponse.__pydantic_fields_set__

__pydantic_fields_set__ #

The names of fields explicitly set during instantiation.

IngestFilesResponse.__pydantic_private__

__pydantic_private__ #

Values of private attributes set on the model instance.

Parameters

data Any

Attributes

IngestFilesResponse.results

One result per requested file, in request order.

IngestionPathRule

class roboto.experimental.ingestion_rules.IngestionPathRule#View Source

The path half of an ingestion rule: include and exclude Git wildmatch patterns.

File annotation and the rule’s trigger both decide through matches(), so a file is marked ingestable exactly when the rule’s trigger would accept its upload.

Attributes

IngestionPathRule.exclude_patterns

exclude_patterns tuple[str, ...] = () #

IngestionPathRule.include_patterns

include_patterns tuple[str, ...] #

IngestionPathRule.matches()

matches(relative_path)#View Source

Whether relative_path matches an include pattern and no exclude pattern, and is not a dotfile.

No rule makes a dotfile ingestable, because triggers never run on dotfiles.

Parameters

relative_path str

Return type

bool

IngestionPathRule.of()

classmethod of(include_patterns, exclude_patterns=())#View Source

Parameters

include_patterns collections.abc.Iterable[str]
exclude_patterns collections.abc.Iterable[str]

IngestionRuleRecord

class roboto.experimental.ingestion_rules.IngestionRuleRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Wire format of an ingestion rule: which file paths in an org are ingestable, and how they are ingested.

A file whose path matches any of include_patterns and none of exclude_patterns is marked ingestable when it is created. The rule owns one trigger (trigger_id) that runs invocation on each matching upload while auto_ingest is on.

Parameters

data Any

Attributes

IngestionRuleRecord.auto_ingest

auto_ingest bool #

Whether matching uploads are ingested automatically: whether the rule’s trigger is enabled. Turning this off disables the trigger and leaves matching files ingestable.

IngestionRuleRecord.created

created datetime.datetime #

IngestionRuleRecord.created_by

created_by str #

IngestionRuleRecord.description

description str | None = None #

IngestionRuleRecord.exclude_patterns

exclude_patterns list[str] = None #

Git wildmatch patterns. A file matching any of them is not ingestable by this rule.

IngestionRuleRecord.include_patterns

include_patterns list[str] #

Git wildmatch patterns, e.g. **/*.mcap. A file matching any of them is ingestable.

IngestionRuleRecord.invocation

How each matching upload is ingested. The trigger passes the uploaded file as the first input, followed by whatever invocation.invocation_input selects. None only on a rule that does not auto-ingest.

IngestionRuleRecord.modified

modified datetime.datetime #

IngestionRuleRecord.modified_by

modified_by str #

IngestionRuleRecord.name

name str #

IngestionRuleRecord.org_id

org_id str #

IngestionRuleRecord.rule_id

rule_id str #

IngestionRuleRecord.trigger_id

trigger_id str | None = None #

The trigger that runs invocation on matching uploads, enabled while auto_ingest is on. Only the rule can enable, disable, edit or delete it. None while the rule has no invocation.

IngestionRun

class roboto.experimental.ingestion_rules.IngestionRun(/, **data)#View Source

Bases: pydantic.BaseModel

The latest time an ingestion rule’s trigger ran on a file’s current upload.

Parameters

data Any

Attributes

IngestionRun.detail

detail str | None = None #

Why the trigger could not start the action, when it could not.

IngestionRun.file_id

file_id str #

IngestionRun.invocation_id

invocation_id str | None = None #

The action invocation the run started. None when the trigger could not start one.

IngestionRun.rule_id

rule_id str #

The rule whose trigger ran.

IngestionRun.started

started datetime.datetime #

IngestionRun.status

IngestionRun.trigger_id

trigger_id str #

IngestionRunStatus

class roboto.experimental.ingestion_rules.IngestionRunStatus#View Source

Bases: roboto.compat.StrEnum

Where one run of a rule’s trigger on a file stands.

Attributes

IngestionRunStatus.Failed

Failed = 'failed' #

The action failed or was cancelled, or the trigger could not start it.

IngestionRunStatus.Finished

Finished = 'finished' #

The action finished. The file’s ingestion_status says how much of it was ingested.

IngestionRunStatus.Running

Running = 'running' #

The ingestion action is queued or running.

LatestIngestionRunsRequest

class roboto.experimental.ingestion_rules.LatestIngestionRunsRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to look up the latest ingestion run on each of some files.

Parameters

data Any

Attributes

LatestIngestionRunsRequest.file_ids

file_ids list[str] = None #

LatestIngestionRunsResponse

class roboto.experimental.ingestion_rules.LatestIngestionRunsResponse(/, **data)#View Source

Bases: pydantic.BaseModel

!!! abstract “Usage Documentation”

[Models](../concepts/models.md)

A base class for creating Pydantic models.

Attributes

LatestIngestionRunsResponse.__class_vars__

__class_vars__ #

The names of the class variables defined on the model.

LatestIngestionRunsResponse.__private_attributes__

__private_attributes__ #

Metadata about the private attributes of the model.

LatestIngestionRunsResponse.__signature__

__signature__ #

The synthesized __init__ [Signature][inspect.Signature] of the model.

LatestIngestionRunsResponse.__pydantic_complete__

__pydantic_complete__ #

Whether model building is completed, or if there are still undefined fields.

LatestIngestionRunsResponse.__pydantic_core_schema__

__pydantic_core_schema__ #

The core schema of the model.

LatestIngestionRunsResponse.__pydantic_custom_init__

__pydantic_custom_init__ #

Whether the model has a custom __init__ function.

LatestIngestionRunsResponse.__pydantic_decorators__

__pydantic_decorators__ #

Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.

LatestIngestionRunsResponse.__pydantic_generic_metadata__

__pydantic_generic_metadata__ #

A dictionary containing metadata about generic Pydantic models. The origin and args items map to the [__origin__][genericalias.__origin__] and [__args__][genericalias.__args__] attributes of [generic aliases][types-genericalias], and the parameter item maps to the __parameter__ attribute of generic classes.

LatestIngestionRunsResponse.__pydantic_parent_namespace__

__pydantic_parent_namespace__ #

Parent namespace of the model, used for automatic rebuilding of models.

LatestIngestionRunsResponse.__pydantic_post_init__

__pydantic_post_init__ #

The name of the post-init method for the model, if defined.

LatestIngestionRunsResponse.__pydantic_root_model__

__pydantic_root_model__ #

Whether the model is a [RootModel][pydantic.root_model.RootModel].

LatestIngestionRunsResponse.__pydantic_serializer__

__pydantic_serializer__ #

The pydantic-core SchemaSerializer used to dump instances of the model.

LatestIngestionRunsResponse.__pydantic_validator__

__pydantic_validator__ #

The pydantic-core SchemaValidator used to validate instances of the model.

LatestIngestionRunsResponse.__pydantic_fields__

__pydantic_fields__ #

A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.

LatestIngestionRunsResponse.__pydantic_computed_fields__

__pydantic_computed_fields__ #

A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.

LatestIngestionRunsResponse.__pydantic_extra__

__pydantic_extra__ #

A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra] is set to ‘allow’.

LatestIngestionRunsResponse.__pydantic_fields_set__

__pydantic_fields_set__ #

The names of fields explicitly set during instantiation.

LatestIngestionRunsResponse.__pydantic_private__

__pydantic_private__ #

Values of private attributes set on the model instance.

Parameters

data Any

Attributes

LatestIngestionRunsResponse.runs

The latest run per file id. A file whose current upload no rule’s trigger has run on, or that the caller may not view, is absent.

MAX_INGEST_FILES

roboto.experimental.ingestion_rules.MAX_INGEST_FILES = 100#View Source

Most files one POST /v1/ingestion-rules/ingest takes.

MAX_MATCH_PATHS

roboto.experimental.ingestion_rules.MAX_MATCH_PATHS = 200#View Source

The most paths one MatchIngestionRulesRequest may ask about.

MatchIngestionRulesRequest

class roboto.experimental.ingestion_rules.MatchIngestionRulesRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to ask which of an org’s ingestion rules match each of some file paths.

Parameters

data Any

Attributes

MatchIngestionRulesRequest.paths

paths list[str] = None #

File paths relative to their dataset, e.g. logs/run_1.mcap.

MatchIngestionRulesResponse

class roboto.experimental.ingestion_rules.MatchIngestionRulesResponse(/, **data)#View Source

Bases: pydantic.BaseModel

The rules matching each requested path, oldest rule first. A path no rule matches maps to an empty list.

Parameters

data Any

Attributes

MatchIngestionRulesResponse.matches

UpdateIngestionRuleRequest

class roboto.experimental.ingestion_rules.UpdateIngestionRuleRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to change an ingestion rule. Only the fields present in the payload change.

Parameters

data Any

Attributes

UpdateIngestionRuleRequest.auto_ingest

auto_ingest bool | None = None #

Turning this on enables the rule’s trigger, creating it if the rule had none; turning it off disables it.

UpdateIngestionRuleRequest.description

description str | None = None #

UpdateIngestionRuleRequest.exclude_patterns

exclude_patterns list[str] | None = None #

UpdateIngestionRuleRequest.include_patterns

include_patterns list[str] | None = None #

UpdateIngestionRuleRequest.invocation

Replaces the rule’s whole invocation when present.

UpdateIngestionRuleRequest.name

name str | None = None #

Was this page helpful?