Update API parameters to 5.x

This commit is contained in:
Honza Král
2017-02-08 21:07:29 +01:00
parent a96f5f7284
commit a180459d69
3 changed files with 19 additions and 26 deletions
+8 -14
View File
@@ -564,7 +564,7 @@ class IndicesClient(NamespacedClient):
'_settings'), params=params, body=body) '_settings'), params=params, body=body)
@query_params('completion_fields', 'fielddata_fields', 'fields', 'groups', @query_params('completion_fields', 'fielddata_fields', 'fields', 'groups',
'human', 'level', 'types') 'include_segment_file_sizes', 'level', 'types')
def stats(self, index=None, metric=None, params=None): def stats(self, index=None, metric=None, params=None):
""" """
Retrieve statistics on different operations happening on an index. Retrieve statistics on different operations happening on an index.
@@ -581,8 +581,9 @@ class IndicesClient(NamespacedClient):
`completion` index metric (supports wildcards) `completion` index metric (supports wildcards)
:arg groups: A comma-separated list of search groups for `search` index :arg groups: A comma-separated list of search groups for `search` index
metric metric
:arg human: Whether to return time and byte values in human-readable :arg include_segment_file_sizes: Whether to report the aggregated disk
format., default False usage of each one of the Lucene index files (only applies if segment
stats are requested), default False
:arg level: Return stats aggregated at cluster, index or shard level, :arg level: Return stats aggregated at cluster, index or shard level,
default 'indices', valid choices are: 'cluster', 'indices', 'shards' default 'indices', valid choices are: 'cluster', 'indices', 'shards'
:arg types: A comma-separated list of document types for the `indexing` :arg types: A comma-separated list of document types for the `indexing`
@@ -591,8 +592,8 @@ class IndicesClient(NamespacedClient):
return self.transport.perform_request('GET', _make_path(index, return self.transport.perform_request('GET', _make_path(index,
'_stats', metric), params=params) '_stats', metric), params=params)
@query_params('allow_no_indices', 'expand_wildcards', 'human', @query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable',
'ignore_unavailable', 'operation_threading', 'verbose') 'operation_threading', 'verbose')
def segments(self, index=None, params=None): def segments(self, index=None, params=None):
""" """
Provide low level segments information that a Lucene index (shard level) is built with. Provide low level segments information that a Lucene index (shard level) is built with.
@@ -606,8 +607,6 @@ class IndicesClient(NamespacedClient):
:arg expand_wildcards: Whether to expand wildcard expression to concrete :arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all' choices are: 'open', 'closed', 'none', 'all'
:arg human: Whether to return time and byte values in human-readable
format., default False
:arg ignore_unavailable: Whether specified concrete indices should be :arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed) ignored when unavailable (missing or closed)
:arg operation_threading: TODO: ? :arg operation_threading: TODO: ?
@@ -687,7 +686,7 @@ class IndicesClient(NamespacedClient):
return self.transport.perform_request('POST', _make_path(index, return self.transport.perform_request('POST', _make_path(index,
'_cache', 'clear'), params=params) '_cache', 'clear'), params=params)
@query_params('active_only', 'detailed', 'human') @query_params('active_only', 'detailed')
def recovery(self, index=None, params=None): def recovery(self, index=None, params=None):
""" """
The indices recovery API provides insight into on-going shard The indices recovery API provides insight into on-going shard
@@ -701,8 +700,6 @@ class IndicesClient(NamespacedClient):
going, default False going, default False
:arg detailed: Whether to display detailed information about shard :arg detailed: Whether to display detailed information about shard
recovery, default False recovery, default False
:arg human: Whether to return time and byte values in human-readable
format., default False
""" """
return self.transport.perform_request('GET', _make_path(index, return self.transport.perform_request('GET', _make_path(index,
'_recovery'), params=params) '_recovery'), params=params)
@@ -732,8 +729,7 @@ class IndicesClient(NamespacedClient):
return self.transport.perform_request('POST', _make_path(index, return self.transport.perform_request('POST', _make_path(index,
'_upgrade'), params=params) '_upgrade'), params=params)
@query_params('allow_no_indices', 'expand_wildcards', 'human', @query_params('allow_no_indices', 'expand_wildcards', 'ignore_unavailable')
'ignore_unavailable')
def get_upgrade(self, index=None, params=None): def get_upgrade(self, index=None, params=None):
""" """
Monitor how much of one or more index is upgraded. Monitor how much of one or more index is upgraded.
@@ -747,8 +743,6 @@ class IndicesClient(NamespacedClient):
:arg expand_wildcards: Whether to expand wildcard expression to concrete :arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all' choices are: 'open', 'closed', 'none', 'all'
:arg human: Whether to return time and byte values in human-readable
format., default False
:arg ignore_unavailable: Whether specified concrete indices should be :arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed) ignored when unavailable (missing or closed)
""" """
+10 -11
View File
@@ -1,12 +1,12 @@
from .utils import NamespacedClient, query_params, _make_path from .utils import NamespacedClient, query_params, _make_path
class NodesClient(NamespacedClient): class NodesClient(NamespacedClient):
@query_params('flat_settings', 'human', 'timeout') @query_params('flat_settings', 'timeout')
def info(self, node_id=None, metric=None, params=None): def info(self, node_id=None, metric=None, params=None):
""" """
The cluster nodes info API allows to retrieve one or more (or all) of The cluster nodes info API allows to retrieve one or more (or all) of
the cluster nodes information. the cluster nodes information.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_ `<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 :arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the returned information; use `_local` to return information from the
@@ -15,20 +15,18 @@ class NodesClient(NamespacedClient):
:arg metric: A comma-separated list of metrics you wish returned. Leave :arg metric: A comma-separated list of metrics you wish returned. Leave
empty to return all. empty to return all.
:arg flat_settings: Return settings in flat format (default: false) :arg flat_settings: Return settings in flat format (default: false)
:arg human: Whether to return time and byte values in human-readable
format., default False
:arg timeout: Explicit operation timeout :arg timeout: Explicit operation timeout
""" """
return self.transport.perform_request('GET', _make_path('_nodes', return self.transport.perform_request('GET', _make_path('_nodes',
node_id, metric), params=params) node_id, metric), params=params)
@query_params('completion_fields', 'fielddata_fields', 'fields', 'groups', @query_params('completion_fields', 'fielddata_fields', 'fields', 'groups',
'human', 'level', 'timeout', 'types') 'include_segment_file_sizes', 'level', 'timeout', 'types')
def stats(self, node_id=None, metric=None, index_metric=None, params=None): def stats(self, node_id=None, metric=None, index_metric=None, params=None):
""" """
The cluster nodes stats API allows to retrieve one or more (or all) of The cluster nodes stats API allows to retrieve one or more (or all) of
the cluster nodes statistics. the cluster nodes statistics.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_ `<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 :arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the returned information; use `_local` to return information from the
@@ -46,10 +44,11 @@ class NodesClient(NamespacedClient):
`completion` index metric (supports wildcards) `completion` index metric (supports wildcards)
:arg groups: A comma-separated list of search groups for `search` index :arg groups: A comma-separated list of search groups for `search` index
metric metric
:arg human: Whether to return time and byte values in human-readable :arg include_segment_file_sizes: Whether to report the aggregated disk
format., default False usage of each one of the Lucene index files (only applies if segment
:arg level: Return indices stats aggregated at node, index or shard stats are requested), default False
level, default 'node', valid choices are: 'node', 'indices', :arg level: Return indices stats aggregated at index, node or shard
level, default 'node', valid choices are: 'indices', 'node',
'shards' 'shards'
:arg timeout: Explicit operation timeout :arg timeout: Explicit operation timeout
:arg types: A comma-separated list of document types for the `indexing` :arg types: A comma-separated list of document types for the `indexing`
@@ -63,7 +62,7 @@ class NodesClient(NamespacedClient):
def hot_threads(self, node_id=None, params=None): def hot_threads(self, node_id=None, params=None):
""" """
An API allowing to get the current hot threads on each node in the cluster. An API allowing to get the current hot threads on each node in the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_ `<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 :arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the returned information; use `_local` to return information from the
+1 -1
View File
@@ -47,7 +47,7 @@ def _make_path(*parts):
quote_plus(_escape(p), b',*') for p in parts if p not in SKIP_IN_PATH) quote_plus(_escape(p), b',*') for p in parts if p not in SKIP_IN_PATH)
# parameters that apply to all methods # parameters that apply to all methods
GLOBAL_PARAMS = ('pretty', 'format', 'filter_path') GLOBAL_PARAMS = ('pretty', 'human', 'error_trace', 'format', 'filter_path')
def query_params(*es_query_params): def query_params(*es_query_params):
""" """