summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources/scenario_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-02-15 10:58:36 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-02-15 10:58:36 +0800
commit1a90aada2b27e69a64c83c2d997df23f86e44285 (patch)
tree1f5ea750666294e4f8547bb352da7b8a821d5533 /testapi/opnfv_testapi/resources/scenario_handlers.py
parent44afde12259d551b74cd0a5d66637e53443ad045 (diff)
implement delete and related unittest
JIRA: RELENG-163 Change-Id: I7fe45f3e92c3dc5f5b32582561249150a2cdb8cf Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources/scenario_handlers.py')
-rw-r--r--testapi/opnfv_testapi/resources/scenario_handlers.py11
1 files changed, 11 insertions, 0 deletions
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