From 961f6b54b3a5f7930c7b5edb2e5a7fda64ed37b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Krawaczy=C5=84ski?= Date: Thu, 26 Oct 2017 14:51:37 +0200 Subject: [PATCH] Update tasks API (#659) * Update cat.py * Update tasks.py --- elasticsearch/client/cat.py | 9 ++++----- elasticsearch/client/tasks.py | 16 +++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/elasticsearch/client/cat.py b/elasticsearch/client/cat.py index 5b3801a1..d6911714 100644 --- a/elasticsearch/client/cat.py +++ b/elasticsearch/client/cat.py @@ -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 diff --git a/elasticsearch/client/tasks.py b/elasticsearch/client/tasks.py index b216aa3a..a0cda685 100644 --- a/elasticsearch/client/tasks.py +++ b/elasticsearch/client/tasks.py @@ -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): """ ``_ @@ -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',