Skip to content

Commit dbea8d4

Browse files
nfsechonzakral
authored andcommitted
Update tasks API (#659)
* Update cat.py * Update tasks.py
1 parent 34a12d1 commit dbea8d4

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

elasticsearch/client/cat.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ def snapshots(self, repository=None, params=None):
396396
return self.transport.perform_request('GET', _make_path('_cat',
397397
'snapshots', repository), params=params)
398398

399-
@query_params('actions', 'detailed', 'format', 'h', 'help', 'node_id',
400-
'parent_node', 'parent_task', 's', 'v')
399+
@query_params('actions', 'detailed', 'format', 'h', 'help', 'nodes',
400+
'parent_task_id', 's', 'v')
401401
def tasks(self, params=None):
402402
"""
403403
@@ -409,12 +409,11 @@ def tasks(self, params=None):
409409
:arg format: a short version of the Accept header, e.g. json, yaml
410410
:arg h: Comma-separated list of column names to display
411411
:arg help: Return help information, default False
412-
:arg node_id: A comma-separated list of node IDs or names to limit the
412+
:arg nodes: A comma-separated list of node IDs or names to limit the
413413
returned information; use `_local` to return information from the
414414
node you're connecting to, leave empty to get information from all
415415
nodes
416-
:arg parent_node: Return tasks with specified parent node.
417-
:arg parent_task: Return tasks with specified parent task id. Set to -1
416+
:arg parent_task_id: Return tasks with specified parent task id. Set to -1
418417
to return all.
419418
:arg s: Comma-separated list of column names or column aliases to sort
420419
by

elasticsearch/client/tasks.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
22

33
class TasksClient(NamespacedClient):
4-
@query_params('actions', 'detailed', 'group_by', 'node_id', 'parent_node',
5-
'parent_task', 'wait_for_completion')
6-
def list(self, task_id=None, params=None):
4+
@query_params('actions', 'detailed', 'group_by', 'nodes', 'parent_node',
5+
'parent_task_id', 'wait_for_completion')
6+
def list(self, params=None):
77
"""
88
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
99
@@ -13,20 +13,20 @@ def list(self, task_id=None, params=None):
1313
:arg detailed: Return detailed task information (default: false)
1414
:arg group_by: Group tasks by nodes or parent/child relationships,
1515
default 'nodes', valid choices are: 'nodes', 'parents'
16-
:arg node_id: A comma-separated list of node IDs or names to limit the
16+
:arg nodes: A comma-separated list of node IDs or names to limit the
1717
returned information; use `_local` to return information from the
1818
node you're connecting to, leave empty to get information from all
1919
nodes
2020
:arg parent_node: Return tasks with specified parent node.
21-
:arg parent_task: Return tasks with specified parent task id
21+
:arg parent_task_id: Return tasks with specified parent task id
2222
(node_id:task_number). Set to -1 to return all.
2323
:arg wait_for_completion: Wait for the matching tasks to complete
2424
(default: false)
2525
"""
2626
return self.transport.perform_request('GET', _make_path('_tasks',
2727
task_id), params=params)
2828

29-
@query_params('actions', 'node_id', 'parent_node', 'parent_task')
29+
@query_params('actions', 'nodes', 'parent_task_id')
3030
def cancel(self, task_id=None, params=None):
3131
"""
3232
@@ -36,12 +36,11 @@ def cancel(self, task_id=None, params=None):
3636
(node_id:task_number)
3737
:arg actions: A comma-separated list of actions that should be
3838
cancelled. Leave empty to cancel all.
39-
:arg node_id: A comma-separated list of node IDs or names to limit the
39+
:arg nodes: A comma-separated list of node IDs or names to limit the
4040
returned information; use `_local` to return information from the
4141
node you're connecting to, leave empty to get information from all
4242
nodes
43-
:arg parent_node: Cancel tasks with specified parent node.
44-
:arg parent_task: Cancel tasks with specified parent task id
43+
:arg parent_task_id: Cancel tasks with specified parent task id
4544
(node_id:task_number). Set to -1 to cancel all.
4645
"""
4746
return self.transport.perform_request('POST', _make_path('_tasks',

0 commit comments

Comments
 (0)