Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions api_client/python/timesketch_api_client/sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,49 +1367,6 @@ def run_aggregator(self, aggregator_name, aggregator_parameters):

return aggregation_obj

def store_aggregation(
self,
name,
description,
aggregator_name,
aggregator_parameters,
chart_type="",
):
"""Store an aggregation in the sketch.

Args:
name (str): a name that will be associated with the aggregation.
description (str): description of the aggregation, visible in the UI.
aggregator_name (str): name of the aggregator class.
aggregator_parameters (dict): parameters of the aggregator.
chart_type (str): string representing the chart type.

Raises:
RuntimeError: if the client is unable to store the aggregation.

Returns:
A stored aggregation object or None if not stored.
"""
if self.is_archived():
raise RuntimeError("Unable to store an aggregator on an archived sketch.")

# TODO: Deprecate this function.
logger.warning(
"This function is about to be deprecated, please use the "
"`.save()` function of an aggregation object instead"
)

aggregator_obj = self.run_aggregator(aggregator_name, aggregator_parameters)
aggregator_obj.name = name
aggregator_obj.description = description
if chart_type:
aggregator_obj.chart_type = chart_type
if aggregator_obj.save():
_ = self.lazyload_data(refresh_cache=True)
return aggregator_obj

return None

def comment_event(self, event_id, index, comment_text):
"""Adds a comment to a single event.

Expand Down