aboutsummaryrefslogtreecommitdiffstats
path: root/api/resources/v2
AgeCommit message (Collapse)AuthorFilesLines
2017-08-25Merge "Add function to upload image from local/url in GUI"Jing Lu2-28/+321
2017-08-24Add function to upload image from local/url in GUIchenjiankun2-28/+321
JIRA: YARDSTICK-782 As user, we need to upload image from local/url. If upload image from local, user need to choose local image, then we will load it to openstack. If upload image from url, we will download it and load it to openstack. Change-Id: Ia9a42fda15a1dfc91476643635343a2f77a94a6b Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-15YAML fixesRoss Brattain1-1/+2
There are multiple issues wiht YAML loading. 1. Jinja2 renders None values as a string 'None'. This is not valid YAML we need to render None values to '~' or 'null' which is the native YAML None value. 2. Jinja2 renders dict and lists that contain unicode with u'foo' values. This is not value YAML syntax. Because we are serializing dict and lists into YAML, we need to encode them as valid YAML. We can override Jinja2 finalize to use yaml.dump to dump inline YAML. We use yaml.safe_dump(elem, default_flow_style=True).replace('\n', '') to generate valid single-line YAML dict and list values. But this problem highlights the general difficulties with templating and loading files. We could avoid this Python->Jinja2->YAML->Python issue by directly injecting the list or dict after the YAML is loaded. I'm not sure of the real utility of these templates. 3. On Python 2 YAML loader is rendering all strings as unicode. This does not work for Trex because Trex is broken and badly coded. Trex does type checking against str() which is different for Python 2 and Python 3. The default YAML loader will return native string types, str() or unicode() for Python 2 and Python 3 respectively. The bad Trex codes is in convert_val: https://github.com/cisco-system-traffic-generator/trex-core/blob/master/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py#L674 def convert_val (val): if is_integer(val): return val if type(val) == str: return ipv4_str_to_num (is_valid_ipv4(val)) raise CTRexPacketBuildException(-11,("init val invalid %s ") % val ); This code is doing type(val) == str. This is bad and broken. We can't fix Trex, so we have to render all strings as native str() types The bug here was that the Heat template loader template_format.py was overriding the global YAML loader to always return unicode. We don't want this global override. To fix this we have to use local subclasses of the yaml.SafeLoader class. But in order to dynamically subclass from CSafeLoader or SafeLoader we have to use the type() builtin to define a new class at runtime. Once we have new classes defined, we can safely isolate different YAML constructors and return unicode or not depending on the case. To be consistent we implement a new yaml_loader.py module to centralize all non-Heat template yaml loading to ensure correct uncode/str conversion Change-Id: Iebf9cf78fbda390977c390436b0869e7bbf503eb Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2017-08-11Add real time log view in GUIchenjiankun1-0/+36
JIRA: YARDSTICK-775 We have GUI now, but we can't see real time log in GUI view. So I add real time log view in GUI. Change-Id: Ie83f327ef0a94302afa6b3def764fec6ef5818d1 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-08-02Add task-args(from yaml file) candidates in /api/v2/yardstick/testcases APIchenjiankun1-1/+6
JIRA: YARDSTICK-766 We have the demand to get all task-args candidates in test case yaml file, so that user get easily change it. The response will like: { 'status': 1, 'result': { 'testcase': case content, 'args': { 'image': {'description': '', 'type': 'String'} } } } In this patch, I add jinja2schema 0.1.4 in requirements.txt. Change-Id: I450082402370add5ab29090286f026fe3cc8c36e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-27Merge "Yardstick GUI & GUI deployment"Jing Lu3-2/+5
2017-07-27Yardstick GUI & GUI deploymentchenjiankun3-2/+5
JIRA: YARDSTICK-758 As E release plan, we have the need of yardstick GUI. This patch is GUI front end code and deployment. The backend code is yardstick API. Change-Id: Ib15f78bcc50168c7828beff97256e9939c6da809 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-24Bugfix: missing license in api directorychenjiankun9-1/+65
JIRA: YARDSTICK-759 In api directory, there are many files missing license header. We need to add it. Change-Id: Ia46cf207295007d4eb7fbf0d3319611f256c36bc Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Add API(v2) to get all task infochenjiankun1-0/+10
JIRA: YARDSTICK-754 API: /api/v2/yardstick/tasks METHOD: GET Change-Id: I556b0880674d78d67e0a556c4d95f902131cd027 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Merge "Add API(v2) to run task"Jing Lu1-0/+46
2017-07-21Merge "Add API(v2) to get all images"Jing Lu1-0/+28
2017-07-21Merge "Add API(v2) to load images"Jing Lu1-0/+44
2017-07-21Add API(v2) to run taskchenjiankun1-0/+46
JIRA: YARDSTICK-741 API: /api/v2/yardstick/tasks/<task_id> METHOD: PUT PARAMS: { 'action': 'run' } Change-Id: Ia5340c6ff45e3e7e70ab4597c39476138e7016f2 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Add API(v2) to get all imageschenjiankun1-0/+28
JIRA: YARDSTICK-752 API: /api/v2/yardstick/images METHOD: GET Change-Id: I7b0bba85d875575ee684cc42cad977af91d6f84e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Merge "Add API(v2) to add suite to task"Rex Lee1-0/+23
2017-07-21Add API(v2) to load imageschenjiankun1-0/+44
JIRA: YARDSTICK-751 API: /api/v2/yardstick/images/action METHOD: POST PARAMS: { 'action': 'load_image' } Change-Id: I9554f35c679ae2a861c7922080aa54a1ffc5bac7 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Add API(v2) to add suite to taskchenjiankun1-0/+23
JIRA: YARDSTICK-740 API: /api/v2/yardstick/tasks/<task_id> METHOD: PUT PARAMS: { 'action': 'add_suite', 'args': { 'suite_name': 'opnfv_smoke', 'suite_content': suite_content } } Change-Id: I1f81c45f143b2fea636cb87f60f2f394bf1380b1 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-21Merge "Add API(v2) to delete certain test suite"Rex Lee1-0/+10
2017-07-21Merge "Add API(v2) to get certain test suite info"Rex Lee1-0/+15
2017-07-21Merge "Add API(v2) to get all test suite"Rex Lee1-0/+12
2017-07-21Merge "Add API(v2) to create test suite"Rex Lee1-0/+44
2017-07-21Merge "Add API to delete certain test case"Rex Lee1-0/+11
2017-07-21Merge "Add API(v2) to get certain test case info"Rex Lee1-0/+16
2017-07-21Merge "Add API(v2) to get all test case info"Rex Lee1-0/+7
2017-07-21Merge "Add API(v2) to upload test case"Rex Lee1-0/+28
2017-07-21Merge "Add API(v2) to add case to task"Rex Lee1-0/+23
2017-07-21Merge "Add API(v2) to delete certain task"Jing Lu1-0/+29
2017-07-21Merge "Add API(v2) to get certain task info"Rex Lee1-0/+21
2017-07-21Merge "Add API(v2) to add environment to task"Rex Lee1-0/+44
2017-07-21Merge "Add API(v2) to create task"Rex Lee1-0/+49
2017-07-21Merge "Add API(v2) to delete certain project"Rex Lee1-0/+32
2017-07-21Merge changes from topics 'get_project', 'get_projects'Rex Lee1-0/+32
* changes: Add API(V2) to get certain project info Add API(v2) to get all projects info
2017-07-21Merge "Add API(v2) to create project"Rex Lee1-0/+33
2017-07-20Add API(v2) to delete certain test suitechenjiankun1-0/+10
JIRA: YARDSTICK-749 API: /api/v2/yardstick/testsuites/<suite_name> METHOD: DELETE Change-Id: Idfb5086ab3ac9e7ea6f9512ee5c7f02090d554c0 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to get certain test suite infochenjiankun1-0/+15
JIRA: YARDSTICK-748 API: /api/v2/yardstick/testsuites/<suite_name> METHOD: GET Change-Id: I0d60ddedff4f76504ebd2e61257bf1b9cad3b923 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to get all test suitechenjiankun1-0/+12
JIRA: YARDSTICK-747 API: /api/v2/yardstick/testsuites METHOD: GET Change-Id: I2375b6d2ea54704f5a2328cc8110058af038e777 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to create test suitechenjiankun1-0/+44
JIRA: YARDSTICK-746 API: /api/v2/yardstick/testsuites/action METHOD: POST PARAMS: { 'action': 'create_suite', 'args': { 'name': 'case_name', 'testcases': [ 'opnfv_yardstick_tc002' ] } } Change-Id: I7e07c599e64e7eedda274c72344e394f5535f055 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API to delete certain test casechenjiankun1-0/+11
JIRA: YARDSTICK-745 API: /api/v2/yardstick/testcases/<case_name> METHOD: DELETE Change-Id: Ic75ee60abfc00d20328ee45b9830dea1fe464482 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to get certain test case infochenjiankun1-0/+16
JIRA: YARDSTICK-744 API: /api/v2/yardstick/testcases METHOD: GET Change-Id: I4b1867f713bce2f9f2342ecec8540b08b0bb3456 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to get all test case infochenjiankun1-0/+7
JIRA: YARDSTICK-743 API: /api/v2/yardstick/testcases METHOD: GET Change-Id: Iced97206cb4c5f68ee8a5729af937e8d45ca6e87 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to upload test casechenjiankun1-0/+28
JIRA: YARDSTICK-742 API: /api/v2/yardstick/testcases/action METHOD: POST PARAMS: { 'action': 'upload_case', 'args': { 'file': file } } Change-Id: Id305e72a24ec28295ac4bae5e5b9ad83eb2c1e34 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-20Add API(v2) to add case to taskchenjiankun1-0/+23
JIRA: YARDSTICK-739 API: /api/v2/yardstick/tasks/<task_id> METHOD: PUT PARAMS: { 'action': 'add_case', 'args': { 'case_name': 'opnfv_yardstick_tc002', 'case_content': case_content } } Change-Id: I53e71e3d662399b08029ed417b5873a4775ca32d Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-19Add API(v2) to delete certain taskchenjiankun1-0/+29
JIRA: YARDSTICK-738 API: /api/v2/yardstick/tasks/<task_id> METHOD: DELETE Change-Id: I28215d2cae63551455abacc4142cff3c4aaed281 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-19Add API(v2) to get certain task infochenjiankun1-0/+21
JIRA: YARDSTICK-737 API: /api/v2/yardstick/tasks/<task_id> METHOD: GET Change-Id: Ia360f4bba05e196e07c9eb339061ccfbf5df8137 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-19Add API(v2) to add environment to taskchenjiankun1-0/+44
JIRA: YARDSTICK-736 API: /api/v2/yardstick/tasks/<task_id> METHOD: PUT PARAMS: { 'action': 'add_environment', 'args': { 'environment_id': environment_id } } Change-Id: Idc31cb21de882d008202b6395158e9f9aa9244db Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-19Add API(v2) to create taskchenjiankun1-0/+49
JIRA: YARDSTICK-735 API: /api/v2/yardstick/tasks/action METHOD: POST PARAMS: { 'action': 'create_task', 'args': { 'name': 'task1', 'project_id': project_id } } Change-Id: I1f9c743f32bbcff999e37cf53ebfa96b41c61e5e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2017-07-19Merge "Add API(v2) to delete container"Jing Lu1-2/+38
2017-07-19Merge "Add API(v2) to get container info"Jing Lu1-0/+27
2017-07-19Merge "Add API(v2) to create grafana"Jing Lu1-7/+152
2017-07-19Merge "Add API(v2) to create influxdb"Jing Lu1-0/+175