From 58fb86a3dae82efd0e6f1bdad7a8c1a2b787f1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Antal?= Date: Mon, 18 Jan 2016 16:55:18 +0100 Subject: [PATCH] Removed unused parameters from api controllers In the Audit controller (watcher/api/controllers/v1/audit.py), we have an unused "audit_uuid" parameter in both get_all() and detail() Similarly, the Action Plan controller (watcher/api/controllers/v1/action_plan.py) has an unused "action_plan_uuid" parameter in both get_all() and detail(). I also removed them from the @wsme_pecan.wsexpose decorator Change-Id: I7f1edfd44dd95c9768249650e19b16fcbe916b89 Closes-Bug: #1534615 --- watcher/api/controllers/v1/action_plan.py | 14 ++++++-------- watcher/api/controllers/v1/audit.py | 12 +++++------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/watcher/api/controllers/v1/action_plan.py b/watcher/api/controllers/v1/action_plan.py index 22be2b4ee..652bf6848 100644 --- a/watcher/api/controllers/v1/action_plan.py +++ b/watcher/api/controllers/v1/action_plan.py @@ -284,9 +284,9 @@ class ActionPlansController(rest.RestController): sort_key=sort_key, sort_dir=sort_dir) - @wsme_pecan.wsexpose(ActionPlanCollection, types.uuid, types.uuid, - int, wtypes.text, wtypes.text, types.uuid) - def get_all(self, action_plan_uuid=None, marker=None, limit=None, + @wsme_pecan.wsexpose(ActionPlanCollection, types.uuid, int, wtypes.text, + wtypes.text, types.uuid) + def get_all(self, marker=None, limit=None, sort_key='id', sort_dir='asc', audit_uuid=None): """Retrieve a list of action plans. @@ -300,14 +300,12 @@ class ActionPlansController(rest.RestController): return self._get_action_plans_collection( marker, limit, sort_key, sort_dir, audit_uuid=audit_uuid) - @wsme_pecan.wsexpose(ActionPlanCollection, types.uuid, types.uuid, - int, wtypes.text, wtypes.text, types.uuid) - def detail(self, action_plan_uuid=None, marker=None, limit=None, + @wsme_pecan.wsexpose(ActionPlanCollection, types.uuid, int, wtypes.text, + wtypes.text, types.uuid) + def detail(self, marker=None, limit=None, sort_key='id', sort_dir='asc', audit_uuid=None): """Retrieve a list of action_plans with detail. - :param action_plan_uuid: UUID of a action plan, to get only - action_plans for that action. :param marker: pagination marker for large data sets. :param limit: maximum number of resources to return in a single result. :param sort_key: column to sort results by. Default: id. diff --git a/watcher/api/controllers/v1/audit.py b/watcher/api/controllers/v1/audit.py index 8a3d5c91b..ca87cc82f 100644 --- a/watcher/api/controllers/v1/audit.py +++ b/watcher/api/controllers/v1/audit.py @@ -292,10 +292,9 @@ class AuditsController(rest.RestController): sort_key=sort_key, sort_dir=sort_dir) - @wsme_pecan.wsexpose(AuditCollection, types.uuid, - types.uuid, int, wtypes.text, + @wsme_pecan.wsexpose(AuditCollection, types.uuid, int, wtypes.text, wtypes.text, wtypes.text) - def get_all(self, audit_uuid=None, marker=None, limit=None, + def get_all(self, marker=None, limit=None, sort_key='id', sort_dir='asc', audit_template=None): """Retrieve a list of audits. @@ -310,13 +309,12 @@ class AuditsController(rest.RestController): sort_dir, audit_template=audit_template) - @wsme_pecan.wsexpose(AuditCollection, types.uuid, - types.uuid, int, wtypes.text, wtypes.text) - def detail(self, audit_uuid=None, marker=None, limit=None, + @wsme_pecan.wsexpose(AuditCollection, types.uuid, int, wtypes.text, + wtypes.text) + def detail(self, marker=None, limit=None, sort_key='id', sort_dir='asc'): """Retrieve a list of audits with detail. - :param audit_uuid: UUID of a audit, to get only audits for that audit. :param marker: pagination marker for large data sets. :param limit: maximum number of resources to return in a single result. :param sort_key: column to sort results by. Default: id.