operation_general: fix logging to use %s
[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 from __future__ import absolute_import
10 import logging
11 import os
12
13 from flasgger.utils import swag_from
14
15 from api.base import ApiResource
16 from api.swagger import models
17
18 logger = logging.getLogger(__name__)
19 logger.setLevel(logging.DEBUG)
20
21
22 TestCaseActionModel = models.TestCaseActionModel
23 TestCaseActionArgsModel = models.TestCaseActionArgsModel
24 TestCaseActionArgsOptsModel = models.TestCaseActionArgsOptsModel
25 TestCaseActionArgsOptsTaskArgModel = models.TestCaseActionArgsOptsTaskArgModel
26
27
28 class Asynctask(ApiResource):
29     def get(self):
30         return self._dispatch_get()
31
32
33 class Testcases(ApiResource):
34     def get(self):
35         return self._dispatch_get()
36
37
38 class ReleaseAction(ApiResource):
39     @swag_from(os.getcwd() + '/swagger/docs/release_action.yaml')
40     def post(self):
41         return self._dispatch_post()
42
43
44 class SamplesAction(ApiResource):
45
46     def post(self):
47         return self._dispatch_post()
48
49
50 TestSuiteActionModel = models.TestSuiteActionModel
51 TestSuiteActionArgsModel = models.TestSuiteActionArgsModel
52 TestSuiteActionArgsOptsModel = models.TestSuiteActionArgsOptsModel
53 TestSuiteActionArgsOptsTaskArgModel = \
54     models.TestSuiteActionArgsOptsTaskArgModel
55
56
57 class TestsuitesAction(ApiResource):
58     @swag_from(os.getcwd() + '/swagger/docs/testsuites_action.yaml')
59     def post(self):
60         return self._dispatch_post()
61
62
63 ResultModel = models.ResultModel
64
65
66 class Results(ApiResource):
67
68     @swag_from(os.getcwd() + '/swagger/docs/results.yaml')
69     def get(self):
70         return self._dispatch_get()
71
72
73 class EnvAction(ApiResource):
74
75     def post(self):
76         return self._dispatch_post()