From 27a24e265737c0d67ed5d93e705d250a9e6b855a Mon Sep 17 00:00:00 2001 From: Kirill Izotov Date: Mon, 15 Sep 2014 14:55:32 +0700 Subject: [PATCH] Support naive filtering in python API Change-Id: I10caecf68c73e7c722a9ab93a718b80c588d4d0e --- mistralclient/api/v2/tasks.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mistralclient/api/v2/tasks.py b/mistralclient/api/v2/tasks.py index b5459a81..95d18315 100644 --- a/mistralclient/api/v2/tasks.py +++ b/mistralclient/api/v2/tasks.py @@ -31,8 +31,13 @@ class TaskManager(base.ResourceManager): return self._update('/tasks/%s' % id, data) - def list(self): - return self._list('/tasks', response_key='tasks') + def list(self, execution_id=None): + url = '/tasks' + + if execution_id: + url = '/executions/%s/tasks' % execution_id + + return self._list(url, response_key='tasks') def get(self, id): self._ensure_not_empty(id=id)