Rollup Indices

class elasticsearch.client.RollupClient(client)
Parameters:

client (BaseClient) –

delete_job(*, id, error_trace=None, filter_path=None, human=None, pretty=None)

Deletes an existing rollup job.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-delete-job.html

Parameters:
  • id (str) – Identifier for the job.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

get_jobs(*, id=None, error_trace=None, filter_path=None, human=None, pretty=None)

Retrieves the configuration, stats, and status of rollup jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-get-job.html

Parameters:
  • id (str | None) – Identifier for the rollup job. If it is _all or omitted, the API returns all rollup jobs.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

get_rollup_caps(*, id=None, error_trace=None, filter_path=None, human=None, pretty=None)

Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-get-rollup-caps.html

Parameters:
  • id (str | None) – Index, indices or index-pattern to return rollup capabilities for. _all may be used to fetch rollup capabilities from all jobs.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

get_rollup_index_caps(*, index, error_trace=None, filter_path=None, human=None, pretty=None)

Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored).

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-get-rollup-index-caps.html

Parameters:
  • index (str | Sequence[str]) – Data stream or index to check for rollup capabilities. Wildcard (*) expressions are supported.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

put_job(*, id, cron=None, groups=None, index_pattern=None, page_size=None, rollup_index=None, error_trace=None, filter_path=None, headers=None, human=None, metrics=None, pretty=None, timeout=None, body=None)

Creates a rollup job.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-put-job.html

Parameters:
  • id (str) – Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. The ID is persistent; it is stored with the rolled up data. If you create a job, let it run for a while, then delete the job, the data that the job rolled up is still be associated with this job ID. You cannot create a new job with the same ID since that could lead to problems with mismatched job configurations.

  • cron (str | None) – A cron string which defines the intervals when the rollup job should be executed. When the interval triggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated to the time interval of the data being rolled up. For example, you may wish to create hourly rollups of your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The cron pattern is defined just like a Watcher cron schedule.

  • groups (Mapping[str, Any] | None) – Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be available later for aggregating into buckets. These aggs and fields can be used in any combination. Think of the groups configuration as defining a set of tools that can later be used in aggregations to partition the data. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide enough flexibility that you simply need to determine which fields are needed, not in what order they are needed.

  • index_pattern (str | None) – The index or index pattern to roll up. Supports wildcard-style patterns (logstash-*). The job attempts to rollup the entire index or index-pattern.

  • page_size (int | None) – The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends to execute faster, but requires more memory during processing. This value has no effect on how the data is rolled up; it is merely used for tweaking the speed or memory cost of the indexer.

  • rollup_index (str | None) – The index that contains the rollup results. The index can be shared with other rollup jobs. The data is stored so that it doesn’t interfere with unrelated jobs.

  • headers (Mapping[str, str | Sequence[str]] | None) –

  • metrics (Sequence[Mapping[str, Any]] | None) – Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined on a per-field basis and for each field you configure which metric should be collected.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – Time to wait for the request to complete.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

  • body (Dict[str, Any] | None) –

Return type:

ObjectApiResponse[Any]

Enables searching rolled-up data using the standard query DSL.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-search.html

Parameters:
  • index (str | Sequence[str]) – Enables searching rolled-up data using the standard Query DSL.

  • aggregations (Mapping[str, Mapping[str, Any]] | None) – Specifies aggregations.

  • aggs (Mapping[str, Mapping[str, Any]] | None) – Specifies aggregations.

  • query (Mapping[str, Any] | None) – Specifies a DSL query.

  • rest_total_hits_as_int (bool | None) – Indicates whether hits.total should be rendered as an integer or an object in the rest search response

  • size (int | None) – Must be zero if set, as rollups work on pre-aggregated data.

  • typed_keys (bool | None) – Specify whether aggregation and suggester names should be prefixed by their respective types in the response

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

  • body (Dict[str, Any] | None) –

Return type:

ObjectApiResponse[Any]

start_job(*, id, error_trace=None, filter_path=None, human=None, pretty=None)

Starts an existing, stopped rollup job.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-start-job.html

Parameters:
  • id (str) – Identifier for the rollup job.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

stop_job(*, id, error_trace=None, filter_path=None, human=None, pretty=None, timeout=None, wait_for_completion=None)

Stops an existing, started rollup job.

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/rollup-stop-job.html

Parameters:
  • id (str) – Identifier for the rollup job.

  • timeout (Literal[-1] | ~typing.Literal[0] | str | None) – If wait_for_completion is true, the API blocks for (at maximum) the specified duration while waiting for the job to stop. If more than timeout time has passed, the API throws a timeout exception.

  • wait_for_completion (bool | None) – If set to true, causes the API to block until the indexer state completely stops. If set to false, the API returns immediately and the indexer is stopped asynchronously in the background.

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]