Elasticsearch API Reference

All the API calls map the raw REST API as closely as possible, including the distinction between required and optional arguments to the calls. Keyword arguments are required for all

Note

Some API parameters in Elasticsearch are reserved keywords in Python. For example the from query parameter for pagination would be aliased as from_.

Elasticsearch

class elasticsearch.Elasticsearch(hosts: Union[str, List[Union[str, Mapping[str, Union[str, int]], elastic_transport.NodeConfig]], None] = None, *, cloud_id: Optional[str] = None, api_key: Union[str, Tuple[str, str], None] = None, basic_auth: Union[str, Tuple[str, str], None] = None, bearer_auth: Optional[str] = None, opaque_id: Optional[str] = None, headers: Union[elastic_transport.client_utils.DefaultType, Mapping[str, str]] = <DEFAULT>, connections_per_node: Union[elastic_transport.client_utils.DefaultType, int] = <DEFAULT>, http_compress: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, verify_certs: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, ca_certs: Union[elastic_transport.client_utils.DefaultType, str] = <DEFAULT>, client_cert: Union[elastic_transport.client_utils.DefaultType, str] = <DEFAULT>, client_key: Union[elastic_transport.client_utils.DefaultType, str] = <DEFAULT>, ssl_assert_hostname: Union[elastic_transport.client_utils.DefaultType, str] = <DEFAULT>, ssl_assert_fingerprint: Union[elastic_transport.client_utils.DefaultType, str] = <DEFAULT>, ssl_version: Union[elastic_transport.client_utils.DefaultType, int] = <DEFAULT>, ssl_context: Union[elastic_transport.client_utils.DefaultType, Any] = <DEFAULT>, ssl_show_warn: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, transport_class: Type[elastic_transport.Transport] = <class 'elastic_transport.Transport'>, request_timeout: Union[elastic_transport.client_utils.DefaultType, None, float] = <DEFAULT>, node_class: Union[elastic_transport.client_utils.DefaultType, Type[elastic_transport.BaseNode]] = <DEFAULT>, node_pool_class: Union[elastic_transport.client_utils.DefaultType, Type[elastic_transport.NodePool]] = <DEFAULT>, randomize_nodes_in_pool: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, node_selector_class: Union[elastic_transport.client_utils.DefaultType, Type[elastic_transport.NodeSelector]] = <DEFAULT>, dead_node_backoff_factor: Union[elastic_transport.client_utils.DefaultType, float] = <DEFAULT>, max_dead_node_backoff: Union[elastic_transport.client_utils.DefaultType, float] = <DEFAULT>, serializer: Optional[elastic_transport.Serializer] = None, serializers: Union[elastic_transport.client_utils.DefaultType, Mapping[str, elastic_transport.Serializer]] = <DEFAULT>, default_mimetype: str = 'application/json', max_retries: Union[elastic_transport.client_utils.DefaultType, int] = <DEFAULT>, retry_on_status: Union[elastic_transport.client_utils.DefaultType, int, Collection[int]] = <DEFAULT>, retry_on_timeout: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, sniff_on_start: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, sniff_before_requests: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, sniff_on_node_failure: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, sniff_timeout: Union[elastic_transport.client_utils.DefaultType, None, float] = <DEFAULT>, min_delay_between_sniffing: Union[elastic_transport.client_utils.DefaultType, None, float] = <DEFAULT>, sniffed_node_callback: Optional[Callable[[Dict[str, Any], elastic_transport.NodeConfig], Optional[elastic_transport.NodeConfig]]] = None, meta_header: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, timeout: Union[elastic_transport.client_utils.DefaultType, None, float] = <DEFAULT>, randomize_hosts: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, host_info_callback: Optional[Callable[[Dict[str, Any], Dict[str, Union[str, int]]], Optional[Dict[str, Union[str, int]]]]] = None, sniffer_timeout: Union[elastic_transport.client_utils.DefaultType, None, float] = <DEFAULT>, sniff_on_connection_fail: Union[elastic_transport.client_utils.DefaultType, bool] = <DEFAULT>, http_auth: Union[elastic_transport.client_utils.DefaultType, Any] = <DEFAULT>, maxsize: Union[elastic_transport.client_utils.DefaultType, int] = <DEFAULT>, _transport: Optional[elastic_transport.Transport] = None)

Elasticsearch low-level client. Provides a straightforward mapping from Python to Elasticsearch REST APIs.

The client instance has additional attributes to update APIs in different namespaces such as async_search, indices, security, and more:

client = Elasticsearch("http://localhost:9200")

# Get Document API
client.get(index="*", id="1")

# Get Index API
client.indices.get(index="*")

Transport options can be set on the client constructor or using the options() method:

# Set 'api_key' on the constructor
client = Elasticsearch(
    "http://localhost:9200",
    api_key=("id", "api_key")
)
client.search(...)

# Set 'api_key' per request
client.options(api_key=("id", "api_key")).search(...)
bulk(*, operations: List[Any], index: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pipeline: Optional[str] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, require_alias: Optional[bool] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to perform multiple index/update/delete operations in a single request.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/docs-bulk.html

Parameters:
  • operations
  • index – Default index for items which don’t provide one
  • pipeline – The pipeline id to preprocess incoming documents with
  • refresh – If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshes.
  • require_alias – Sets require_alias for all incoming documents. Defaults to unset (false)
  • routing – Specific routing value
  • source – True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
  • source_excludes – Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
  • source_includes – Default list of fields to extract and return from the _source field, can be overridden on each sub-request
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
clear_scroll(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, scroll_id: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Explicitly clears the search context for a scroll.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/clear-scroll-api.html

Parameters:scroll_id
close() → None

Closes the Transport and all internal connections

close_point_in_time(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Close a point in time

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/point-in-time-api.html

Parameters:id
count(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, lenient: Optional[bool] = None, min_score: Optional[float] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, q: Optional[str] = None, query: Optional[Any] = None, routing: Optional[Any] = None, terminate_after: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns number of documents matching a query.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html

Parameters:
  • index – A comma-separated list of indices to restrict the results
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • analyze_wildcard – Specify whether wildcard and prefix queries should be analyzed (default: false)
  • analyzer – The analyzer to use for the query string
  • default_operator – The default operator for query string query (AND or OR)
  • df – The field to use as default where no field prefix is given in the query string
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_throttled – Whether specified concrete, expanded or aliased indices should be ignored when throttled
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  • min_score – Include only documents with a specific _score value in the result
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • q – Query in the Lucene query string syntax
  • query
  • routing – A comma-separated list of specific routing values
  • terminate_after – The maximum count for each shard, upon reaching which the query execution will terminate early
create(*, index: Any, id: Any, document: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pipeline: Optional[str] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, routing: Optional[Any] = None, timeout: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html

Parameters:
  • index – The name of the index
  • id – Document ID
  • document
  • pipeline – The pipeline id to preprocess incoming documents with
  • refresh – If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshes.
  • routing – Specific routing value
  • timeout – Explicit operation timeout
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
delete(*, index: Any, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, if_primary_term: Optional[int] = None, if_seq_no: Optional[Any] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, routing: Optional[Any] = None, timeout: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes a document from the index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html

Parameters:
  • index – The name of the index
  • id – The document ID
  • if_primary_term – only perform the delete operation if the last operation that has changed the document has the specified primary term
  • if_seq_no – only perform the delete operation if the last operation that has changed the document has the specified sequence number
  • refresh – If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshes.
  • routing – Specific routing value
  • timeout – Explicit operation timeout
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
delete_by_query(*, index: Any, allow_no_indices: Optional[bool] = None, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, conflicts: Optional[Any] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, lenient: Optional[bool] = None, max_docs: Optional[int] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, q: Optional[str] = None, query: Optional[Any] = None, refresh: Optional[bool] = None, request_cache: Optional[bool] = None, requests_per_second: Optional[int] = None, routing: Optional[Any] = None, scroll: Optional[Any] = None, scroll_size: Optional[int] = None, search_timeout: Optional[Any] = None, search_type: Optional[Any] = None, slice: Optional[Any] = None, slices: Optional[int] = None, sort: Optional[List[str]] = None, stats: Optional[List[str]] = None, terminate_after: Optional[int] = None, timeout: Optional[Any] = None, version: Optional[bool] = None, wait_for_active_shards: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes documents matching the provided query.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html

Parameters:
  • index – A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • analyze_wildcard – Specify whether wildcard and prefix queries should be analyzed (default: false)
  • analyzer – The analyzer to use for the query string
  • conflicts – What to do when the delete by query hits version conflicts?
  • default_operator – The default operator for query string query (AND or OR)
  • df – The field to use as default where no field prefix is given in the query string
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • from – Starting offset (default: 0)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  • max_docs
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • q – Query in the Lucene query string syntax
  • query
  • refresh – Should the affected indexes be refreshed?
  • request_cache – Specify if request cache should be used for this request or not, defaults to index level setting
  • requests_per_second – The throttle for this request in sub-requests per second. -1 means no throttle.
  • routing – A comma-separated list of specific routing values
  • scroll – Specify how long a consistent view of the index should be maintained for scrolled search
  • scroll_size – Size on the scroll request powering the delete by query
  • search_timeout – Explicit timeout for each search request. Defaults to no timeout.
  • search_type – Search operation type
  • slice
  • slices – The number of slices this task should be divided into. Defaults to 1, meaning the task isn’t sliced into subtasks. Can be set to auto.
  • sort – A comma-separated list of <field>:<direction> pairs
  • stats – Specific ‘tag’ of the request for logging and statistical purposes
  • terminate_after – The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
  • timeout – Time each individual bulk request should wait for shards that are unavailable.
  • version – Specify whether to return document version as part of a hit
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
  • wait_for_completion – Should the request should block until the delete by query is complete.
delete_by_query_rethrottle(*, task_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, requests_per_second: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Changes the number of requests per second for a particular Delete By Query operation.

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html

Parameters:
  • task_id – The task id to rethrottle
  • requests_per_second – The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
delete_script(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a script.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

Parameters:
  • id – Script ID
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
exists(*, index: Any, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, realtime: Optional[bool] = None, refresh: Optional[bool] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stored_fields: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None) → elastic_transport.HeadApiResponse

Returns information about whether a document exists in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

Parameters:
  • index – The name of the index
  • id – The document ID
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • realtime – Specify whether to perform the operation in realtime or search mode
  • refresh – Refresh the shard containing the document before performing the operation
  • routing – Specific routing value
  • source – True or false to return the _source field or not, or a list of fields to return
  • source_excludes – A list of fields to exclude from the returned _source field
  • source_includes – A list of fields to extract and return from the _source field
  • stored_fields – A comma-separated list of stored fields to return in the response
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
exists_source(*, index: Any, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, realtime: Optional[bool] = None, refresh: Optional[bool] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None) → elastic_transport.HeadApiResponse

Returns information about whether a document source exists in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

Parameters:
  • index – The name of the index
  • id – The document ID
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • realtime – Specify whether to perform the operation in realtime or search mode
  • refresh – Refresh the shard containing the document before performing the operation
  • routing – Specific routing value
  • source – True or false to return the _source field or not, or a list of fields to return
  • source_excludes – A list of fields to exclude from the returned _source field
  • source_includes – A list of fields to extract and return from the _source field
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
explain(*, index: Any, id: Any, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, lenient: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, q: Optional[str] = None, query: Optional[Any] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stored_fields: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about why a specific matches (or doesn’t match) a query.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html

Parameters:
  • index – The name of the index
  • id – The document ID
  • analyze_wildcard – Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
  • analyzer – The analyzer for the query string query
  • default_operator – The default operator for query string query (AND or OR)
  • df – The default field for query string query (default: _all)
  • lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • q – Query in the Lucene query string syntax
  • query
  • routing – Specific routing value
  • source – True or false to return the _source field or not, or a list of fields to return
  • source_excludes – A list of fields to exclude from the returned _source field
  • source_includes – A list of fields to extract and return from the _source field
  • stored_fields – A comma-separated list of stored fields to return in the response
field_caps(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, fields: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_unmapped: Optional[bool] = None, index_filter: Optional[Any] = None, pretty: Optional[bool] = None, runtime_mappings: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the information about the capabilities of fields among multiple indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html

Parameters:
  • index – Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.
  • allow_no_indices – If false, the request returns an error if any wildcard expression, [index alias](https://www.elastic.co/guide/en/elasticsearch/reference/current/aliases.html), or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
  • expand_wildcards – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.
  • fields – Comma-separated list of fields to retrieve capabilities for. Wildcard (*) expressions are supported.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • include_unmapped – If true, unmapped fields are included in the response.
  • index_filter – Allows to filter indices if the provided query rewrites to match_none on every shard.
  • runtime_mappings – Defines ad-hoc [runtime fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime-search-request.html) in the request similar to the way it is done in [search requests](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-api-body-runtime). These fields exist only as part of the query and take precedence over fields defined with the same name in the index mappings.
get(*, index: Any, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, realtime: Optional[bool] = None, refresh: Optional[bool] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stored_fields: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

Parameters:
  • index – Name of the index that contains the document.
  • id – Unique identifier of the document.
  • preference – Specifies the node or shard the operation should be performed on. Random by default.
  • realtime – Boolean) If true, the request is real-time as opposed to near-real-time.
  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.
  • routing – Target the specified primary shard.
  • source – True or false to return the _source field or not, or a list of fields to return.
  • source_excludes – A comma-separated list of source fields to exclude in the response.
  • source_includes – A comma-separated list of source fields to include in the response.
  • stored_fields – A comma-separated list of stored fields to return in the response
  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
  • version_type – Specific version type: internal, external, external_gte.
get_script(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a script.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

Parameters:
  • id – Script ID
  • master_timeout – Specify timeout for connection to master
get_script_context(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns all script contexts.

https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-contexts.html

get_script_languages(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns available script types, languages and contexts

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

get_source(*, index: Any, id: Any, preference: Optional[str] = None, realtime: Optional[bool] = None, refresh: Optional[bool] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stored_fields: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the source of a document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html

Parameters:
  • index – Name of the index that contains the document.
  • id – Unique identifier of the document.
  • preference – Specifies the node or shard the operation should be performed on. Random by default.
  • realtime – Boolean) If true, the request is real-time as opposed to near-real-time.
  • refresh – If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.
  • routing – Target the specified primary shard.
  • source – True or false to return the _source field or not, or a list of fields to return.
  • source_excludes – A comma-separated list of source fields to exclude in the response.
  • source_includes – A comma-separated list of source fields to include in the response.
  • stored_fields
  • version – Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
  • version_type – Specific version type: internal, external, external_gte.
index(*, index: Any, document: Any, id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, if_primary_term: Optional[int] = None, if_seq_no: Optional[Any] = None, op_type: Optional[Any] = None, pipeline: Optional[str] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, require_alias: Optional[bool] = None, routing: Optional[Any] = None, timeout: Optional[Any] = None, version: Optional[Any] = None, version_type: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates a document in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html

Parameters:
  • index – The name of the index
  • document
  • id – Document ID
  • if_primary_term – only perform the index operation if the last operation that has changed the document has the specified primary term
  • if_seq_no – only perform the index operation if the last operation that has changed the document has the specified sequence number
  • op_type – Explicit operation type. Defaults to index for requests with an explicit document ID, and to `create`for requests without an explicit document ID
  • pipeline – The pipeline id to preprocess incoming documents with
  • refresh – If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshes.
  • require_alias – When true, requires destination to be an alias. Default is false
  • routing – Specific routing value
  • timeout – Explicit operation timeout
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
info(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns basic information about the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

Performs a kNN search.

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

Parameters:
  • index – A comma-separated list of index names to search; use _all or to perform the operation on all indices
  • knn – kNN query to execute
  • docvalue_fields – The request returns doc values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns.
  • fields – The request returns values for field names matching these patterns in the hits.fields property of the response. Accepts wildcard (*) patterns.
  • routing – A comma-separated list of specific routing values
  • source – Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.
  • stored_fields – List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.
mget(*, index: Optional[Any] = None, docs: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ids: Optional[Any] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, realtime: Optional[bool] = None, refresh: Optional[bool] = None, routing: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stored_fields: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to get multiple documents in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html

Parameters:
  • index – Name of the index to retrieve documents from when ids are specified, or when a document in the docs array does not specify an index.
  • docs – The documents you want to retrieve. Required if no index is specified in the request URI.
  • ids – The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI.
  • preference – Specifies the node or shard the operation should be performed on. Random by default.
  • realtime – If true, the request is real-time as opposed to near-real-time.
  • refresh – If true, the request refreshes relevant shards before retrieving documents.
  • routing – Custom value used to route operations to a specific shard.
  • source – True or false to return the _source field or not, or a list of fields to return.
  • source_excludes – A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter.
  • source_includes – A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.
  • stored_fields – If true, retrieves the document fields stored in the index rather than the document _source.
msearch(*, searches: List[Any], index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, ccs_minimize_roundtrips: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, max_concurrent_searches: Optional[int] = None, max_concurrent_shard_requests: Optional[int] = None, pre_filter_shard_size: Optional[int] = None, pretty: Optional[bool] = None, rest_total_hits_as_int: Optional[bool] = None, search_type: Optional[Any] = None, typed_keys: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to execute several search operations in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html

Parameters:
  • searches
  • index – Comma-separated list of data streams, indices, and index aliases to search.
  • allow_no_indices – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
  • ccs_minimize_roundtrips – If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.
  • expand_wildcards – Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
  • ignore_throttled – If true, concrete, expanded or aliased indices are ignored when frozen.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • max_concurrent_searches – Maximum number of concurrent searches the multi search API can execute.
  • max_concurrent_shard_requests – Maximum number of concurrent shard requests that each sub-search request executes per node.
  • pre_filter_shard_size – Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.
  • rest_total_hits_as_int – If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.
  • search_type – Indicates whether global term and document frequencies should be used when scoring returned documents.
  • typed_keys – Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.
msearch_template(*, search_templates: List[Any], index: Optional[Any] = None, ccs_minimize_roundtrips: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_concurrent_searches: Optional[int] = None, pretty: Optional[bool] = None, rest_total_hits_as_int: Optional[bool] = None, search_type: Optional[Any] = None, typed_keys: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to execute several search template operations in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html

Parameters:
  • search_templates
  • index – A comma-separated list of index names to use as default
  • ccs_minimize_roundtrips – Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
  • max_concurrent_searches – Controls the maximum number of concurrent searches the multi search api will execute
  • rest_total_hits_as_int – Indicates whether hits.total should be rendered as an integer or an object in the rest search response
  • search_type – Search operation type
  • typed_keys – Specify whether aggregation and suggester names should be prefixed by their respective types in the response
mtermvectors(*, index: Optional[Any] = None, docs: Optional[List[Any]] = None, error_trace: Optional[bool] = None, field_statistics: Optional[bool] = None, fields: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ids: Optional[List[Any]] = None, offsets: Optional[bool] = None, payloads: Optional[bool] = None, positions: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, realtime: Optional[bool] = None, routing: Optional[Any] = None, term_statistics: Optional[bool] = None, version: Optional[Any] = None, version_type: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns multiple termvectors in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html

Parameters:
  • index – The index in which the document resides.
  • docs
  • field_statistics – Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • fields – A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • ids
  • offsets – Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • payloads – Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • positions – Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • preference – Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • realtime – Specifies if requests are real-time as opposed to near-real-time (default: true).
  • routing – Specific routing value. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • term_statistics – Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body “params” or “docs”.
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
open_point_in_time(*, index: Any, keep_alive: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Open a point in time that can be used in subsequent searches

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/point-in-time-api.html

Parameters:
  • index – A comma-separated list of index names to open point in time; use _all or empty string to perform the operation on all indices
  • keep_alive – Specific the time to live for the point in time
ping(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → bool

Returns True if a successful response returns from the info() API, otherwise returns False. This API call can fail either at the transport layer (due to connection errors or timeouts) or from a non-2XX HTTP response (due to authentication or authorization issues).

If you want to discover why the request failed you should use the info() API.

https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

put_script(*, id: Any, script: Any, context: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates a script.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html

Parameters:
  • id – Script ID
  • script
  • context – Script context
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
rank_eval(*, index: Any, requests: List[Any], allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, metric: Optional[Any] = None, pretty: Optional[bool] = None, search_type: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to evaluate the quality of ranked search results over a set of typical search queries

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html

Parameters:
  • index – Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (*) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *.
  • requests – A set of typical search requests, together with their provided ratings.
  • allow_no_indices – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • metric – Definition of the evaluation metric to calculate.
  • search_type – Search operation type
reindex(*, conflicts: Optional[Any] = None, dest: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_docs: Optional[int] = None, pretty: Optional[bool] = None, refresh: Optional[bool] = None, requests_per_second: Optional[int] = None, require_alias: Optional[bool] = None, script: Optional[Any] = None, scroll: Optional[Any] = None, size: Optional[int] = None, slices: Optional[int] = None, source: Optional[Any] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to copy documents from one index to another, optionally filtering the source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html

Parameters:
  • conflicts
  • dest
  • max_docs
  • refresh – Should the affected indexes be refreshed?
  • requests_per_second – The throttle to set on this request in sub-requests per second. -1 means no throttle.
  • require_alias
  • script
  • scroll – Control how long to keep the search context alive
  • size
  • slices – The number of slices this task should be divided into. Defaults to 1, meaning the task isn’t sliced into subtasks. Can be set to auto.
  • source
  • timeout – Time each individual bulk request should wait for shards that are unavailable.
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
  • wait_for_completion – Should the request should block until the reindex is complete.
reindex_rethrottle(*, task_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, requests_per_second: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Changes the number of requests per second for a particular Reindex operation.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html

Parameters:
  • task_id – The task id to rethrottle
  • requests_per_second – The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
render_search_template(*, id: Optional[Any] = None, error_trace: Optional[bool] = None, file: Optional[str] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, params: Optional[Dict[str, Any]] = None, pretty: Optional[bool] = None, source: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to use the Mustache language to pre-render a search definition.

https://www.elastic.co/guide/en/elasticsearch/reference/current/render-search-template-api.html

Parameters:
  • id – The id of the stored search template
  • file
  • params
  • source
scripts_painless_execute(*, context: Optional[str] = None, context_setup: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, script: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows an arbitrary script to be executed and a result to be returned

https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html

Parameters:
  • context
  • context_setup
  • script
scroll(*, scroll_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, rest_total_hits_as_int: Optional[bool] = None, scroll: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to retrieve a large numbers of results from a single search request.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll

Parameters:
  • scroll_id – Scroll ID of the search.
  • rest_total_hits_as_int – If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object.
  • scroll – Period to retain the search context for scrolling.
search(*, index: Optional[Any] = None, aggregations: Optional[Dict[str, Any]] = None, aggs: Optional[Dict[str, Any]] = None, allow_no_indices: Optional[bool] = None, allow_partial_search_results: Optional[bool] = None, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, batched_reduce_size: Optional[int] = None, ccs_minimize_roundtrips: Optional[bool] = None, collapse: Optional[Any] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, docvalue_fields: Optional[List[Any]] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, explain: Optional[bool] = None, fields: Optional[List[Any]] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, highlight: Optional[Any] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, indices_boost: Optional[List[Dict[Any, float]]] = None, lenient: Optional[bool] = None, max_concurrent_shard_requests: Optional[int] = None, min_compatible_shard_node: Optional[Any] = None, min_score: Optional[float] = None, pit: Optional[Any] = None, post_filter: Optional[Any] = None, pre_filter_shard_size: Optional[int] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, profile: Optional[bool] = None, q: Optional[str] = None, query: Optional[Any] = None, request_cache: Optional[bool] = None, rescore: Union[Any, List[Any], None] = None, rest_total_hits_as_int: Optional[bool] = None, routing: Optional[Any] = None, runtime_mappings: Optional[Any] = None, script_fields: Optional[Dict[str, Any]] = None, scroll: Optional[Any] = None, search_after: Optional[Any] = None, search_type: Optional[Any] = None, seq_no_primary_term: Optional[bool] = None, size: Optional[int] = None, slice: Optional[Any] = None, sort: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stats: Optional[List[str]] = None, stored_fields: Optional[Any] = None, suggest: Optional[Any] = None, suggest_field: Optional[Any] = None, suggest_mode: Optional[Any] = None, suggest_size: Optional[int] = None, suggest_text: Optional[str] = None, terminate_after: Optional[int] = None, timeout: Optional[str] = None, track_scores: Optional[bool] = None, track_total_hits: Optional[Any] = None, typed_keys: Optional[bool] = None, version: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns results matching a query.

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

Parameters:
  • index – A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
  • aggregations
  • aggs
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • allow_partial_search_results – Indicate if an error should be returned if there is a partial search failure or timeout
  • analyze_wildcard – Specify whether wildcard and prefix queries should be analyzed (default: false)
  • analyzer – The analyzer to use for the query string
  • batched_reduce_size – The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
  • ccs_minimize_roundtrips – Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
  • collapse
  • default_operator – The default operator for query string query (AND or OR)
  • df – The field to use as default where no field prefix is given in the query string
  • docvalue_fields – Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • explain – If true, returns detailed information about score computation as part of a hit.
  • fields – Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.
  • from – Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.
  • highlight
  • ignore_throttled – Whether specified concrete, expanded or aliased indices should be ignored when throttled
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • indices_boost – Boosts the _score of documents from specified indices.
  • lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  • max_concurrent_shard_requests – The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
  • min_compatible_shard_node – The minimum compatible version that all shards involved in search should have for this request to be successful
  • min_score – Minimum _score for matching documents. Documents with a lower _score are not included in the search results.
  • pit – Limits the search to a point in time (PIT). If you provide a PIT, you cannot specify an <index> in the request path.
  • post_filter
  • pre_filter_shard_size – A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • profile
  • q – Query in the Lucene query string syntax
  • query – Defines the search definition using the Query DSL.
  • request_cache – Specify if request cache should be used for this request or not, defaults to index level setting
  • rescore
  • rest_total_hits_as_int – Indicates whether hits.total should be rendered as an integer or an object in the rest search response
  • routing – A comma-separated list of specific routing values
  • runtime_mappings – Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.
  • script_fields – Retrieve a script evaluation (based on different fields) for each hit.
  • scroll – Specify how long a consistent view of the index should be maintained for scrolled search
  • search_after
  • search_type – Search operation type
  • seq_no_primary_term – If true, returns sequence number and primary term of the last modification of each hit. See Optimistic concurrency control.
  • size – The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.
  • slice
  • sort
  • source – Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.
  • source_excludes – A list of fields to exclude from the returned _source field
  • source_includes – A list of fields to extract and return from the _source field
  • stats – Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.
  • stored_fields – List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.
  • suggest
  • suggest_field – Specifies which field to use for suggestions.
  • suggest_mode – Specify suggest mode
  • suggest_size – How many suggestions to return in response
  • suggest_text – The source text for which the suggestions should be returned.
  • terminate_after – Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Defaults to 0, which does not terminate query execution early.
  • timeout – Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.
  • track_scores – If true, calculate and return document scores, even if the scores are not used for sorting.
  • track_total_hits – Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.
  • typed_keys – Specify whether aggregation and suggester names should be prefixed by their respective types in the response
  • version – If true, returns document version as part of a hit.
search_mvt(*, index: Any, field: Any, zoom: Any, x: Any, y: Any, aggs: Optional[Dict[str, Any]] = None, error_trace: Optional[bool] = None, exact_bounds: Optional[bool] = None, extent: Optional[int] = None, fields: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, grid_precision: Optional[int] = None, grid_type: Optional[Any] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, runtime_mappings: Optional[Any] = None, size: Optional[int] = None, sort: Optional[Any] = None, track_total_hits: Optional[Any] = None) → elastic_transport.BinaryApiResponse

Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html

Parameters:
  • index – Comma-separated list of data streams, indices, or aliases to search
  • field – Field containing geospatial data to return
  • zoom – Zoom level for the vector tile to search
  • x – X coordinate for the vector tile to search
  • y – Y coordinate for the vector tile to search
  • aggs – Sub-aggregations for the geotile_grid. Supports the following aggregation types: - avg - cardinality - max - min - sum
  • exact_bounds – If false, the meta layer’s feature is the bounding box of the tile. If true, the meta layer’s feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on <field> values that intersect the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile.
  • extent – Size, in pixels, of a side of the tile. Vector tiles are square with equal sides.
  • fields – Fields to return in the hits layer. Supports wildcards (*). This parameter does not support fields with array values. Fields with array values may return inconsistent results.
  • grid_precision – Additional zoom levels available through the aggs layer. For example, if <zoom> is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don’t include the aggs layer.
  • grid_type – Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a geotile_grid cell. If ‘grid’ each feature is a Polygon of the cells bounding box. If ‘point’ each feature is a Point that is the centroid of the cell.
  • query – Query DSL used to filter documents for the search.
  • runtime_mappings – Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.
  • size – Maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don’t include the hits layer.
  • sort – Sorts features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box’s diagonal length, from longest to shortest.
  • track_total_hits – Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.
search_shards(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, local: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, routing: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about the indices and shards that a search request would be executed against.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html

Parameters:
  • index – A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • local – Return local information, do not retrieve the state from master node (default: false)
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • routing – Specific routing value
search_template(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, ccs_minimize_roundtrips: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, explain: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, id: Optional[Any] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, params: Optional[Dict[str, Any]] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, profile: Optional[bool] = None, rest_total_hits_as_int: Optional[bool] = None, routing: Optional[Any] = None, scroll: Optional[Any] = None, search_type: Optional[Any] = None, source: Optional[str] = None, typed_keys: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to use the Mustache language to pre-render a search definition.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html

Parameters:
  • index – Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*).
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • ccs_minimize_roundtrips – Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • explain
  • id – ID of the search template to use. If no source is specified, this parameter is required.
  • ignore_throttled – Whether specified concrete, expanded or aliased indices should be ignored when throttled
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • params
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • profile
  • rest_total_hits_as_int – If true, hits.total are rendered as an integer in the response.
  • routing – Custom value used to route operations to a specific shard.
  • scroll – Specifies how long a consistent view of the index should be maintained for scrolled search.
  • search_type – The type of the search operation.
  • source – An inline search template. Supports the same parameters as the search API’s request body. Also supports Mustache variables. If no id is specified, this parameter is required.
  • typed_keys – Specify whether aggregation and suggester names should be prefixed by their respective types in the response
terms_enum(*, index: Any, field: Any, case_insensitive: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, index_filter: Optional[Any] = None, pretty: Optional[bool] = None, search_after: Optional[str] = None, size: Optional[int] = None, string: Optional[str] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html

Parameters:
  • index – Comma-separated list of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported.
  • field – The string to match at the start of indexed terms. If not provided, all terms in the field are considered.
  • case_insensitive – When true the provided search string is matched against index terms without case sensitivity.
  • index_filter – Allows to filter an index shard if the provided query rewrites to match_none.
  • search_after
  • size – How many matching terms to return.
  • string – The string after which terms in the index should be returned. Allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request.
  • timeout – The maximum length of time to spend collecting results. Defaults to “1s” (one second). If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty.
termvectors(*, index: Any, id: Optional[Any] = None, doc: Optional[Any] = None, error_trace: Optional[bool] = None, field_statistics: Optional[bool] = None, fields: Optional[Any] = None, filter: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, offsets: Optional[bool] = None, payloads: Optional[bool] = None, per_field_analyzer: Optional[Dict[Any, str]] = None, positions: Optional[bool] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, realtime: Optional[bool] = None, routing: Optional[Any] = None, term_statistics: Optional[bool] = None, version: Optional[Any] = None, version_type: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information and statistics about terms in the fields of a particular document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html

Parameters:
  • index – The index in which the document resides.
  • id – The id of the document, when not specified a doc param should be supplied.
  • doc
  • field_statistics – Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.
  • fields – A comma-separated list of fields to return.
  • filter
  • offsets – Specifies if term offsets should be returned.
  • payloads – Specifies if term payloads should be returned.
  • per_field_analyzer
  • positions – Specifies if term positions should be returned.
  • preference – Specify the node or shard the operation should be performed on (default: random).
  • realtime – Specifies if request is real-time as opposed to near-real-time (default: true).
  • routing – Specific routing value.
  • term_statistics – Specifies if total term frequency and document frequency should be returned.
  • version – Explicit version number for concurrency control
  • version_type – Specific version type
update(*, index: Any, id: Any, detect_noop: Optional[bool] = None, doc: Optional[Any] = None, doc_as_upsert: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, if_primary_term: Optional[int] = None, if_seq_no: Optional[Any] = None, lang: Optional[str] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, require_alias: Optional[bool] = None, retry_on_conflict: Optional[int] = None, routing: Optional[Any] = None, script: Optional[Any] = None, scripted_upsert: Optional[bool] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, timeout: Optional[Any] = None, upsert: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates a document with a script or partial document.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html

Parameters:
  • index – The name of the index
  • id – Document ID
  • detect_noop – Set to false to disable setting ‘result’ in the response to ‘noop’ if no change to the document occurred.
  • doc – A partial update to an existing document.
  • doc_as_upsert – Set to true to use the contents of ‘doc’ as the value of ‘upsert’
  • if_primary_term – Only perform the operation if the document has this primary term.
  • if_seq_no – Only perform the operation if the document has this sequence number.
  • lang – The script language.
  • refresh – If ‘true’, Elasticsearch refreshes the affected shards to make this operation visible to search, if ‘wait_for’ then wait for a refresh to make this operation visible to search, if ‘false’ do nothing with refreshes.
  • require_alias – If true, the destination must be an index alias.
  • retry_on_conflict – Specify how many times should the operation be retried when a conflict occurs.
  • routing – Custom value used to route operations to a specific shard.
  • script – Script to execute to update the document.
  • scripted_upsert – Set to true to execute the script whether or not the document exists.
  • source – Set to false to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve.
  • source_excludes – Specify the source fields you want to exclude.
  • source_includes – Specify the source fields you want to retrieve.
  • timeout – Period to wait for dynamic mapping updates and active shards. This guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur.
  • upsert – If the document does not already exist, the contents of ‘upsert’ are inserted as a new document. If the document exists, the ‘script’ is executed.
  • wait_for_active_shards – The number of shard copies that must be active before proceeding with the operations. Set to ‘all’ or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard.
update_by_query(*, index: Any, allow_no_indices: Optional[bool] = None, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, conflicts: Optional[Any] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, lenient: Optional[bool] = None, max_docs: Optional[int] = None, pipeline: Optional[str] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, refresh: Optional[bool] = None, request_cache: Optional[bool] = None, requests_per_second: Optional[int] = None, routing: Optional[Any] = None, script: Optional[Any] = None, scroll: Optional[Any] = None, scroll_size: Optional[int] = None, search_timeout: Optional[Any] = None, search_type: Optional[Any] = None, slice: Optional[Any] = None, slices: Optional[int] = None, sort: Optional[List[str]] = None, stats: Optional[List[str]] = None, terminate_after: Optional[int] = None, timeout: Optional[Any] = None, version: Optional[bool] = None, version_type: Optional[bool] = None, wait_for_active_shards: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Performs an update on every document in the index without changing the source, for example to pick up a mapping change.

https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html

Parameters:
  • index – A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • analyze_wildcard – Specify whether wildcard and prefix queries should be analyzed (default: false)
  • analyzer – The analyzer to use for the query string
  • conflicts
  • default_operator – The default operator for query string query (AND or OR)
  • df – The field to use as default where no field prefix is given in the query string
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • from – Starting offset (default: 0)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  • max_docs
  • pipeline – Ingest pipeline to set on index requests made by this action. (default: none)
  • preference – Specify the node or shard the operation should be performed on (default: random)
  • query
  • refresh – Should the affected indexes be refreshed?
  • request_cache – Specify if request cache should be used for this request or not, defaults to index level setting
  • requests_per_second – The throttle to set on this request in sub-requests per second. -1 means no throttle.
  • routing – A comma-separated list of specific routing values
  • script
  • scroll – Specify how long a consistent view of the index should be maintained for scrolled search
  • scroll_size – Size on the scroll request powering the update by query
  • search_timeout – Explicit timeout for each search request. Defaults to no timeout.
  • search_type – Search operation type
  • slice
  • slices – The number of slices this task should be divided into. Defaults to 1, meaning the task isn’t sliced into subtasks. Can be set to auto.
  • sort – A comma-separated list of <field>:<direction> pairs
  • stats – Specific ‘tag’ of the request for logging and statistical purposes
  • terminate_after – The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
  • timeout – Time each individual bulk request should wait for shards that are unavailable.
  • version – Specify whether to return document version as part of a hit
  • version_type – Should the document increment the version number (internal) on hit or not (reindex)
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
  • wait_for_completion – Should the request should block until the update by query operation is complete.
update_by_query_rethrottle(*, task_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, requests_per_second: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Changes the number of requests per second for a particular Update By Query operation.

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html

Parameters:
  • task_id – The task id to rethrottle
  • requests_per_second – The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.

Autoscaling

class elasticsearch.client.AutoscalingClient(client: elasticsearch._sync.client._base.BaseClient)
delete_autoscaling_policy(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-delete-autoscaling-policy.html

Parameters:name – the name of the autoscaling policy
get_autoscaling_capacity(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-get-autoscaling-capacity.html

get_autoscaling_policy(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-get-autoscaling-capacity.html

Parameters:name – the name of the autoscaling policy
put_autoscaling_policy(*, name: Any, policy: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/autoscaling-put-autoscaling-policy.html

Parameters:
  • name – the name of the autoscaling policy
  • policy

Cat

class elasticsearch.client.CatClient(client: elasticsearch._sync.client._base.BaseClient)
aliases(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Shows information about currently configured aliases to indices including filter and routing infos.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-alias.html

Parameters:
  • name – A comma-separated list of alias names to return
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
allocation(*, node_id: Optional[Any] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-allocation.html

Parameters:
  • node_id – A comma-separated list of node IDs or names to limit the returned information
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
count(*, index: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Provides quick access to the document count of the entire cluster, or individual indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-count.html

Parameters:
  • index – A comma-separated list of index names to limit the returned information
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
fielddata(*, fields: Optional[Any] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Shows how much heap memory is currently being used by fielddata on every data node in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-fielddata.html

Parameters:
  • fields – A comma-separated list of fields to return the fielddata size
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
health(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, ts: Optional[bool] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns a concise representation of the cluster health.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-health.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • ts – Set to false to disable timestamping
  • v – When set to true will enable verbose output.
help(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → elastic_transport.TextApiResponse

Returns help for the Cat APIs.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
indices(*, index: Optional[Any] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, health: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, include_unloaded_segments: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, pri: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about indices: number of primaries and replicas, document counts, disk size, …

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-indices.html

Parameters:
  • index – A comma-separated list of index names to limit the returned information
  • bytes – The unit in which to display byte values
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • health – A health status (“green”, “yellow”, or “red” to filter only indices matching the specified health status
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • include_unloaded_segments – If set to true segment stats will include stats for segments that are not currently loaded into memory
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • pri – Set to true to return stats only for primary shards
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
master(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about the master node.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-master.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
ml_data_frame_analytics(*, id: Optional[Any] = None, allow_no_match: Optional[bool] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, time: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Gets configuration and usage information about data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-dfanalytics.html

Parameters:
  • id – The ID of the data frame analytics to fetch
  • allow_no_match – Whether to ignore if a wildcard expression matches no configs. (This includes _all string or when no configs have been specified)
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – Comma-separated list of column names to display.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – Comma-separated list of column names or column aliases used to sort the response.
  • time – Unit used to display time values.
  • v – When set to true will enable verbose output.
ml_datafeeds(*, datafeed_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, time: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Gets configuration and usage information about datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-datafeeds.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed.
  • allow_no_match – Specifies what to do when the request: * Contains wildcard expressions and there are no datafeeds that match. * Contains the _all string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If true, the API returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – Comma-separated list of column names to display.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – Comma-separated list of column names or column aliases used to sort the response.
  • time – The unit used to display time values.
  • v – When set to true will enable verbose output.
ml_jobs(*, job_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, time: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Gets configuration and usage information about anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-anomaly-detectors.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • allow_no_match – Specifies what to do when the request: * Contains wildcard expressions and there are no jobs that match. * Contains the _all string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If true, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.
  • bytes – The unit used to display byte values.
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – Comma-separated list of column names to display.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – Comma-separated list of column names or column aliases used to sort the response.
  • time – The unit used to display time values.
  • v – When set to true will enable verbose output.
ml_trained_models(*, model_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, from_: Optional[int] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, size: Optional[int] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Gets configuration and usage information about inference trained models.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-trained-model.html

Parameters:
  • model_id – The ID of the trained models stats to fetch
  • allow_no_match – Whether to ignore if a wildcard expression matches no trained models. (This includes _all string or when no trained models have been specified)
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • from – skips a number of trained models
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • size – specifies a max number of trained models to get
  • v – When set to true will enable verbose output.
nodeattrs(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about custom node attributes.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-nodeattrs.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
nodes(*, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, full_id: Union[bool, str, None] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns basic statistics about performance of cluster nodes.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-nodes.html

Parameters:
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • full_id – Return the full node ID instead of the shortened version (default: false)
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
pending_tasks(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns a concise representation of the cluster pending tasks.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-pending-tasks.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
plugins(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about installed plugins across nodes node.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-plugins.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
recovery(*, index: Optional[Any] = None, active_only: Optional[bool] = None, bytes: Optional[Any] = None, detailed: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about index shard recoveries, both on-going completed.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-recovery.html

Parameters:
  • index – Comma-separated list or wildcard expression of index names to limit the returned information
  • active_only – If true, the response only includes ongoing shard recoveries
  • bytes – The unit in which to display byte values
  • detailed – If true, the response includes detailed information about shard recoveries
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
repositories(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about snapshot repositories registered in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-repositories.html

Parameters:
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
segments(*, index: Optional[Any] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Provides low-level information about the segments in the shards of an index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-segments.html

Parameters:
  • index – A comma-separated list of index names to limit the returned information
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
shards(*, index: Optional[Any] = None, bytes: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Provides a detailed view of shard allocation on nodes.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-shards.html

Parameters:
  • index – A comma-separated list of index names to limit the returned information
  • bytes – The unit in which to display byte values
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
snapshots(*, repository: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns all snapshots in a specific repository.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-snapshots.html

Parameters:
  • repository – Name of repository from which to fetch the snapshot information
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • ignore_unavailable – Set to true to ignore unavailable snapshots
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
tasks(*, actions: Optional[List[str]] = None, detailed: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, node_id: Optional[List[str]] = None, parent_task: Optional[int] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about the tasks currently executing on one or more nodes in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html

Parameters:
  • actions – A comma-separated list of actions that should be returned. Leave empty to return all.
  • detailed – Return detailed task information (default: false)
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • node_id
  • parent_task
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
templates(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns information about existing templates.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-templates.html

Parameters:
  • name – A pattern that returned template names must match
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • v – When set to true will enable verbose output.
thread_pool(*, thread_pool_patterns: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, time: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-thread-pool.html

Parameters:
  • thread_pool_patterns – List of thread pool names used to limit the request. Accepts wildcard expressions.
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • h – List of columns to appear in the response. Supports simple wildcards.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.
  • time – Unit used to display time values.
  • v – When set to true will enable verbose output.
transforms(*, transform_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, from_: Optional[int] = None, h: Optional[Any] = None, help: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, s: Optional[Any] = None, size: Optional[int] = None, time: Optional[Any] = None, v: Optional[bool] = None) → Union[elastic_transport.ObjectApiResponse[typing.Any][Any], elastic_transport.TextApiResponse]

Gets configuration and usage information about transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cat-transforms.html

Parameters:
  • transform_id – The id of the transform for which to get stats. ‘_all’ or ‘*’ implies all transforms
  • allow_no_match – Whether to ignore if a wildcard expression matches no transforms. (This includes _all string or when no transforms have been specified)
  • format – Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile.
  • from – skips a number of transform configs, defaults to 0
  • h – Comma-separated list of column names to display.
  • help – When set to true will output available columns. This option can’t be combined with any other query string option.
  • local – If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.
  • master_timeout – Period to wait for a connection to the master node.
  • s – Comma-separated list of column names or column aliases used to sort the response.
  • size – specifies a max number of transforms to get, defaults to 100
  • time – Unit used to display time values.
  • v – When set to true will enable verbose output.

Cross-Cluster Replication (CCR)

class elasticsearch.client.CcrClient(client: elasticsearch._sync.client._base.BaseClient)
delete_auto_follow_pattern(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes auto-follow patterns.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-delete-auto-follow-pattern.html

Parameters:name – The name of the auto follow pattern.
follow(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, leader_index: Optional[Any] = None, max_outstanding_read_requests: Optional[int] = None, max_outstanding_write_requests: Optional[int] = None, max_read_request_operation_count: Optional[int] = None, max_read_request_size: Optional[str] = None, max_retry_delay: Optional[Any] = None, max_write_buffer_count: Optional[int] = None, max_write_buffer_size: Optional[str] = None, max_write_request_operation_count: Optional[int] = None, max_write_request_size: Optional[str] = None, pretty: Optional[bool] = None, read_poll_timeout: Optional[Any] = None, remote_cluster: Optional[str] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new follower index configured to follow the referenced leader index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-put-follow.html

Parameters:
  • index – The name of the follower index
  • leader_index
  • max_outstanding_read_requests
  • max_outstanding_write_requests
  • max_read_request_operation_count
  • max_read_request_size
  • max_retry_delay
  • max_write_buffer_count
  • max_write_buffer_size
  • max_write_request_operation_count
  • max_write_request_size
  • read_poll_timeout
  • remote_cluster
  • wait_for_active_shards – Sets the number of shard copies that must be active before returning. Defaults to 0. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
follow_info(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about all follower indices, including parameters and status for each follower index

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-follow-info.html

Parameters:index – A comma-separated list of index patterns; use _all to perform the operation on all indices
follow_stats(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-follow-stats.html

Parameters:index – A comma-separated list of index patterns; use _all to perform the operation on all indices
forget_follower(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, follower_cluster: Optional[str] = None, follower_index: Optional[Any] = None, follower_index_uuid: Optional[Any] = None, human: Optional[bool] = None, leader_remote_cluster: Optional[str] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes the follower retention leases from the leader.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-forget-follower.html

Parameters:
  • index – the name of the leader index for which specified follower retention leases should be removed
  • follower_cluster
  • follower_index
  • follower_index_uuid
  • leader_remote_cluster
get_auto_follow_pattern(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-auto-follow-pattern.html

Parameters:name – Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections.
pause_auto_follow_pattern(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Pauses an auto-follow pattern

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-pause-auto-follow-pattern.html

Parameters:name – The name of the auto follow pattern that should pause discovering new indices to follow.
pause_follow(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Pauses a follower index. The follower index will not fetch any additional operations from the leader index.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-pause-follow.html

Parameters:index – The name of the follower index that should pause following its leader index.
put_auto_follow_pattern(*, name: Any, remote_cluster: str, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, follow_index_pattern: Optional[Any] = None, human: Optional[bool] = None, leader_index_exclusion_patterns: Optional[Any] = None, leader_index_patterns: Optional[Any] = None, max_outstanding_read_requests: Optional[int] = None, max_outstanding_write_requests: Optional[int] = None, max_read_request_operation_count: Optional[int] = None, max_read_request_size: Optional[Any] = None, max_retry_delay: Optional[Any] = None, max_write_buffer_count: Optional[int] = None, max_write_buffer_size: Optional[Any] = None, max_write_request_operation_count: Optional[int] = None, max_write_request_size: Optional[Any] = None, pretty: Optional[bool] = None, read_poll_timeout: Optional[Any] = None, settings: Optional[Dict[str, Any]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-put-auto-follow-pattern.html

Parameters:
  • name – The name of the collection of auto-follow patterns.
  • remote_cluster – The remote cluster containing the leader indices to match against.
  • follow_index_pattern – The name of follower index. The template {{leader_index}} can be used to derive the name of the follower index from the name of the leader index. When following a data stream, use {{leader_index}}; CCR does not support changes to the names of a follower data stream’s backing indices.
  • leader_index_exclusion_patterns – An array of simple index patterns that can be used to exclude indices from being auto-followed. Indices in the remote cluster whose names are matching one or more leader_index_patterns and one or more leader_index_exclusion_patterns won’t be followed.
  • leader_index_patterns – An array of simple index patterns to match against indices in the remote cluster specified by the remote_cluster field.
  • max_outstanding_read_requests – The maximum number of outstanding reads requests from the remote cluster.
  • max_outstanding_write_requests – The maximum number of outstanding reads requests from the remote cluster.
  • max_read_request_operation_count – The maximum number of operations to pull per read from the remote cluster.
  • max_read_request_size – The maximum size in bytes of per read of a batch of operations pulled from the remote cluster.
  • max_retry_delay – The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying.
  • max_write_buffer_count – The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit.
  • max_write_buffer_size – The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit.
  • max_write_request_operation_count – The maximum number of operations per bulk write request executed on the follower.
  • max_write_request_size – The maximum total bytes of operations per bulk write request executed on the follower.
  • read_poll_timeout – The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again.
  • settings – Settings to override from the leader index. Note that certain settings can not be overrode (e.g., index.number_of_shards).
resume_auto_follow_pattern(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Resumes an auto-follow pattern that has been paused

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-resume-auto-follow-pattern.html

Parameters:name – The name of the auto follow pattern to resume discovering new indices to follow.
resume_follow(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_outstanding_read_requests: Optional[int] = None, max_outstanding_write_requests: Optional[int] = None, max_read_request_operation_count: Optional[int] = None, max_read_request_size: Optional[str] = None, max_retry_delay: Optional[Any] = None, max_write_buffer_count: Optional[int] = None, max_write_buffer_size: Optional[str] = None, max_write_request_operation_count: Optional[int] = None, max_write_request_size: Optional[str] = None, pretty: Optional[bool] = None, read_poll_timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Resumes a follower index that has been paused

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-resume-follow.html

Parameters:
  • index – The name of the follow index to resume following.
  • max_outstanding_read_requests
  • max_outstanding_write_requests
  • max_read_request_operation_count
  • max_read_request_size
  • max_retry_delay
  • max_write_buffer_count
  • max_write_buffer_size
  • max_write_request_operation_count
  • max_write_request_size
  • read_poll_timeout
stats(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Gets all stats related to cross-cluster replication.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-get-stats.html

unfollow(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ccr-post-unfollow.html

Parameters:index – The name of the follower index that should be turned into a regular index.

Cluster

class elasticsearch.client.ClusterClient(client: elasticsearch._sync.client._base.BaseClient)
allocation_explain(*, current_node: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, include_disk_info: Optional[bool] = None, include_yes_decisions: Optional[bool] = None, index: Optional[Any] = None, pretty: Optional[bool] = None, primary: Optional[bool] = None, shard: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Provides explanations for shard allocations in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-allocation-explain.html

Parameters:
  • current_node – Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node.
  • include_disk_info – If true, returns information about disk usage and shard sizes.
  • include_yes_decisions – If true, returns YES decisions in explanation.
  • index – Specifies the name of the index that you would like an explanation for.
  • primary – If true, returns explanation for the primary shard for the given shard ID.
  • shard – Specifies the ID of the shard that you would like an explanation for.
delete_component_template(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a component template

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-component-template.html

Parameters:
  • name – The name of the template
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
delete_voting_config_exclusions(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, wait_for_removal: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clears cluster voting config exclusions.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/voting-config-exclusions.html

Parameters:wait_for_removal – Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any action. If set to false then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster.
exists_component_template(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.HeadApiResponse

Returns information about whether a particular component template exist

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-component-template.html

Parameters:
  • name – Comma-separated list of component template names used to limit the request. Wildcard (*) expressions are supported.
  • local – If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
get_component_template(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns one or more component templates

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-component-template.html

Parameters:
  • name – The comma separated names of the component templates
  • flat_settings
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Explicit operation timeout for connection to master node
get_settings(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, include_defaults: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns cluster settings.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-get-settings.html

Parameters:
  • flat_settings – Return settings in flat format (default: false)
  • include_defaults – Whether to return all default clusters setting.
  • master_timeout – Explicit operation timeout for connection to master node
  • timeout – Explicit operation timeout
health(*, index: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, level: Optional[Any] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None, wait_for_events: Optional[Any] = None, wait_for_no_initializing_shards: Optional[bool] = None, wait_for_no_relocating_shards: Optional[bool] = None, wait_for_nodes: Union[int, str, None] = None, wait_for_status: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns basic information about the health of the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-health.html

Parameters:
  • index – Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or *.
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • level – Can be one of cluster, indices or shards. Controls the details level of the health information returned.
  • local – If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
  • wait_for_active_shards – A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.
  • wait_for_events – Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed.
  • wait_for_no_initializing_shards – A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards.
  • wait_for_no_relocating_shards – A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards.
  • wait_for_nodes – The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.
  • wait_for_status – One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status.
pending_tasks(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-pending.html

Parameters:
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Specify timeout for connection to master
post_voting_config_exclusions(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, node_ids: Optional[Any] = None, node_names: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates the cluster voting config exclusions by node ids or node names.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/voting-config-exclusions.html

Parameters:
  • node_ids – A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify node_names.
  • node_names – A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify node_ids.
  • timeout – When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error.
put_component_template(*, name: Any, template: Any, aliases: Optional[Dict[str, Any]] = None, create: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, mappings: Optional[Any] = None, master_timeout: Optional[Any] = None, meta: Optional[Any] = None, pretty: Optional[bool] = None, settings: Optional[Any] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates a component template

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/indices-component-template.html

Parameters:
  • name – The name of the template
  • template
  • aliases
  • create – Whether the index template should only be added if new or can also replace an existing one
  • mappings
  • master_timeout – Specify timeout for connection to master
  • meta
  • settings
  • version
put_settings(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, persistent: Optional[Dict[str, Any]] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, transient: Optional[Dict[str, Any]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates the cluster settings.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-update-settings.html

Parameters:
  • flat_settings – Return settings in flat format (default: false)
  • master_timeout – Explicit operation timeout for connection to master node
  • persistent
  • timeout – Explicit operation timeout
  • transient
remote_info(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the information about configured remote clusters.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-remote-info.html

reroute(*, commands: Optional[List[Any]] = None, dry_run: Optional[bool] = None, error_trace: Optional[bool] = None, explain: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, metric: Optional[Any] = None, pretty: Optional[bool] = None, retry_failed: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to manually change the allocation of individual shards in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-reroute.html

Parameters:
  • commands – Defines the commands to perform.
  • dry_run – If true, then the request simulates the operation only and returns the resulting state.
  • explain – If true, then the response contains an explanation of why the commands can or cannot be executed.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • metric – Limits the information returned to the specified metrics.
  • retry_failed – If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
state(*, metric: Optional[Any] = None, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, wait_for_metadata_version: Optional[Any] = None, wait_for_timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a comprehensive information about the state of the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-state.html

Parameters:
  • metric – Limit the information returned to the specified metrics
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • flat_settings – Return settings in flat format (default: false)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Specify timeout for connection to master
  • wait_for_metadata_version – Wait for the metadata version to be equal or greater than the specified metadata version
  • wait_for_timeout – The maximum time to wait for wait_for_metadata_version before timing out
stats(*, node_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns high-level overview of cluster statistics.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-stats.html

Parameters:
  • node_id – Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster.
  • flat_settings – Return settings in flat format (default: false)
  • timeout – Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s _nodes.failed property. Defaults to no timeout.

Dangling Indices

class elasticsearch.client.DanglingIndicesClient(client: elasticsearch._sync.client._base.BaseClient)
delete_dangling_index(*, index_uuid: Any, accept_data_loss: bool, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes the specified dangling index

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html

Parameters:
  • index_uuid – The UUID of the dangling index
  • accept_data_loss – Must be set to true in order to delete the dangling index
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
import_dangling_index(*, index_uuid: Any, accept_data_loss: bool, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Imports the specified dangling index

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html

Parameters:
  • index_uuid – The UUID of the dangling index
  • accept_data_loss – Must be set to true in order to import the dangling index
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
list_dangling_indices(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns all dangling indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html

Enrich Policies

class elasticsearch.client.EnrichClient(client: elasticsearch._sync.client._base.BaseClient)
delete_policy(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing enrich policy and its enrich index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html

Parameters:name – The name of the enrich policy
execute_policy(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates the enrich index for an existing enrich policy.

https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html

Parameters:
  • name – The name of the enrich policy
  • wait_for_completion – Should the request should block until the execution is complete.
get_policy(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Gets information about an enrich policy.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html

Parameters:name – A comma-separated list of enrich policy names
put_policy(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, geo_match: Optional[Any] = None, human: Optional[bool] = None, match: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new enrich policy.

https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html

Parameters:
  • name – The name of the enrich policy
  • geo_match
  • match
stats(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Gets enrich coordinator statistics and information about enrich policies that are currently executing.

https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html

Event Query Language (EQL)

class elasticsearch.client.EqlClient(client: elasticsearch._sync.client._base.BaseClient)
delete(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.

https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html

Parameters:id – Identifier for the search to delete.
get(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, keep_alive: Optional[Any] = None, pretty: Optional[bool] = None, wait_for_completion_timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns async results from previously executed Event Query Language (EQL) search

https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html

Parameters:
  • id – Identifier for the search.
  • keep_alive – Period for which the search and its results are stored on the cluster. Defaults to the keep_alive value set by the search’s EQL search API request.
  • wait_for_completion_timeout – Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.
get_status(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the status of a previously submitted async or stored Event Query Language (EQL) search

https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html

Parameters:id – Identifier for the search.
search(*, index: Any, query: str, allow_no_indices: Optional[bool] = None, case_sensitive: Optional[bool] = None, error_trace: Optional[bool] = None, event_category_field: Optional[Any] = None, expand_wildcards: Optional[Any] = None, fetch_size: Optional[int] = None, fields: Union[Any, List[Any], None] = None, filter: Union[Any, List[Any], None] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, keep_alive: Optional[Any] = None, keep_on_completion: Optional[bool] = None, pretty: Optional[bool] = None, result_position: Optional[Any] = None, runtime_mappings: Optional[Any] = None, size: Optional[int] = None, tiebreaker_field: Optional[Any] = None, timestamp_field: Optional[Any] = None, wait_for_completion_timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns results matching a query expressed in Event Query Language (EQL)

https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html

Parameters:
  • index – The name of the index to scope the operation
  • query – EQL query you wish to run.
  • allow_no_indices
  • case_sensitive
  • event_category_field – Field containing the event classification, such as process, file, or network.
  • expand_wildcards
  • fetch_size – Maximum number of events to search at a time for sequence queries.
  • fields – Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit.
  • filter – Query, written in Query DSL, used to filter the events on which the EQL query runs.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • keep_alive
  • keep_on_completion
  • result_position
  • runtime_mappings
  • size – For basic queries, the maximum number of matching events to return. Defaults to 10
  • tiebreaker_field – Field used to sort hits with the same timestamp in ascending order
  • timestamp_field – Field containing event timestamp. Default “@timestamp”
  • wait_for_completion_timeout

Snapshottable Features

class elasticsearch.client.FeaturesClient(client: elasticsearch._sync.client._base.BaseClient)
get_features(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-features-api.html

reset_features(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Resets the internal state of features, usually by deleting system indices

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Fleet

class elasticsearch.client.FleetClient(client: elasticsearch._sync.client._base.BaseClient)
global_checkpoints(*, index: Any, checkpoints: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_advance: Optional[bool] = None, wait_for_index: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html

Parameters:
  • index – A single index or index alias that resolves to a single index.
  • checkpoints – A comma separated list of previous global checkpoints. When used in combination with wait_for_advance, the API will only return once the global checkpoints advances past the checkpoints. Providing an empty list will cause Elasticsearch to immediately return the current global checkpoints.
  • timeout – Period to wait for a global checkpoints to advance past checkpoints.
  • wait_for_advance – A boolean value which controls whether to wait (until the timeout) for the global checkpoints to advance past the provided checkpoints.
  • wait_for_index – A boolean value which controls whether to wait (until the timeout) for the target index to exist and all primary shards be active. Can only be true when wait_for_advance is true.
msearch(*, index: Any, searches: List[Any], allow_no_indices: Optional[bool] = None, allow_partial_search_results: Optional[bool] = None, ccs_minimize_roundtrips: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, max_concurrent_searches: Optional[int] = None, max_concurrent_shard_requests: Optional[int] = None, pre_filter_shard_size: Optional[int] = None, pretty: Optional[bool] = None, rest_total_hits_as_int: Optional[bool] = None, search_type: Optional[Any] = None, typed_keys: Optional[bool] = None, wait_for_checkpoints: Optional[List[Any]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.

Parameters:
  • index – A single target to search. If the target is an index alias, it must resolve to a single index.
  • searches
  • allow_no_indices – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
  • allow_partial_search_results – If true, returns partial results if there are shard request timeouts or [shard failures](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#shard-failures). If false, returns an error with no partial results. Defaults to the configured cluster setting search.default_allow_partial_results which is true by default.
  • ccs_minimize_roundtrips – If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests.
  • expand_wildcards – Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
  • ignore_throttled – If true, concrete, expanded or aliased indices are ignored when frozen.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • max_concurrent_searches – Maximum number of concurrent searches the multi search API can execute.
  • max_concurrent_shard_requests – Maximum number of concurrent shard requests that each sub-search request executes per node.
  • pre_filter_shard_size – Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint.
  • rest_total_hits_as_int – If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object.
  • search_type – Indicates whether global term and document frequencies should be used when scoring returned documents.
  • typed_keys – Specifies whether aggregation and suggester names should be prefixed by their respective types in the response.
  • wait_for_checkpoints – A comma separated list of checkpoints. When configured, the search API will only be executed on a shard after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause Elasticsearch to immediately execute the search.
search(*, index: Any, aggregations: Optional[Dict[str, Any]] = None, aggs: Optional[Dict[str, Any]] = None, allow_no_indices: Optional[bool] = None, allow_partial_search_results: Optional[bool] = None, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, batched_reduce_size: Optional[int] = None, ccs_minimize_roundtrips: Optional[bool] = None, collapse: Optional[Any] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, docvalue_fields: Optional[List[Any]] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, explain: Optional[bool] = None, fields: Optional[List[Any]] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, highlight: Optional[Any] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, indices_boost: Optional[List[Dict[Any, float]]] = None, lenient: Optional[bool] = None, max_concurrent_shard_requests: Optional[int] = None, min_compatible_shard_node: Optional[Any] = None, min_score: Optional[float] = None, pit: Optional[Any] = None, post_filter: Optional[Any] = None, pre_filter_shard_size: Optional[int] = None, preference: Optional[str] = None, pretty: Optional[bool] = None, profile: Optional[bool] = None, q: Optional[str] = None, query: Optional[Any] = None, request_cache: Optional[bool] = None, rescore: Union[Any, List[Any], None] = None, rest_total_hits_as_int: Optional[bool] = None, routing: Optional[Any] = None, runtime_mappings: Optional[Any] = None, script_fields: Optional[Dict[str, Any]] = None, scroll: Optional[Any] = None, search_after: Optional[Any] = None, search_type: Optional[Any] = None, seq_no_primary_term: Optional[bool] = None, size: Optional[int] = None, slice: Optional[Any] = None, sort: Optional[Any] = None, source: Optional[Any] = None, source_excludes: Optional[Any] = None, source_includes: Optional[Any] = None, stats: Optional[List[str]] = None, stored_fields: Optional[Any] = None, suggest: Optional[Any] = None, suggest_field: Optional[Any] = None, suggest_mode: Optional[Any] = None, suggest_size: Optional[int] = None, suggest_text: Optional[str] = None, terminate_after: Optional[int] = None, timeout: Optional[str] = None, track_scores: Optional[bool] = None, track_total_hits: Optional[Any] = None, typed_keys: Optional[bool] = None, version: Optional[bool] = None, wait_for_checkpoints: Optional[List[Any]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.

Parameters:
  • index – A single target to search. If the target is an index alias, it must resolve to a single index.
  • aggregations
  • aggs
  • allow_no_indices
  • allow_partial_search_results – If true, returns partial results if there are shard request timeouts or [shard failures](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#shard-failures). If false, returns an error with no partial results. Defaults to the configured cluster setting search.default_allow_partial_results which is true by default.
  • analyze_wildcard
  • analyzer
  • batched_reduce_size
  • ccs_minimize_roundtrips
  • collapse
  • default_operator
  • df
  • docvalue_fields – Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.
  • expand_wildcards
  • explain – If true, returns detailed information about score computation as part of a hit.
  • fields – Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.
  • from – Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.
  • highlight
  • ignore_throttled
  • ignore_unavailable
  • indices_boost – Boosts the _score of documents from specified indices.
  • lenient
  • max_concurrent_shard_requests
  • min_compatible_shard_node
  • min_score – Minimum _score for matching documents. Documents with a lower _score are not included in the search results.
  • pit – Limits the search to a point in time (PIT). If you provide a PIT, you cannot specify an <index> in the request path.
  • post_filter
  • pre_filter_shard_size
  • preference
  • profile
  • q
  • query – Defines the search definition using the Query DSL.
  • request_cache
  • rescore
  • rest_total_hits_as_int
  • routing
  • runtime_mappings – Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.
  • script_fields – Retrieve a script evaluation (based on different fields) for each hit.
  • scroll
  • search_after
  • search_type
  • seq_no_primary_term – If true, returns sequence number and primary term of the last modification of each hit. See Optimistic concurrency control.
  • size – The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.
  • slice
  • sort
  • source – Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.
  • source_excludes
  • source_includes
  • stats – Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.
  • stored_fields – List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.
  • suggest
  • suggest_field – Specifies which field to use for suggestions.
  • suggest_mode
  • suggest_size
  • suggest_text – The source text for which the suggestions should be returned.
  • terminate_after – Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Defaults to 0, which does not terminate query execution early.
  • timeout – Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.
  • track_scores – If true, calculate and return document scores, even if the scores are not used for sorting.
  • track_total_hits – Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.
  • typed_keys
  • version – If true, returns document version as part of a hit.
  • wait_for_checkpoints – A comma separated list of checkpoints. When configured, the search API will only be executed on a shard after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause Elasticsearch to immediately execute the search.

Graph Explore

class elasticsearch.client.GraphClient(client: elasticsearch._sync.client._base.BaseClient)
explore(*, index: Any, connections: Optional[Any] = None, controls: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, routing: Optional[Any] = None, timeout: Optional[Any] = None, vertices: Optional[List[Any]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Explore extracted and summarized information about the documents and terms in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html

Parameters:
  • index – A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
  • connections
  • controls
  • query
  • routing – Specific routing value
  • timeout – Explicit operation timeout
  • vertices

Index Lifecycle Management (ILM)

class elasticsearch.client.IlmClient(client: elasticsearch._sync.client._base.BaseClient)
delete_lifecycle(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html

Parameters:
  • name – Identifier for the policy.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
explain_lifecycle(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, only_errors: Optional[bool] = None, only_managed: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about the index’s current lifecycle state, such as the currently executing phase, action, and step.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html

Parameters:
  • index – Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (*). To target all data streams and indices, use * or _all.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • only_errors – Filters the returned indices to only indices that are managed by ILM.
  • only_managed – Filters the returned indices to only indices that are managed by ILM and are in an error state, either due to an encountering an error while executing the policy, or attempting to use a policy that does not exist.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
get_lifecycle(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the specified policy definition. Includes the policy version and last modified date.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html

Parameters:
  • name – Identifier for the policy.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
get_status(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves the current index lifecycle management (ILM) status.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html

migrate_to_data_tiers(*, dry_run: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, legacy_template_to_delete: Optional[str] = None, node_attribute: Optional[str] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html

Parameters:
  • dry_run – If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration. This provides a way to retrieve the indices and ILM policies that need to be migrated.
  • legacy_template_to_delete
  • node_attribute
move_to_step(*, index: Any, current_step: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, next_step: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Manually moves an index into the specified step and executes that step.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html

Parameters:
  • index – The name of the index whose lifecycle step is to change
  • current_step
  • next_step
put_lifecycle(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, policy: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a lifecycle policy

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html

Parameters:
  • name – Identifier for the policy.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • policy
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
remove_policy(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes the assigned lifecycle policy and stops managing the specified index

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html

Parameters:index – The name of the index to remove policy on
retry(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retries executing the policy for an index that is in the ERROR step.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html

Parameters:index – The name of the indices (comma-separated) whose failed lifecycle step is to be retry
start(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Start the index lifecycle management (ILM) plugin.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html

Parameters:
  • master_timeout
  • timeout
stop(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin

https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html

Parameters:
  • master_timeout
  • timeout

Indices

class elasticsearch.client.IndicesClient(client: elasticsearch._sync.client._base.BaseClient)
add_block(*, index: Any, block: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds a block to an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html

Parameters:
  • index – A comma separated list of indices to add a block to
  • block – The block to add (one of read, write, read_only or metadata)
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
analyze(*, index: Optional[Any] = None, analyzer: Optional[str] = None, attributes: Optional[List[str]] = None, char_filter: Optional[List[Any]] = None, error_trace: Optional[bool] = None, explain: Optional[bool] = None, field: Optional[Any] = None, filter: Optional[List[Any]] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, normalizer: Optional[str] = None, pretty: Optional[bool] = None, text: Optional[Any] = None, tokenizer: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Performs the analysis process on a text and return the tokens breakdown of the text.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html

Parameters:
  • index – The name of the index to scope the operation
  • analyzer
  • attributes
  • char_filter
  • explain
  • field
  • filter
  • normalizer
  • text
  • tokenizer
clear_cache(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, fielddata: Optional[bool] = None, fields: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None, query: Optional[bool] = None, request: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clears all or specific caches for one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html

Parameters:
  • index – A comma-separated list of index name to limit the operation
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • fielddata – Clear field data
  • fields – A comma-separated list of fields to clear when using the fielddata parameter (default: all)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • query – Clear query caches
  • request – Clear request cache
clone(*, index: Any, target: Any, aliases: Optional[Dict[Any, Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, settings: Optional[Dict[str, Any]] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clones an index

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clone-index.html

Parameters:
  • index – The name of the source index to clone
  • target – The name of the target index to clone into
  • aliases
  • master_timeout – Specify timeout for connection to master
  • settings
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Set the number of active shards to wait for on the cloned index before the operation returns.
close(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Closes an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html

Parameters:
  • index – A comma separated list of indices to close
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Sets the number of active shards to wait for before the operation returns.
create(*, index: Any, aliases: Optional[Dict[Any, Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, mappings: Optional[Any] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, settings: Optional[Any] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates an index with optional settings and mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html

Parameters:
  • index – The name of the index
  • aliases
  • mappings – Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters
  • master_timeout – Specify timeout for connection to master
  • settings
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Set the number of active shards to wait for before the operation returns.
create_data_stream(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a data stream

https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

Parameters:name – The name of the data stream
data_streams_stats(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Provides statistics on operations happening in a data stream.

https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

Parameters:
  • name – A comma-separated list of data stream names; use _all or empty string to perform the operation on all data streams
  • expand_wildcards
delete(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html

Parameters:
  • index – A comma-separated list of indices to delete; use _all or * string to delete all indices
  • allow_no_indices – Ignore if a wildcard expression resolves to no concrete indices (default: false)
  • expand_wildcards – Whether wildcard expressions should get expanded to open, closed, or hidden indices
  • ignore_unavailable – Ignore unavailable indexes (default: false)
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
delete_alias(*, index: Any, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an alias.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html

Parameters:
  • index – A comma-separated list of index names (supports wildcards); use _all for all indices
  • name – A comma-separated list of aliases to delete (supports wildcards); use _all to delete all aliases for the specified indices.
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit timestamp for the document
delete_data_stream(*, name: Any, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a data stream.

https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

Parameters:
  • name – A comma-separated list of data streams to delete; use * to delete all data streams
  • expand_wildcards – Whether wildcard expressions should get expanded to open or closed indices (default: open)
delete_index_template(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:name – The name of the template
delete_template(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – The name of the template
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
disk_usage(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flush: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, run_expensive_tasks: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Analyzes the disk usage of each field of an index or data stream

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-disk-usage.html

Parameters:
  • index – Comma-separated list of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly.
  • allow_no_indices – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.
  • expand_wildcards – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.
  • flush – If true, the API performs a flush before analysis. If false, the response may not include uncommitted data.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • run_expensive_tasks – Analyzing field disk usage is resource-intensive. To use the API, this parameter must be set to true.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
  • wait_for_active_shards – The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1). Default: 1, the primary shard.
exists(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_defaults: Optional[bool] = None, local: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.HeadApiResponse

Returns information about whether a particular index exists.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html

Parameters:
  • index – A comma-separated list of index names
  • allow_no_indices – Ignore if a wildcard expression resolves to no concrete indices (default: false)
  • expand_wildcards – Whether wildcard expressions should get expanded to open or closed indices (default: open)
  • flat_settings – Return settings in flat format (default: false)
  • ignore_unavailable – Ignore unavailable indexes (default: false)
  • include_defaults – Whether to return all default setting for each of the indices.
  • local – Return local information, do not retrieve the state from master node (default: false)
exists_alias(*, name: Any, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, local: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.HeadApiResponse

Returns information about whether a particular alias exists.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html

Parameters:
  • name – A comma-separated list of alias names to return
  • index – A comma-separated list of index names to filter aliases
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • local – Return local information, do not retrieve the state from master node (default: false)
exists_index_template(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.HeadApiResponse

Returns information about whether a particular index template exists.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
exists_template(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.HeadApiResponse

Returns information about whether a particular index template exists.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – The comma separated names of the index templates
  • flat_settings – Return settings in flat format (default: false)
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Explicit operation timeout for connection to master node
flush(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None, wait_if_ongoing: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Performs the flush operation on one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string for all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • force – Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • wait_if_ongoing – If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running.
forcemerge(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flush: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, max_num_segments: Optional[int] = None, only_expunge_deletes: Optional[bool] = None, pretty: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Performs the force merge operation on one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • flush – Specify whether the index should be flushed after performing the operation (default: true)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • max_num_segments – The number of segments the index should be merged into (default: dynamic)
  • only_expunge_deletes – Specify whether the operation should only expunge deleted documents
  • wait_for_completion
get(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_defaults: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html

Parameters:
  • index – Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported.
  • allow_no_indices – Ignore if a wildcard expression resolves to no concrete indices (default: false)
  • expand_wildcards – Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden.
  • flat_settings – If true, returns settings in flat format.
  • ignore_unavailable – If false, requests that target a missing index return an error.
  • include_defaults – If true, return all default settings in the response.
  • local – If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
get_alias(*, index: Optional[Any] = None, name: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, local: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns an alias.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html

Parameters:
  • index – A comma-separated list of index names to filter aliases
  • name – A comma-separated list of alias names to return
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • local – Return local information, do not retrieve the state from master node (default: false)
get_data_stream(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns data streams.

https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

Parameters:
  • name – A comma-separated list of data streams to get; use * to get all data streams
  • expand_wildcards – Whether wildcard expressions should get expanded to open or closed indices (default: open)
get_field_mapping(*, fields: Any, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_defaults: Optional[bool] = None, local: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns mapping for one or more fields.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html

Parameters:
  • fields – A comma-separated list of fields
  • index – A comma-separated list of index names
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • include_defaults – Whether the default mapping values should be returned as well
  • local – Return local information, do not retrieve the state from master node (default: false)
get_index_template(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported.
  • flat_settings – If true, returns settings in flat format.
  • local – If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
get_mapping(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns mappings for one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html

Parameters:
  • index – A comma-separated list of index names
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Specify timeout for connection to master
get_settings(*, index: Optional[Any] = None, name: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_defaults: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns settings for one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • name – The name of the settings that should be included
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • flat_settings – Return settings in flat format (default: false)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • include_defaults – Whether to return all default setting for each of the indices.
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Specify timeout for connection to master
get_template(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – The comma separated names of the index templates
  • flat_settings – Return settings in flat format (default: false)
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Explicit operation timeout for connection to master node
migrate_to_data_stream(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Migrates an alias to a data stream

https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

Parameters:name – The name of the alias to migrate
open(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Opens an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html

Parameters:
  • index – A comma separated list of indices to open
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Sets the number of active shards to wait for before the operation returns.
promote_data_stream(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Promotes a data stream from a replicated data stream managed by CCR to a regular data stream

https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

Parameters:name – The name of the data stream
put_alias(*, index: Any, name: Any, error_trace: Optional[bool] = None, filter: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, index_routing: Optional[Any] = None, is_write_index: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, routing: Optional[Any] = None, search_routing: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates an alias.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html

Parameters:
  • index – A comma-separated list of index names the alias should point to (supports wildcards); use _all to perform the operation on all indices.
  • name – The name of the alias to be created or updated
  • filter
  • index_routing
  • is_write_index
  • master_timeout – Specify timeout for connection to master
  • routing
  • search_routing
  • timeout – Explicit timestamp for the document
put_index_template(*, name: Any, composed_of: Optional[List[Any]] = None, create: Optional[bool] = None, data_stream: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, index_patterns: Optional[Any] = None, meta: Optional[Any] = None, pretty: Optional[bool] = None, priority: Optional[int] = None, template: Optional[Any] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – Index or template name
  • composed_of
  • create – Whether the index template should only be added if new or can also replace an existing one
  • data_stream
  • index_patterns
  • meta
  • priority
  • template
  • version
put_mapping(*, index: Any, allow_no_indices: Optional[bool] = None, date_detection: Optional[bool] = None, dynamic: Optional[Any] = None, dynamic_date_formats: Optional[List[str]] = None, dynamic_templates: Union[Dict[str, Any], List[Dict[str, Any]], None] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, field_names: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, meta: Optional[Any] = None, numeric_detection: Optional[bool] = None, pretty: Optional[bool] = None, properties: Optional[Dict[Any, Any]] = None, routing: Optional[Any] = None, runtime: Optional[Any] = None, source: Optional[Any] = None, timeout: Optional[Any] = None, write_index_only: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates the index mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html

Parameters:
  • index – A comma-separated list of index names the mapping should be added to (supports wildcards); use _all or omit to add the mapping on all indices.
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • date_detection – Controls whether dynamic date detection is enabled.
  • dynamic – Controls whether new fields are added dynamically.
  • dynamic_date_formats – If date detection is enabled then new string fields are checked against ‘dynamic_date_formats’ and if the value matches then a new date field is added instead of string.
  • dynamic_templates – Specify dynamic templates for the mapping.
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • field_names – Control whether field names are enabled for the index.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • master_timeout – Specify timeout for connection to master
  • meta – A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata.
  • numeric_detection – Automatically map strings into numeric data types for all fields.
  • properties – Mapping for a field. For new fields, this mapping can include: - Field name - Field data type - Mapping parameters
  • routing – Enable making a routing value required on indexed documents.
  • runtime – Mapping of runtime fields for the index.
  • source – Control whether the _source field is enabled on the index.
  • timeout – Explicit operation timeout
  • write_index_only – When true, applies mappings only to the write index of an alias or data stream
put_settings(*, settings: Any, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, preserve_existing: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates the index settings.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html

Parameters:
  • settings
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • flat_settings – Return settings in flat format (default: false)
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • master_timeout – Specify timeout for connection to master
  • preserve_existing – Whether to update existing settings. If set to true existing settings on an index remain unchanged, the default is false
  • timeout – Explicit operation timeout
put_template(*, name: Any, aliases: Optional[Dict[Any, Any]] = None, create: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, index_patterns: Union[List[str], str, None] = None, mappings: Optional[Any] = None, master_timeout: Optional[Any] = None, order: Optional[int] = None, pretty: Optional[bool] = None, settings: Optional[Dict[str, Any]] = None, timeout: Optional[Any] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates an index template.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – The name of the template
  • aliases – Aliases for the index.
  • create – If true, this request cannot replace or update existing index templates.
  • flat_settings
  • index_patterns – Array of wildcard expressions used to match the names of indices during creation.
  • mappings – Mapping for fields in the index.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • order – Order in which Elasticsearch applies this template if index matches multiple templates. Templates with lower ‘order’ values are merged first. Templates with higher ‘order’ values are merged later, overriding templates with lower values.
  • settings – Configuration options for the index.
  • timeout
  • version – Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch.
recovery(*, index: Optional[Any] = None, active_only: Optional[bool] = None, detailed: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about ongoing index shard recoveries.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • active_only – Display only those recoveries that are currently on-going
  • detailed – Whether to display detailed information about shard recovery
refresh(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Performs the refresh operation in one or more indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
reload_search_analyzers(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Reloads an index’s search analyzers and their resources.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html

Parameters:
  • index – A comma-separated list of index names to reload analyzers for
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
resolve_index(*, name: Any, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about any matching indices, aliases, and data streams

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-resolve-index-api.html

Parameters:
  • name – A comma-separated list of names or wildcard expressions
  • expand_wildcards – Whether wildcard expressions should get expanded to open or closed indices (default: open)
rollover(*, alias: Any, new_index: Optional[Any] = None, aliases: Optional[Dict[Any, Any]] = None, conditions: Optional[Any] = None, dry_run: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, mappings: Optional[Any] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, settings: Optional[Dict[str, Any]] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates an alias to point to a new index when the existing index is considered to be too large or too old.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html

Parameters:
  • alias – The name of the alias to rollover
  • new_index – The name of the rollover index
  • aliases
  • conditions
  • dry_run – If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
  • mappings
  • master_timeout – Specify timeout for connection to master
  • settings
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Set the number of active shards to wait for on the newly created rollover index before the operation returns.
segments(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None, verbose: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Provides low-level information about segments in a Lucene index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • verbose – Includes detailed memory usage by Lucene.
shard_stores(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None, status: Union[Any, List[Any], None] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Provides store information for shard copies of indices.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html

Parameters:
  • index – List of data streams, indices, and aliases used to limit the request.
  • allow_no_indices – If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices.
  • expand_wildcards – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
  • ignore_unavailable – If true, missing or closed indices are not included in the response.
  • status – List of shard health statuses used to limit the request.
shrink(*, index: Any, target: Any, aliases: Optional[Dict[Any, Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, settings: Optional[Dict[str, Any]] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allow to shrink an existing index into a new index with fewer primary shards.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html

Parameters:
  • index – The name of the source index to shrink
  • target – The name of the target index to shrink into
  • aliases
  • master_timeout – Specify timeout for connection to master
  • settings
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Set the number of active shards to wait for on the shrunken index before the operation returns.
simulate_index_template(*, name: Any, allow_auto_create: Optional[bool] = None, composed_of: Optional[List[Any]] = None, create: Optional[bool] = None, data_stream: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, index_patterns: Optional[Any] = None, master_timeout: Optional[Any] = None, meta: Optional[Any] = None, pretty: Optional[bool] = None, priority: Optional[int] = None, template: Optional[Any] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Simulate matching the given index name against the index templates in the system

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – Index or template name to simulate
  • allow_auto_create
  • composed_of
  • create – If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.
  • data_stream
  • index_patterns
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • meta
  • priority
  • template
  • version
simulate_template(*, name: Optional[Any] = None, create: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, template: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Simulate resolving the given template name or body

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html

Parameters:
  • name – Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body.
  • create – If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • template
split(*, index: Any, target: Any, aliases: Optional[Dict[Any, Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, settings: Optional[Dict[str, Any]] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows you to split an existing index into a new index with more primary shards.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html

Parameters:
  • index – The name of the source index to split
  • target – The name of the target index to split into
  • aliases
  • master_timeout – Specify timeout for connection to master
  • settings
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Set the number of active shards to wait for on the shrunken index before the operation returns.
stats(*, index: Optional[Any] = None, metric: Optional[Any] = None, completion_fields: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, fielddata_fields: Optional[Any] = None, fields: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, forbid_closed_indices: Optional[bool] = None, groups: Union[List[str], str, None] = None, human: Optional[bool] = None, include_segment_file_sizes: Optional[bool] = None, include_unloaded_segments: Optional[bool] = None, level: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Provides statistics on operations happening in an index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html

Parameters:
  • index – A comma-separated list of index names; use _all or empty string to perform the operation on all indices
  • metric – Limit the information returned the specific metrics.
  • completion_fields – A comma-separated list of fields for the completion index metric (supports wildcards)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • fielddata_fields – A comma-separated list of fields for the fielddata index metric (supports wildcards)
  • fields – A comma-separated list of fields for fielddata and completion index metric (supports wildcards)
  • forbid_closed_indices – If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices
  • groups – A comma-separated list of search groups for search index metric
  • include_segment_file_sizes – Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
  • include_unloaded_segments – If set to true segment stats will include stats for segments that are not currently loaded into memory
  • level – Return stats aggregated at cluster, index or shard level
unfreeze(*, index: Any, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_active_shards: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again.

https://www.elastic.co/guide/en/elasticsearch/reference/current/unfreeze-index-api.html

Parameters:
  • index – The name of the index to unfreeze
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • master_timeout – Specify timeout for connection to master
  • timeout – Explicit operation timeout
  • wait_for_active_shards – Sets the number of active shards to wait for before the operation returns.
update_aliases(*, actions: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates index aliases.

https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html

Parameters:
  • actions
  • master_timeout – Specify timeout for connection to master
  • timeout – Request timeout
validate_query(*, index: Optional[Any] = None, all_shards: Optional[bool] = None, allow_no_indices: Optional[bool] = None, analyze_wildcard: Optional[bool] = None, analyzer: Optional[str] = None, default_operator: Optional[Any] = None, df: Optional[str] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, explain: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, lenient: Optional[bool] = None, pretty: Optional[bool] = None, q: Optional[str] = None, query: Optional[Any] = None, rewrite: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows a user to validate a potentially expensive query without executing it.

https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html

Parameters:
  • index – A comma-separated list of index names to restrict the operation; use _all or empty string to perform the operation on all indices
  • all_shards – Execute validation on all shards instead of one random shard per index
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • analyze_wildcard – Specify whether wildcard and prefix queries should be analyzed (default: false)
  • analyzer – The analyzer to use for the query string
  • default_operator – The default operator for query string query (AND or OR)
  • df – The field to use as default where no field prefix is given in the query string
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • explain – Return detailed information about the error
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
  • lenient – Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  • q – Query in the Lucene query string syntax
  • query
  • rewrite – Provide a more detailed explanation showing the actual Lucene query that will be executed.

Ingest Pipelines

class elasticsearch.client.IngestClient(client: elasticsearch._sync.client._base.BaseClient)
delete_pipeline(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html

Parameters:
  • id – Pipeline ID
  • master_timeout – Explicit operation timeout for connection to master node
  • timeout – Explicit operation timeout
geo_ip_stats(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns statistical information about geoip databases

https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html

get_pipeline(*, id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, summary: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html

Parameters:
  • id – Comma separated list of pipeline ids. Wildcards supported
  • master_timeout – Explicit operation timeout for connection to master node
  • summary – Return pipelines without their definitions (default: false)
processor_grok(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a list of the built-in patterns.

https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get

put_pipeline(*, id: Any, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, meta: Optional[Any] = None, on_failure: Optional[List[Any]] = None, pretty: Optional[bool] = None, processors: Optional[List[Any]] = None, timeout: Optional[Any] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates a pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html

Parameters:
  • id – ID of the ingest pipeline to create or update.
  • description – Description of the ingest pipeline.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • meta – Optional metadata about the ingest pipeline. May have any contents. This map is not automatically generated by Elasticsearch.
  • on_failure – Processors to run immediately after a processor failure. Each processor supports a processor-level on_failure value. If a processor without an on_failure value fails, Elasticsearch uses this pipeline-level parameter as a fallback. The processors in this parameter run sequentially in the order specified. Elasticsearch will not attempt to run the pipeline’s remaining processors.
  • processors – Processors used to perform transformations on documents before indexing. Processors run sequentially in the order specified.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
  • version – Version number used by external systems to track ingest pipelines. This parameter is intended for external systems only. Elasticsearch does not use or validate pipeline version numbers.
simulate(*, id: Optional[Any] = None, docs: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pipeline: Optional[Any] = None, pretty: Optional[bool] = None, verbose: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows to simulate a pipeline with example documents.

https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html

Parameters:
  • id – Pipeline ID
  • docs
  • pipeline
  • verbose – Verbose mode. Display data output for each processor in executed pipeline

License

class elasticsearch.client.LicenseClient(client: elasticsearch._sync.client._base.BaseClient)
delete(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes licensing information for the cluster

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-license.html

get(*, accept_enterprise: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, local: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves licensing information for the cluster

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-license.html

Parameters:
  • accept_enterprise – If true, this parameter returns enterprise for Enterprise license types. If false, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility. This parameter is deprecated and will always be set to true in 8.x.
  • local – Specifies whether to retrieve local information. The default value is false, which means the information is retrieved from the master node.
get_basic_status(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about the status of the basic license.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-basic-status.html

get_trial_status(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about the status of the trial license.

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-trial-status.html

post(*, licenses: List[Any], acknowledge: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, license: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates the license for the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/master/update-license.html

Parameters:
  • licenses – A sequence of one or more JSON documents containing the license information.
  • acknowledge – Specifies whether you acknowledge the license changes.
  • license
post_start_basic(*, acknowledge: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Starts an indefinite basic license.

https://www.elastic.co/guide/en/elasticsearch/reference/master/start-basic.html

Parameters:acknowledge – whether the user has acknowledged acknowledge messages (default: false)
post_start_trial(*, acknowledge: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, type_query_string: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

starts a limited time trial license.

https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html

Parameters:
  • acknowledge – whether the user has acknowledged acknowledge messages (default: false)
  • type_query_string

Logstash

class elasticsearch.client.LogstashClient(client: elasticsearch._sync.client._base.BaseClient)
delete_pipeline(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes Logstash Pipelines used by Central Management

https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html

Parameters:id – The ID of the Pipeline
get_pipeline(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves Logstash Pipelines used by Central Management

https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html

Parameters:id – A comma-separated list of Pipeline IDs
put_pipeline(*, id: Any, pipeline: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds and updates Logstash Pipelines used for Central Management

https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html

Parameters:
  • id – The ID of the Pipeline
  • pipeline

Migration

class elasticsearch.client.MigrationClient(client: elasticsearch._sync.client._base.BaseClient)
deprecations(*, index: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version.

https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html

Parameters:index – Comma-separate list of data streams or indices to check. Wildcard (*) expressions are supported.

Machine Learning (ML)

class elasticsearch.client.MlClient(client: elasticsearch._sync.client._base.BaseClient)
close_job(*, job_id: Any, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-close-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can close all jobs by using _all or by specifying * as the job identifier.
  • allow_no_match – Refer to the description for the allow_no_match query parameter.
  • force – Refer to the descriptiion for the force query parameter.
  • timeout – Refer to the description for the timeout query parameter.
delete_calendar(*, calendar_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar.html

Parameters:calendar_id – A string that uniquely identifies a calendar.
delete_calendar_event(*, calendar_id: Any, event_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes scheduled events from a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar-event.html

Parameters:
  • calendar_id – The ID of the calendar to modify
  • event_id – The ID of the event to remove from the calendar
delete_calendar_job(*, calendar_id: Any, job_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes anomaly detection jobs from a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-calendar-job.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.
  • job_id – An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups.
delete_data_frame_analytics(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/delete-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job.
  • force – If true, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job.
  • timeout – The time to wait for the job to be deleted.
delete_datafeed(*, datafeed_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/ml-delete-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • force – Use to forcefully delete a started datafeed; this method is quicker than stopping and deleting the datafeed.
delete_expired_data(*, job_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, requests_per_second: Optional[float] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes expired and unused machine learning data.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html

Parameters:
  • job_id – Identifier for an anomaly detection job. It can be a job identifier, a group name, or a wildcard expression.
  • requests_per_second – The desired requests per second for the deletion processes. The default behavior is no throttling.
  • timeout – How long can the underlying delete processes run until they are canceled.
delete_filter(*, filter_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a filter.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html

Parameters:filter_id – A string that uniquely identifies a filter.
delete_forecast(*, job_id: Any, forecast_id: Optional[Any] = None, allow_no_forecasts: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes forecasts from a machine learning job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • forecast_id – A comma-separated list of forecast identifiers. If you do not specify this optional parameter or if you specify _all or * the API deletes all forecasts from the job.
  • allow_no_forecasts – Specifies whether an error occurs when there are no forecasts. In particular, if this parameter is set to false and there are no forecasts associated with the job, attempts to delete all forecasts return an error.
  • timeout – Specifies the period of time to wait for the completion of the delete operation. When this period of time elapses, the API fails and returns an error.
delete_job(*, job_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • force – Use to forcefully delete an opened job; this method is quicker than closing and deleting the job.
  • wait_for_completion – Specifies whether the request should return immediately or wait until the job deletion completes.
delete_model_snapshot(*, job_id: Any, snapshot_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing model snapshot.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • snapshot_id – Identifier for the model snapshot.
delete_trained_model(*, model_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing trained inference model that is currently not referenced by an ingest pipeline.

https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • force – Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment.
delete_trained_model_alias(*, model_id: Any, model_alias: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a model alias that refers to the trained model

https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html

Parameters:
  • model_id – The trained model ID to which the model alias refers.
  • model_alias – The model alias to delete.
estimate_model_memory(*, analysis_config: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_bucket_cardinality: Optional[Dict[Any, int]] = None, overall_cardinality: Optional[Dict[Any, int]] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Estimates the model memory

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html

Parameters:
  • analysis_config – For a list of the properties that you can specify in the analysis_config component of the body of this API.
  • max_bucket_cardinality – Estimates of the highest cardinality in a single bucket that is observed for influencer fields over the time period that the job analyzes data. To produce a good answer, values must be provided for all influencer fields. Providing values for fields that are not listed as influencers has no effect on the estimation.
  • overall_cardinality – Estimates of the cardinality that is observed for fields over the whole time period that the job analyzes data. To produce a good answer, values must be provided for fields referenced in the by_field_name, over_field_name and partition_field_name of any detectors. Providing values for other fields has no effect on the estimation. It can be omitted from the request if no detectors have a by_field_name, over_field_name or partition_field_name.
evaluate_data_frame(*, evaluation: Any, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, query: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Evaluates the data frame analytics for an annotated index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html

Parameters:
  • evaluation – Defines the type of evaluation you want to perform.
  • index – Defines the index in which the evaluation will be performed.
  • query – A query clause that retrieves a subset of data from the source index.
explain_data_frame_analytics(*, id: Optional[Any] = None, allow_lazy_start: Optional[bool] = None, analysis: Optional[Any] = None, analyzed_fields: Optional[Any] = None, description: Optional[str] = None, dest: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_num_threads: Optional[int] = None, model_memory_limit: Optional[str] = None, pretty: Optional[bool] = None, source: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Explains a data frame analytics config.

http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • allow_lazy_start – Specifies whether this job can start when there is insufficient machine learning node capacity for it to be immediately assigned to a node.
  • analysis – The analysis configuration, which contains the information necessary to perform one of the following types of analysis: classification, outlier detection, or regression.
  • analyzed_fields – Specify includes and/or excludes patterns to select which fields will be included in the analysis. The patterns specified in excludes are applied last, therefore excludes takes precedence. In other words, if the same field is specified in both includes and excludes, then the field will not be included in the analysis.
  • description – A description of the job.
  • dest – The destination configuration, consisting of index and optionally results_field (ml by default).
  • max_num_threads – The maximum number of threads to be used by the analysis. Using more threads may decrease the time necessary to complete the analysis at the cost of using more CPU. Note that the process may use additional threads for operational functionality other than the analysis itself.
  • model_memory_limit – The approximate maximum amount of memory resources that are permitted for analytical processing. If your elasticsearch.yml file contains an xpack.ml.max_model_memory_limit setting, an error occurs when you try to create data frame analytics jobs that have model_memory_limit values greater than that setting.
  • source – The configuration of how to source the analysis data. It requires an index. Optionally, query and _source may be specified.
flush_job(*, job_id: Any, advance_time: Optional[Any] = None, calc_interim: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, skip_time: Optional[Any] = None, start: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Forces any buffered data to be processed by the job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • advance_time – Refer to the description for the advance_time query parameter.
  • calc_interim – Refer to the description for the calc_interim query parameter.
  • end – Refer to the description for the end query parameter.
  • skip_time – Refer to the description for the skip_time query parameter.
  • start – Refer to the description for the start query parameter.
forecast(*, job_id: Any, duration: Optional[Any] = None, error_trace: Optional[bool] = None, expires_in: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_model_memory: Optional[str] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Predicts the future behavior of a time series by using its historical behavior.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html

Parameters:
  • job_id – Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs.
  • duration – Refer to the description for the duration query parameter.
  • expires_in – Refer to the description for the expires_in query parameter.
  • max_model_memory – Refer to the description for the max_model_memory query parameter.
get_buckets(*, job_id: Any, timestamp: Optional[Any] = None, anomaly_score: Optional[float] = None, desc: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, exclude_interim: Optional[bool] = None, expand: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, page: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None, sort: Optional[Any] = None, start: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves anomaly detection job results for one or more buckets.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • timestamp – The timestamp of a single bucket result. If you do not specify this parameter, the API returns information about all buckets.
  • anomaly_score – Refer to the description for the anomaly_score query parameter.
  • desc – Refer to the description for the desc query parameter.
  • end – Refer to the description for the end query parameter.
  • exclude_interim – Refer to the description for the exclude_interim query parameter.
  • expand – Refer to the description for the expand query parameter.
  • from – Skips the specified number of buckets.
  • page
  • size – Specifies the maximum number of buckets to obtain.
  • sort – Refer to the desription for the sort query parameter.
  • start – Refer to the description for the start query parameter.
get_calendar_events(*, calendar_id: Any, end: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, job_id: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None, start: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about the scheduled events in calendars.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using _all or * or by omitting the calendar identifier.
  • end – Specifies to get events with timestamps earlier than this time.
  • from – Skips the specified number of events.
  • job_id – Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of _all or *.
  • size – Specifies the maximum number of events to obtain.
  • start – Specifies to get events with timestamps after this time.
get_calendars(*, calendar_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, page: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves configuration information for calendars.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using _all or * or by omitting the calendar identifier.
  • from – Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier.
  • page – This object is supported only when you omit the calendar identifier.
  • size – Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier.
get_categories(*, job_id: Any, category_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, page: Optional[Any] = None, partition_field_value: Optional[str] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves anomaly detection job results for one or more categories.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • category_id – Identifier for the category, which is unique in the job. If you specify neither the category ID nor the partition_field_value, the API returns information about all categories. If you specify only the partition_field_value, it returns information about all categories for the specified partition.
  • from – Skips the specified number of categories.
  • page
  • partition_field_value – Only return categories for the specified partition.
  • size – Specifies the maximum number of categories to obtain.
get_data_frame_analytics(*, id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, exclude_generated: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves configuration information for data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame analytics jobs.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
  • from – Skips the specified number of data frame analytics jobs.
  • size – Specifies the maximum number of data frame analytics jobs to obtain.
get_data_frame_analytics_stats(*, id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, size: Optional[int] = None, verbose: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves usage information for data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html

Parameters:
  • id – Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame analytics jobs.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • from – Skips the specified number of data frame analytics jobs.
  • size – Specifies the maximum number of data frame analytics jobs to obtain.
  • verbose – Defines whether the stats response should be verbose.
get_datafeed_stats(*, datafeed_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves usage information for datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html

Parameters:
  • datafeed_id – Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the API returns information about all datafeeds.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no datafeeds that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
get_datafeeds(*, datafeed_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, exclude_generated: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves configuration information for datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html

Parameters:
  • datafeed_id – Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the API returns information about all datafeeds.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no datafeeds that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
get_filters(*, filter_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves filters.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html

Parameters:
  • filter_id – A string that uniquely identifies a filter.
  • from – Skips the specified number of filters.
  • size – Specifies the maximum number of filters to obtain.
get_influencers(*, job_id: Any, desc: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, exclude_interim: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, influencer_score: Optional[float] = None, page: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None, sort: Optional[Any] = None, start: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves anomaly detection job results for one or more influencers.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • desc – If true, the results are sorted in descending order.
  • end – Returns influencers with timestamps earlier than this time. The default value means it is unset and results are not limited to specific timestamps.
  • exclude_interim – If true, the output excludes interim results. By default, interim results are included.
  • from – Skips the specified number of influencers.
  • influencer_score – Returns influencers with anomaly scores greater than or equal to this value.
  • page
  • size – Specifies the maximum number of influencers to obtain.
  • sort – Specifies the sort field for the requested influencers. By default, the influencers are sorted by the influencer_score value.
  • start – Returns influencers with timestamps after this time. The default value means it is unset and results are not limited to specific timestamps.
get_job_stats(*, job_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves usage information for anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. If you do not specify one of these options, the API returns information for all anomaly detection jobs.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If true, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches.
get_jobs(*, job_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, exclude_generated: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves configuration information for anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these options, the API returns information for all anomaly detection jobs.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
get_model_snapshots(*, job_id: Any, snapshot_id: Optional[Any] = None, desc: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, page: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None, sort: Optional[Any] = None, start: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about model snapshots.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • snapshot_id – A numerical character string that uniquely identifies the model snapshot. You can get information for multiple snapshots by using a comma-separated list or a wildcard expression. You can get all snapshots by using _all, by specifying * as the snapshot ID, or by omitting the snapshot ID.
  • desc – Refer to the description for the desc query parameter.
  • end – Refer to the description for the end query parameter.
  • from – Skips the specified number of snapshots.
  • page
  • size – Specifies the maximum number of snapshots to obtain.
  • sort – Refer to the description for the sort query parameter.
  • start – Refer to the description for the start query parameter.
get_overall_buckets(*, job_id: Any, allow_no_match: Optional[bool] = None, bucket_span: Optional[Any] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, exclude_interim: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, overall_score: Union[float, str, None] = None, pretty: Optional[bool] = None, start: Optional[Any] = None, top_n: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html

Parameters:
  • job_id – Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs or groups, or a wildcard expression. You can summarize the bucket results for all anomaly detection jobs by using _all or by specifying * as the <job_id>.
  • allow_no_match – Refer to the description for the allow_no_match query parameter.
  • bucket_span – Refer to the description for the bucket_span query parameter.
  • end – Refer to the description for the end query parameter.
  • exclude_interim – Refer to the description for the exclude_interim query parameter.
  • overall_score – Refer to the description for the overall_score query parameter.
  • start – Refer to the description for the start query parameter.
  • top_n – Refer to the description for the top_n query parameter.
get_records(*, job_id: Any, desc: Optional[bool] = None, end: Optional[Any] = None, error_trace: Optional[bool] = None, exclude_interim: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, page: Optional[Any] = None, pretty: Optional[bool] = None, record_score: Optional[float] = None, size: Optional[int] = None, sort: Optional[Any] = None, start: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves anomaly records for an anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • desc – Refer to the description for the desc query parameter.
  • end – Refer to the description for the end query parameter.
  • exclude_interim – Refer to the description for the exclude_interim query parameter.
  • from – Skips the specified number of records.
  • page
  • record_score – Refer to the description for the record_score query parameter.
  • size – Specifies the maximum number of records to obtain.
  • sort – Refer to the description for the sort query parameter.
  • start – Refer to the description for the start query parameter.
get_trained_models(*, model_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, decompress_definition: Optional[bool] = None, error_trace: Optional[bool] = None, exclude_generated: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, include: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None, tags: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves configuration information for a trained inference model.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • allow_no_match – Specifies what to do when the request: - Contains wildcard expressions and there are no models that match. - Contains the _all string or no identifiers and there are no matches. - Contains wildcard expressions and there are only partial matches. If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.
  • decompress_definition – Specifies whether the included model definition should be returned as a JSON map (true) or in a custom compressed format (false).
  • exclude_generated – Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
  • from – Skips the specified number of models.
  • include – A comma delimited string of optional fields to include in the response body.
  • size – Specifies the maximum number of models to obtain.
  • tags – A comma delimited string of tags. A trained model can have many tags, or none. When supplied, only trained models that contain all the supplied tags are returned.
get_trained_models_stats(*, model_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves usage information for trained inference models.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html

Parameters:
  • model_id – The unique identifier of the trained model or a model alias.
  • allow_no_match – Specifies what to do when the request: - Contains wildcard expressions and there are no models that match. - Contains the _all string or no identifiers and there are no matches. - Contains wildcard expressions and there are only partial matches. If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.
  • from – Skips the specified number of models.
  • size – Specifies the maximum number of models to obtain.
infer_trained_model_deployment(*, model_id: Any, docs: List[Dict[str, str]], error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Evaluate a trained model.

https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-trained-model-deployment.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • docs – An array of objects to pass to the model for inference. The objects should contain a field matching your configured trained model input. Typically, the field name is text_field. Currently, only a single value is allowed.
  • timeout – Controls the amount of time to wait for inference results.
info(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns defaults and limits used by machine learning.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html

open_job(*, job_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Opens one or more anomaly detection jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • timeout – Refer to the description for the timeout query parameter.
post_calendar_events(*, calendar_id: Any, events: List[Any], error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Posts scheduled events in a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.
  • events – A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format.
post_data(*, job_id: Any, data: List[Any], error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, reset_end: Optional[Any] = None, reset_start: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Sends data to an anomaly detection job for analysis.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html

Parameters:
  • job_id – Identifier for the anomaly detection job. The job must have a state of open to receive and process the data.
  • data
  • reset_end – Specifies the end of the bucket resetting range.
  • reset_start – Specifies the start of the bucket resetting range.
preview_data_frame_analytics(*, id: Optional[Any] = None, config: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Previews that will be analyzed given a data frame analytics config.

http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job.
  • config – A data frame analytics config as described in create data frame analytics jobs. Note that id and dest don’t need to be provided in the context of this API.
preview_datafeed(*, datafeed_id: Optional[Any] = None, datafeed_config: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, job_config: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Previews a datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. NOTE: If you use this path parameter, you cannot provide datafeed or anomaly detection job configuration details in the request body.
  • datafeed_config – The datafeed definition to preview.
  • job_config – The configuration details for the anomaly detection job that is associated with the datafeed. If the datafeed_config object does not include a job_id that references an existing anomaly detection job, you must supply this job_config object. If you include both a job_id and a job_config, the latter information is used. You cannot specify a job_config object unless you also supply a datafeed_config object.
put_calendar(*, calendar_id: Any, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, job_ids: Optional[List[Any]] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Instantiates a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.
  • description – A description of the calendar.
  • job_ids – An array of anomaly detection job identifiers.
put_calendar_job(*, calendar_id: Any, job_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds an anomaly detection job to a calendar.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html

Parameters:
  • calendar_id – A string that uniquely identifies a calendar.
  • job_id – An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups.
put_data_frame_analytics(*, id: Any, analysis: Any, dest: Any, source: Any, allow_lazy_start: Optional[bool] = None, analyzed_fields: Optional[Any] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, headers: Optional[Any] = None, human: Optional[bool] = None, max_num_threads: Optional[int] = None, model_memory_limit: Optional[str] = None, pretty: Optional[bool] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Instantiates a data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/put-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • analysis – The analysis configuration, which contains the information necessary to perform one of the following types of analysis: classification, outlier detection, or regression.
  • dest – The destination configuration.
  • source – The configuration of how to source the analysis data.
  • allow_lazy_start – Specifies whether this job can start when there is insufficient machine learning node capacity for it to be immediately assigned to a node. If set to false and a machine learning node with capacity to run the job cannot be immediately found, the API returns an error. If set to true, the API does not return an error; the job waits in the starting state until sufficient machine learning node capacity is available. This behavior is also affected by the cluster-wide xpack.ml.max_lazy_ml_nodes setting.
  • analyzed_fields – Specifies includes and/or excludes patterns to select which fields will be included in the analysis. The patterns specified in excludes are applied last, therefore excludes takes precedence. In other words, if the same field is specified in both includes and excludes, then the field will not be included in the analysis. If analyzed_fields is not set, only the relevant fields will be included. For example, all the numeric fields for outlier detection. The supported fields vary for each type of analysis. Outlier detection requires numeric or boolean data to analyze. The algorithms don’t support missing values therefore fields that have data types other than numeric or boolean are ignored. Documents where included fields contain missing values, null values, or an array are also ignored. Therefore the dest index may contain documents that don’t have an outlier score. Regression supports fields that are numeric, boolean, text, keyword, and ip data types. It is also tolerant of missing values. Fields that are supported are included in the analysis, other fields are ignored. Documents where included fields contain an array with two or more values are also ignored. Documents in the dest index that don’t contain a results field are not included in the regression analysis. Classification supports fields that are numeric, boolean, text, keyword, and ip data types. It is also tolerant of missing values. Fields that are supported are included in the analysis, other fields are ignored. Documents where included fields contain an array with two or more values are also ignored. Documents in the dest index that don’t contain a results field are not included in the classification analysis. Classification analysis can be improved by mapping ordinal variable values to a single number. For example, in case of age ranges, you can model the values as 0-14 = 0, 15-24 = 1, 25-34 = 2, and so on.
  • description – A description of the job.
  • headers
  • max_num_threads – The maximum number of threads to be used by the analysis. Using more threads may decrease the time necessary to complete the analysis at the cost of using more CPU. Note that the process may use additional threads for operational functionality other than the analysis itself.
  • model_memory_limit – The approximate maximum amount of memory resources that are permitted for analytical processing. If your elasticsearch.yml file contains an xpack.ml.max_model_memory_limit setting, an error occurs when you try to create data frame analytics jobs that have model_memory_limit values greater than that setting.
  • version
put_datafeed(*, datafeed_id: Any, aggregations: Optional[Dict[str, Any]] = None, allow_no_indices: Optional[bool] = None, chunking_config: Optional[Any] = None, delayed_data_check_config: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, frequency: Optional[Any] = None, headers: Optional[Any] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, indexes: Optional[Any] = None, indices: Optional[Any] = None, indices_options: Optional[Any] = None, job_id: Optional[Any] = None, max_empty_searches: Optional[int] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, query_delay: Optional[Any] = None, runtime_mappings: Optional[Any] = None, script_fields: Optional[Dict[str, Any]] = None, scroll_size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Instantiates a datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • aggregations – If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.
  • allow_no_indices – If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the _all string or when no indices are specified.
  • chunking_config – Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated; it is an advanced configuration option.
  • delayed_data_check_config – Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the query_delay is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.
  • expand_wildcards – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values.
  • frequency – The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. When frequency is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.
  • headers
  • ignore_throttled – If true, concrete, expanded, or aliased indices are ignored when frozen.
  • ignore_unavailable – If true, unavailable indices (missing or closed) are ignored.
  • indexes – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.
  • indices – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.
  • indices_options – Specifies index expansion options that are used during search
  • job_id – Identifier for the anomaly detection job.
  • max_empty_searches – If a real-time datafeed has never seen any data (including during any initial training period), it automatically stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after frequency times max_empty_searches of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
  • query – The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch.
  • query_delay – The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between 60s and 120s. This randomness improves the query performance when there are multiple jobs running on the same node.
  • runtime_mappings – Specifies runtime fields for the datafeed search.
  • script_fields – Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.
  • scroll_size – The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of index.max_result_window, which is 10,000 by default.
put_filter(*, filter_id: Any, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, items: Optional[List[str]] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Instantiates a filter.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html

Parameters:
  • filter_id – A string that uniquely identifies a filter.
  • description – A description of the filter.
  • items – The items of the filter. A wildcard * can be used at the beginning or the end of an item. Up to 10000 items are allowed in each filter.
put_job(*, job_id: Any, analysis_config: Any, data_description: Any, allow_lazy_open: Optional[bool] = None, analysis_limits: Optional[Any] = None, background_persist_interval: Optional[Any] = None, custom_settings: Optional[Any] = None, daily_model_snapshot_retention_after_days: Optional[int] = None, datafeed_config: Optional[Any] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, groups: Optional[List[str]] = None, human: Optional[bool] = None, model_plot_config: Optional[Any] = None, model_snapshot_retention_days: Optional[int] = None, pretty: Optional[bool] = None, renormalization_window_days: Optional[int] = None, results_index_name: Optional[Any] = None, results_retention_days: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Instantiates an anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html

Parameters:
  • job_id – The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • analysis_config – Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational.
  • data_description – Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained.
  • allow_lazy_open – Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.
  • analysis_limits – Limits can be applied for the resources required to hold the mathematical models in memory. These limits are approximate and can be set per job. They do not control the memory used by other processes, for example the Elasticsearch Java processes.
  • background_persist_interval – Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the background_persist_interval value too low.
  • custom_settings – Advanced configuration option. Contains custom meta data about the job.
  • daily_model_snapshot_retention_after_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to model_snapshot_retention_days.
  • datafeed_config – Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead.
  • description – A description of the job.
  • groups – A list of job groups. A job can belong to no groups or many.
  • model_plot_config – This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. Model plot provides a simplified and indicative view of the model and its bounds. It does not display complex features such as multivariate correlations or multimodal data. As such, anomalies may occasionally be reported which cannot be seen in the model plot. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced.
  • model_snapshot_retention_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.
  • renormalization_window_days – Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen. The default value is the longer of 30 days or 100 bucket spans.
  • results_index_name – A text string that affects the name of the machine learning results index. By default, the job generates an index named .ml-anomalies-shared.
  • results_retention_days – Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.
put_trained_model(*, model_id: Any, inference_config: Any, input: Any, compressed_definition: Optional[str] = None, defer_definition_decompression: Optional[bool] = None, definition: Optional[Any] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, metadata: Optional[Any] = None, model_size_bytes: Optional[int] = None, model_type: Optional[Any] = None, pretty: Optional[bool] = None, tags: Optional[List[str]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates an inference trained model.

https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • inference_config – The default configuration for inference. This can be either a regression or classification configuration. It must match the underlying definition.trained_model’s target_type.
  • input – The input field names for the model definition.
  • compressed_definition – The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified.
  • defer_definition_decompression – If set to true and a compressed_definition is provided, the request defers definition decompression and skips relevant validations.
  • definition – The inference definition for the model. If definition is specified, then compressed_definition cannot be specified.
  • description – A human-readable description of the inference trained model.
  • metadata – An object map that contains metadata about the model.
  • model_size_bytes – The estimated memory usage in bytes to keep the trained model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied.
  • model_type – The model type.
  • tags – An array of tags to organize the model.
put_trained_model_alias(*, model_id: Any, model_alias: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, reassign: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new model alias (or reassigns an existing one) to refer to the trained model

https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html

Parameters:
  • model_id – The identifier for the trained model that the alias refers to.
  • model_alias – The alias to create or update. This value cannot end in numbers.
  • reassign – Specifies whether the alias gets reassigned to the specified trained model if it is already assigned to a different model. If the alias is already assigned and this parameter is false, the API returns an error.
put_trained_model_definition_part(*, model_id: Any, part: int, definition: str, total_definition_length: int, total_parts: int, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates part of a trained model definition

https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • part – The definition part number. When the definition is loaded for inference the definition parts are streamed in the order of their part number. The first part must be 0 and the final part must be total_parts - 1.
  • definition – The definition part for the model. Must be a base64 encoded string.
  • total_definition_length – The total uncompressed definition length in bytes. Not base64 encoded.
  • total_parts – The total number of parts that will be uploaded. Must be greater than 0.
put_trained_model_vocabulary(*, model_id: Any, vocabulary: List[str], error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a trained model vocabulary

https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • vocabulary – The model vocabulary, which must not be empty.
reset_job(*, job_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Resets an existing anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html

Parameters:
  • job_id – The ID of the job to reset.
  • wait_for_completion – Should this request wait until the operation has completed before returning.
revert_model_snapshot(*, job_id: Any, snapshot_id: Any, delete_intervening_results: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Reverts to a specific snapshot.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • snapshot_id – You can specify empty as the <snapshot_id>. Reverting to the empty snapshot means the anomaly detection job starts learning a new model from scratch when it is started.
  • delete_intervening_results – Refer to the description for the delete_intervening_results query parameter.
set_upgrade_mode(*, enabled: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html

Parameters:
  • enabled – When true, it enables upgrade_mode which temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from starting.
  • timeout – The time to wait for the request to be completed.
start_data_frame_analytics(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Starts a data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • timeout – Controls the amount of time to wait until the data frame analytics job starts.
start_datafeed(*, datafeed_id: Any, end: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, start: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Starts one or more datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • end – Refer to the description for the end query parameter.
  • start – Refer to the description for the start query parameter.
  • timeout – Refer to the description for the timeout query parameter.
start_trained_model_deployment(*, model_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, inference_threads: Optional[int] = None, model_threads: Optional[int] = None, pretty: Optional[bool] = None, queue_capacity: Optional[int] = None, timeout: Optional[Any] = None, wait_for: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Start a trained model deployment.

https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html

Parameters:
  • model_id – The unique identifier of the trained model. Currently, only PyTorch models are supported.
  • inference_threads – Specifies the number of threads that are used by the inference process. If you increase this value, inference speed generally increases. However, the actual number of threads is limited by the number of available CPU cores.
  • model_threads – Specifies the number of threads that are used when sending inference requests to the model. If you increase this value, throughput generally increases.
  • queue_capacity – Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds this value, new requests are rejected with a 429 error.
  • timeout – Specifies the amount of time to wait for the model to deploy.
  • wait_for – Specifies the allocation status to wait for before returning.
stop_data_frame_analytics(*, id: Any, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stops one or more data frame analytics jobs.

https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no data frame analytics jobs that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. The default value is true, which returns an empty data_frame_analytics array when there are no matches and the subset of results when there are partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • force – If true, the data frame analytics job is stopped forcefully.
  • timeout – Controls the amount of time to wait until the data frame analytics job stops. Defaults to 20 seconds.
stop_datafeed(*, datafeed_id: Any, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stops one or more datafeeds.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html

Parameters:
  • datafeed_id – Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a wildcard expression. You can close all datafeeds by using _all or by specifying * as the identifier.
  • allow_no_match – Refer to the description for the allow_no_match query parameter.
  • force – Refer to the description for the force query parameter.
  • timeout – Refer to the description for the timeout query parameter.
stop_trained_model_deployment(*, model_id: Any, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stop a trained model deployment.

https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html

Parameters:
  • model_id – The unique identifier of the trained model.
  • allow_no_match – Specifies what to do when the request: contains wildcard expressions and there are no deployments that match; contains the _all string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches. If false, the request returns a 404 status code when there are no matches or only partial matches.
  • force – Forcefully stops the deployment, even if it is used by ingest pipelines. You can’t use these pipelines until you restart the model deployment.
update_data_frame_analytics(*, id: Any, allow_lazy_start: Optional[bool] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, max_num_threads: Optional[int] = None, model_memory_limit: Optional[str] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates certain properties of a data frame analytics job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html

Parameters:
  • id – Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • allow_lazy_start – Specifies whether this job can start when there is insufficient machine learning node capacity for it to be immediately assigned to a node.
  • description – A description of the job.
  • max_num_threads – The maximum number of threads to be used by the analysis. Using more threads may decrease the time necessary to complete the analysis at the cost of using more CPU. Note that the process may use additional threads for operational functionality other than the analysis itself.
  • model_memory_limit – The approximate maximum amount of memory resources that are permitted for analytical processing. If your elasticsearch.yml file contains an xpack.ml.max_model_memory_limit setting, an error occurs when you try to create data frame analytics jobs that have model_memory_limit values greater than that setting.
update_datafeed(*, datafeed_id: Any, aggregations: Optional[Dict[str, Any]] = None, allow_no_indices: Optional[bool] = None, chunking_config: Optional[Any] = None, delayed_data_check_config: Optional[Any] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, frequency: Optional[Any] = None, human: Optional[bool] = None, ignore_throttled: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, indexes: Optional[List[str]] = None, indices: Optional[List[str]] = None, indices_options: Optional[Any] = None, max_empty_searches: Optional[int] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, query_delay: Optional[Any] = None, runtime_mappings: Optional[Any] = None, script_fields: Optional[Dict[str, Any]] = None, scroll_size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates certain properties of a datafeed.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html

Parameters:
  • datafeed_id – A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • aggregations – If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.
  • allow_no_indices – If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the _all string or when no indices are specified.
  • chunking_config – Datafeeds might search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated; it is an advanced configuration option.
  • delayed_data_check_config – Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the query_delay is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.
  • expand_wildcards – Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values. Valid values are: * all: Match any data stream or index, including hidden ones. * closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. * hidden: Match hidden data streams and hidden indices. Must be combined with open, closed, or both. * none: Wildcard patterns are not accepted. * open: Match open, non-hidden indices. Also matches any non-hidden data stream.
  • frequency – The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. When frequency is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.
  • ignore_throttled – If true, concrete, expanded or aliased indices are ignored when frozen.
  • ignore_unavailable – If true, unavailable indices (missing or closed) are ignored.
  • indexes – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.
  • indices – An array of index names. Wildcards are supported. If any of the indices are in remote clusters, the machine learning nodes must have the remote_cluster_client role.
  • indices_options – Specifies index expansion options that are used during search.
  • max_empty_searches – If a real-time datafeed has never seen any data (including during any initial training period), it automatically stops and closes the associated job after this many real-time searches return no documents. In other words, it stops after frequency times max_empty_searches of real-time operation. If not set, a datafeed with no end time that sees no data remains started until it is explicitly stopped. By default, it is not set.
  • query – The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. Note that if you change the query, the analyzed data is also changed. Therefore, the time required to learn might be long and the understandability of the results is unpredictable. If you want to make significant changes to the source data, it is recommended that you clone the job and datafeed and make the amendments in the clone. Let both run in parallel and close one when you are satisfied with the results of the job.
  • query_delay – The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between 60s and 120s. This randomness improves the query performance when there are multiple jobs running on the same node.
  • runtime_mappings – Specifies runtime fields for the datafeed search.
  • script_fields – Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.
  • scroll_size – The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of index.max_result_window.
update_filter(*, filter_id: Any, add_items: Optional[List[str]] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, remove_items: Optional[List[str]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates the description of a filter, adds items, or removes items.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html

Parameters:
  • filter_id – A string that uniquely identifies a filter.
  • add_items – The items to add to the filter.
  • description – A description for the filter.
  • remove_items – The items to remove from the filter.
update_job(*, job_id: Any, allow_lazy_open: Optional[bool] = None, analysis_limits: Optional[Any] = None, background_persist_interval: Optional[Any] = None, categorization_filters: Optional[List[str]] = None, custom_settings: Optional[Dict[str, Any]] = None, daily_model_snapshot_retention_after_days: Optional[int] = None, description: Optional[str] = None, detectors: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, groups: Optional[List[str]] = None, human: Optional[bool] = None, model_plot_config: Optional[Any] = None, model_snapshot_retention_days: Optional[int] = None, per_partition_categorization: Optional[Any] = None, pretty: Optional[bool] = None, renormalization_window_days: Optional[int] = None, results_retention_days: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates certain properties of an anomaly detection job.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html

Parameters:
  • job_id – Identifier for the job.
  • allow_lazy_open – Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node. If false and a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide xpack.ml.max_lazy_ml_nodes setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.
  • analysis_limits
  • background_persist_interval – Advanced configuration option. The time between each periodic persistence of the model. The default value is a randomized value between 3 to 4 hours, which avoids all jobs persisting at exactly the same time. The smallest allowed value is 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the value too low. If the job is open when you make the update, you must stop the datafeed, close the job, then reopen the job and restart the datafeed for the changes to take effect.
  • categorization_filters
  • custom_settings – Advanced configuration option. Contains custom meta data about the job. For example, it can contain custom URL information as shown in Adding custom URLs to machine learning results.
  • daily_model_snapshot_retention_after_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to model_snapshot_retention_days. For jobs created before version 7.8.0, the default value matches model_snapshot_retention_days.
  • description – A description of the job.
  • detectors – An array of detector update objects.
  • groups – A list of job groups. A job can belong to no groups or many.
  • model_plot_config
  • model_snapshot_retention_days – Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job.
  • per_partition_categorization – Settings related to how categorization interacts with partition fields.
  • renormalization_window_days – Advanced configuration option. The period over which adjustments to the score are applied, as new data is seen.
  • results_retention_days – Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained.
update_model_snapshot(*, job_id: Any, snapshot_id: Any, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, retain: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates certain properties of a snapshot.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • snapshot_id – Identifier for the model snapshot.
  • description – A description of the model snapshot.
  • retain – If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted.
upgrade_job_snapshot(*, job_id: Any, snapshot_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Upgrades a given job snapshot to the current major version.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html

Parameters:
  • job_id – Identifier for the anomaly detection job.
  • snapshot_id – A numerical character string that uniquely identifies the model snapshot.
  • timeout – Controls the time to wait for the request to complete.
  • wait_for_completion – When true, the API won’t respond until the upgrade is complete. Otherwise, it responds as soon as the upgrade task is assigned to a node.
validate(*, analysis_config: Optional[Any] = None, analysis_limits: Optional[Any] = None, data_description: Optional[Any] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, job_id: Optional[Any] = None, model_plot: Optional[Any] = None, model_snapshot_id: Optional[Any] = None, model_snapshot_retention_days: Optional[int] = None, pretty: Optional[bool] = None, results_index_name: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Validates an anomaly detection job.

https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html

Parameters:
  • analysis_config
  • analysis_limits
  • data_description
  • description
  • job_id
  • model_plot
  • model_snapshot_id
  • model_snapshot_retention_days
  • results_index_name
validate_detector(*, detector: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Validates an anomaly detection detector.

https://www.elastic.co/guide/en/machine-learning/current/ml-jobs.html

Parameters:detector

Monitoring

class elasticsearch.client.MonitoringClient(client: elasticsearch._sync.client._base.BaseClient)
bulk(*, interval: Any, operations: List[Any], system_api_version: str, system_id: str, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Used by the monitoring features to send monitoring data.

https://www.elastic.co/guide/en/elasticsearch/reference/master/monitor-elasticsearch-cluster.html

Parameters:
  • interval – Collection interval (e.g., ’10s’ or ‘10000ms’) of the payload
  • operations
  • system_api_version
  • system_id – Identifier of the monitored system

Nodes

class elasticsearch.client.NodesClient(client: elasticsearch._sync.client._base.BaseClient)
hot_threads(*, node_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_idle_threads: Optional[bool] = None, interval: Optional[Any] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, snapshots: Optional[int] = None, sort: Optional[Any] = None, threads: Optional[int] = None, timeout: Optional[Any] = None, type: Optional[Any] = None) → elastic_transport.TextApiResponse

Returns information about hot threads on each node in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-hot-threads.html

Parameters:
  • node_id – List of node IDs or names used to limit returned information.
  • ignore_idle_threads – If true, known idle threads (e.g. waiting in a socket select, or to get a task from an empty queue) are filtered out.
  • interval – The interval to do the second sampling of threads.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • snapshots – Number of samples of thread stacktrace.
  • sort – The sort order for ‘cpu’ type (default: total)
  • threads – Specifies the number of hot threads to provide information for.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
  • type – The type to sample.
info(*, node_id: Optional[Any] = None, metric: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, flat_settings: Optional[bool] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about nodes in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-info.html

Parameters:
  • node_id – Comma-separated list of node IDs or names used to limit returned information.
  • metric – Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest.
  • flat_settings – If true, returns settings in flat format.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
reload_secure_settings(*, node_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, secure_settings_password: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Reloads secure settings.

https://www.elastic.co/guide/en/elasticsearch/reference/master/secure-settings.html#reloadable-secure-settings

Parameters:
  • node_id – A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
  • secure_settings_password
  • timeout – Explicit operation timeout
stats(*, node_id: Optional[Any] = None, metric: Optional[Any] = None, index_metric: Optional[Any] = None, completion_fields: Optional[Any] = None, error_trace: Optional[bool] = None, fielddata_fields: Optional[Any] = None, fields: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, groups: Optional[bool] = None, human: Optional[bool] = None, include_segment_file_sizes: Optional[bool] = None, include_unloaded_segments: Optional[bool] = None, level: Optional[Any] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, types: Optional[List[str]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns statistical information about nodes in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-stats.html

Parameters:
  • node_id – Comma-separated list of node IDs or names used to limit returned information.
  • metric – Limit the information returned to the specified metrics
  • index_metric – Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.
  • completion_fields – Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.
  • fielddata_fields – Comma-separated list or wildcard expressions of fields to include in fielddata statistics.
  • fields – Comma-separated list or wildcard expressions of fields to include in the statistics.
  • groups – Comma-separated list of search groups to include in the search statistics.
  • include_segment_file_sizes – If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).
  • include_unloaded_segments – If set to true segment stats will include stats for segments that are not currently loaded into memory
  • level – Indicates whether statistics are aggregated at the cluster, index, or shard level.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
  • types – A comma-separated list of document types for the indexing index metric.
usage(*, node_id: Optional[Any] = None, metric: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns low-level information about REST actions usage on nodes.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/cluster-nodes-usage.html

Parameters:
  • node_id – A comma-separated list of node IDs or names to limit the returned information; use _local to return information from the node you’re connecting to, leave empty to get information from all nodes
  • metric – Limit the information returned to the specified metrics
  • timeout – Explicit operation timeout

Rollup Indices

class elasticsearch.client.RollupClient(client: elasticsearch._sync.client._base.BaseClient)
delete_job(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing rollup job.

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

Parameters:id – The ID of the job to delete
get_jobs(*, id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

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

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

Parameters:id – The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
get_rollup_caps(*, id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

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/master/rollup-get-rollup-caps.html

Parameters:id – The ID of the index to check rollup capabilities on, or left blank for all jobs
get_rollup_index_caps(*, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

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/master/rollup-get-rollup-index-caps.html

Parameters:index – The rollup index or index pattern to obtain rollup capabilities from.
put_job(*, id: Any, cron: str, groups: Any, index_pattern: str, page_size: int, rollup_index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, headers: Optional[Any] = None, human: Optional[bool] = None, metrics: Optional[List[Any]] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a rollup job.

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

Parameters:
  • id – 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 – 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 – 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 – 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 – 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 – 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
  • metrics – 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 – Time to wait for the request to complete.
rollup(*, index: Any, rollup_index: Any, config: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Rollup an index

https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html

Parameters:
  • index – The index to roll up
  • rollup_index – The name of the rollup index to create
  • config

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

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

Parameters:
  • index – The indices or index-pattern(s) (containing rollup or regular data) that should be searched
  • aggregations
  • aggs
  • query
  • rest_total_hits_as_int – Indicates whether hits.total should be rendered as an integer or an object in the rest search response
  • size – Must be zero if set, as rollups work on pre-aggregated data
  • typed_keys – Specify whether aggregation and suggester names should be prefixed by their respective types in the response
start_job(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Starts an existing, stopped rollup job.

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

Parameters:id – The ID of the job to start
stop_job(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stops an existing, started rollup job.

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

Parameters:
  • id – The ID of the job to stop
  • timeout – Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s.
  • wait_for_completion – True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false.

Searchable Snapshots

class elasticsearch.client.SearchableSnapshotsClient(client: elasticsearch._sync.client._base.BaseClient)
cache_stats(*, node_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieve node-level cache statistics about searchable snapshots.

https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html

Parameters:
  • node_id – A comma-separated list of node IDs or names to limit the returned information; use _local to return information from the node you’re connecting to, leave empty to get information from all nodes
  • master_timeout
clear_cache(*, index: Optional[Any] = None, allow_no_indices: Optional[bool] = None, error_trace: Optional[bool] = None, expand_wildcards: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clear the cache of searchable snapshots.

https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html

Parameters:
  • index – A comma-separated list of index names
  • allow_no_indices – Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • expand_wildcards – Whether to expand wildcard expression to concrete indices that are open, closed or both.
  • ignore_unavailable – Whether specified concrete indices should be ignored when unavailable (missing or closed)
mount(*, repository: Any, snapshot: Any, index: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_index_settings: Optional[List[str]] = None, index_settings: Optional[Dict[str, Any]] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, renamed_index: Optional[Any] = None, storage: Optional[str] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Mount a snapshot as a searchable index.

https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-api-mount-snapshot.html

Parameters:
  • repository – The name of the repository containing the snapshot of the index to mount
  • snapshot – The name of the snapshot of the index to mount
  • index
  • ignore_index_settings
  • index_settings
  • master_timeout – Explicit operation timeout for connection to master node
  • renamed_index
  • storage – Selects the kind of local storage used to accelerate searches. Experimental, and defaults to full_copy
  • wait_for_completion – Should this request wait until the operation has completed before returning
stats(*, index: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, level: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieve shard-level statistics about searchable snapshots.

https://www.elastic.co/guide/en/elasticsearch/reference/master/searchable-snapshots-apis.html

Parameters:
  • index – A comma-separated list of index names
  • level – Return stats aggregated at cluster, index or shard level

Security

class elasticsearch.client.SecurityClient(client: elasticsearch._sync.client._base.BaseClient)
authenticate(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Enables authentication as a user and retrieve information about the authenticated user.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html

change_password(*, username: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, password: Optional[Any] = None, password_hash: Optional[str] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Changes the passwords of users in the native realm and built-in users.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html

Parameters:
  • username – The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user.
  • password – The new password value. Passwords must be at least 6 characters long.
  • password_hash – A hash of the new password value. This must be produced using the same hashing algorithm as has been configured for password storage. For more details, see the explanation of the xpack.security.authc.password_hashing.algorithm setting.
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
clear_api_key_cache(*, ids: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clear a subset or all entries from the API key cache.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html

Parameters:ids – A comma-separated list of IDs of API keys to clear from the cache
clear_cached_privileges(*, application: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Evicts application privileges from the native application privileges cache.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html

Parameters:application – A comma-separated list of application names
clear_cached_realms(*, realms: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, usernames: Optional[List[str]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Evicts users from the user cache. Can completely clear the cache or evict specific users.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html

Parameters:
  • realms – Comma-separated list of realms to clear
  • usernames – Comma-separated list of usernames to clear from the cache
clear_cached_roles(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Evicts roles from the native role cache.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html

Parameters:name – Role name
clear_cached_service_tokens(*, namespace: Any, service: Any, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Evicts tokens from the service account token caches.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html

Parameters:
  • namespace – An identifier for the namespace
  • service – An identifier for the service name
  • name – A comma-separated list of service token names
create_api_key(*, error_trace: Optional[bool] = None, expiration: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, metadata: Optional[Any] = None, name: Optional[Any] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, role_descriptors: Optional[Dict[str, Any]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates an API key for access without requiring basic authentication.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html

Parameters:
  • expiration – Expiration time for the API key. By default, API keys never expire.
  • metadata – Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage.
  • name – Specifies the name for this API key.
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
  • role_descriptors – An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.
create_service_token(*, namespace: Any, service: Any, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a service account token for access without requiring basic authentication.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html

Parameters:
  • namespace – An identifier for the namespace
  • service – An identifier for the service name
  • name – An identifier for the token name
delete_privileges(*, application: Any, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes application privileges.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html

Parameters:
  • application – Application name
  • name – Privilege name
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
delete_role(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes roles in the native realm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html

Parameters:
  • name – Role name
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
delete_role_mapping(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes role mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html

Parameters:
  • name – Role-mapping name
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
delete_service_token(*, namespace: Any, service: Any, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a service account token.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html

Parameters:
  • namespace – An identifier for the namespace
  • service – An identifier for the service name
  • name – An identifier for the token name
  • refresh – If true then refresh the affected shards to make this operation visible to search, if wait_for (the default) then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
delete_user(*, username: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes users from the native realm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html

Parameters:
  • username – username
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
disable_user(*, username: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Disables users in the native realm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html

Parameters:
  • username – The username of the user to disable
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
enable_user(*, username: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Enables users in the native realm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html

Parameters:
  • username – The username of the user to enable
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
enroll_kibana(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-kibana-enrollment.html

enroll_node(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Allows a new node to enroll to an existing cluster with security enabled.

https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-node-enrollment.html

get_api_key(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, id: Optional[Any] = None, name: Optional[Any] = None, owner: Optional[bool] = None, pretty: Optional[bool] = None, realm_name: Optional[Any] = None, username: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information for one or more API keys.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html

Parameters:
  • id – API key id of the API key to be retrieved
  • name – API key name of the API key to be retrieved
  • owner – flag to query API keys owned by the currently authenticated user
  • realm_name – realm name of the user who created this API key to be retrieved
  • username – user name of the user who created this API key to be retrieved
get_builtin_privileges(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html

get_privileges(*, application: Optional[Any] = None, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves application privileges.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html

Parameters:
  • application – Application name
  • name – Privilege name
get_role(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves roles in the native realm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html

Parameters:name – The name of the role. You can specify multiple roles as a comma-separated list. If you do not specify this parameter, the API returns information about all roles.
get_role_mapping(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves role mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html

Parameters:name – The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does not affect the behavior of the mapping in any way. You can specify multiple mapping names as a comma-separated list. If you do not specify this parameter, the API returns information about all role mappings.
get_service_accounts(*, namespace: Optional[Any] = None, service: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about service accounts.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html

Parameters:
  • namespace – Name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit the service parameter.
  • service – Name of the service name. Omit this parameter to retrieve information about all service accounts that belong to the specified namespace.
get_service_credentials(*, namespace: Any, service: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information of all service credentials for a service account.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html

Parameters:
  • namespace – Name of the namespace.
  • service – Name of the service name.
get_token(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, grant_type: Optional[Any] = None, human: Optional[bool] = None, kerberos_ticket: Optional[str] = None, password: Optional[Any] = None, pretty: Optional[bool] = None, refresh_token: Optional[str] = None, scope: Optional[str] = None, username: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a bearer token for access without requiring basic authentication.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html

Parameters:
  • grant_type
  • kerberos_ticket
  • password
  • refresh_token
  • scope
  • username
get_user(*, username: Union[Any, List[Any], None] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about users in the native realm and built-in users.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html

Parameters:username – An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves information about all users.
get_user_privileges(*, application: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, priviledge: Optional[Any] = None, username: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves security privileges for the logged in user.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html

Parameters:
  • application – The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, the API returns information about all privileges for all applications.
  • priviledge – The name of the privilege. If you do not specify this parameter, the API returns information about all privileges for the requested application.
  • username
grant_api_key(*, api_key: Any, grant_type: Any, access_token: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, password: Optional[Any] = None, pretty: Optional[bool] = None, username: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates an API key on behalf of another user.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html

Parameters:
  • api_key
  • grant_type
  • access_token
  • password
  • username
has_privileges(*, user: Optional[Any] = None, application: Optional[List[Any]] = None, cluster: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, index: Optional[List[Any]] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Determines whether the specified user has a specified list of privileges.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html

Parameters:
  • user – Username
  • application
  • cluster – A list of the cluster privileges that you want to check.
  • index
invalidate_api_key(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, id: Optional[Any] = None, ids: Optional[List[Any]] = None, name: Optional[Any] = None, owner: Optional[bool] = None, pretty: Optional[bool] = None, realm_name: Optional[str] = None, username: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Invalidates one or more API keys.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html

Parameters:
  • id
  • ids
  • name
  • owner
  • realm_name
  • username
invalidate_token(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, realm_name: Optional[Any] = None, refresh_token: Optional[str] = None, token: Optional[str] = None, username: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Invalidates one or more access tokens or refresh tokens.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html

Parameters:
  • realm_name
  • refresh_token
  • token
  • username
put_privileges(*, privileges: Dict[str, Dict[str, Any]], error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds or updates application privileges.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html

Parameters:
  • privileges
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
put_role(*, name: Any, applications: Optional[List[Any]] = None, cluster: Optional[List[Any]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, global_: Optional[Dict[str, Any]] = None, human: Optional[bool] = None, indices: Optional[List[Any]] = None, metadata: Optional[Any] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, run_as: Optional[List[str]] = None, transient_metadata: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds and updates roles in the native realm.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html

Parameters:
  • name – The name of the role.
  • applications – A list of application privilege entries.
  • cluster – A list of cluster privileges. These privileges define the cluster-level actions for users with this role.
  • global – An object defining global privileges. A global privilege is a form of cluster privilege that is request-aware. Support for global privileges is currently limited to the management of application privileges.
  • indices – A list of indices permissions entries.
  • metadata – Optional metadata. Within the metadata object, keys that begin with an underscore (_) are reserved for system use.
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
  • run_as – A list of users that the owners of this role can impersonate.
  • transient_metadata – Indicates roles that might be incompatible with the current cluster license, specifically roles with document and field level security. When the cluster license doesn’t allow certain features for a given role, this parameter is updated dynamically to list the incompatible features. If enabled is false, the role is ignored, but is still listed in the response from the authenticate API.
put_role_mapping(*, name: Any, enabled: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, metadata: Optional[Any] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, roles: Optional[List[str]] = None, rules: Optional[Any] = None, run_as: Optional[List[str]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates and updates role mappings.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html

Parameters:
  • name – Role-mapping name
  • enabled
  • metadata
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
  • roles
  • rules
  • run_as
put_user(*, username: Any, email: Union[None, str] = None, enabled: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, full_name: Union[None, str] = None, human: Optional[bool] = None, metadata: Optional[Any] = None, password: Optional[Any] = None, password_hash: Optional[str] = None, pretty: Optional[bool] = None, refresh: Optional[Any] = None, roles: Optional[List[str]] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds and updates users in the native realm. These users are commonly referred to as native users.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html

Parameters:
  • username – The username of the User
  • email
  • enabled
  • full_name
  • metadata
  • password
  • password_hash
  • refresh – If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.
  • roles
query_api_keys(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, search_after: Optional[Any] = None, size: Optional[int] = None, sort: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information for API keys using a subset of query DSL

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html

Parameters:
  • from – Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.
  • query – A query to filter which API keys to return. The query supports a subset of query types, including match_all, bool, term, terms, ids, prefix, wildcard, and range. You can query all public information associated with an API key
  • search_after
  • size – The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.
  • sort
saml_authenticate(*, content: str, ids: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, realm: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html

Parameters:
  • content – The SAML response as it was sent by the user’s browser, usually a Base64 encoded XML document.
  • ids – A json array with all the valid SAML Request Ids that the caller of the API has for the current user.
  • realm – The name of the realm that should authenticate the SAML response. Useful in cases where many SAML realms are defined.
saml_complete_logout(*, ids: Any, realm: str, content: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, query_string: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Verifies the logout response sent from the SAML IdP

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html

Parameters:
  • ids – A json array with all the valid SAML Request Ids that the caller of the API has for the current user.
  • realm – The name of the SAML realm in Elasticsearch for which the configuration is used to verify the logout response.
  • content – If the SAML IdP sends the logout response with the HTTP-Post binding, this field must be set to the value of the SAMLResponse form parameter from the logout response.
  • query_string – If the SAML IdP sends the logout response with the HTTP-Redirect binding, this field must be set to the query string of the redirect URI.
saml_invalidate(*, query_string: str, acs: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, realm: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Consumes a SAML LogoutRequest

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html

Parameters:
  • query_string – The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout. This query should include a single parameter named SAMLRequest that contains a SAML logout request that is deflated and Base64 encoded. If the SAML IdP has signed the logout request, the URL should include two extra parameters named SigAlg and Signature that contain the algorithm used for the signature and the signature value itself. In order for Elasticsearch to be able to verify the IdP’s signature, the value of the query_string field must be an exact match to the string provided by the browser. The client application must not attempt to parse or process the string in any way.
  • acs – The Assertion Consumer Service URL that matches the one of the SAML realm in Elasticsearch that should be used. You must specify either this parameter or the realm parameter.
  • realm – The name of the SAML realm in Elasticsearch the configuration. You must specify either this parameter or the acs parameter.
saml_logout(*, token: str, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, refresh_token: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Invalidates an access token and a refresh token that were generated via the SAML Authenticate API

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html

Parameters:
  • token – The access token that was returned as a response to calling the SAML authenticate API. Alternatively, the most recent token that was received after refreshing the original one by using a refresh_token.
  • refresh_token – The refresh token that was returned as a response to calling the SAML authenticate API. Alternatively, the most recent refresh token that was received after refreshing the original access token.
saml_prepare_authentication(*, acs: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, realm: Optional[str] = None, relay_state: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a SAML authentication request

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html

Parameters:
  • acs – The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch. The realm is used to generate the authentication request. You must specify either this parameter or the realm parameter.
  • realm – The name of the SAML realm in Elasticsearch for which the configuration is used to generate the authentication request. You must specify either this parameter or the acs parameter.
  • relay_state – A string that will be included in the redirect URL that this API returns as the RelayState query parameter. If the Authentication Request is signed, this value is used as part of the signature computation.
saml_service_provider_metadata(*, realm_name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html

Parameters:realm_name – The name of the SAML realm in Elasticsearch.

Shutdown

class elasticsearch.client.ShutdownClient(client: elasticsearch._sync.client._base.BaseClient)
delete_node(*, node_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/current

Parameters:node_id – The node id of node to be removed from the shutdown state
get_node(*, node_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieve status of a node or nodes that are currently marked as shutting down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/current

Parameters:node_id – Which node for which to retrieve the shutdown status
put_node(*, node_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.

https://www.elastic.co/guide/en/elasticsearch/reference/current

Parameters:node_id – The node id of node to be shut down

Snapshot Lifecycle Management (SLM)

class elasticsearch.client.SlmClient(client: elasticsearch._sync.client._base.BaseClient)
delete_lifecycle(*, policy_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing snapshot lifecycle policy.

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html

Parameters:policy_id – The id of the snapshot lifecycle policy to remove
execute_lifecycle(*, policy_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html

Parameters:policy_id – The id of the snapshot lifecycle policy to be executed
execute_retention(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes any snapshots that are expired according to the policy’s retention rules.

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html

get_lifecycle(*, policy_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html

Parameters:policy_id – Comma-separated list of snapshot lifecycle policies to retrieve
get_stats(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns global and policy-level statistics about actions taken by snapshot lifecycle management.

https://www.elastic.co/guide/en/elasticsearch/reference/master/slm-api-get-stats.html

get_status(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves the status of snapshot lifecycle management (SLM).

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html

put_lifecycle(*, policy_id: Any, config: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, name: Optional[Any] = None, pretty: Optional[bool] = None, repository: Optional[str] = None, retention: Optional[Any] = None, schedule: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates or updates a snapshot lifecycle policy.

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html

Parameters:
  • policy_id – ID for the snapshot lifecycle policy you want to create or update.
  • config – Configuration for each snapshot created by the policy.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • name – Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name.
  • repository – Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API.
  • retention – Retention rules used to retain and delete snapshots created by the policy.
  • schedule – Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
start(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Turns on snapshot lifecycle management (SLM).

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html

stop(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Turns off snapshot lifecycle management (SLM).

https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html

Snapshots

class elasticsearch.client.SnapshotClient(client: elasticsearch._sync.client._base.BaseClient)
cleanup_repository(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes stale data from repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/clean-up-snapshot-repo-api.html

Parameters:
  • name – Snapshot repository to clean up.
  • master_timeout – Period to wait for a connection to the master node.
  • timeout – Period to wait for a response.
clone(*, repository: Any, snapshot: Any, target_snapshot: Any, indices: str, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clones indices from one snapshot into another snapshot in the same repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • repository – A repository name
  • snapshot – The name of the snapshot to clone from
  • target_snapshot – The name of the cloned snapshot to create
  • indices
  • master_timeout – Explicit operation timeout for connection to master node
  • timeout
create(*, repository: Any, snapshot: Any, error_trace: Optional[bool] = None, feature_states: Optional[List[str]] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_global_state: Optional[bool] = None, indices: Optional[Any] = None, master_timeout: Optional[Any] = None, metadata: Optional[Any] = None, partial: Optional[bool] = None, pretty: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a snapshot in a repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • repository – Repository for the snapshot.
  • snapshot – Name of the snapshot. Must be unique in the repository.
  • feature_states – Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If include_global_state is true, all current feature states are included by default. If include_global_state is false, no feature states are included by default.
  • ignore_unavailable – If true, the request ignores data streams and indices in indices that are missing or closed. If false, the request returns an error for any data stream or index that is missing or closed.
  • include_global_state – If true, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via feature_states).
  • indices – Data streams and indices to include in the snapshot. Supports multi-target syntax. Includes all data streams and indices by default.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • metadata – Optional metadata for the snapshot. May have any contents. Must be less than 1024 bytes. This map is not automatically generated by Elasticsearch.
  • partial – If true, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If false, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.
  • wait_for_completion – If true, the request returns a response when the snapshot is complete. If false, the request returns a response when the snapshot initializes.
create_repository(*, name: Any, settings: Any, type: str, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, repository: Optional[Any] = None, timeout: Optional[Any] = None, verify: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • name – A repository name
  • settings
  • type
  • master_timeout – Explicit operation timeout for connection to master node
  • repository
  • timeout – Explicit operation timeout
  • verify – Whether to verify the repository after creation
delete(*, repository: Any, snapshot: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes one or more snapshots.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • repository – A repository name
  • snapshot – A comma-separated list of snapshot names
  • master_timeout – Explicit operation timeout for connection to master node
delete_repository(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes a repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • name – Name of the snapshot repository to unregister. Wildcard (*) patterns are supported.
  • master_timeout – Explicit operation timeout for connection to master node
  • timeout – Explicit operation timeout
get(*, repository: Any, snapshot: Any, after: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_sort_value: Optional[str] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, include_repository: Optional[bool] = None, index_details: Optional[bool] = None, master_timeout: Optional[Any] = None, offset: Optional[int] = None, order: Optional[Any] = None, pretty: Optional[bool] = None, size: Optional[int] = None, slm_policy_filter: Optional[Any] = None, sort: Optional[Any] = None, verbose: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about a snapshot.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • repository – Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported.
  • snapshot – Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - To get information about any snapshots that are currently running, use _current.
  • after – Offset identifier to start pagination from as returned by the next field in the response body.
  • from_sort_value – Value of the current sort column at which to start retrieval. Can either be a string snapshot- or repository name when sorting by snapshot or repository name, a millisecond time value or a number when sorting by index- or shard count.
  • ignore_unavailable – If false, the request returns an error for any snapshots that are unavailable.
  • include_repository – Whether to include the repository name in the snapshot info. Defaults to true.
  • index_details – If true, returns additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. Defaults to false, meaning that this information is omitted.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • offset – Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0.
  • order – Sort order. Valid values are asc for ascending and desc for descending order. Defaults to asc, meaning ascending order.
  • size – Maximum number of snapshots to return. Defaults to 0 which means return all that match the request without limit.
  • slm_policy_filter – Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Also accepts wildcards (*) and combinations of wildcards followed by exclude patterns starting with -. To include snapshots not created by an SLM policy you can use the special pattern _none that will match all snapshots without an SLM policy.
  • sort – Allows setting a sort order for the result. Defaults to start_time, i.e. sorting by snapshot start time stamp.
  • verbose – If true, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.
get_repository(*, name: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, local: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about a repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • name – A comma-separated list of repository names
  • local – Return local information, do not retrieve the state from master node (default: false)
  • master_timeout – Explicit operation timeout for connection to master node
restore(*, repository: Any, snapshot: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_index_settings: Optional[List[str]] = None, ignore_unavailable: Optional[bool] = None, include_aliases: Optional[bool] = None, include_global_state: Optional[bool] = None, index_settings: Optional[Any] = None, indices: Optional[Any] = None, master_timeout: Optional[Any] = None, partial: Optional[bool] = None, pretty: Optional[bool] = None, rename_pattern: Optional[str] = None, rename_replacement: Optional[str] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Restores a snapshot.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • repository – A repository name
  • snapshot – A snapshot name
  • ignore_index_settings
  • ignore_unavailable
  • include_aliases
  • include_global_state
  • index_settings
  • indices
  • master_timeout – Explicit operation timeout for connection to master node
  • partial
  • rename_pattern
  • rename_replacement
  • wait_for_completion – Should this request wait until the operation has completed before returning
status(*, repository: Optional[Any] = None, snapshot: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_unavailable: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about the status of a snapshot.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • repository – A repository name
  • snapshot – A comma-separated list of snapshot names
  • ignore_unavailable – Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown
  • master_timeout – Explicit operation timeout for connection to master node
verify_repository(*, name: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Verifies a repository.

https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html

Parameters:
  • name – A repository name
  • master_timeout – Explicit operation timeout for connection to master node
  • timeout – Explicit operation timeout

SQL

class elasticsearch.client.SqlClient(client: elasticsearch._sync.client._base.BaseClient)
clear_cursor(*, cursor: str, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Clears the SQL cursor

https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html

Parameters:cursor
delete_async(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.

https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html

Parameters:id – The async search ID
get_async(*, id: Any, delimiter: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, human: Optional[bool] = None, keep_alive: Optional[Any] = None, pretty: Optional[bool] = None, wait_for_completion_timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the current status and available results for an async SQL search or stored synchronous SQL search

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html

Parameters:
  • id – The async search ID
  • delimiter – Separator for CSV results. The API only supports this parameter for CSV responses.
  • format – Format for the response. You must specify a format using this parameter or the Accept HTTP header. If you specify both, the API uses this parameter.
  • keep_alive – Retention period for the search and its results. Defaults to the keep_alive period for the original SQL search.
  • wait_for_completion_timeout – Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results.
get_async_status(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns the current status of an async SQL search or a stored synchronous SQL search

https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html

Parameters:id – The async search ID
query(*, columnar: Optional[bool] = None, cursor: Optional[str] = None, error_trace: Optional[bool] = None, fetch_size: Optional[int] = None, field_multi_value_leniency: Optional[bool] = None, filter: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, format: Optional[str] = None, human: Optional[bool] = None, page_timeout: Optional[Any] = None, pretty: Optional[bool] = None, query: Optional[str] = None, request_timeout: Optional[Any] = None, time_zone: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Executes a SQL request

https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html

Parameters:
  • columnar
  • cursor
  • fetch_size – The maximum number of rows (or entries) to return in one response
  • field_multi_value_leniency – Throw an exception when encountering multiple values for a field (default) or be lenient and return the first value from the list (without any guarantees of what that will be - typically the first in natural ascending order).
  • filter – Optional Elasticsearch query DSL for additional filtering.
  • format – a short version of the Accept header, e.g. json, yaml
  • page_timeout – The timeout before a pagination request fails.
  • query – SQL query to execute
  • request_timeout – The timeout before the request fails.
  • time_zone – Time-zone in ISO 8601 used for executing the query on the server. More information available here.
translate(*, query: str, error_trace: Optional[bool] = None, fetch_size: Optional[int] = None, filter: Optional[Any] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, time_zone: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Translates SQL into Elasticsearch queries

https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html

Parameters:
  • query
  • fetch_size
  • filter
  • time_zone

TLS/SSL

class elasticsearch.client.SslClient(client: elasticsearch._sync.client._base.BaseClient)
certificates(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about the X.509 certificates used to encrypt communications in the cluster.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html

Tasks

class elasticsearch.client.TasksClient(client: elasticsearch._sync.client._base.BaseClient)
cancel(*, task_id: Optional[Any] = None, actions: Union[List[str], str, None] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, nodes: Optional[List[str]] = None, parent_task_id: Optional[str] = None, pretty: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Cancels a task, if it can be cancelled through an API.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html

Parameters:
  • task_id – Cancel the task with specified task id (node_id:task_number)
  • actions – A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
  • nodes – A comma-separated list of node IDs or names to limit the returned information; use _local to return information from the node you’re connecting to, leave empty to get information from all nodes
  • parent_task_id – Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
  • wait_for_completion – Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
get(*, task_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns information about a task.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html

Parameters:
  • task_id – Return the task with specified id (node_id:task_number)
  • timeout – Explicit operation timeout
  • wait_for_completion – Wait for the matching tasks to complete (default: false)
list(*, actions: Union[List[str], str, None] = None, detailed: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, group_by: Optional[Any] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, node_id: Optional[List[str]] = None, parent_task_id: Optional[Any] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Returns a list of tasks.

https://www.elastic.co/guide/en/elasticsearch/reference/8.0/tasks.html

Parameters:
  • actions – Comma-separated list or wildcard expression of actions used to limit the request.
  • detailed – If true, the response includes detailed information about shard recoveries.
  • group_by – Key used to group tasks in the response.
  • master_timeout – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
  • node_id – Comma-separated list of node IDs or names used to limit returned information.
  • parent_task_id – Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of -1.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
  • wait_for_completion – If true, the request blocks until the operation is complete.

Text Structure

class elasticsearch.client.TextStructureClient(client: elasticsearch._sync.client._base.BaseClient)
find_structure(*, text_files: List[Any], charset: Optional[str] = None, column_names: Optional[str] = None, delimiter: Optional[str] = None, explain: Optional[bool] = None, format: Optional[str] = None, grok_pattern: Optional[str] = None, has_header_row: Optional[bool] = None, line_merge_size_limit: Optional[int] = None, lines_to_sample: Optional[int] = None, quote: Optional[str] = None, should_trim_fields: Optional[bool] = None, timeout: Optional[Any] = None, timestamp_field: Optional[Any] = None, timestamp_format: Optional[str] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch.

https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html

Parameters:
  • text_files
  • charset – The text’s character set. It must be a character set that is supported by the JVM that Elasticsearch uses. For example, UTF-8, UTF-16LE, windows-1252, or EUC-JP. If this parameter is not specified, the structure finder chooses an appropriate character set.
  • column_names – If you have set format to delimited, you can specify the column names in a comma-separated list. If this parameter is not specified, the structure finder uses the column names from the header row of the text. If the text does not have a header role, columns are named “column1”, “column2”, “column3”, etc.
  • delimiter – If you have set format to delimited, you can specify the character used to delimit the values in each row. Only a single character is supported; the delimiter cannot have multiple characters. By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (|). In this default scenario, all rows must have the same number of fields for the delimited format to be detected. If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row.
  • explain – If this parameter is set to true, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result.
  • format – The high level structure of the text. Valid values are ndjson, xml, delimited, and semi_structured_text. By default, the API chooses the format. In this default scenario, all rows must have the same number of fields for a delimited format to be detected. If the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row.
  • grok_pattern – If you have set format to semi_structured_text, you can specify a Grok pattern that is used to extract fields from every message in the text. The name of the timestamp field in the Grok pattern must match what is specified in the timestamp_field parameter. If that parameter is not specified, the name of the timestamp field in the Grok pattern must match “timestamp”. If grok_pattern is not specified, the structure finder creates a Grok pattern.
  • has_header_row – If you have set format to delimited, you can use this parameter to indicate whether the column names are in the first row of the text. If this parameter is not specified, the structure finder guesses based on the similarity of the first row of the text to other rows.
  • line_merge_size_limit – The maximum number of characters in a message when lines are merged to form messages while analyzing semi-structured text. If you have extremely long messages you may need to increase this, but be aware that this may lead to very long processing times if the way to group lines into messages is misdetected.
  • lines_to_sample – The number of lines to include in the structural analysis, starting from the beginning of the text. The minimum is 2; If the value of this parameter is greater than the number of lines in the text, the analysis proceeds (as long as there are at least two lines in the text) for all of the lines.
  • quote – If you have set format to delimited, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. Only a single character is supported. If this parameter is not specified, the default value is a double quote (“). If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample.
  • should_trim_fields – If you have set format to delimited, you can specify whether values between delimiters should have whitespace trimmed from them. If this parameter is not specified and the delimiter is pipe (|), the default value is true. Otherwise, the default value is false.
  • timeout – Sets the maximum amount of time that the structure analysis make take. If the analysis is still running when the timeout expires then it will be aborted.
  • timestamp_field – Optional parameter to specify the timestamp field in the file
  • timestamp_format – The Java time format of the timestamp field in the text.

Transforms

class elasticsearch.client.TransformClient(client: elasticsearch._sync.client._base.BaseClient)
delete_transform(*, transform_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deletes an existing transform.

https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html

Parameters:
  • transform_id – Identifier for the transform.
  • force – If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
get_transform(*, transform_id: Optional[Any] = None, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, exclude_generated: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves configuration information for transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html

Parameters:
  • transform_id – Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using _all, by specifying * as the <transform_id>, or by omitting the <transform_id>.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • exclude_generated – Excludes fields that were automatically added when creating the transform. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
  • from – Skips the specified number of transforms.
  • size – Specifies the maximum number of transforms to obtain.
get_transform_stats(*, transform_id: Any, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, size: Optional[int] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves usage information for transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html

Parameters:
  • transform_id – Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using _all, by specifying * as the <transform_id>, or by omitting the <transform_id>.
  • allow_no_match – Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches.
  • from – Skips the specified number of transforms.
  • size – Specifies the maximum number of transforms to obtain.
preview_transform(*, transform_id: Optional[Any] = None, description: Optional[str] = None, dest: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, frequency: Optional[Any] = None, human: Optional[bool] = None, latest: Optional[Any] = None, pivot: Optional[Any] = None, pretty: Optional[bool] = None, retention_policy: Optional[Any] = None, settings: Optional[Any] = None, source: Optional[Any] = None, sync: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Previews a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html

Parameters:
  • transform_id – The id of the transform to preview.
  • description – Free text description of the transform.
  • dest – The destination for the transform.
  • frequency – The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.
  • latest – The latest method transforms the data by finding the latest document for each unique key.
  • pivot – The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields and the aggregation to reduce the data.
  • retention_policy – Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index.
  • settings – Defines optional transform settings.
  • source – The source of the data for the transform.
  • sync – Defines the properties transforms require to run continuously.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
put_transform(*, transform_id: Any, dest: Any, source: Any, defer_validation: Optional[bool] = None, description: Optional[str] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, frequency: Optional[Any] = None, human: Optional[bool] = None, latest: Optional[Any] = None, meta: Optional[Any] = None, pivot: Optional[Any] = None, pretty: Optional[bool] = None, retention_policy: Optional[Any] = None, settings: Optional[Any] = None, sync: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Instantiates a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html

Parameters:
  • transform_id – Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters.
  • dest – The destination for the transform.
  • source – The source of the data for the transform.
  • defer_validation – When the transform is created, a series of validations occur to ensure its success. For example, there is a check for the existence of the source indices and a check that the destination index is not part of the source index pattern. You can use this parameter to skip the checks, for example when the source index does not exist until after the transform is created. The validations are always run when you start the transform, however, with the exception of privilege checks.
  • description – Free text description of the transform.
  • frequency – The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.
  • latest – The latest method transforms the data by finding the latest document for each unique key.
  • meta – Defines optional transform metadata.
  • pivot – The pivot method transforms the data by aggregating and grouping it. These objects define the group by fields and the aggregation to reduce the data.
  • retention_policy – Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index.
  • settings – Defines optional transform settings.
  • sync – Defines the properties transforms require to run continuously.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
start_transform(*, transform_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Starts one or more transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html

Parameters:
  • transform_id – Identifier for the transform.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
stop_transform(*, transform_id: Any, allow_no_match: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, force: Optional[bool] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None, wait_for_checkpoint: Optional[bool] = None, wait_for_completion: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stops one or more transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html

Parameters:
  • transform_id – Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, use _all or * as the identifier.
  • allow_no_match – Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If it is true, the API returns a successful acknowledgement message when there are no matches. When there are only partial matches, the API stops the appropriate transforms. If it is false, the request returns a 404 status code when there are no matches or only partial matches.
  • force – If it is true, the API forcefully stops the transforms.
  • timeout – Period to wait for a response when wait_for_completion is true. If no response is received before the timeout expires, the request returns a timeout exception. However, the request continues processing and eventually moves the transform to a STOPPED state.
  • wait_for_checkpoint – If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false, the transform stops as soon as possible.
  • wait_for_completion – If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns immediately and the indexer is stopped asynchronously in the background.
update_transform(*, transform_id: Any, defer_validation: Optional[bool] = None, description: Optional[str] = None, dest: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, frequency: Optional[Any] = None, human: Optional[bool] = None, meta: Optional[Any] = None, pretty: Optional[bool] = None, retention_policy: Optional[Any] = None, settings: Optional[Any] = None, source: Optional[Any] = None, sync: Optional[Any] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Updates certain properties of a transform.

https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html

Parameters:
  • transform_id – Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
  • defer_validation – When true, deferrable validations are not run. This behavior may be desired if the source index does not exist until after the transform is created.
  • description – Free text description of the transform.
  • dest – The destination for the transform.
  • frequency – The interval between checks for changes in the source indices when the transform is running continuously. Also determines the retry interval in the event of transient failures while the transform is searching or indexing. The minimum value is 1s and the maximum is 1h.
  • meta – Defines optional transform metadata.
  • retention_policy – Defines a retention policy for the transform. Data that meets the defined criteria is deleted from the destination index.
  • settings – Defines optional transform settings.
  • source – The source of the data for the transform.
  • sync – Defines the properties transforms require to run continuously.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
upgrade_transforms(*, dry_run: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, timeout: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Upgrades all transforms.

https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html

Parameters:
  • dry_run – When true, the request checks for updates but does not run them.
  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

Watcher

class elasticsearch.client.WatcherClient(client: elasticsearch._sync.client._base.BaseClient)
ack_watch(*, watch_id: Any, action_id: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Acknowledges a watch, manually throttling the execution of the watch’s actions.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html

Parameters:
  • watch_id – Watch ID
  • action_id – A comma-separated list of the action ids to be acked
activate_watch(*, watch_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Activates a currently inactive watch.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html

Parameters:watch_id – Watch ID
deactivate_watch(*, watch_id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Deactivates a currently active watch.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html

Parameters:watch_id – Watch ID
delete_watch(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Removes a watch from Watcher.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html

Parameters:id – Watch ID
execute_watch(*, id: Optional[Any] = None, action_modes: Optional[Dict[str, Any]] = None, alternative_input: Optional[Dict[str, Any]] = None, debug: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, ignore_condition: Optional[bool] = None, pretty: Optional[bool] = None, record_execution: Optional[bool] = None, simulated_actions: Optional[Any] = None, trigger_data: Optional[Any] = None, watch: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Forces the execution of a stored watch.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html

Parameters:
  • id – Identifier for the watch.
  • action_modes – Determines how to handle the watch actions as part of the watch execution. See [Action execution modes](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode) for more information.
  • alternative_input – When present, the watch uses this object as a payload instead of executing its own input.
  • debug – Defines whether the watch runs in debug mode.
  • ignore_condition – When set to true, the watch execution uses the always condition. This can also be specified as an HTTP parameter.
  • record_execution – When set to true, the watch record representing the watch execution result is persisted to the .watcher-history index for the current time. In addition, the status of the watch is updated, possibly throttling subsequent executions. This can also be specified as an HTTP parameter.
  • simulated_actions
  • trigger_data – This structure is parsed as the data of the trigger event that will be used during the watch execution
  • watch – When present, this [watch](https://www.elastic.co/guide/en/elasticsearch/reference/current/how-watcher-works.html#watch-definition) is used instead of the one specified in the request. This watch is not persisted to the index and record_execution cannot be set.
get_watch(*, id: Any, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves a watch by its ID.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html

Parameters:id – Watch ID
put_watch(*, id: Any, actions: Optional[Dict[str, Any]] = None, active: Optional[bool] = None, condition: Optional[Any] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, if_primary_term: Optional[int] = None, if_seq_no: Optional[Any] = None, input: Optional[Any] = None, metadata: Optional[Any] = None, pretty: Optional[bool] = None, throttle_period: Optional[str] = None, transform: Optional[Any] = None, trigger: Optional[Any] = None, version: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Creates a new watch, or updates an existing one.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html

Parameters:
  • id – Watch ID
  • actions
  • active – Specify whether the watch is in/active by default
  • condition
  • if_primary_term – only update the watch if the last operation that has changed the watch has the specified primary term
  • if_seq_no – only update the watch if the last operation that has changed the watch has the specified sequence number
  • input
  • metadata
  • throttle_period
  • transform
  • trigger
  • version – Explicit version number for concurrency control
query_watches(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, from_: Optional[int] = None, human: Optional[bool] = None, pretty: Optional[bool] = None, query: Optional[Any] = None, search_after: Optional[Any] = None, size: Optional[int] = None, sort: Optional[Any] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves stored watches.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html

Parameters:
  • from – The offset from the first result to fetch. Needs to be non-negative.
  • query – Optional, query filter watches to be returned.
  • search_after – Optional search After to do pagination using last hit’s sort values.
  • size – The number of hits to return. Needs to be non-negative.
  • sort – Optional sort definition.
start(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Starts Watcher if it is not already running.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html

stats(*, metric: Union[Any, List[Any], None] = None, emit_stacktraces: Optional[bool] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves the current Watcher metrics.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html

Parameters:
  • metric – Defines which additional metrics are included in the response.
  • emit_stacktraces – Defines whether stack traces are generated for each watch that is running.
stop(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Stops Watcher if it is running.

https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html

X-Pack

class elasticsearch.client.XPackClient(client: elasticsearch._sync.client._base.BaseClient)
info(*, accept_enterprise: Optional[bool] = None, categories: Optional[List[str]] = None, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves information about the installed X-Pack features.

https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html

Parameters:
  • accept_enterprise – If this param is used it must be set to true
  • categories – Comma-separated list of info categories. Can be any of: build, license, features
usage(*, error_trace: Optional[bool] = None, filter_path: Union[List[str], str, None] = None, human: Optional[bool] = None, master_timeout: Optional[Any] = None, pretty: Optional[bool] = None) → elastic_transport.ObjectApiResponse[typing.Any][Any]

Retrieves usage information about the installed X-Pack features.

https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html

Parameters:master_timeout – Specify timeout for watch write operation