Updated API
This commit is contained in:
+131
-45
@@ -1,106 +1,123 @@
|
|||||||
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
|
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
|
||||||
|
|
||||||
class CatClient(NamespacedClient):
|
class CatClient(NamespacedClient):
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def aliases(self, name=None, params=None):
|
def aliases(self, name=None, params=None):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html>`_
|
||||||
|
|
||||||
:arg name: A comma-separated list of alias names to return
|
: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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'aliases', name), params=params)
|
'aliases', name), params=params)
|
||||||
|
|
||||||
@query_params('bytes', 'h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('bytes', 'format', 'h', 'help', 'local', 'master_timeout',
|
||||||
|
's', 'v')
|
||||||
def allocation(self, node_id=None, params=None):
|
def allocation(self, node_id=None, params=None):
|
||||||
"""
|
"""
|
||||||
Allocation provides a snapshot of how shards have located around the
|
Allocation provides a snapshot of how shards have located around the
|
||||||
cluster and the state of disk usage.
|
cluster and the state of disk usage.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
|
`<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
|
:arg node_id: A comma-separated list of node IDs or names to limit the
|
||||||
returned information
|
returned information
|
||||||
:arg bytes: The unit in which to display byte values, valid choices are:
|
:arg bytes: The unit in which to display byte values, valid choices are:
|
||||||
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
|
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
|
||||||
|
:arg format: a short version of the Accept header, e.g. json, yaml
|
||||||
:arg h: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'allocation', node_id), params=params)
|
'allocation', node_id), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def count(self, index=None, params=None):
|
def count(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
Count provides quick access to the document count of the entire cluster,
|
Count provides quick access to the document count of the entire cluster,
|
||||||
or individual indices.
|
or individual indices.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
|
`<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
|
:arg index: A comma-separated list of index names to limit the returned
|
||||||
information
|
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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat', 'count',
|
||||||
'count', index), params=params)
|
index), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'ts', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'ts',
|
||||||
|
'v')
|
||||||
def health(self, params=None):
|
def health(self, params=None):
|
||||||
"""
|
"""
|
||||||
health is a terse, one-line representation of the same information from
|
health is a terse, one-line representation of the same information from
|
||||||
:meth:`~elasticsearch.client.cluster.ClusterClient.health` API
|
:meth:`~elasticsearch.client.cluster.ClusterClient.health` API
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html>`_
|
`<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 column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg ts: Set to false to disable timestamping, default True
|
:arg ts: Set to false to disable timestamping, default True
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/health',
|
return self.transport.perform_request('GET', '/_cat/health',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('help')
|
@query_params('help', 's')
|
||||||
def help(self, params=None):
|
def help(self, params=None):
|
||||||
"""
|
"""
|
||||||
A simple help for the cat api.
|
A simple help for the cat api.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html>`_
|
||||||
|
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat', params=params)
|
return self.transport.perform_request('GET', '/_cat', params=params)
|
||||||
|
|
||||||
@query_params('bytes', 'format', 'h', 'health', 'help', 'local',
|
@query_params('bytes', 'format', 'h', 'health', 'help', 'local',
|
||||||
'master_timeout', 'pri', 'v')
|
'master_timeout', 'pri', 's', 'v')
|
||||||
def indices(self, index=None, params=None):
|
def indices(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
The indices command provides a cross-section of each index.
|
The indices command provides a cross-section of each index.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
|
`<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
|
:arg index: A comma-separated list of index names to limit the returned
|
||||||
information
|
information
|
||||||
:arg bytes: The unit in which to display byte values, valid choices are:
|
:arg bytes: The unit in which to display byte values, valid choices are:
|
||||||
'b', 'k', 'm', 'g'
|
'b', 'k', 'm', 'g'
|
||||||
|
:arg format: a short version of the Accept header, e.g. json, yaml
|
||||||
:arg h: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg health: A health status ("green", "yellow", or "red" to filter only
|
:arg health: A health status ("green", "yellow", or "red" to filter only
|
||||||
indices matching the specified health status, default None, valid
|
indices matching the specified health status, default None, valid
|
||||||
@@ -112,232 +129,279 @@ class CatClient(NamespacedClient):
|
|||||||
node
|
node
|
||||||
:arg pri: Set to true to return stats only for primary shards, default
|
:arg pri: Set to true to return stats only for primary shards, default
|
||||||
False
|
False
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'indices', index), params=params)
|
'indices', index), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def master(self, params=None):
|
def master(self, params=None):
|
||||||
"""
|
"""
|
||||||
Displays the master's node ID, bound IP address, and node name.
|
Displays the master's node ID, bound IP address, and node name.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-master.html>`_
|
`<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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/master',
|
return self.transport.perform_request('GET', '/_cat/master',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'full_id', 'h', 'help', 'local', 'master_timeout',
|
||||||
|
's', 'v')
|
||||||
def nodes(self, params=None):
|
def nodes(self, params=None):
|
||||||
"""
|
"""
|
||||||
The nodes command shows the cluster topology.
|
The nodes command shows the cluster topology.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html>`_
|
`<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 column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/nodes',
|
return self.transport.perform_request('GET', '/_cat/nodes',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('bytes', 'h', 'help', 'master_timeout', 'v')
|
@query_params('bytes', 'format', 'h', 'help', 'master_timeout', 's', 'v')
|
||||||
def recovery(self, index=None, params=None):
|
def recovery(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
recovery is a view of shard replication.
|
recovery is a view of shard replication.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
|
`<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
|
:arg index: A comma-separated list of index names to limit the returned
|
||||||
information
|
information
|
||||||
:arg bytes: The unit in which to display byte values, valid choices are:
|
:arg bytes: The unit in which to display byte values, valid choices are:
|
||||||
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
|
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
|
||||||
|
:arg format: a short version of the Accept header, e.g. json, yaml
|
||||||
:arg h: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'recovery', index), params=params)
|
'recovery', index), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def shards(self, index=None, params=None):
|
def shards(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
The shards command is the detailed view of what nodes contain which shards.
|
The shards command is the detailed view of what nodes contain which shards.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
|
`<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
|
:arg index: A comma-separated list of index names to limit the returned
|
||||||
information
|
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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'shards', index), params=params)
|
'shards', index), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'v')
|
@query_params('format', 'h', 'help', 's', 'v')
|
||||||
def segments(self, index=None, params=None):
|
def segments(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
The segments command is the detailed view of Lucene segments per index.
|
The segments command is the detailed view of Lucene segments per index.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
|
`<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
|
:arg index: A comma-separated list of index names to limit the returned
|
||||||
information
|
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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'segments', index), params=params)
|
'segments', index), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def pending_tasks(self, params=None):
|
def pending_tasks(self, params=None):
|
||||||
"""
|
"""
|
||||||
pending_tasks provides the same information as the
|
pending_tasks provides the same information as the
|
||||||
:meth:`~elasticsearch.client.cluster.ClusterClient.pending_tasks` API
|
:meth:`~elasticsearch.client.cluster.ClusterClient.pending_tasks` API
|
||||||
in a convenient tabular format.
|
in a convenient tabular format.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-pending-tasks.html>`_
|
`<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: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/pending_tasks',
|
return self.transport.perform_request('GET', '/_cat/pending_tasks',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'size',
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'size',
|
||||||
'thread_pool_patterns', 'v')
|
'v')
|
||||||
def thread_pool(self, thread_pools=None, params=None):
|
def thread_pool(self, thread_pool_patterns=None, params=None):
|
||||||
"""
|
"""
|
||||||
Get information about thread pools.
|
Get information about thread pools.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
|
`<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: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg size: The multiplier in which to display values, valid choices are:
|
:arg size: The multiplier in which to display values, valid choices are:
|
||||||
'', 'k', 'm', 'g', 't', 'p'
|
'', 'k', 'm', 'g', 't', 'p'
|
||||||
:arg thread_pool_patterns: A comma-separated list of regular-expressions
|
|
||||||
to filter the thread pools in the output
|
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'thread_pool', thread_pools), params=params)
|
'thread_pool', thread_pool_patterns), params=params)
|
||||||
|
|
||||||
@query_params('bytes', 'h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('bytes', 'format', 'h', 'help', 'local', 'master_timeout',
|
||||||
|
's', 'v')
|
||||||
def fielddata(self, fields=None, params=None):
|
def fielddata(self, fields=None, params=None):
|
||||||
"""
|
"""
|
||||||
Shows information about currently loaded fielddata on a per-node basis.
|
Shows information about currently loaded fielddata on a per-node basis.
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
|
||||||
|
|
||||||
:arg fields: A comma-separated list of fields to return the fielddata
|
:arg fields: A comma-separated list of fields to return the fielddata
|
||||||
size
|
size
|
||||||
:arg bytes: The unit in which to display byte values, valid choices are:
|
:arg bytes: The unit in which to display byte values, valid choices are:
|
||||||
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
|
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
|
||||||
|
:arg format: a short version of the Accept header, e.g. json, yaml
|
||||||
:arg h: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'fielddata', fields), params=params)
|
'fielddata', fields), params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def plugins(self, params=None):
|
def plugins(self, params=None):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html>`_
|
`<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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/plugins',
|
return self.transport.perform_request('GET', '/_cat/plugins',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def nodeattrs(self, params=None):
|
def nodeattrs(self, params=None):
|
||||||
"""
|
"""
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodeattrs.html>`_
|
|
||||||
|
|
||||||
|
`<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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node (default: false)
|
master node (default: false)
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/nodeattrs',
|
return self.transport.perform_request('GET', '/_cat/nodeattrs',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'local', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
def repositories(self, params=None):
|
def repositories(self, params=None):
|
||||||
"""
|
"""
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html>`_
|
|
||||||
|
|
||||||
|
`<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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg local: Return local information, do not retrieve the state from
|
:arg local: Return local information, do not retrieve the state from
|
||||||
master node, default False
|
master node, default False
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/repositories',
|
return self.transport.perform_request('GET', '/_cat/repositories',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
@query_params('h', 'help', 'ignore_unavailable', 'master_timeout', 'v')
|
@query_params('format', 'h', 'help', 'ignore_unavailable', 'master_timeout',
|
||||||
|
's', 'v')
|
||||||
def snapshots(self, repository=None, params=None):
|
def snapshots(self, repository=None, params=None):
|
||||||
"""
|
"""
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html>`_
|
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html>`_
|
||||||
|
|
||||||
:arg repository: Name of repository from which to fetch the snapshot
|
:arg repository: Name of repository from which to fetch the snapshot
|
||||||
information
|
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 h: Comma-separated list of column names to display
|
||||||
:arg help: Return help information, default False
|
:arg help: Return help information, default False
|
||||||
:arg ignore_unavailable: Set to true to ignore unavailable snapshots,
|
:arg ignore_unavailable: Set to true to ignore unavailable snapshots,
|
||||||
default False
|
default False
|
||||||
:arg master_timeout: Explicit operation timeout for connection to master
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
node
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', _make_path('_cat',
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
'snapshots', repository), params=params)
|
'snapshots', repository), params=params)
|
||||||
|
|
||||||
@query_params('actions', 'detailed', 'format', 'h', 'help', 'node_id',
|
@query_params('actions', 'detailed', 'format', 'h', 'help', 'node_id',
|
||||||
'parent_node', 'parent_task', 'v')
|
'parent_node', 'parent_task', 's', 'v')
|
||||||
def tasks(self, params=None):
|
def tasks(self, params=None):
|
||||||
"""
|
"""
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
|
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
|
||||||
|
|
||||||
:arg actions: A comma-separated list of actions that should be returned.
|
:arg actions: A comma-separated list of actions that should be returned.
|
||||||
Leave empty to return all.
|
Leave empty to return all.
|
||||||
@@ -352,8 +416,30 @@ class CatClient(NamespacedClient):
|
|||||||
:arg parent_node: Return tasks with specified parent node.
|
:arg parent_node: Return tasks with specified parent node.
|
||||||
:arg parent_task: Return tasks with specified parent task id. Set to -1
|
:arg parent_task: Return tasks with specified parent task id. Set to -1
|
||||||
to return all.
|
to return all.
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
:arg v: Verbose mode. Display column headers, default False
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request('GET', '/_cat/tasks',
|
return self.transport.perform_request('GET', '/_cat/tasks',
|
||||||
params=params)
|
params=params)
|
||||||
|
|
||||||
|
@query_params('format', 'h', 'help', 'local', 'master_timeout', 's', 'v')
|
||||||
|
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-separated list of column names to display
|
||||||
|
:arg help: Return help information, default False
|
||||||
|
:arg local: Return local information, do not retrieve the state from
|
||||||
|
master node (default: false)
|
||||||
|
:arg master_timeout: Explicit operation timeout for connection to master
|
||||||
|
node
|
||||||
|
:arg s: Comma-separated list of column names or column aliases to sort
|
||||||
|
by
|
||||||
|
:arg v: Verbose mode. Display column headers, default False
|
||||||
|
"""
|
||||||
|
return self.transport.perform_request('GET', _make_path('_cat',
|
||||||
|
'templates', name), params=params)
|
||||||
|
|
||||||
|
|||||||
@@ -870,7 +870,8 @@ class IndicesClient(NamespacedClient):
|
|||||||
return self.transport.perform_request('PUT', _make_path(index,
|
return self.transport.perform_request('PUT', _make_path(index,
|
||||||
'_shrink', target), params=params, body=body)
|
'_shrink', target), params=params, body=body)
|
||||||
|
|
||||||
@query_params('master_timeout', 'timeout', 'wait_for_active_shards')
|
@query_params('dry_run', 'master_timeout', 'timeout',
|
||||||
|
'wait_for_active_shards')
|
||||||
def rollover(self, alias, new_index=None, body=None, params=None):
|
def rollover(self, alias, new_index=None, body=None, params=None):
|
||||||
"""
|
"""
|
||||||
The rollover index API rolls an alias over to a new index when the
|
The rollover index API rolls an alias over to a new index when the
|
||||||
@@ -885,6 +886,9 @@ class IndicesClient(NamespacedClient):
|
|||||||
:arg alias: The name of the alias to rollover
|
:arg alias: The name of the alias to rollover
|
||||||
:arg new_index: The name of the rollover index
|
:arg new_index: The name of the rollover index
|
||||||
:arg body: The conditions that needs to be met for executing rollover
|
:arg body: The conditions that needs to be met for executing rollover
|
||||||
|
:arg dry_run: If set to true the rollover action will only be validated
|
||||||
|
but not actually performed even if a condition matches. The default
|
||||||
|
is false
|
||||||
:arg master_timeout: Specify timeout for connection to master
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
:arg timeout: Explicit operation timeout
|
:arg timeout: Explicit operation timeout
|
||||||
:arg wait_for_active_shards: Set the number of active shards to wait for
|
:arg wait_for_active_shards: Set the number of active shards to wait for
|
||||||
|
|||||||
Reference in New Issue
Block a user