Refactor o2dms api swagger
[pti/o2.git] / o2dms / views / dms_dto.py
1 # Copyright (C) 2021 Wind River Systems, Inc.
2 #
3 #  Licensed under the Apache License, Version 2.0 (the "License");
4 #  you may not use this file except in compliance with the License.
5 #  You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #  Unless required by applicable law or agreed to in writing, software
10 #  distributed under the License is distributed on an "AS IS" BASIS,
11 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #  See the License for the specific language governing permissions and
13 #  limitations under the License.
14
15 from flask_restx import fields
16 from o2dms.views import api_dms_lcm_v1
17
18
19 class DmsDTO:
20     dms_get = api_dms_lcm_v1.model(
21         "DmsGetDto",
22         {
23             'deploymentManagerId': fields.String(
24                 required=True,
25                 description='Deployment manager ID'),
26             'name': fields.String,
27             'description': fields.String,
28             'supportedLocations': fields.String,
29             'capabilities': fields.String,
30             'capacity': fields.String,
31         }
32     )
33
34
35 class DmsLcmNfDeploymentDescriptorDTO:
36     dmslcm_NfDeploymentDescriptor_get = api_dms_lcm_v1.model(
37         "NfDeploymentDescriptorGetDto",
38         {
39             'id': fields.String(
40                 required=True,
41                 description='NfDeploymentDescriptor ID'),
42             'name': fields.String,
43             'description': fields.String,
44             'inputParams': fields.String,
45             'outputParams': fields.String
46         }
47     )
48
49     NfDeploymentDescriptor_create = api_dms_lcm_v1.model(
50         "NfDeploymentDescriptorCreateDto",
51         {
52             'name': fields.String,
53             'description': fields.String,
54             'inputParams': fields.String,
55             'outputParams': fields.String
56         }
57     )
58
59     NfDeploymentDescriptor_create_post_resp = api_dms_lcm_v1.model(
60         "NfDeploymentDescriptorCreateRespDto",
61         {
62             'id': fields.String(
63                 required=True, description='NfDeploymentDescriptor ID'),
64         }
65     )
66
67     NfDeploymentDescriptor_update = api_dms_lcm_v1.model(
68         "NfDeploymentDescriptorCreateDto",
69         {
70             'name': fields.String,
71             'description': fields.String,
72             'inputParams': fields.String,
73             'outputParams': fields.String
74         }
75     )