1 # Copyright (C) 2021 Wind River Systems, Inc.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 from flask_restx import fields
16 from o2dms.api.dms_api_ns import api_dms_lcm_v1
17 from o2common.helper import o2logging
18 logger = o2logging.get_logger(__name__)
22 # profile = api_dms_lcm_v1.model("DMSGetDtoProfile", {
23 # 'cluster_api_endpoint': fields.String(
24 # attributes='cluster_api_endpoint'),
25 # 'cluster_ca_cert': fields.String(attributes='cluster_ca_cert'),
26 # 'admin_user': fields.String(attributes='admin_user'),
27 # 'admin_client_cert': fields.String(attributes='admin_client_cert'),
28 # 'admin_client_key': fields.String(attributes='admin_client_key'),
29 # # 'kube_config_file': fields.String(attributes='kube_config_file')
32 dms_get = api_dms_lcm_v1.model(
35 'deploymentManagerId': fields.String(
37 description='Deployment manager ID'),
38 'name': fields.String,
39 'description': fields.String,
40 'supportedLocations': fields.String,
41 'capabilities': fields.String,
42 'capacity': fields.String,
43 # 'profileName': fields.String,
44 # 'profileData': fields.Nested(profile, False, True),
49 class DmsLcmNfDeploymentDescriptorDTO:
50 NfDeploymentDescriptor_get = api_dms_lcm_v1.model(
51 "NfDeploymentDescriptorGetDto",
55 description='NfDeploymentDescriptor ID'),
56 'name': fields.String,
57 'description': fields.String,
58 'inputParams': fields.String,
59 'outputParams': fields.String,
60 'artifactRepoUrl': fields.String,
61 'artifactName': fields.String
65 NfDeploymentDescriptor_create = api_dms_lcm_v1.model(
66 "NfDeploymentDescriptorCreateDto",
68 'name': fields.String,
69 'description': fields.String,
70 'artifactRepoUrl': fields.String,
71 'artifactName': fields.String,
72 'inputParams': fields.String,
73 'outputParams': fields.String
77 NfDeploymentDescriptor_create_post_resp = api_dms_lcm_v1.model(
78 "NfDeploymentDescriptorCreateRespDto",
81 required=True, description='NfDeploymentDescriptor ID'),
85 NfDeploymentDescriptor_update = api_dms_lcm_v1.model(
86 "NfDeploymentDescriptorUpdateDto",
88 'name': fields.String,
89 'description': fields.String,
90 'artifactRepoUrl': fields.String,
91 'artifactName': fields.String,
92 'inputParams': fields.String,
93 'outputParams': fields.String
98 class DmsLcmNfDeploymentDTO:
99 NfDeployment_get = api_dms_lcm_v1.model(
100 "NfDeploymentGetDto",
104 description='NfDeployment ID'),
105 'name': fields.String,
106 'description': fields.String,
107 'descriptorId': fields.String,
108 'parentDeploymentId': fields.String,
109 'status': fields.Integer
113 NfDeployment_create = api_dms_lcm_v1.model(
114 "NfDeploymentCreateDto",
116 'name': fields.String,
117 'description': fields.String,
118 'descriptorId': fields.String,
119 'parentDeploymentId': fields.String
123 NfDeployment_create_post_resp = api_dms_lcm_v1.model(
124 "NfDeploymentCreateRespDto",
127 required=True, description='NfDeployment ID'),
131 NfDeployment_update = api_dms_lcm_v1.model(
132 "NfDeploymentUpdateDto",
134 'name': fields.String,
135 'description': fields.String,
136 'parentDeploymentId': fields.String
141 class DmsLcmNfOCloudVResourceDTO:
142 NfOCloudVResource_get = api_dms_lcm_v1.model(
143 "NfOCloudVResourceGetDto",
147 description='NfOCloudVResource ID'),
148 'name': fields.String,
149 'description': fields.String,
150 'descriptorId': fields.String,
151 'vresourceType': fields.String,
152 'status': fields.Integer,
153 'metadata': fields.String