From: chenjiankun Date: Thu, 20 Jul 2017 03:36:38 +0000 (+0000) Subject: Add API(v2) to get all test case info X-Git-Tag: opnfv-5.0.RC1~363^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=c23de3d10294b85d6bb54191027fd3be983ce2f7;p=yardstick.git Add API(v2) to get all test case info JIRA: YARDSTICK-743 API: /api/v2/yardstick/testcases METHOD: GET Change-Id: Iced97206cb4c5f68ee8a5729af937e8d45ca6e87 Signed-off-by: chenjiankun --- diff --git a/api/resources/v2/testcases.py b/api/resources/v2/testcases.py index 119d0e230..3277b4c43 100644 --- a/api/resources/v2/testcases.py +++ b/api/resources/v2/testcases.py @@ -4,6 +4,8 @@ import os from api import ApiResource from yardstick.common.utils import result_handler from yardstick.common import constants as consts +from yardstick.benchmark.core import Param +from yardstick.benchmark.core.testcase import Testcase LOG = logging.getLogger(__name__) LOG.setLevel(logging.DEBUG) @@ -11,6 +13,11 @@ LOG.setLevel(logging.DEBUG) class V2Testcases(ApiResource): + def get(self): + param = Param({}) + testcase_list = Testcase().list_all(param) + return result_handler(consts.API_SUCCESS, testcase_list) + def post(self): return self._dispatch_post()