Update tasks API (#659)

* Update cat.py

* Update tasks.py
This commit is contained in:
Patryk Krawaczyński
2017-10-26 14:51:37 +02:00
committed by Honza Král
parent 40b0a68b82
commit 961f6b54b3
2 changed files with 11 additions and 14 deletions
+4 -5
View File
@@ -402,8 +402,8 @@ class CatClient(NamespacedClient):
return self.transport.perform_request('GET', _make_path('_cat',
'snapshots', repository), params=params)
@query_params('actions', 'detailed', 'format', 'h', 'help', 'node_id',
'parent_node', 'parent_task', 's', 'v')
@query_params('actions', 'detailed', 'format', 'h', 'help', 'nodes',
'parent_task_id', 's', 'v')
def tasks(self, params=None):
"""
@@ -415,12 +415,11 @@ class CatClient(NamespacedClient):
: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 node_id: A comma-separated list of node IDs or names to limit the
: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
: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_id: Return tasks with specified parent task id. Set to -1
to return all.
:arg s: Comma-separated list of column names or column aliases to sort
by
+7 -9
View File
@@ -1,8 +1,8 @@
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class TasksClient(NamespacedClient):
@query_params('actions', 'detailed', 'group_by', 'node_id', 'parent_node',
'parent_task', 'wait_for_completion')
@query_params('actions', 'detailed', 'group_by', 'nodes',
'parent_task_id', 'wait_for_completion')
def list(self, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
@@ -12,19 +12,18 @@ class TasksClient(NamespacedClient):
:arg detailed: Return detailed task information (default: false)
:arg group_by: Group tasks by nodes or parent/child relationships,
default 'nodes', valid choices are: 'nodes', 'parents'
:arg node_id: A comma-separated list of node IDs or names to limit the
: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
:arg parent_node: Return tasks with specified parent node.
:arg parent_task: Return tasks with specified parent task id
:arg parent_task_id: Return tasks with specified parent task id
(node_id:task_number). Set to -1 to return all.
:arg wait_for_completion: Wait for the matching tasks to complete
(default: false)
"""
return self.transport.perform_request('GET', '/_tasks', params=params)
@query_params('actions', 'node_id', 'parent_node', 'parent_task')
@query_params('actions', 'nodes', 'parent_task_id')
def cancel(self, task_id=None, params=None):
"""
@@ -34,12 +33,11 @@ class TasksClient(NamespacedClient):
(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 limit the
: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
:arg parent_node: Cancel tasks with specified parent node.
:arg parent_task: Cancel tasks with specified parent task id
:arg parent_task_id: Cancel tasks with specified parent task id
(node_id:task_number). Set to -1 to cancel all.
"""
return self.transport.perform_request('POST', _make_path('_tasks',