Skip to content

Commit b049b68

Browse files
rooterkyberianfxdgear
authored andcommitted
add timeout param to Tasks API (closes elastic#852) (elastic#853)
1 parent de8413f commit b049b68

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

elasticsearch/client/tasks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class TasksClient(NamespacedClient):
44
@query_params('actions', 'detailed', 'group_by', 'nodes',
5-
'parent_task_id', 'wait_for_completion')
5+
'parent_task_id', 'wait_for_completion', 'timeout')
66
def list(self, params=None):
77
"""
88
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
@@ -20,6 +20,7 @@ def list(self, params=None):
2020
(node_id:task_number). Set to -1 to return all.
2121
:arg wait_for_completion: Wait for the matching tasks to complete
2222
(default: false)
23+
:arg timeout: Maximum waiting time for `wait_for_completion`
2324
"""
2425
return self.transport.perform_request('GET', '/_tasks', params=params)
2526

@@ -43,7 +44,7 @@ def cancel(self, task_id=None, params=None):
4344
return self.transport.perform_request('POST', _make_path('_tasks',
4445
task_id, '_cancel'), params=params)
4546

46-
@query_params('wait_for_completion')
47+
@query_params('wait_for_completion', 'timeout')
4748
def get(self, task_id=None, params=None):
4849
"""
4950
Retrieve information for a particular task.
@@ -52,6 +53,7 @@ def get(self, task_id=None, params=None):
5253
:arg task_id: Return the task with specified id (node_id:task_number)
5354
:arg wait_for_completion: Wait for the matching tasks to complete
5455
(default: false)
56+
:arg timeout: Maximum waiting time for `wait_for_completion`
5557
"""
5658
return self.transport.perform_request('GET', _make_path('_tasks',
5759
task_id), params=params)

0 commit comments

Comments
 (0)