desc
stringlengths
3
26.7k
decl
stringlengths
11
7.89k
bodies
stringlengths
8
553k
'Retreive a :class:`~elasticsearch.Connection` instance from the :class:`~elasticsearch.ConnectionPool` instance.'
def get_connection(self):
if self.sniffer_timeout: if (time.time() >= (self.last_sniff + self.sniffer_timeout)): self.sniff_hosts() return self.connection_pool.get_connection()
'Perform the request to get sniffins information. Returns a list of dictionaries (one per node) containing all the information from the cluster. It also sets the last_sniff attribute in case of a successful attempt. In rare cases it might be possible to override this method in your custom Transport class to serve data ...
def _get_sniff_data(self, initial=False):
previous_sniff = self.last_sniff try: self.last_sniff = time.time() for c in chain(self.connection_pool.connections, self.seed_connections): try: (_, headers, node_info) = c.perform_request('GET', '/_nodes/_all/http', timeout=(self.sniff_timeout if (not initial) else ...
'Obtain a list of nodes from the cluster and create a new connection pool using the information retrieved. To extract the node connection parameters use the ``nodes_to_host_callback``. :arg initial: flag indicating if this is during startup (``sniff_on_start``), ignore the ``sniff_timeout`` if ``True``'
def sniff_hosts(self, initial=False):
node_info = self._get_sniff_data(initial) hosts = list(filter(None, (self._get_host_info(n) for n in node_info))) if (not hosts): raise TransportError('N/A', 'Unable to sniff hosts - no viable hosts found.') self.set_connections(hosts)
'Mark a connection as dead (failed) in the connection pool. If sniffing on failure is enabled this will initiate the sniffing process. :arg connection: instance of :class:`~elasticsearch.Connection` that failed'
def mark_dead(self, connection):
self.connection_pool.mark_dead(connection) if self.sniff_on_connection_fail: self.sniff_hosts()
'Perform the actual request. Retrieve a connection from the connection pool, pass all the information to it\'s perform_request method and return the data. If an exception was raised, mark the connection as failed and retry (up to `max_retries` times). If the operation was succesful and the connection used was previousl...
def perform_request(self, method, url, params=None, body=None):
if (body is not None): body = self.serializer.dumps(body) if ((method in ('HEAD', 'GET')) and (self.send_get_body_as != 'GET')): if (self.send_get_body_as == 'POST'): method = 'POST' elif (self.send_get_body_as == 'source'): if (params is None)...
'Explcitly closes connections'
def close(self):
self.connection_pool.close()
'`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_ :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. :arg detailed: Return detailed task information (default: false) :arg group_by: Group tasks by nodes or parent/child relationships, default ...
@query_params('actions', 'detailed', 'group_by', 'node_id', 'parent_node', 'parent_task', 'wait_for_completion') def list(self, params=None):
return self.transport.perform_request('GET', '/_tasks', params=params)
'`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_ :arg task_id: Cancel the task with specified task id (node_id:task_number) :arg actions: A comma-separated list of actions that should be cancelled. Leave empty to cancel all. :arg node_id: A comma-separated list of node IDs or names to lim...
@query_params('actions', 'node_id', 'parent_node', 'parent_task') def cancel(self, task_id=None, params=None):
return self.transport.perform_request('POST', _make_path('_tasks', task_id, '_cancel'), params=params)
'Retrieve information for a particular task. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_ :arg task_id: Return the task with specified id (node_id:task_number) :arg wait_for_completion: Wait for the matching tasks to complete (default: false)'
@query_params('wait_for_completion') def get(self, task_id=None, params=None):
return self.transport.perform_request('GET', _make_path('_tasks', task_id), params=params)
':arg hosts: list of nodes we should connect to. Node should be a dictionary ({"host": "localhost", "port": 9200}), the entire dictionary will be passed to the :class:`~elasticsearch.Connection` class as kwargs, or a string in the format of ``host[:port]`` which will be translated to a dictionary automatically. If no ...
def __init__(self, hosts=None, transport_class=Transport, **kwargs):
self.transport = transport_class(_normalize_hosts(hosts), **kwargs) self.indices = IndicesClient(self) self.ingest = IngestClient(self) self.cluster = ClusterClient(self) self.cat = CatClient(self) self.nodes = NodesClient(self) self.remote = RemoteClient(self) self.snapshot = SnapshotCl...
'Returns True if the cluster is up, False otherwise. `<http://www.elastic.co/guide/>`_'
@query_params() def ping(self, params=None):
try: return self.transport.perform_request(u'HEAD', u'/', params=params) except TransportError: return False
'Get the basic info from the current cluster. `<http://www.elastic.co/guide/>`_'
@query_params() def info(self, params=None):
return self.transport.perform_request(u'GET', u'/', params=params)
'Adds a typed JSON document in a specific index, making it searchable. Behind the scenes this method calls index(..., op_type=\'create\') `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html>`_ :arg index: The name of the index :arg doc_type: The type of the document :arg id: Document ID :a...
@query_params(u'parent', u'pipeline', u'refresh', u'routing', u'timeout', u'timestamp', u'ttl', u'version', u'version_type', u'wait_for_active_shards') def create(self, index, doc_type, id, body, params=None):
for param in (index, doc_type, id, body): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request(u'PUT', _make_path(index, doc_type, id, u'_create'), params=params, body=body)
'Adds or updates a typed JSON document in a specific index, making it searchable. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html>`_ :arg index: The name of the index :arg doc_type: The type of the document :arg body: The document :arg id: Document ID :arg op_type: Explicit operation t...
@query_params(u'op_type', u'parent', u'pipeline', u'refresh', u'routing', u'timeout', u'timestamp', u'ttl', u'version', u'version_type', u'wait_for_active_shards') def index(self, index, doc_type, body, id=None, params=None):
for param in (index, doc_type, body): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request((u'POST' if (id in SKIP_IN_PATH) else u'PUT'), _make_path(index, doc_type, id), params=params, body=body)...
'Returns a boolean indicating whether or not given document exists in Elasticsearch. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html>`_ :arg index: The name of the index :arg doc_type: The type of the document (use `_all` to fetch the first document matching the ID across all types) :arg ...
@query_params(u'_source', u'_source_exclude', u'_source_include', u'parent', u'preference', u'realtime', u'refresh', u'routing', u'stored_fields', u'version', u'version_type') def exists(self, index, doc_type, id, params=None):
for param in (index, doc_type, id): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request(u'HEAD', _make_path(index, doc_type, id), params=params)
'`<http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html>`_ :arg index: The name of the index :arg doc_type: The type of the document; use `_all` to fetch the first document matching the ID across all types :arg id: The document ID :arg _source: True or false to return the _source field or not, or...
@query_params(u'_source', u'_source_exclude', u'_source_include', u'parent', u'preference', u'realtime', u'refresh', u'routing', u'version', u'version_type') def exists_source(self, index, doc_type, id, params=None):
for param in (index, doc_type, id): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request(u'HEAD', _make_path(index, doc_type, id, u'_source'), params=params)
'Get a typed JSON document from the index based on its id. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html>`_ :arg index: The name of the index :arg doc_type: The type of the document (use `_all` to fetch the first document matching the ID across all types) :arg id: The document ID :arg _...
@query_params(u'_source', u'_source_exclude', u'_source_include', u'parent', u'preference', u'realtime', u'refresh', u'routing', u'stored_fields', u'version', u'version_type') def get(self, index, doc_type, id, params=None):
for param in (index, doc_type, id): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request(u'GET', _make_path(index, doc_type, id), params=params)
'Get the source of a document by it\'s index, type and id. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html>`_ :arg index: The name of the index :arg doc_type: The type of the document; use `_all` to fetch the first document matching the ID across all types :arg id: The document ID :arg _s...
@query_params(u'_source', u'_source_exclude', u'_source_include', u'parent', u'preference', u'realtime', u'refresh', u'routing', u'version', u'version_type') def get_source(self, index, doc_type, id, params=None):
for param in (index, doc_type, id): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request(u'GET', _make_path(index, doc_type, id, u'_source'), params=params)
'Get multiple documents based on an index, type (optional) and ids. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html>`_ :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. :arg index: The n...
@query_params(u'_source', u'_source_exclude', u'_source_include', u'preference', u'realtime', u'refresh', u'routing', u'stored_fields') def mget(self, body, index=None, doc_type=None, params=None):
if (body in SKIP_IN_PATH): raise ValueError(u"Empty value passed for a required argument 'body'.") return self.transport.perform_request(u'GET', _make_path(index, doc_type, u'_mget'), params=params, body=body)
'Update a document based on a script or partial data provided. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html>`_ :arg index: The name of the index :arg doc_type: The type of the document :arg id: Document ID :arg body: The request definition using either `script` or partial `doc` :arg...
@query_params(u'_source', u'_source_exclude', u'_source_include', u'fields', u'lang', u'parent', u'refresh', u'retry_on_conflict', u'routing', u'timeout', u'timestamp', u'ttl', u'version', u'version_type', u'wait_for_active_shards') def update(self, index, doc_type, id, body=None, params=None):
for param in (index, doc_type, id): if (param in SKIP_IN_PATH): raise ValueError(u'Empty value passed for a required argument.') return self.transport.perform_request(u'POST', _make_path(index, doc_type, id, u'_update'), params=params, body=body)
'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 information; use `_local` to return informati...
@query_params('flat_settings', 'timeout') def info(self, node_id=None, metric=None, params=None):
return self.transport.perform_request('GET', _make_path('_nodes', node_id, metric), params=params)
'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 information; use `_local` to return informat...
@query_params('completion_fields', 'fielddata_fields', 'fields', 'groups', 'include_segment_file_sizes', 'level', 'timeout', 'types') def stats(self, node_id=None, metric=None, index_metric=None, params=None):
return self.transport.perform_request('GET', _make_path('_nodes', node_id, 'stats', metric, index_metric), params=params)
'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 information from the node y...
@query_params('type', 'ignore_idle_threads', 'interval', 'snapshots', 'threads', 'timeout') def hot_threads(self, node_id=None, params=None):
if (params and ('type_' in params)): params['type'] = params.pop('type_') return self.transport.perform_request('GET', _make_path('_cluster', 'nodes', node_id, 'hotthreads'), params=params)
'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; use `_local` to return information ...
@query_params('human', 'timeout') def usage(self, node_id=None, metric=None, params=None):
return self.transport.perform_request('GET', _make_path('_nodes', node_id, 'usage', metric), params=params)
'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 \'cluster\', valid choices are: \'clust...
@query_params('level', 'local', 'master_timeout', 'timeout', 'wait_for_active_shards', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_nodes', 'wait_for_status') def health(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path('_cluster', 'health', index), params=params)
'The pending cluster tasks API returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html>`_ :arg local: Return local information, do not retrieve the stat...
@query_params('local', 'master_timeout') def pending_tasks(self, params=None):
return self.transport.perform_request('GET', '/_cluster/pending_tasks', params=params)
'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 string to perform the operation ...
@query_params('allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'local', 'master_timeout') def state(self, metric=None, index=None, params=None):
if (index and (not metric)): metric = '_all' return self.transport.perform_request('GET', _make_path('_cluster', 'state', metric, index), params=params)
'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 comma-separated list of node IDs...
@query_params('flat_settings', 'timeout') def stats(self, node_id=None, params=None):
url = '/_cluster/stats' if node_id: url = _make_path('_cluster/stats/nodes', node_id) return self.transport.perform_request('GET', url, params=params)
'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 operation only and return the result...
@query_params('dry_run', 'explain', 'master_timeout', 'metric', 'retry_failed', 'timeout') def reroute(self, body=None, params=None):
return self.transport.perform_request('POST', '/_cluster/reroute', params=params, body=body)
'Get cluster settings. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_ :arg flat_settings: Return settings in flat format (default: false) :arg include_defaults: Whether to return all default clusters setting., default False :arg master_timeout: Explicit operation timeou...
@query_params('flat_settings', 'include_defaults', 'master_timeout', 'timeout') def get_settings(self, params=None):
return self.transport.perform_request('GET', '/_cluster/settings', params=params)
'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 flat format (default: false) :arg m...
@query_params('flat_settings', 'master_timeout', 'timeout') def put_settings(self, body=None, params=None):
return self.transport.perform_request('PUT', '/_cluster/settings', params=params, body=body)
'`<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 sizes (default: false) :arg include_yes_...
@query_params('include_disk_info', 'include_yes_decisions') def allocation_explain(self, body=None, params=None):
return self.transport.perform_request('GET', '/_cluster/allocation/explain', params=params, body=body)
'`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-remote-info.html>`_'
@query_params() def info(self, params=None):
return self.transport.perform_request('GET', '/_remote/info', params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html>`_ :arg name: A comma-separated list of alias names to return :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: Return help information, default False :ar...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def aliases(self, name=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'aliases', name), params=params)
'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 information :arg bytes: The unit in which to...
@query_params('bytes', 'format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def allocation(self, node_id=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'allocation', node_id), params=params)
'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: a short version of the Accept header, e.g....
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def count(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'count', index), params=params)
'health is a terse, one-line representation of the same information from :meth:`~elasticsearch.client.cluster.ClusterClient.health` API `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html>`_ :arg format: a short version of the Accept header, e.g. json, yaml :arg h: Comma-separated list of ...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'ts', 'v') def health(self, params=None):
return self.transport.perform_request('GET', '/_cat/health', params=params)
'A simple help for the cat api. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html>`_ :arg help: Return help information, default False :arg s: Comma-separated list of column names or column aliases to sort by'
@query_params('help', 's') def help(self, params=None):
return self.transport.perform_request('GET', '/_cat', params=params)
'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, valid choices are: \'b\', \'k\', \'...
@query_params('bytes', 'format', 'h', 'health', 'help', 'local', 'master_timeout', 'pri', 's', 'v') def indices(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'indices', index), params=params)
'Displays the master\'s node ID, bound IP address, and node name. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-master.html>`_ :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: Return help information, default Fa...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def master(self, params=None):
return self.transport.perform_request('GET', '/_cat/master', params=params)
'The nodes command shows the cluster topology. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html>`_ :arg format: a short version of the Accept header, e.g. json, yaml :arg full_id: Return the full node ID instead of the shortened version (default: false) :arg h: Comma-separated list of co...
@query_params('format', 'full_id', 'h', 'help', 'local', 'master_timeout', 's', 'v') def nodes(self, params=None):
return self.transport.perform_request('GET', '/_cat/nodes', params=params)
'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: \'b\', \'k\', \'kb\', \'m\', \'mb\...
@query_params('bytes', 'format', 'h', 'help', 'master_timeout', 's', 'v') def recovery(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'recovery', index), params=params)
'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 format: a short version of the Accept header, e.g. json, yaml :arg h:...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def shards(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'shards', index), params=params)
'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 format: a short version of the Accept header, e.g. json, yaml :arg h: C...
@query_params('format', 'h', 'help', 's', 'v') def segments(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'segments', index), params=params)
'pending_tasks provides the same information as the :meth:`~elasticsearch.client.cluster.ClusterClient.pending_tasks` API in a convenient tabular format. `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-pending-tasks.html>`_ :arg format: a short version of the Accept header, e.g. json, yaml :arg h:...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def pending_tasks(self, params=None):
return self.transport.perform_request('GET', '/_cat/pending_tasks', params=params)
'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 header, e.g. json, yaml :arg h: Comm...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'size', 'v') def thread_pool(self, thread_pool_patterns=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'thread_pool', thread_pool_patterns), params=params)
'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 values, valid choices are: \'b\', \'k\...
@query_params('bytes', 'format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def fielddata(self, fields=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'fielddata', fields), params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html>`_ :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: Return help information, default False :arg local: Return local information, do not retrieve the st...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def plugins(self, params=None):
return self.transport.perform_request('GET', '/_cat/plugins', params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodeattrs.html>`_ :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: Return help information, default False :arg local: Return local information, do not retrieve the ...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def nodeattrs(self, params=None):
return self.transport.perform_request('GET', '/_cat/nodeattrs', params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html>`_ :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: Return help information, default False :arg local: Return local information, do not retrieve t...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def repositories(self, params=None):
return self.transport.perform_request('GET', '/_cat/repositories', params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html>`_ :arg repository: Name of repository from which to fetch the snapshot information :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: Return help info...
@query_params('format', 'h', 'help', 'ignore_unavailable', 'master_timeout', 's', 'v') def snapshots(self, repository, params=None):
if (repository in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'repository'.") return self.transport.perform_request('GET', _make_path('_cat', 'snapshots', repository), params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_ :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. :arg detailed: Return detailed task information (default: false) :arg format: a short version of the Accept header, e.g. json, yaml :arg h:...
@query_params('actions', 'detailed', 'format', 'h', 'help', 'node_id', 'parent_node', 'parent_task', 's', 'v') def tasks(self, params=None):
return self.transport.perform_request('GET', '/_cat/tasks', params=params)
'`<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: Return help information, default Fal...
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v') def templates(self, name=None, params=None):
return self.transport.perform_request('GET', _make_path('_cat', 'templates', name), params=params)
'Create a snapshot in repository `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A snapshot name :arg body: The snapshot definition :arg master_timeout: Explicit operation timeout for connection to master node :arg wait_for_com...
@query_params('master_timeout', 'wait_for_completion') def create(self, repository, snapshot, body=None, params=None):
for param in (repository, snapshot): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path('_snapshot', repository, snapshot), params=params, body=body)
'Deletes a snapshot from a repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A snapshot name :arg master_timeout: Explicit operation timeout for connection to master node'
@query_params('master_timeout') def delete(self, repository, snapshot, params=None):
for param in (repository, snapshot): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('DELETE', _make_path('_snapshot', repository, snapshot), params=params)
'Retrieve information about a snapshot. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a ...
@query_params('ignore_unavailable', 'master_timeout', 'verbose') def get(self, repository, snapshot, params=None):
for param in (repository, snapshot): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('GET', _make_path('_snapshot', repository, snapshot), params=params)
'Removes a shared file system repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A comma-separated list of repository names :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout'
@query_params('master_timeout', 'timeout') def delete_repository(self, repository, params=None):
if (repository in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'repository'.") return self.transport.perform_request('DELETE', _make_path('_snapshot', repository), params=params)
'Return information about registered repositories. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A comma-separated list of repository names :arg local: Return local information, do not retrieve the state from master node (default: false) :arg master_timeout:...
@query_params('local', 'master_timeout') def get_repository(self, repository=None, params=None):
return self.transport.perform_request('GET', _make_path('_snapshot', repository), params=params)
'Registers a shared file system repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg body: The repository definition :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation ti...
@query_params('master_timeout', 'timeout', 'verify') def create_repository(self, repository, body, params=None):
for param in (repository, body): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path('_snapshot', repository), params=params, body=body)
'Restore a snapshot. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A snapshot name :arg body: Details of what to restore :arg master_timeout: Explicit operation timeout for connection to master node :arg wait_for_completion: ...
@query_params('master_timeout', 'wait_for_completion') def restore(self, repository, snapshot, body=None, params=None):
for param in (repository, snapshot): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('POST', _make_path('_snapshot', repository, snapshot, '_restore'), params=params, body=body)
'Return information about all currently running snapshots. By specifying a repository name, it\'s possible to limit the results to a particular repository. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg snapshot: A comma-separated list ...
@query_params('ignore_unavailable', 'master_timeout') def status(self, repository=None, snapshot=None, params=None):
return self.transport.perform_request('GET', _make_path('_snapshot', repository, snapshot, '_status'), params=params)
'Returns a list of nodes where repository was successfully verified or an error message if verification process failed. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection to master n...
@query_params('master_timeout', 'timeout') def verify_repository(self, repository, params=None):
if (repository in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'repository'.") return self.transport.perform_request('POST', _make_path('_snapshot', repository, '_verify'), params=params)
'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 which the analysis should...
@query_params('format', 'prefer_local') def analyze(self, index=None, body=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_analyze'), params=params, body=body)
'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 to perform the operation on all indic...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable') def refresh(self, index=None, params=None):
return self.transport.perform_request('POST', _make_path(index, '_refresh'), params=params)
'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 expression resolves into no concrete ...
@query_params('allow_no_indices', 'expand_wildcards', 'force', 'ignore_unavailable', 'wait_if_ongoing') def flush(self, index=None, params=None):
return self.transport.perform_request('POST', _make_path(index, '_flush'), params=params)
'Create an index in Elasticsearch. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html>`_ :arg index: The name of the index :arg body: The configuration for the index (`settings` and `mappings`) :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit o...
@query_params('master_timeout', 'timeout', 'update_all_types', 'wait_for_active_shards') def create(self, index, body=None, params=None):
if (index in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'index'.") return self.transport.perform_request('PUT', _make_path(index), params=params, body=body)
'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 concrete indices (default: false...
@query_params('allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'include_defaults', 'local') def get(self, index, feature=None, params=None):
if (index in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'index'.") return self.transport.perform_request('GET', _make_path(index, feature), params=params)
'Open a closed index to make it available for search. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html>`_ :arg index: The name of the index :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout') def open(self, index, params=None):
if (index in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'index'.") return self.transport.perform_request('POST', _make_path(index, '_open'), params=params)
'Close an index to remove it\'s overhead from the cluster. Closed index is blocked for read/write operations. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html>`_ :arg index: The name of the index :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves i...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout') def close(self, index, params=None):
if (index in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'index'.") return self.transport.perform_request('POST', _make_path(index, '_close'), params=params)
'Delete an index in Elasticsearch `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html>`_ :arg index: A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices :arg allow_no_indices: Ignore if a wildcard expression resolves to no concrete indices (...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout') def delete(self, index, params=None):
if (index in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'index'.") return self.transport.perform_request('DELETE', _make_path(index), params=params)
'Return a boolean indicating whether given index exists. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html>`_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves to no concrete indices (default: false) :arg expand_wildcards...
@query_params('allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'include_defaults', 'local') def exists(self, index, params=None):
if (index in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'index'.") return self.transport.perform_request('HEAD', _make_path(index), params=params)
'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 of document types to check :arg allow...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local') def exists_type(self, index, doc_type, params=None):
for param in (index, doc_type): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('HEAD', _make_path(index, '_mapping', doc_type), params=params)
'Register specific mapping definition for a specific type. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html>`_ :arg doc_type: The name of the document type :arg body: The mapping definition :arg index: A comma-separated list of index names the mapping should be added to (support...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'master_timeout', 'timeout', 'update_all_types') def put_mapping(self, doc_type, body, index=None, params=None):
for param in (doc_type, body): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path(index, '_mapping', doc_type), params=params, body=body)
'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 ignore if a wildcard indices expre...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local') def get_mapping(self, index=None, doc_type=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_mapping', doc_type), params=params)
'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 document types :arg allow_no_indic...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'include_defaults', 'local') def get_field_mapping(self, fields, index=None, doc_type=None, params=None):
if (fields in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'fields'.") return self.transport.perform_request('GET', _make_path(index, '_mapping', doc_type, 'field', fields), params=params)
'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 indices. :arg name: The name of the alias t...
@query_params('master_timeout', 'timeout') def put_alias(self, index, name, body=None, params=None):
for param in (index, name): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path(index, '_alias', name), params=params, body=body)
'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_indices: Whether to ignore if a w...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local') def exists_alias(self, index=None, name=None, params=None):
return self.transport.perform_request('HEAD', _make_path(index, '_alias', name), params=params)
'Retrieve a specified alias. `<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_indices: Whether to ignore if a wildcard indices expression r...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'local') def get_alias(self, index=None, name=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_alias', name), params=params)
'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 timeout: Request timeout'
@query_params('master_timeout', 'timeout') def update_aliases(self, body, params=None):
if (body in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request('POST', '/_aliases', params=params, body=body)
'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 wildcards); use `_all` to delete all aliase...
@query_params('master_timeout', 'timeout') def delete_alias(self, index, name, params=None):
for param in (index, name): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('DELETE', _make_path(index, '_alias', name), params=params)
'Create an index template that will automatically be applied to new indices created. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_ :arg name: The name of the template :arg body: The template definition :arg create: Whether the index template should only be added if new or ca...
@query_params('create', 'flat_settings', 'master_timeout', 'order', 'timeout') def put_template(self, name, body, params=None):
for param in (name, body): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path('_template', name), params=params, body=body)
'Return a boolean indicating whether given template exists. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: false) :arg local: Return local information, do ...
@query_params('flat_settings', 'local', 'master_timeout') def exists_template(self, name, params=None):
if (name in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'name'.") return self.transport.perform_request('HEAD', _make_path('_template', name), params=params)
'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 retrieve the state from master node (de...
@query_params('flat_settings', 'local', 'master_timeout') def get_template(self, name=None, params=None):
return self.transport.perform_request('GET', _make_path('_template', name), params=params)
'Delete 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 master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout'
@query_params('master_timeout', 'timeout') def delete_template(self, name, params=None):
if (name in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'name'.") return self.transport.perform_request('DELETE', _make_path('_template', name), params=params)
'Retrieve settings for one or more (or all) indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg name: The name of the settings that should be incl...
@query_params('allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'include_defaults', 'local') def get_settings(self, index=None, name=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_settings', name), params=params)
'Change specific index level settings in real time. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html>`_ :arg body: The index settings to be updated :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allo...
@query_params('allow_no_indices', 'expand_wildcards', 'flat_settings', 'ignore_unavailable', 'master_timeout', 'preserve_existing') def put_settings(self, body, index=None, params=None):
if (body in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request('PUT', _make_path(index, '_settings'), params=params, body=body)
'Retrieve statistics on different operations happening on an index. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg metric: Limit the information returned the...
@query_params('completion_fields', 'fielddata_fields', 'fields', 'groups', 'include_segment_file_sizes', 'level', 'types') def stats(self, index=None, metric=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_stats', metric), params=params)
'Provide low level segments information that a Lucene index (shard level) is built with. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-segments.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allow_no_indices: ...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'operation_threading', 'verbose') def segments(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_segments'), params=params)
'Validate a potentially expensive query without executing it. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-validate.html>`_ :arg index: A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices :arg doc_type: A comma-se...
@query_params('all_shards', 'allow_no_indices', 'analyze_wildcard', 'analyzer', 'default_operator', 'df', 'expand_wildcards', 'explain', 'ignore_unavailable', 'lenient', 'operation_threading', 'q', 'rewrite') def validate_query(self, index=None, doc_type=None, body=None, params=None):
return self.transport.perform_request('GET', _make_path(index, doc_type, '_validate', 'query'), params=params, body=body)
'Clear either all caches or specific cached associated with one ore more indices. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html>`_ :arg index: A comma-separated list of index name to limit the operation :arg allow_no_indices: Whether to ignore if a wildcard indices expression ...
@query_params('allow_no_indices', 'expand_wildcards', 'field_data', 'fielddata', 'fields', 'ignore_unavailable', 'query', 'recycler', 'request') def clear_cache(self, index=None, params=None):
return self.transport.perform_request('POST', _make_path(index, '_cache', 'clear'), params=params)
'The indices recovery API provides insight into on-going shard recoveries. Recovery status may be reported for specific indices, or cluster-wide. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-recovery.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to per...
@query_params('active_only', 'detailed') def recovery(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_recovery'), params=params)
'Upgrade one or more indices to the latest format through an API. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a w...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'only_ancient_segments', 'wait_for_completion') def upgrade(self, index=None, params=None):
return self.transport.perform_request('POST', _make_path(index, '_upgrade'), params=params)
'Monitor how much of one or more index is upgraded. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indice...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable') def get_upgrade(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_upgrade'), params=params)
'Perform a normal flush, then add a generated unique marker (sync_id) to all shards. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-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 w...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable') def flush_synced(self, index=None, params=None):
return self.transport.perform_request('POST', _make_path(index, '_flush', 'synced'), params=params)
'Provides store information for shard copies of indices. Store information reports on which nodes shard copies exist, the shard copy version, indicating how recent they are, and any exceptions encountered while opening the shard index or from earlier engine failure. `<http://www.elastic.co/guide/en/elasticsearch/refere...
@query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable', 'operation_threading', 'status') def shard_stores(self, index=None, params=None):
return self.transport.perform_request('GET', _make_path(index, '_shard_stores'), params=params)
'The force merge API allows to force merging of one or more indices through an API. The merge relates to the number of segments a Lucene index holds within each shard. The force merge operation allows to reduce the number of segments by merging them. This call will block until the merge is complete. If the http connect...
@query_params('allow_no_indices', 'expand_wildcards', 'flush', 'ignore_unavailable', 'max_num_segments', 'only_expunge_deletes', 'operation_threading', 'wait_for_merge') def forcemerge(self, index=None, params=None):
return self.transport.perform_request('POST', _make_path(index, '_forcemerge'), params=params)
'The shrink index API allows you to shrink an existing index into a new index with fewer primary shards. The number of primary shards in the target index must be a factor of the shards in the source index. For example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an index with 15 primary...
@query_params('master_timeout', 'timeout', 'wait_for_active_shards') def shrink(self, index, target, body=None, params=None):
for param in (index, target): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path(index, '_shrink', target), params=params, body=body)
'The rollover index API rolls an alias over to a new index when the existing index is considered to be too large or too old. The API accepts a single alias name and a list of conditions. The alias must point to a single index only. If the index satisfies the specified conditions then a new index is created and the alia...
@query_params('dry_run', 'master_timeout', 'timeout', 'wait_for_active_shards') def rollover(self, alias, new_index=None, body=None, params=None):
if (alias in SKIP_IN_PATH): raise ValueError("Empty value passed for a required argument 'alias'.") return self.transport.perform_request('POST', _make_path(alias, '_rollover', new_index), params=params, body=body)
'`<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'
@query_params('master_timeout') def get_pipeline(self, id=None, params=None):
return self.transport.perform_request('GET', _make_path('_ingest', 'pipeline', id), params=params)
'`<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_ :arg id: Pipeline ID :arg body: The ingest definition :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout'
@query_params('master_timeout', 'timeout') def put_pipeline(self, id, body, params=None):
for param in (id, body): if (param in SKIP_IN_PATH): raise ValueError('Empty value passed for a required argument.') return self.transport.perform_request('PUT', _make_path('_ingest', 'pipeline', id), params=params, body=body)