Merge "Implement Virtual Switch resilience test case"
[yardstick.git] / api / swagger / models.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 from flask_restful import fields
11 from flask_restful_swagger import swagger
12
13
14 # for testcases/action runTestCase action
15 @swagger.model
16 class TestCaseActionArgsOptsTaskArgModel:
17     resource_fields = {
18     }
19
20
21 @swagger.model
22 class TestCaseActionArgsOptsModel:
23     resource_fields = {
24         'task-args': TestCaseActionArgsOptsTaskArgModel,
25         'keep-deploy': fields.String,
26         'suite': fields.String
27     }
28
29
30 @swagger.model
31 class TestCaseActionArgsModel:
32     resource_fields = {
33         'testcase': fields.String,
34         'opts': TestCaseActionArgsOptsModel
35     }
36
37
38 @swagger.model
39 class TestCaseActionModel:
40     resource_fields = {
41         'action': fields.String,
42         'args': TestCaseActionArgsModel
43     }
44
45
46 # for testsuite/action runTestSuite action
47 @swagger.model
48 class TestSuiteActionArgsOptsTaskArgModel:
49     resource_fields = {
50     }
51
52
53 @swagger.model
54 class TestSuiteActionArgsOptsModel:
55     resource_fields = {
56         'task-args': TestSuiteActionArgsOptsTaskArgModel,
57         'keep-deploy': fields.String,
58         'suite': fields.String
59     }
60
61 @swagger.model
62 class TestSuiteActionArgsModel:
63     resource_fields = {
64         'testsuite': fields.String,
65         'opts': TestSuiteActionArgsOptsModel
66     }
67
68
69 @swagger.model
70 class TestSuiteActionModel:
71     resource_fields = {
72         'action': fields.String,
73         'args': TestSuiteActionArgsModel
74     }
75
76
77 # for results
78 @swagger.model
79 class ResultModel:
80     resource_fields = {
81         'status': fields.String,
82         'result': fields.List
83     }