eb81145fcff8a905d1ad6bfb4bc3dc90838ef468
[yardstick.git] / api / views.py
1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import logging
10 import os
11
12 from flasgger.utils import swag_from
13
14 from api.base import ApiResource
15 from api.swagger import models
16
17 logger = logging.getLogger(__name__)
18 logger.setLevel(logging.DEBUG)
19
20
21 TestCaseActionModel = models.TestCaseActionModel
22 TestCaseActionArgsModel = models.TestCaseActionArgsModel
23 TestCaseActionArgsOptsModel = models.TestCaseActionArgsOptsModel
24 TestCaseActionArgsOptsTaskArgModel = models.TestCaseActionArgsOptsTaskArgModel
25
26
27 class Asynctask(ApiResource):
28     def get(self):
29         return self._dispatch_get()
30
31
32 class ReleaseAction(ApiResource):
33     @swag_from(os.getcwd() + '/swagger/docs/release_action.yaml')
34     def post(self):
35         return self._dispatch_post()
36
37
38 class SamplesAction(ApiResource):
39     def post(self):
40         return self._dispatch_post()
41
42
43 TestSuiteActionModel = models.TestSuiteActionModel
44 TestSuiteActionArgsModel = models.TestSuiteActionArgsModel
45 TestSuiteActionArgsOptsModel = models.TestSuiteActionArgsOptsModel
46 TestSuiteActionArgsOptsTaskArgModel = models.TestSuiteActionArgsOptsTaskArgModel
47
48
49 class TestsuitesAction(ApiResource):
50     @swag_from(os.getcwd() + '/swagger/docs/testsuites_action.yaml')
51     def post(self):
52         return self._dispatch_post()
53
54
55 ResultModel = models.ResultModel
56
57
58 class Results(ApiResource):
59     @swag_from(os.getcwd() + '/swagger/docs/results.yaml')
60     def get(self):
61         return self._dispatch_get()
62
63
64 class EnvAction(ApiResource):
65     def post(self):
66         return self._dispatch_post()