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 'profile': fields.Nested(profile, False, True),
48 class DmsLcmNfDeploymentDescriptorDTO:
49 NfDeploymentDescriptor_get = api_dms_lcm_v1.model(
50 "NfDeploymentDescriptorGetDto",
54 description='NfDeploymentDescriptor ID'),
55 'name': fields.String,
56 'description': fields.String,
57 'inputParams': fields.String,
58 'outputParams': fields.String,
59 'artifactRepoUrl': fields.String,
60 'artifactName': fields.String
64 NfDeploymentDescriptor_create = api_dms_lcm_v1.model(
65 "NfDeploymentDescriptorCreateDto",
67 'name': fields.String,
68 'description': fields.String,
69 'artifactRepoUrl': fields.String,
70 'artifactName': fields.String,
71 'inputParams': fields.String,
72 'outputParams': fields.String
76 NfDeploymentDescriptor_create_post_resp = api_dms_lcm_v1.model(
77 "NfDeploymentDescriptorCreateRespDto",
80 required=True, description='NfDeploymentDescriptor ID'),
84 NfDeploymentDescriptor_update = api_dms_lcm_v1.model(
85 "NfDeploymentDescriptorUpdateDto",
87 'name': fields.String,
88 'description': fields.String,
89 'artifactRepoUrl': fields.String,
90 'artifactName': fields.String,
91 'inputParams': fields.String,
92 'outputParams': fields.String
97 class DmsLcmNfDeploymentDTO:
98 NfDeployment_get = api_dms_lcm_v1.model(
103 description='NfDeployment ID'),
104 'name': fields.String,
105 'description': fields.String,
106 'descriptorId': fields.String,
107 'parentDeploymentId': fields.String,
108 'status': fields.Integer
112 NfDeployment_create = api_dms_lcm_v1.model(
113 "NfDeploymentCreateDto",
115 'name': fields.String,
116 'description': fields.String,
117 'descriptorId': fields.String,
118 'parentDeploymentId': fields.String
122 NfDeployment_create_post_resp = api_dms_lcm_v1.model(
123 "NfDeploymentCreateRespDto",
126 required=True, description='NfDeployment ID'),
130 NfDeployment_update = api_dms_lcm_v1.model(
131 "NfDeploymentUpdateDto",
133 'name': fields.String,
134 'description': fields.String,
135 'parentDeploymentId': fields.String
140 class DmsLcmNfOCloudVResourceDTO:
141 NfOCloudVResource_get = api_dms_lcm_v1.model(
142 "NfOCloudVResourceGetDto",
146 description='NfOCloudVResource ID'),
147 'name': fields.String,
148 'description': fields.String,
149 'descriptorId': fields.String,
150 'vresourceType': fields.String,
151 'status': fields.Integer,
152 'metadata': fields.String