Skip to content

Update ES client API's for some missing 7 features #949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 141 additions & 19 deletions elasticsearch/client/__init__.py

Large diffs are not rendered by default.

23 changes: 8 additions & 15 deletions elasticsearch/client/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ def aliases(self, name=None, params=None):
"GET", _make_path("_cat", "aliases", name), params=params
)

@query_params(
"bytes", "size", "format", "h", "help", "local", "master_timeout", "s", "v"
)
@query_params("bytes", "format", "h", "help", "local", "master_timeout", "s", "v")
def allocation(self, node_id=None, params=None):
"""
Allocation provides a snapshot of how shards have located around the
Expand All @@ -52,7 +50,7 @@ def allocation(self, node_id=None, params=None):
"GET", _make_path("_cat", "allocation", node_id), params=params
)

@query_params("size", "format", "h", "help", "local", "master_timeout", "s", "v")
@query_params("format", "h", "help", "local", "master_timeout", "s", "v")
def count(self, index=None, params=None):
"""
Count provides quick access to the document count of the entire cluster,
Expand Down Expand Up @@ -111,7 +109,6 @@ def help(self, params=None):

@query_params(
"bytes",
"time",
"size",
"format",
"h",
Expand Down Expand Up @@ -218,16 +215,7 @@ def recovery(self, index=None, params=None):
)

@query_params(
"bytes",
"time",
"size",
"format",
"h",
"help",
"local",
"master_timeout",
"s",
"v",
"bytes", "size", "format", "h", "help", "local", "master_timeout", "s", "v"
)
def shards(self, index=None, params=None):
"""
Expand Down Expand Up @@ -442,6 +430,7 @@ def snapshots(self, repository, params=None):
"h",
"help",
"nodes",
"node_id",
"parent_task_id",
"s",
"v",
Expand All @@ -458,6 +447,10 @@ def tasks(self, params=None):
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg nodes: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes (used for older version of Elasticsearch)
: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 you're connecting to, leave empty to get information from all
nodes
Expand Down
19 changes: 18 additions & 1 deletion elasticsearch/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@

class ClusterClient(NamespacedClient):
@query_params(
"expand_wildcards",
"level",
"local",
"master_timeout",
"timeout",
"wait_for_active_shards",
"wait_for_events",
"wait_for_no_initializing_shards",
"wait_for_no_relocating_shards",
"wait_for_nodes",
"wait_for_status",
"wait_for_no_initializing_shards",
)
def health(self, index=None, params=None):
"""
Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_

:arg index: Limit the information returned to a specific index
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg level: Specify the level of detail for returned information,
default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
:arg local: Return local information, do not retrieve the state from
Expand Down Expand Up @@ -66,6 +70,8 @@ def pending_tasks(self, params=None):
"ignore_unavailable",
"local",
"master_timeout",
"wait_for_metadata_version",
"wait_for_timeout",
)
def state(self, metric=None, index=None, params=None):
"""
Expand All @@ -87,6 +93,10 @@ def state(self, metric=None, index=None, params=None):
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Specify timeout for connection to master
:arg wait_for_metadata_version: Wait for the metadata version to be
equal or greater than the specified metadata version
:arg wait_for_timeout: The maximum time to wait for
wait_for_metadata_version before timing out
"""
if index and not metric:
metric = "_all"
Expand Down Expand Up @@ -174,6 +184,13 @@ def put_settings(self, body=None, params=None):
"PUT", "/_cluster/settings", params=params, body=body
)

@query_params()
def remote_info(self, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html>`_
"""
return self.transport.perform_request("GET", "/_remote/info", params=params)

@query_params("include_disk_info", "include_yes_decisions")
def allocation_explain(self, body=None, params=None):
"""
Expand Down
Loading