From 1a90aada2b27e69a64c83c2d997df23f86e44285 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 15 Feb 2017 10:58:36 +0800 Subject: implement delete and related unittest JIRA: RELENG-163 Change-Id: I7fe45f3e92c3dc5f5b32582561249150a2cdb8cf Signed-off-by: SerenaFeng --- testapi/opnfv_testapi/resources/scenario_handlers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testapi/opnfv_testapi/resources/scenario_handlers.py') diff --git a/testapi/opnfv_testapi/resources/scenario_handlers.py b/testapi/opnfv_testapi/resources/scenario_handlers.py index a8c1a94..7c8c333 100644 --- a/testapi/opnfv_testapi/resources/scenario_handlers.py +++ b/testapi/opnfv_testapi/resources/scenario_handlers.py @@ -116,6 +116,17 @@ class ScenarioGURHandler(GenericScenarioHandler): db_keys = ['name'] self._update(query, db_keys) + @swagger.operation(nickname="deleteScenarioByName") + def delete(self, name): + """ + @description: delete a scenario by name + @return 200: delete success + @raise 404: scenario not exist: + """ + + query = {'name': name} + self._delete(query) + def _update_query(self, keys, data): query = dict() equal = True -- cgit 1.2.3-korg