summaryrefslogtreecommitdiffstats
path: root/api/resources/v2
diff options
context:
space:
mode:
authorJing Lu <lvjing5@huawei.com>2017-08-02 01:20:22 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-02 01:20:22 +0000
commite78324bf2672a694f460e953373f18729c476e8d (patch)
tree6c9da69d55402e3f2c717028db713128aa15f7b9 /api/resources/v2
parentb57da1432fae39ea414c42734e730df329de66e3 (diff)
parentd5ff38b3ff3309cb1fed11266c98aca23001ea44 (diff)
Merge "Add task-args(from yaml file) candidates in /api/v2/yardstick/testcases API"
Diffstat (limited to 'api/resources/v2')
-rw-r--r--api/resources/v2/testcases.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/resources/v2/testcases.py b/api/resources/v2/testcases.py
index b47a8f6b7..316ef2664 100644
--- a/api/resources/v2/testcases.py
+++ b/api/resources/v2/testcases.py
@@ -10,6 +10,8 @@ import logging
import errno
import os
+import jinja2schema
+
from api import ApiResource
from yardstick.common.utils import result_handler
from yardstick.common import constants as consts
@@ -56,7 +58,10 @@ class V2Testcase(ApiResource):
if e.errno == errno.ENOENT:
return result_handler(consts.API_ERROR, 'case does not exist')
- return result_handler(consts.API_SUCCESS, {'testcase': data})
+ options = {k: {'description': '', 'type': v.__class__.__name__}
+ for k, v in jinja2schema.infer(data).items()}
+
+ return result_handler(consts.API_SUCCESS, {'testcase': data, 'args': options})
def delete(self, case_name):
case_path = os.path.join(consts.TESTCASE_DIR, '{}.yaml'.format(case_name))