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

roboto.domain.events

Events domain module for the Roboto SDK.

This module provides functionality for creating and managing events, which are time-anchored annotations that relate Roboto entities (datasets, files, topics, and message paths) to specific time periods. Events enable temporal analysis, data annotation, and correlation of activities across different data sources.

The events domain includes:

  • Event creation and management
  • Association with datasets, files, topics, and message paths
  • Time-based data retrieval and analysis
  • Display options and metadata management
  • Event querying and filtering capabilities

Submodules

Package Contents

CreateEventRequest

class roboto.domain.events.CreateEventRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for the Create Event operation.

Parameters

data Any

Attributes

CreateEventRequest.associations

associations list[roboto.association.Association] = None #

Datasets, files, topics and message paths which this event relates to. At least one must be provided. All referenced datasets, files, topics and message paths must be owned by the same organization.

CreateEventRequest.custom_fields

custom_fields dict[str, Any] | None = None #

Initial values for Ready custom fields on this event.

Each key must be the name of a CustomField that is Ready for the caller’s org and the Event entity type; each value must satisfy the field’s declared type. Names that are undefined or not Ready, and values that don’t match the field’s type, are rejected with a structured error.

CreateEventRequest.description

description str | None = None #

An optional human-readable description of the event.

CreateEventRequest.display_options

display_options EventDisplayOptions | None = None #

Display options for this event, such as color.

CreateEventRequest.end_time

end_time int #

The end time of the event, in nanoseconds since epoch (assumed Unix epoch). This can be equal to start_time if the event is discrete, but can never be less than start_time.

CreateEventRequest.metadata

metadata dict[str, Any] = None #

Initial key-value pairs to associate with this event for discovery and search.

CreateEventRequest.name

name str #

A brief human-readable name for the event. Many events can have the same name. “Takeoff”, “Crash”, “CPU Spike”, “Bad Image Quality”, and “Unexpected Left” are a few potential examples.

CreateEventRequest.start_time

start_time int #

The start time of the event, in nanoseconds since epoch (assumed Unix epoch).

CreateEventRequest.tags

tags list[str] = None #

Initial tags to associate with this event for discovery and search.

DeleteEventsRequest

class roboto.domain.events.DeleteEventsRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for the Delete Events (bulk) operation.

Used to delete multiple events in a single request. Event IDs that don’t exist are silently ignored so the operation is idempotent; an ID the caller isn’t allowed to delete causes the whole request to be rejected.

A single request may contain at most MAX_EVENTS_PER_DELETE_BATCH event IDs; larger requests are rejected. Use roboto.domain.events.Event.delete_many(), which chunks input into batches of this size for you.

Parameters

data Any

Attributes

DeleteEventsRequest.event_ids

event_ids list[str] #

IDs of the events to delete. At most MAX_EVENTS_PER_DELETE_BATCH per request.

Event

class roboto.domain.events.Event(record, roboto_client=None)#View Source

Represents an event within the Roboto platform.

An event is a time-anchored annotation that relates Roboto entities (datasets, files, topics, and message paths) to specific time periods. Events enable temporal analysis, data correlation, and annotation of activities across different data sources.

Events serve as temporal markers that can:

  • Annotate specific time periods in your data
  • Associate multiple entities (datasets, files, topics, message paths) with time ranges
  • Enable time-based data retrieval and analysis
  • Support metadata and tagging for organization and search
  • Provide visual markers in timeline views and analysis tools

Events can represent instantaneous moments (point in time) or time ranges. They are particularly useful for marking significant occurrences like sensor anomalies, system events, behavioral patterns, or any other time-based phenomena in your data.

Events cannot be instantiated directly through the constructor. Use the class methods Event.create() to create new events or Event.from_id() to load existing events.

Event.clear_custom_field()

clear_custom_field(name)#View Source

Clear a single custom-field value on this event to None.

Parameters

name str

Return type

Event.clear_custom_fields()

clear_custom_fields(names)#View Source

Clear multiple custom-field values on this event to None.

Parameters

names collections.abc.Sequence[str]

Return type

Properties

Event.color

color str | None #

Display color for the event, if set.

Return type: Optional[str]

Event.create()

classmethod create(name, start_time, end_time=None, associations=None, dataset_ids=None, file_ids=None, topic_ids=None, message_path_ids=None, description=None, metadata=None, tags=None, display_options=None, custom_fields=None, caller_org_id=None, roboto_client=None)#View Source

Create a new event associated with at least one dataset, file, topic, or message path.

Creates a time-anchored event that can be associated with various Roboto entities. For instantaneous events (a point in time), only start_time is required. Otherwise, both start_time and end_time should be provided. These fields accept nanoseconds since the UNIX epoch, or any other compatible representations supported by to_epoch_nanoseconds().

Events must be associated with at least one entity. While associations, file_ids, topic_ids, dataset_ids and message_path_ids are all optional, at least one of them must contain a valid association for the event.

Parameters

name str

Human-readable name for the event. Required.

start_time roboto.time.Time

Start timestamp of the event as nanoseconds since UNIX epoch, or any value convertible by to_epoch_nanoseconds().

end_time Optional[roboto.time.Time]

End timestamp of the event. If not provided, defaults to start_time for instantaneous events.

associations Optional[collections.abc.Collection[roboto.association.Association]]

Collection of Association objects linking the event to specific entities.

dataset_ids Optional[collections.abc.Collection[str]]

Dataset IDs to associate the event with.

file_ids Optional[collections.abc.Collection[str]]

File IDs to associate the event with.

topic_ids Optional[collections.abc.Collection[str]]

Topic IDs to associate the event with.

message_path_ids Optional[collections.abc.Collection[str]]

Message path IDs to associate the event with.

description Optional[str]

Optional human-readable description of the event.

metadata Optional[dict[str, Any]]

Key-value metadata for discovery and search.

tags Optional[list[str]]

Tags for categorizing and searching the event.

Visual display options such as color.

custom_fields Optional[dict[str, Any]]

Optional initial values for Ready custom fields defined on Events in the caller’s org. Keys must match Ready field names; values must satisfy each field’s declared type.

caller_org_id Optional[str]

Organization ID of the SDK caller. If not provided, uses the caller’s organization.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Returns

Event instance with the provided attributes and associations.

Raises

Invalid parameters (e.g., start_time > end_time), or associations point to non-existent resources.

Caller lacks permission to access associated entities.

Usage

Create an event for a sensor anomaly on a specific topic:

from roboto.domain.events import Event
event = Event.create(
    name="Temperature Spike",
    start_time=1722870127699468923,
    end_time=1722870127799468923,
    description="Unusual temperature readings detected",
    topic_ids=["tp_abc123"],
    tags=["anomaly", "temperature"],
    metadata={"severity": "high", "sensor_id": "temp_01"},
)

Create an instantaneous event on a file:

event = Event.create(
    name="System Boot",
    start_time="1722870127.699468923",  # String format also supported
    file_ids=["fl_xyz789"],
    tags=["system", "boot"],
)

Create an event with display options:

from roboto.domain.events import EventDisplayOptions
event = Event.create(
    name="Critical Alert",
    start_time=1722870127699468923,
    end_time=1722870127799468923,
    dataset_ids=["ds_abc123"],
    display_options=EventDisplayOptions(color="red"),
    metadata={"alert_type": "critical", "component": "engine"},
)

Properties

Event.created

created datetime.datetime #

Date and time when this event was created.

Return type: datetime.datetime

Event.created_by

created_by str #

User who created this event.

Return type: str

Event.custom_fields

custom_fields dict[str, Any] #

Custom-field values defined on Events in this org.

Every Ready CustomField defined for (org_id, Event) appears as a key. Values that have not been set on this event surface as None rather than being absent. Empty when no custom fields are defined for the org.

A Timestamp value is returned as an ISO 8601 string.

Return type: dict[str, Any]

Event.dataset_ids()

dataset_ids(strict_associations=False)#View Source

Get dataset IDs associated with this event.

Parameters

strict_associations bool

If True, only return datasets with direct associations. If False (default), also return datasets inferred from file and topic associations.

Returns

list[str]

List of unique dataset IDs associated with this event.

Usage

Get all associated dataset IDs:

event = Event.from_id("ev_abc123")
dataset_ids = event.dataset_ids()
print(f"Associated with {len(dataset_ids)} datasets")

Get only directly associated datasets:

strict_dataset_ids = event.dataset_ids(strict_associations=True)
print(f"Directly associated with {len(strict_dataset_ids)} datasets")

Event.delete()

delete()#View Source

Delete this event permanently.

This operation cannot be undone. The event and all its associations will be permanently removed from the platform.

Raises

Caller lacks permission to delete this event.

Event has already been deleted or does not exist.

Return type

None

Usage

Delete an event:

event = Event.from_id("ev_abc123")
event.delete()
# Event is now permanently deleted

Conditional deletion:

event = Event.from_id("ev_abc123")
if "temporary" in event.tags:
    event.delete()
    print("Temporary event deleted")

Event.delete_many()

classmethod delete_many(event_ids, roboto_client=None)#View Source

Delete multiple events.

Authorization works just like delete(): you can delete any event you’re able to manage. If the list includes an event you’re not allowed to delete, the whole request is rejected and nothing is deleted. This operation cannot be undone. Event IDs that don’t exist are ignored, so the call is idempotent and safe to retry.

The bulk delete API caps each request at MAX_EVENTS_PER_DELETE_BATCH event IDs. This method removes that limit for callers by splitting event_ids into chunks of that size and sending one request per chunk. Because each chunk is its own request, deleting a very large number of events is not atomic: if a request fails partway through, earlier chunks stay deleted. The operation is idempotent, so retrying with the same IDs safely finishes the job.

Parameters

event_ids collections.abc.Collection[str]

IDs of the events to delete. May exceed the per-request limit; they are batched automatically.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Raises

Caller isn’t allowed to delete one of the requested events.

Return type

None

Usage

Delete several events at once:

from roboto.domain.events import Event
Event.delete_many(["ev_abc123", "ev_def456", "ev_ghi789"])

Delete the events surfaced by a query:

events = list(Event.get_by_dataset("ds_abc123"))
Event.delete_many([event.event_id for event in events])

Properties

Event.description

description str | None #

Optional human-readable description of the event.

Return type: Optional[str]

Event.display_options

Display options for the event, such as color.

Event.end_time

end_time int #

End time of the event in nanoseconds since UNIX epoch.

Return type: int

Event.event_id

event_id str #

Unique identifier for this event.

Return type: str

Event.file_ids()

file_ids(strict_associations=False)#View Source

Get file IDs associated with this event.

Parameters

strict_associations bool

If True, only return files with direct associations. If False (default), also return files inferred from topic and message path associations.

Returns

list[str]

List of unique file IDs associated with this event.

Usage

Get all associated file IDs:

event = Event.from_id("ev_abc123")
file_ids = event.file_ids()
print(f"Associated with {len(file_ids)} files")

Get only directly associated files:

strict_file_ids = event.file_ids(strict_associations=True)
for file_id in strict_file_ids:
    print(f"Directly associated file: {file_id}")

Event.from_id()

classmethod from_id(event_id, roboto_client=None)#View Source

Load an existing event by its ID.

Parameters

event_id str

Unique identifier of the event to retrieve.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Returns

Event instance for the specified ID.

Raises

Event with the specified ID does not exist.

Caller lacks permission to access the event.

Usage

Load an event by ID:

event = Event.from_id("ev_abc123")
print(f"Event: {event.name}")
print(f"Created: {event.created}")

Load and update an event:

event = Event.from_id("ev_abc123")
updated_event = event.set_description("Updated description")
print(f"New description: {updated_event.description}")

Event.get_by_associations()

classmethod get_by_associations(associations, roboto_client=None)#View Source

Retrieve all events associated with the provided associations.

Returns events that match any of the provided associations. Events that you don’t have access to will be filtered out of the response rather than raising an exception.

Parameters

associations collections.abc.Collection[roboto.association.Association]

Collection of Association objects to query events for.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Yields

Event instances associated with any of the specified associations.

Return type

collections.abc.Generator[Event, None, None]

Usage

Query events for multiple associations:

from roboto import Association
associations = [Association.topic("tp_abc123"), Association.file("fl_xyz789")]
events = list(Event.get_by_associations(associations))
for event in events:
    print(f"Event: {event.name}")

Query events for a specific dataset and file combination:

associations = [Association.dataset("ds_abc123"), Association.file("fl_xyz789")]
events = list(Event.get_by_associations(associations))

Event.get_by_dataset()

classmethod get_by_dataset(dataset_id, roboto_client=None, strict_associations=False)#View Source

Retrieve all events associated with a specific dataset.

Returns events that are associated with the given dataset. By default, this includes events associated with the dataset itself, as well as events associated with any files or topics within that dataset. Use strict_associations=True to only return events with direct dataset associations.

Parameters

dataset_id str

ID of the dataset to query events for.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

strict_associations bool

If True, only return events with direct dataset associations. If False (default), also return events associated with files or topics within the dataset.

Yields

Event instances associated with the specified dataset.

Return type

collections.abc.Generator[Event, None, None]

Usage

Get all events for a dataset (including file and topic events):

events = list(Event.get_by_dataset("ds_abc123"))
for event in events:
    print(f"Event: {event.name} at {event.start_time}")

Get only events directly associated with the dataset:

strict_events = list(Event.get_by_dataset("ds_abc123", strict_associations=True))
print(f"Found {len(strict_events)} dataset-level events")

Process events in batches:

for event in Event.get_by_dataset("ds_abc123"):
    if "anomaly" in event.tags:
        print(f"Anomaly event: {event.name}")

Event.get_by_file()

classmethod get_by_file(file_id, roboto_client=None)#View Source

Retrieve all events with a direct association to a specific file.

Parameters

file_id str

ID of the file to query events for.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Yields

Event instances directly associated with the specified file.

Return type

collections.abc.Generator[Event, None, None]

Usage

Get all events for a specific file:

events = list(Event.get_by_file("fl_xyz789"))
for event in events:
    print(f"File event: {event.name}")

Check if a file has any events:

file_events = list(Event.get_by_file("fl_xyz789"))
if file_events:
    print(f"File has {len(file_events)} events")
else:
    print("No events found for this file")

Event.get_by_message_path()

classmethod get_by_message_path(message_path_id, roboto_client=None)#View Source

Retrieve all events with a direct association to a specific message path.

Parameters

message_path_id str

ID of the message path to query events for.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Yields

Event instances directly associated with the specified message path.

Return type

collections.abc.Generator[Event, None, None]

Usage

Get all events for a specific message path:

events = list(Event.get_by_message_path("mp_abc123"))
for event in events:
    print(f"Message path event: {event.name}")

Find events within a time range for a message path:

events = Event.get_by_message_path("mp_abc123")
filtered_events = [event for event in events if event.start_time >= 1722870127699468923]

Event.get_by_topic()

classmethod get_by_topic(topic_id, roboto_client=None)#View Source

Retrieve all events with a direct association to a specific topic.

Parameters

topic_id str

ID of the topic to query events for.

roboto_client Optional[roboto.http.RobotoClient]

HTTP client for API communication. If None, uses the default client.

Yields

Event instances directly associated with the specified topic.

Return type

collections.abc.Generator[Event, None, None]

Usage

Get all events for a specific topic:

events = list(Event.get_by_topic("tp_abc123"))
for event in events:
    print(f"Topic event: {event.name}")

Analyze event patterns for a topic:

events = list(Event.get_by_topic("tp_abc123"))
anomaly_events = [e for e in events if "anomaly" in e.tags]
print(f"Found {len(anomaly_events)} anomaly events")

Event.get_data()

get_data(message_paths_include=None, message_paths_exclude=None, topic_name=None, topic_data_service=None, cache_dir=None, strict_associations=False)#View Source

Iteratively yield records of the underlying topic data this event annotates.

An event can be associated with data at multiple resolutions:

  • as an event on its containing dataset, file, and/or topic,
  • but also directly with the message path (“signal data”)

A single event can also span signals that share a timeline, so it may annotate multiple topics in a file, or even multiple files in a dataset.

For now, getting the underlying signal data associated with an event only works for events that can be sourced to a single topic (extracted from one file, uploaded to one dataset). This means that the event must have been made on either a single file, a single topic, or one or many message paths within that topic.

If the event was made on a file, topic_name must be provided, and either or both of message_paths_include or message_paths_exclude may be provided, but are optional.

If the event was made on a topic, either or both of message_paths_include or message_paths_exclude may be provided, but are optional. topic_name, if provided in this instance, is ignored.

If the event was made on one or many message paths, each of those message paths must be found in the same topic. topic_name, message_paths_include, and message_paths_exclude, if provided in this instance, are ignored.

If the event is associated with data at multiple resolutions (e.g., two message paths, one topic, one file), this method will consider the lowest resolution associations first (message path), then topic, then file.

If message_paths_include or message_paths_exclude are defined, they should be dot notation paths that match attributes of individual data records. If a partial path is provided, it is treated as a wildcard, matching all subpaths.

For example, given topic data with the following interface:

{
    "velocity": {
        "x": <uint32>,
        "y": <uint32>,
        "z": <uint32>
    }
}

Calling get_data on an Event associated with that topic like:

event.get_data(message_paths_include=["velocity.x", "velocity.y"])

is expected to give the same output as:

event.get_data(message_paths_include=["velocity"], message_paths_exclude=["velocity.z"])

Parameters

message_paths_include Optional[collections.abc.Iterable[str]]
message_paths_exclude Optional[collections.abc.Iterable[str]]
topic_name Optional[str]
topic_data_service Optional[roboto.domain.topics.TopicDataService]
cache_dir Union[str, pathlib.Path, None]
strict_associations bool

Return type

collections.abc.Generator[tuple[roboto.domain.topics.Timestamp, dict[str, Any]], None, None]

Event.get_data_as_df()

get_data_as_df(message_paths_include=None, message_paths_exclude=None, topic_name=None, topic_data_service=None, cache_dir=None, strict_associations=False)#View Source

Return the underlying topic data this event annotates as a pandas DataFrame.

Collects all data from get_data() and returns it as a pandas DataFrame with the log time as the index. Requires installing this package using the roboto[analytics] extra.

Parameters

message_paths_include Optional[collections.abc.Iterable[str]]

Dot notation paths to include in the data.

message_paths_exclude Optional[collections.abc.Iterable[str]]

Dot notation paths to exclude from the data.

topic_name Optional[str]

Required when event is associated with a file.

topic_data_service Optional[roboto.domain.topics.TopicDataService]

Service for accessing topic data.

cache_dir Union[str, pathlib.Path, None]

Directory for caching downloaded data.

strict_associations bool

Returns

pandas.DataFrame

DataFrame containing the event’s underlying topic data, indexed by log time.

Raises

ImportError

If pandas is not installed (install with roboto[analytics]).

Invalid parameters or event associations.

Usage

Get event data as a DataFrame:

event = Event.from_id("ev_abc123")
df = event.get_data_as_df()
print(f"Data shape: {df.shape}")
print(df.head())

Get specific message paths as DataFrame:

df = event.get_data_as_df(message_paths_include=["velocity.x", "velocity.y"])
print(df.columns.tolist())

Analyze event data:

df = event.get_data_as_df()
print(f"Event duration: {df.index.max() - df.index.min()} ns")
print(f"Data points: {len(df)}")

Event.message_path_ids()

message_path_ids()#View Source

Get message path IDs directly associated with this event.

Returns

list[str]

List of unique message path IDs directly associated with this event.

Usage

Get message path IDs:

event = Event.from_id("ev_abc123")
msgpath_ids = event.message_path_ids()
print(f"Associated with {len(msgpath_ids)} message paths")

Properties

Event.metadata

metadata dict[str, Any] #

Key-value metadata associated with this event.

Return type: dict[str, Any]

Event.modified

modified datetime.datetime #

Date and time when this event was last modified.

Return type: datetime.datetime

Event.modified_by

modified_by str #

User who last modified this event.

Return type: str

Event.name

name str #

Human-readable name of the event.

Return type: str

Event.put_metadata()

put_metadata(metadata)#View Source

Add or update metadata fields for this event.

Parameters

metadata dict[str, Any]

Dictionary of key-value pairs to add or update.

Returns

Updated Event instance.

Usage

Add metadata to an event:

event = Event.from_id("ev_abc123")
updated_event = event.put_metadata({"severity": "high", "component": "engine", "alert_id": "alert_001"})
print(updated_event.metadata["severity"])
# 'high'

Event.put_tags()

put_tags(tags)#View Source

Replace all tags for this event.

Parameters

tags list[str]

List of tags to set for this event.

Returns

Updated Event instance.

Usage

Set tags for an event:

event = Event.from_id("ev_abc123")
updated_event = event.put_tags(["anomaly", "critical", "engine"])
print(updated_event.tags)
# ['anomaly', 'critical', 'engine']

Properties

Event.record

Underlying event record data.

Event.refresh()

refresh()#View Source

Refresh this event’s data from the server.

Fetches the latest version of this event from the server, updating all properties to reflect any changes made by other processes.

Returns

This Event instance with refreshed data.

Usage

Refresh an event to get latest changes:

event = Event.from_id("ev_abc123")
# Event may have been updated by another process
refreshed_event = event.refresh()
print(f"Current description: {refreshed_event.description}")

Event.remove_metadata()

remove_metadata(metadata)#View Source

Remove metadata fields from this event.

Parameters

Sequence of metadata field names to remove. Supports dot notation for nested fields.

Returns

Updated Event instance.

Usage

Remove specific metadata fields:

event = Event.from_id("ev_abc123")
updated_event = event.remove_metadata(["severity", "temp_data.max"])
# Fields 'severity' and nested 'temp_data.max' are now removed

Event.remove_tags()

remove_tags(tags)#View Source

Remove specific tags from this event.

Parameters

Sequence of tag names to remove from this event.

Returns

Updated Event instance.

Usage

Remove specific tags:

event = Event.from_id("ev_abc123")
updated_event = event.remove_tags(["temporary", "draft"])
# Tags 'temporary' and 'draft' are now removed

Event.set_color()

set_color(color)#View Source

Set the display color for this event.

Parameters

color Optional[str]

CSS-compatible color value (e.g., “red”, “#ff0000”, “rgb(255,0,0)”). Use None to clear the color and use automatic coloring.

Returns

Updated Event instance.

Usage

Set event color to red:

event = Event.from_id("ev_abc123")
updated_event = event.set_color("red")
print(updated_event.color)
# 'red'

Clear event color:

updated_event = event.set_color(None)
print(updated_event.color)
# None

Event.set_custom_field()

set_custom_field(name, value)#View Source

Set a single custom-field value on this event.

name must be the name of a Ready custom field for this event’s org and the Event entity type; value must satisfy the field’s declared type.

Parameters

name str
value Any

Return type

Event.set_custom_fields()

set_custom_fields(fields)#View Source

Set or overwrite multiple custom-field values on this event.

Each key must name a Ready custom field for this event’s org and the Event entity type; each value must satisfy the field’s declared type.

Parameters

fields dict[str, Any]

Return type

Event.set_description()

set_description(description)#View Source

Set the description for this event.

Parameters

description Optional[str]

New description for the event. Use None to clear the description.

Returns

Updated Event instance.

Usage

Set event description:

event = Event.from_id("ev_abc123")
updated_event = event.set_description("Updated event description")
print(updated_event.description)
# 'Updated event description'

Clear event description:

updated_event = event.set_description(None)
print(updated_event.description)
# None

Event.set_name()

set_name(name)#View Source

Set the name for this event.

Parameters

name str

New name for the event.

Returns

Updated Event instance.

Usage

Update event name:

event = Event.from_id("ev_abc123")
updated_event = event.set_name("Critical System Alert")
print(updated_event.name)
# 'Critical System Alert'

Properties

Event.start_time

start_time int #

Start time of the event in nanoseconds since UNIX epoch.

Return type: int

Event.tags

tags list[str] #

Tags associated with this event for categorization and search.

Return type: list[str]

Event.to_dict()

to_dict()#View Source

Convert this event to a dictionary representation.

Returns

dict[str, Any]

Dictionary containing all event data in JSON-serializable format.

Usage

Convert event to dictionary:

event = Event.from_id("ev_abc123")
event_dict = event.to_dict()
print(event_dict["name"])
print(event_dict["start_time"])

Event.topic_ids()

topic_ids(strict_associations=False)#View Source

Get topic IDs associated with this event.

Parameters

strict_associations bool

If True, only return topics with direct associations. If False (default), also return topics inferred from message path associations.

Returns

list[str]

List of unique topic IDs associated with this event.

Usage

Get all associated topic IDs:

event = Event.from_id("ev_abc123")
topic_ids = event.topic_ids()
print(f"Associated with {len(topic_ids)} topics")

Get only directly associated topics:

strict_topic_ids = event.topic_ids(strict_associations=True)
for topic_id in strict_topic_ids:
    print(f"Directly associated topic: {topic_id}")

Event.update()

update(name=NotSet, start_time=NotSet, end_time=NotSet, description=NotSet, metadata_changeset=NotSet, display_options_changeset=NotSet, custom_fields_changeset=None)#View Source

Update this event’s attributes.

Updates various properties of the event including name, time range, description, metadata, and display options. Only specified parameters are updated; others remain unchanged.

When provided, start_time and end_time should be integers representing nanoseconds since the UNIX epoch, or convertible to such integers by to_epoch_nanoseconds().

Parameters

New human-readable name for the event.

New start timestamp for the event.

New end timestamp for the event.

description Union[str, None, roboto.sentinels.NotSetType]

New description for the event. Set to None to clear existing description.

Changes to apply to the event’s metadata and tags.

Changes to apply to the event’s display options.

custom_fields_changeset Optional[roboto.updates.CustomFieldChangeset]

Changes to apply to Ready custom-field values on this event. Field names not referenced by the changeset are left unchanged.

Returns

This Event instance with attributes updated accordingly.

Raises

ValueError

If start_time or end_time are negative.

If start_time > end_time.

Caller lacks permission to edit this event.

Usage

Update event name and description:

event = Event.from_id("ev_abc123")
updated_event = event.update(
    name="Critical System Alert", description="Updated description with more details"
)

Update event time range:

updated_event = event.update(start_time=1722870127699468923, end_time=1722870127799468923)

Update metadata and display options:

from roboto.updates import MetadataChangeset
from roboto.domain.events import EventDisplayOptionsChangeset
updated_event = event.update(
    metadata_changeset=MetadataChangeset(
        put_fields={"severity": "high"}, put_tags=["critical", "urgent"]
    ),
    display_options_changeset=EventDisplayOptionsChangeset(color="red"),
)

EventDisplayOptions

class roboto.domain.events.EventDisplayOptions(/, **data)#View Source

Bases: pydantic.BaseModel

Display options for an event.

Parameters

data Any

Attributes

EventDisplayOptions.color

color str | None = None #

Display color for the event.

Used to visually distinguish events on a timeline, and optionally to signal semantic information about the event (e.g. “red” for events representing critical issues).

Any value that is permissible in CSS to define a valid color can be used here, encoded as a string. For instance, the following are all valid: “red”, “#ff0000”, “rgb(255 0 0)”.

EventDisplayOptions.has_options()

has_options()#View Source

Checks whether any display options have been specified.

Return type

bool

EventDisplayOptionsChangeset

class roboto.domain.events.EventDisplayOptionsChangeset(/, **data)#View Source

Bases: pydantic.BaseModel

A set of changes to the display options of an event.

Parameters

data Any

EventDisplayOptionsChangeset.apply_to()

apply_to(display_options)#View Source

Applies this changeset to some existing display options.

Parameters

display_options EventDisplayOptions

Attributes

EventDisplayOptionsChangeset.color

color str | None | roboto.sentinels.NotSetType #

An update to an event’s color.

Use None to clear any previously set color value. On the Roboto website, the event will be displayed using an automatically selected color.

EventDisplayOptionsChangeset.has_changes()

has_changes()#View Source

Checks whether this changeset contains any changes.

Return type

bool

Attributes

EventDisplayOptionsChangeset.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

EventRecord

class roboto.domain.events.EventRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A wire-transmissible representation of an event.

Parameters

data Any

Attributes

EventRecord.associations

associations list[roboto.association.Association] = None #

Datasets, files, topics and message paths which this event pertains to.

EventRecord.created

created datetime.datetime #

Date/time when this event was created.

EventRecord.created_by

created_by str #

The user who created this event.

EventRecord.custom_fields

custom_fields dict[str, Any] = None #

Values for the custom fields defined on Events in this org.

Every Ready custom field defined for (org_id, Event) appears as a key; values that have not been set surface as None rather than being absent. Empty when no custom fields are defined for the org.

EventRecord.description

description str | None = None #

An optional human-readable description of the event.

EventRecord.display_options

Display options for the event, such as color.

EventRecord.end_time

end_time int #

The end time of the event, in nanoseconds since epoch (assumed Unix epoch). This can be equal to start_time if the event is discrete, but can never be less than start_time.

EventRecord.event_id

event_id str #

A globally unique ID used to reference an event.

EventRecord.metadata

metadata dict[str, Any] = None #

Key-value pairs to associate with this event for discovery and search.

EventRecord.modified

modified datetime.datetime #

Date/time when this event was last modified.

EventRecord.modified_by

modified_by str #

The user who last modified this event.

EventRecord.name

name str #

A brief human-readable name for the event. Many events can have the same name. “Takeoff”, “Crash”, “CPU Spike”, “Bad Image Quality”, and “Unexpected Left” are a few potential examples.

EventRecord.org_id

org_id str #

The organization to which this event belongs.

EventRecord.start_time

start_time int #

The start time of the event, in nanoseconds since epoch (assumed Unix epoch).

EventRecord.tags

tags list[str] = None #

Tags to associate with this event for discovery and search.

MAX_EVENTS_PER_DELETE_BATCH

roboto.domain.events.MAX_EVENTS_PER_DELETE_BATCH = 1000#View Source

Maximum number of event IDs the bulk Delete Events API accepts in a single request.

The cap keeps a single delete bounded to one reasonably sized DELETE statement and transaction, so an oversized request can’t make the service or database go nuts. A request that exceeds it is rejected server-side with a 400. roboto.domain.events.Event.delete_many() splits larger inputs into chunks of this size automatically, so SDK callers don’t need to batch by hand.

QueryEventsForAssociationsRequest

class roboto.domain.events.QueryEventsForAssociationsRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for the Query Events for Associations operation.

Parameters

data Any

Attributes

QueryEventsForAssociationsRequest.associations

Associations to query events for.

QueryEventsForAssociationsRequest.page_token

page_token str | None = None #

Token to use to fetch the next page of results, use None for the first page.

UpdateEventRequest

class roboto.domain.events.UpdateEventRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload for the Update Event operation. Allows any of the mutable fields of an event to be changed.

Parameters

data Any

Attributes

UpdateEventRequest.custom_fields_changeset

custom_fields_changeset roboto.updates.CustomFieldChangeset | None = None #

Changes to apply to Ready custom-field values on this event.

Each referenced field name must be a Ready custom field for this event’s org and the Event entity type; each set_fields value must satisfy the field’s declared type. Names that are undefined or not Ready are rejected with a structured error. Field names not mentioned by the changeset are left unchanged.

UpdateEventRequest.description

description str | None | roboto.sentinels.NotSetType #

An optional human-readable description of the event.

UpdateEventRequest.display_options_changeset

Display options changes to apply to this event.

UpdateEventRequest.end_time

The end time of the event, in nanoseconds since epoch (assumed Unix epoch). This can be equal to start_time if the event is discrete, but can never be less than start_time.

UpdateEventRequest.metadata_changeset

Metadata and tag changes to make for this event

UpdateEventRequest.model_config

model_config #

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

UpdateEventRequest.name

A brief human-readable name for the event. Many events can have the same name. “Takeoff”, “Crash”, “CPU Spike”, “Bad Image Quality”, and “Unexpected Left” are a few potential examples.

UpdateEventRequest.start_time

The start time of the event, in nanoseconds since epoch (assumed Unix epoch).

Was this page helpful?