INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html>`_ :arg body: The token to invalidate
def invalidate_token(self, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html>`_ :arg body: The token to invalidate """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a requi...
`<TODO>`_ :arg body: The privilege(s) to add :arg 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 wi...
def put_privileges(self, body, params=None): """ `<TODO>`_ :arg body: The privilege(s) to add :arg 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 opera...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html>`_ :arg username: The username of the User :arg body: The user to add :arg refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wai...
def put_user(self, username, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html>`_ :arg username: The username of the User :arg body: The user to add :arg refresh: If `true` (the default) then refresh the affected...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy
def delete_lifecycle(self, policy=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy """ return self.transport.perform_request( "DELETE", _make_pat...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html>`_ :arg index: The name of the index to explain
def explain_lifecycle(self, index=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html>`_ :arg index: The name of the index to explain """ return self.transport.perform_request( "GET", _make_path(index, ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy
def get_lifecycle(self, policy=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy """ return self.transport.perform_request( "GET", _make_path("_ilm",...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html>`_ :arg index: The name of the index whose lifecycle step is to change :arg body: The new lifecycle step to move to
def move_to_step(self, index=None, body=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html>`_ :arg index: The name of the index whose lifecycle step is to change :arg body: The new lifecycle step to move to """ ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy :arg body: The lifecycle policy definition to register
def put_lifecycle(self, policy=None, body=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html>`_ :arg policy: The name of the index lifecycle policy :arg body: The lifecycle policy definition to register """ re...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html>`_ :arg index: The name of the indices (comma-separated) whose failed lifecycle step is to be retry
def retry(self, index=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html>`_ :arg index: The name of the indices (comma-separated) whose failed lifecycle step is to be retry """ return self.transport.perform...
`<https://www.elastic.co/guide/en/x-pack/current/license-management.html>`_ :arg body: licenses to be installed :arg acknowledge: whether the user has acknowledged acknowledge messages (default: false)
def post(self, body=None, params=None): """ `<https://www.elastic.co/guide/en/x-pack/current/license-management.html>`_ :arg body: licenses to be installed :arg acknowledge: whether the user has acknowledged acknowledge messages (default: false) """ return se...
Go through the git repository log and generate a document per commit containing all the metadata.
def parse_commits(head, name): """ Go through the git repository log and generate a document per commit containing all the metadata. """ for commit in head.traverse(): yield { '_id': commit.hexsha, 'repository': name, 'committed_date': datetime.fromtimesta...
Parse a git repository with all it's commits and load it into elasticsearch using `client`. If the index doesn't exist it will be created.
def load_repo(client, path=None, index='git'): """ Parse a git repository with all it's commits and load it into elasticsearch using `client`. If the index doesn't exist it will be created. """ path = dirname(dirname(abspath(__file__))) if path is None else path repo_name = basename(path) re...
`<>`_ :arg id: The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
def get_jobs(self, id=None, params=None): """ `<>`_ :arg id: The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs """ return self.transport.perform_request( "GET", _make_path("_rollup", "job", id), params=params )
`<>`_ :arg id: The ID of the index to check rollup capabilities on, or left blank for all jobs
def get_rollup_caps(self, id=None, params=None): """ `<>`_ :arg id: The ID of the index to check rollup capabilities on, or left blank for all jobs """ return self.transport.perform_request( "GET", _make_path("_rollup", "data", id), params=params ...
`<>`_ :arg id: The ID of the job to create :arg body: The job configuration
def put_job(self, id, body, params=None): """ `<>`_ :arg id: The ID of the job to create :arg body: The job configuration """ for param in (id, body): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") ...
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_ :arg index: Index pattern
def info(self, index=None, params=None): """ `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_ :arg index: Index pattern """ return self.transport.perform_request( "GET", _make_path(index, "_xpack", "migration", "depreca...
The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_ :arg node_id: A comma-separated list of node IDs or names to limit the returned informati...
def info(self, node_id=None, metric=None, params=None): """ The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_ :arg node_id: A comma-sep...
The cluster nodes stats API allows to retrieve one or more (or all) of the cluster nodes statistics. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_ :arg node_id: A comma-separated list of node IDs or names to limit the returned informat...
def stats(self, node_id=None, metric=None, index_metric=None, params=None): """ The cluster nodes stats API allows to retrieve one or more (or all) of the cluster nodes statistics. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_ :arg...
An API allowing to get the current hot threads on each node in the cluster. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return...
def hot_threads(self, node_id=None, params=None): """ An API allowing to get the current hot threads on each node in the cluster. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_ :arg node_id: A comma-separated list of node IDs or names...
Split actions into chunks by number or size, serialize them into strings in the process.
def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer): """ Split actions into chunks by number or size, serialize them into strings in the process. """ bulk_actions, bulk_data = [], [] size, action_count = 0, 0 for action, data in actions: raw_data, raw_action = data, ...
The cluster nodes usage API allows to retrieve information on the usage of features for each node. `<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html>`_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information;...
def usage(self, node_id=None, metric=None, params=None): """ The cluster nodes usage API allows to retrieve information on the usage of features for each node. `<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html>`_ :arg node_id: A comma-separ...
Send a bulk request to elasticsearch and process the output.
def _process_bulk_chunk( client, bulk_actions, bulk_data, raise_on_exception=True, raise_on_error=True, *args, **kwargs ): """ Send a bulk request to elasticsearch and process the output. """ # if raise on error is set, we need to collect errors per chunk before raising them ...
Streaming bulk consumes actions from the iterable passed in and yields results per action. For non-streaming usecases use :func:`~elasticsearch.helpers.bulk` which is a wrapper around streaming bulk that returns summary information about the bulk operation once the entire input is consumed and sent. ...
def streaming_bulk( client, actions, chunk_size=500, max_chunk_bytes=100 * 1024 * 1024, raise_on_error=True, expand_action_callback=expand_action, raise_on_exception=True, max_retries=0, initial_backoff=2, max_backoff=600, yield_ok=True, *args, **kwargs ): """ ...
Parallel version of the bulk helper run in multiple threads at once. :arg client: instance of :class:`~elasticsearch.Elasticsearch` to use :arg actions: iterator containing the actions :arg thread_count: size of the threadpool to use for the bulk requests :arg chunk_size: number of docs in one chunk se...
def parallel_bulk( client, actions, thread_count=4, chunk_size=500, max_chunk_bytes=100 * 1024 * 1024, queue_size=4, expand_action_callback=expand_action, *args, **kwargs ): """ Parallel version of the bulk helper run in multiple threads at once. :arg client: instance of...
Simple abstraction on top of the :meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that yields all hits as returned by underlining scroll requests. By default scan does not return results in any pre-determined order. To have a standard order in the returned documents (either by score ...
def scan( client, query=None, scroll="5m", raise_on_error=True, preserve_order=False, size=1000, request_timeout=None, clear_scroll=True, scroll_kwargs=None, **kwargs ): """ Simple abstraction on top of the :meth:`~elasticsearch.Elasticsearch.scroll` api - a simple it...
Reindex all documents from one index that satisfy a given query to another, potentially (if `target_client` is specified) on a different cluster. If you don't specify the query you will reindex all the documents. Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is available as part of e...
def reindex( client, source_index, target_index, query=None, target_client=None, chunk_size=500, scroll="5m", scan_kwargs={}, bulk_kwargs={}, ): """ Reindex all documents from one index that satisfy a given query to another, potentially (if `target_client` is specified) ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_ :arg transform_id: The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms :arg from_: skips a number of transform configs, defaults...
def get_data_frame_transform(self, transform_id=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_ :arg transform_id: The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' impl...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_ :arg transform_id: The id of the transform for which to get stats. '_all' or '*' implies all transforms
def get_data_frame_transform_stats(self, transform_id=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_ :arg transform_id: The id of the transform for which to get stats. '_all' or '*' implies all transfo...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_ :arg body: The definition for the data_frame transform to preview
def preview_data_frame_transform(self, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_ :arg body: The definition for the data_frame transform to preview """ if body in SKIP_IN_PATH: raise ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_ :arg transform_id: The id of the new transform. :arg body: The data frame transform definition
def put_data_frame_transform(self, transform_id, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_ :arg transform_id: The id of the new transform. :arg body: The data frame transform definition """ ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_ :arg transform_id: The id of the transform to stop :arg timeout: Controls the time to wait until the transform has stopped. Default to 30 seconds :arg wait_for_completion: Whether to ...
def stop_data_frame_transform(self, transform_id, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_ :arg transform_id: The id of the transform to stop :arg timeout: Controls the time to wait until the transform has stop...
Allocation provides a snapshot of how shards have located around the cluster and the state of disk usage. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_ :arg node_id: A comma-separated list of node IDs or names to limit the returned informat...
def allocation(self, node_id=None, params=None): """ Allocation provides a snapshot of how shards have located around the cluster and the state of disk usage. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_ :arg node_id: A comma-separated...
Count provides quick access to the document count of the entire cluster, or individual indices. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg format...
def count(self, index=None, params=None): """ Count provides quick access to the document count of the entire cluster, or individual indices. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_ :arg index: A comma-separated list of index names to ...
The indices command provides a cross-section of each index. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to display byte values,...
def indices(self, index=None, params=None): """ The indices command provides a cross-section of each index. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_ :arg index: A comma-separated list of index names to limit the returned informati...
recovery is a view of shard replication. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to display byte values, valid choices are...
def recovery(self, index=None, params=None): """ recovery is a view of shard replication. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg b...
The shards command is the detailed view of what nodes contain which shards. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to displ...
def shards(self, index=None, params=None): """ The shards command is the detailed view of what nodes contain which shards. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_ :arg index: A comma-separated list of index names to limit the returned ...
The segments command is the detailed view of Lucene segments per index. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_ :arg index: A comma-separated list of index names to limit the returned information :arg bytes: The unit in which to display...
def segments(self, index=None, params=None): """ The segments command is the detailed view of Lucene segments per index. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_ :arg index: A comma-separated list of index names to limit the returned ...
Get information about thread pools. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_ :arg thread_pool_patterns: A comma-separated list of regular-expressions to filter the thread pools in the output :arg format: a short version of the Accept ...
def thread_pool(self, thread_pool_patterns=None, params=None): """ Get information about thread pools. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_ :arg thread_pool_patterns: A comma-separated list of regular-expressions to filter...
Shows information about currently loaded fielddata on a per-node basis. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_ :arg fields: A comma-separated list of fields to return the fielddata size :arg bytes: The unit in which to display byte va...
def fielddata(self, fields=None, params=None): """ Shows information about currently loaded fielddata on a per-node basis. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_ :arg fields: A comma-separated list of fields to return the fielddata ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_ :arg name: A pattern that returned template names must match :arg format: a short version of the Accept header, e.g. json, yaml :arg h: Comma-separated list of column names to display :arg help: Retu...
def templates(self, name=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_ :arg name: A pattern that returned template names must match :arg format: a short version of the Accept header, e.g. json, yaml :arg h: Comma-...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_ :arg watch_id: Watch ID :arg action_id: A comma-separated list of the action ids to be acked
def ack_watch(self, watch_id, action_id=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_ :arg watch_id: Watch ID :arg action_id: A comma-separated list of the action ids to be acked """ if watch_id in ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_ :arg watch_id: Watch ID
def activate_watch(self, watch_id, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_ :arg watch_id: Watch ID """ if watch_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argu...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_ :arg id: Watch ID
def delete_watch(self, id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_ :arg id: Watch ID """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") re...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_ :arg id: Watch ID :arg body: Execution control :arg debug: indicates whether the watch should execute in debug mode
def execute_watch(self, id=None, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_ :arg id: Watch ID :arg body: Execution control :arg debug: indicates whether the watch should execute in debug mode ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_ :arg id: Watch ID :arg body: The watch :arg active: Specify whether the watch is in/active by default :arg if_primary_term: only update the watch if the last operation that has cha...
def put_watch(self, id, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_ :arg id: Watch ID :arg body: The watch :arg active: Specify whether the watch is in/active by default :arg if_primary_term:...
Get a very simple status on the health of the cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_ :arg index: Limit the information returned to a specific index :arg level: Specify the level of detail for returned information, default 'cl...
def health(self, index=None, params=None): """ Get a very simple status on the health of the cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_ :arg index: Limit the information returned to a specific index :arg level: Specify the le...
Get a comprehensive state information of the whole cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_ :arg metric: Limit the information returned to the specified metrics :arg index: A comma-separated list of index names; use `_all` or empty ...
def state(self, metric=None, index=None, params=None): """ Get a comprehensive state information of the whole cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_ :arg metric: Limit the information returned to the specified metrics :arg...
The Cluster Stats API allows to retrieve statistics from a cluster wide perspective. The API returns basic index metrics and information about the current nodes that form the cluster. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>`_ :arg node_id: A ...
def stats(self, node_id=None, params=None): """ The Cluster Stats API allows to retrieve statistics from a cluster wide perspective. The API returns basic index metrics and information about the current nodes that form the cluster. `<http://www.elastic.co/guide/en/elasticsearch/r...
Explicitly execute a cluster reroute allocation command including specific commands. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_ :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) :arg dry_run: Simulate the ...
def reroute(self, body=None, params=None): """ Explicitly execute a cluster reroute allocation command including specific commands. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_ :arg body: The definition of `commands` to perform (`move`, `cance...
Update cluster wide specific settings. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_ :arg body: The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). :arg flat_settings: Return settings in...
def put_settings(self, body=None, params=None): """ Update cluster wide specific settings. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_ :arg body: The settings to be updated. Can be either `transient` or `persistent` (survi...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_ :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' :arg include_disk_info: Return information about disk usage and shard si...
def allocation_explain(self, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_ :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' :arg inclu...
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_ :arg index: Index pattern
def deprecations(self, index=None, params=None): """ `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_ :arg index: Index pattern """ return self.transport.perform_request( "GET", _make_path(index, "_migration", "deprecations"), para...
Return a connection from the pool using the `ConnectionSelector` instance. It tries to resurrect eligible connections, forces a resurrection when no connections are availible and passes the list of live connections to the selector instance to choose from. Returns a connection i...
def get_connection(self): """ Return a connection from the pool using the `ConnectionSelector` instance. It tries to resurrect eligible connections, forces a resurrection when no connections are availible and passes the list of live connections to the selector instance t...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_ :arg index: The name of the follower index :arg body: The name of the leader index and other optional ccr related parameters :arg wait_for_active_shards: Sets the number of shard copies that mus...
def follow(self, index, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_ :arg index: The name of the follower index :arg body: The name of the leader index and other optional ccr related parameters :arg ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices
def follow_info(self, index=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices """ return self....
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices
def follow_stats(self, index, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_ :arg index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices """ if index in SKI...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_ :arg name: The name of the auto follow pattern.
def get_auto_follow_pattern(self, name=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_ :arg name: The name of the auto follow pattern. """ return self.transport.perform_request( "GET", _mak...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_ :arg name: The name of the auto follow pattern. :arg body: The specification of the auto follow pattern
def put_auto_follow_pattern(self, name, body, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_ :arg name: The name of the auto follow pattern. :arg body: The specification of the auto follow pattern """ ...
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other optional ccr related parameters
def resume_follow(self, index, body=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_ :arg index: The name of the follow index to resume following. :arg body: The name of the leader index and other optional ccr relat...
`<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_ :arg id: Comma separated list of pipeline ids. Wildcards supported :arg master_timeout: Explicit operation timeout for connection to master node
def get_pipeline(self, id=None, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_ :arg id: Comma separated list of pipeline ids. Wildcards supported :arg master_timeout: Explicit operation timeout for connection to master node ...
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg event_id: The ID of the event to remove from the calendar
def delete_calendar_event(self, calendar_id, event_id, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to modify :arg event_id: The ID of the event to remove from the calendar """ for param in (calendar_id, event_id): if param in SKIP_IN_PATH...
`<>`_ :arg filter_id: The ID of the filter to delete
def delete_filter(self, filter_id, params=None): """ `<>`_ :arg filter_id: The ID of the filter to delete """ if filter_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'filter_id'.") return self.transport.perform_request( ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_ :arg job_id: The ID of the job from which to delete forecasts :arg forecast_id: The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` :arg allow_no_forec...
def delete_forecast(self, job_id, forecast_id=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_ :arg job_id: The ID of the job from which to delete forecasts :arg forecast_id: The ID of the forecast to delete, can be comm...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_ :arg job_id: The ID of the job to delete :arg force: True if the job should be forcefully deleted, default False :arg wait_for_completion: Should this request wait until the operation has complete...
def delete_job(self, job_id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_ :arg job_id: The ID of the job to delete :arg force: True if the job should be forcefully deleted, default False :arg wait_for_completion: Should...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to delete
def delete_model_snapshot(self, job_id, snapshot_id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to delete """ for param in ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_ :arg body: The contents of the file to be analyzed :arg charset: Optional parameter to specify the character set of the file :arg column_names: Optional parameter containing a comma separated ...
def find_file_structure(self, body, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_ :arg body: The contents of the file to be analyzed :arg charset: Optional parameter to specify the character set of the file ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_ :arg job_id: The name of the job to flush :arg body: Flush parameters :arg advance_time: Advances time to the given value generating results and updating the model for the advanced interval ...
def flush_job(self, job_id, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_ :arg job_id: The name of the job to flush :arg body: Flush parameters :arg advance_time: Advances time to the given value generating res...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_ :arg job_id: ID of the job to get bucket results from :arg timestamp: The timestamp of the desired single bucket result :arg body: Bucket selection details if not provided in URI :arg anomaly_score: F...
def get_buckets(self, job_id, timestamp=None, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_ :arg job_id: ID of the job to get bucket results from :arg timestamp: The timestamp of the desired single bucket result ...
`<>`_ :arg calendar_id: The ID of the calendar containing the events :arg end: Get events before this time :arg from_: Skips a number of events :arg job_id: Get events for the job. When this option is used calendar_id must be '_all' :arg size: Specifies a max number ...
def get_calendar_events(self, calendar_id, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar containing the events :arg end: Get events before this time :arg from_: Skips a number of events :arg job_id: Get events for the job. When this option is used ...
`<>`_ :arg calendar_id: The ID of the calendar to fetch :arg body: The from and size parameters optionally sent in the body :arg from_: skips a number of calendars :arg size: specifies a max number of calendars to get
def get_calendars(self, calendar_id=None, body=None, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to fetch :arg body: The from and size parameters optionally sent in the body :arg from_: skips a number of calendars :arg size: specifies a max number of...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_ :arg job_id: The name of the job :arg category_id: The identifier of the category definition of interest :arg body: Category selection details if not provided in URI :arg from_: skips a number of ca...
def get_categories(self, job_id, category_id=None, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_ :arg job_id: The name of the job :arg category_id: The identifier of the category definition of interest :arg ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_ :arg datafeed_id: The ID of the datafeeds stats to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no ...
def get_datafeed_stats(self, datafeed_id=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_ :arg datafeed_id: The ID of the datafeeds stats to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard expression ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_ :arg datafeed_id: The ID of the datafeeds to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds...
def get_datafeeds(self, datafeed_id=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_ :arg datafeed_id: The ID of the datafeeds to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard expression matches...
`<>`_ :arg filter_id: The ID of the filter to fetch :arg from_: skips a number of filters :arg size: specifies a max number of filters to get
def get_filters(self, filter_id=None, params=None): """ `<>`_ :arg filter_id: The ID of the filter to fetch :arg from_: skips a number of filters :arg size: specifies a max number of filters to get """ return self.transport.perform_request( "GET", _ma...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_ :arg job_id: The ID of the jobs stats to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specifi...
def get_job_stats(self, job_id=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_ :arg job_id: The ID of the jobs stats to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression matches no jobs. (Th...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_ :arg job_id: The ID of the jobs to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)
def get_jobs(self, job_id=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_ :arg job_id: The ID of the jobs to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression matches no jobs. (This includes `_all...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to fetch :arg body: Model snapshot selection criteria :arg desc: True if the results should be sorted in descending o...
def get_model_snapshots(self, job_id, snapshot_id=None, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to fetch :arg body: Mode...
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg body: A list of events
def post_calendar_events(self, calendar_id, body, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to modify :arg body: A list of events """ for param in (calendar_id, body): if param in SKIP_IN_PATH: raise ValueError("Empty va...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_ :arg job_id: The name of the job receiving the data :arg body: The data to process :arg reset_end: Optional parameter to specify the end of the bucket resetting range :arg reset_start: Opti...
def post_data(self, job_id, body, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_ :arg job_id: The name of the job receiving the data :arg body: The data to process :arg reset_end: Optional parameter to specify the end of t...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to preview
def preview_datafeed(self, datafeed_id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to preview """ if datafeed_id in SKIP_IN_PATH: raise ValueError( ...
`<>`_ :arg calendar_id: The ID of the calendar to create :arg body: The calendar details
def put_calendar(self, calendar_id, body=None, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to create :arg body: The calendar details """ if calendar_id in SKIP_IN_PATH: raise ValueError( "Empty value passed for a required ...
`<>`_ :arg calendar_id: The ID of the calendar to modify :arg job_id: The ID of the job to add to the calendar
def put_calendar_job(self, calendar_id, job_id, params=None): """ `<>`_ :arg calendar_id: The ID of the calendar to modify :arg job_id: The ID of the job to add to the calendar """ for param in (calendar_id, job_id): if param in SKIP_IN_PATH: ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to start :arg body: The start datafeed parameters :arg end: The end time when the datafeed should stop. When not set, the datafeed continues in real ti...
def start_datafeed(self, datafeed_id, body=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to start :arg body: The start datafeed parameters :arg end: The end time when th...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to update :arg body: The datafeed update settings
def update_datafeed(self, datafeed_id, body, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_ :arg datafeed_id: The ID of the datafeed to update :arg body: The datafeed update settings """ for param in (datafee...
`<>`_ :arg filter_id: The ID of the filter to update :arg body: The filter update
def update_filter(self, filter_id, body, params=None): """ `<>`_ :arg filter_id: The ID of the filter to update :arg body: The filter update """ for param in (filter_id, body): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to update :arg body: The model snapshot properties to update
def update_model_snapshot(self, job_id, snapshot_id, body, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to update :arg body: The mode...
`<>`_ :arg body: The job config
def validate(self, body, params=None): """ `<>`_ :arg body: The job config """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "POST", "/_ml/anomaly_detectors/_...
`<>`_ :arg body: The detector
def validate_detector(self, body, params=None): """ `<>`_ :arg body: The detector """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "POST", "/_ml/...
Perform the analysis process on a text and return the tokens breakdown of the text. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_ :arg index: The name of the index to scope the operation :arg body: Define analyzer/tokenizer parameters and the text on w...
def analyze(self, index=None, body=None, params=None): """ Perform the analysis process on a text and return the tokens breakdown of the text. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_ :arg index: The name of the index to scope the operatio...
Explicitly refresh one or more index, making all operations performed since the last refresh available for search. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string t...
def refresh(self, index=None, params=None): """ Explicitly refresh one or more index, making all operations performed since the last refresh available for search. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html>`_ :arg index: A comma-separat...
Explicitly flush one or more indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices :arg allow_no_indices: Whether to ignore if a wildcard indices ...
def flush(self, index=None, params=None): """ Explicitly flush one or more indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices :a...
The get index API allows to retrieve information about one or more indexes. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves to no ...
def get(self, index, feature=None, params=None): """ The get index API allows to retrieve information about one or more indexes. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_ :arg index: A comma-separated list of index names :arg allo...
Check if a type/types exists in an index/indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html>`_ :arg index: A comma-separated list of index names; use `_all` to check the types across all indices :arg doc_type: A comma-separated list o...
def exists_type(self, index, doc_type, params=None): """ Check if a type/types exists in an index/indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html>`_ :arg index: A comma-separated list of index names; use `_all` to check the...
Retrieve mapping definition of index or index/type. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html>`_ :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of document types :arg allow_no_indices: Whether to ig...
def get_mapping(self, index=None, doc_type=None, params=None): """ Retrieve mapping definition of index or index/type. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html>`_ :arg index: A comma-separated list of index names :arg doc_type: A ...
Retrieve mapping definition of a specific field. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html>`_ :arg fields: A comma-separated list of fields :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of do...
def get_field_mapping(self, fields, index=None, doc_type=None, params=None): """ Retrieve mapping definition of a specific field. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html>`_ :arg fields: A comma-separated list of fields :arg...
Create an alias for a specific index/indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all ind...
def put_alias(self, index, name, body=None, params=None): """ Create an alias for a specific index/indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names the alias should point to (s...
Return a boolean indicating whether given alias exists. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :arg name: A comma-separated list of alias names to return :arg allow_no_i...
def exists_alias(self, index=None, name=None, params=None): """ Return a boolean indicating whether given alias exists. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :a...
Update specified aliases. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg body: The definition of `actions` to perform :arg master_timeout: Specify timeout for connection to master :arg request_timeout: Request timeout
def update_aliases(self, body, params=None): """ Update specified aliases. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg body: The definition of `actions` to perform :arg master_timeout: Specify timeout for connection to master ...
Delete specific alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names (supports wildcards); use `_all` for all indices :arg name: A comma-separated list of aliases to delete (supports ...
def delete_alias(self, index, name, params=None): """ Delete specific alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names (supports wildcards); use `_all` for all indices :a...
Retrieve an index template by its name. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_ :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: false) :arg local: Return local information, do not retriev...
def get_template(self, name=None, params=None): """ Retrieve an index template by its name. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_ :arg name: The name of the template :arg flat_settings: Return settings in flat format (default:...