66294cf00fc2962fae8ff8c957a10c14dcd6bbb3
[osm/NG-UI.git] / src / models / NSInstanceModel.ts
1 /*
2  Copyright 2020 TATA ELXSI
3
4  Licensed under the Apache License, Version 2.0 (the 'License');
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15
16  Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
17  */
18 /**
19  * @file  Model for NS Instance related information.
20  */
21 // tslint:disable: completed-docs
22 import { DF, VLD } from 'NSDModel';
23 import { VNFDAdminDetails } from 'VNFDModel';
24
25 /** Interface for NSInstanceDetails */
26 export interface NSInstanceDetails {
27     'orchestration-progress': JSON;
28     'constituent-vnfr-ref': string[];
29     'operational-events': string[];
30     admin: Admin;
31     'ssh-authorized-key': string;
32     _admin: _Admin;
33     'admin-status': string;
34     'operational-status': string;
35     'datacenter': string;
36     nsd: NSD;
37     'nsd-id': string;
38     name: string;
39     'name-ref': string;
40     id: string;
41     'nsd-name-ref': string;
42     description: string;
43     'detailed-status': string;
44     'config-status': string;
45     'resource-orchestrator': string;
46     'nsd-ref': string;
47     vld: VLD[];
48     instantiate_params: InstantiateParam;
49     additionalParamsForNs: AdditionalParamForN;
50     _id?: string;
51     vcaStatus?: object;
52 }
53
54 /** Interface for Admin */
55 interface Admin {
56     deployed: DeployedAdmin;
57 }
58
59 /** Interface for DeployedAdmin */
60 interface DeployedAdmin {
61     RO: ROAdmin;
62 }
63
64 /** Interface for ROAdmin */
65 interface ROAdmin {
66     'nsr_status': string;
67 }
68
69 /** Interface for _Admin */
70 // tslint:disable-next-line:class-name
71 interface _Admin {
72     'projects_write': string[];
73     deployed: DeployedAdmin;
74     nslcmop: string;
75     nsState: string;
76     modified: number;
77     projects_read: string[];
78     created: string;
79 }
80
81 /** Interface for Deployed_Admin */
82 interface DeployedAdmin {
83     VCA: string[];
84     RO: ROAdmin;
85 }
86
87 /** Interface for RO_Admin */
88 interface ROAdmin {
89     'nsr_status': string;
90     'nsr_id': string;
91     'nsd_id': string;
92     vnfd: VNFD[];
93 }
94
95 /** Interface for VNFD */
96 interface VNFD {
97     'member-vnf-index': number;
98     id: string;
99 }
100
101 /** Interface for NSD */
102 export interface NSD {
103     description: string;
104     _admin: VNFDAdminDetails;
105     name: string;
106     version: string;
107     _id: string;
108     id: string;
109     vendor: string;
110     vdur: string[];
111     'connection-point': CONNECTIONPOINT[];
112     'virtual-link-desc': NSDVLD[];
113     df: DF[];
114 }
115
116 /** Interface for _AdminDetails */
117 // tslint:disable-next-line:class-name
118 export interface _AdminDetails {
119     usageState: string;
120     projects_write: string[];
121     projects_read: string[];
122     operationalState: string;
123     modified: string;
124     storage: Storage;
125     onboardingState: string;
126     userDefinedData: JSON;
127     created: number;
128 }
129
130 /** Interface for Storage */
131 interface Storage {
132     path: string;
133     'pkg-dir': string;
134     zipfile: string;
135     folder: string;
136     descriptor: string;
137     fs: string;
138 }
139
140 /** Interface for NSDVLD */
141 export interface NSDVLD {
142     'vim-id': string;
143     'status-detailed': string;
144     name: string;
145     status: string;
146     'vim-network-name': string;
147     id: string;
148     'type': string;
149     df: DF[];
150 }
151
152 /** Interface for Vm Migration */
153 export interface VMMIGRATION {
154     lcmOperationType: string;
155     vnfInstanceId: string;
156     migrateToHost?: string;
157     vdu?: VDUPARAM;
158 }
159
160 /** Interface for vdu for Vm Migration */
161 export interface VDUPARAM {
162     vduId?: string;
163     vduCountIndex?: string;
164 }
165
166 /** Interface for Ns Update */
167 export interface NSUPDATE {
168     lcmOperationType: string;
169     updateType: string;
170     nsInstanceId: string;
171     changeVnfPackageData: CHANGEVNFDATA;
172 }
173
174 /** Interface for changeVnfPackageData in Ns Update */
175 export interface CHANGEVNFDATA {
176     vnfdId: string;
177     vnfInstanceId: string;
178 }
179
180 /** Interface for terminate vnf in Ns Update */
181 export interface TERMINATEVNF {
182     lcmOperationType: string;
183     updateType: string;
184     nsInstanceId: string;
185     removeVnfInstanceId: string;
186 }
187
188 /** Interface for Start, Stop & Rebuild */
189 export interface StartStopRebuild {
190     updateType: string;
191     operateVnfData: OPERATEVNFDATA;
192 }
193
194 /** Interface for operateVnfData  in Start, Stop and Rebuild */
195 export interface OPERATEVNFDATA {
196     additionalParam: ADDITIONALPARAMS;
197     vnfInstanceId: string;
198     changeStateTo: string;
199 }
200
201 /** Interface for additionalParam in Start, Stop and Rebuild */
202 export interface ADDITIONALPARAMS {
203     'run-day1': boolean;
204     'vdu_id': string;
205     'count-index': string;
206 }
207
208 /** Interface for VerticalScaling */
209 export interface VerticalScaling {
210     lcmOperationType: string;
211     verticalScale: string;
212     nsInstanceId: string;
213     changeVnfFlavorData: CHANGEVNFFLAVORDATAPARAM;
214 }
215
216 /** Interface for changeVnfFlavorData in Vertical Scaling */
217 export interface CHANGEVNFFLAVORDATAPARAM {
218     vnfInstanceId: string;
219     additionalParams: ADDITIONALPARAM;
220
221 }
222
223 /** Interface for additionalParam in Vertical Scaling */
224 export interface ADDITIONALPARAM {
225     vduid: string;
226     vduCountIndex: string;
227     virtualMemory: number;
228     sizeOfStorage: number;
229     numVirtualCpu: number;
230
231 }
232
233 /** Interface for InstantiateParam */
234 interface InstantiateParam {
235     nsdId: string;
236     nsName: string;
237     nsDescription: string;
238     vimAccountId: string;
239 }
240
241 /** Interface for AdditionalParamForN */
242 interface AdditionalParamForN {
243     _id: string;
244     'ns-instance-config-ref': string;
245     'crete-time': string;
246 }
247
248 /** interface for the History nsdInstanceData */
249 export interface NSDInstanceData {
250     id?: string;
251     lcmOperationType?: string;
252     operationState?: string;
253     startTime?: number;
254     statusEnteredTime?: number;
255     identifier: string;
256     name: string;
257     NsdName: string;
258     OperationalStatus: string;
259     ConfigStatus: string;
260     DetailedStatus: string;
261     state?: string;
262     memberIndex?: DF[];
263     nsConfig?: object;
264     vcaStatus?: object;
265     adminDetails?: object;
266     vnfID?: string[];
267     nsd?: NSD;
268     operationParams?: OPERATIONPARAMS;
269     'nsd-id': string;
270     constituent: string[];
271 }
272
273 /** Interface for the operationparams */
274 export interface OPERATIONPARAMS {
275     scaleType?: string;
276     scaleVnfData?: SCALEVNFDATA;
277 }
278
279 /** Interface for the scaleVnfData */
280 export interface SCALEVNFDATA {
281     scaleVnfType?: string;
282     scaleByStepData?: SCALEBYSTEPDATA;
283 }
284
285 /** Interface for the scaleByStepData */
286 export interface SCALEBYSTEPDATA {
287     'scaling-group-descriptor'?: string;
288     'member-vnf-index'?: string;
289 }
290
291 /** Interface for the nsInfo */
292 export interface NSINFO {
293     nsInstanceID: string;
294     nsName: string;
295     nsOperationalStatus: string;
296     nsConfigStatus: string;
297     nsDetailedStatus: string;
298     nsResourceOrchestrator: string;
299 }
300
301 /** Interface for the NSINSTANCENODES */
302 export interface NSINSTANCENODES {
303     id?: string;
304     nodeTypeRef?: string;
305     name?: string;
306     'type'?: string;
307     vnfdCP?: DF[];
308     vimNetworkName?: string;
309     shortName?: string;
310     cp?: CONNECTIONPOINT[];
311     vdur?: string[];
312     vld?: NSDVLD[];
313     nsID?: string;
314     vnfdID?: string;
315     vimID?: string;
316     vndfrID?: string;
317     ipAddress?: string;
318     memberIndex?: string;
319     vnfdRef?: string;
320     vndfCPRef?: string;
321     selectorId?: string;
322     reflexive?: Boolean;
323     nodeIndex?: number;
324 }
325
326 /** Interface for the connection-point */
327 export interface CONNECTIONPOINT {
328     'connection-point-id': string;
329     name: string;
330     id: string;
331 }
332
333 /** Interface for Exec NS Primitive */
334 export interface NSPrimitive {
335     'primitive': string;
336     'primitive_params': NSPrimitiveParams[];
337     'member_vnf_index': string;
338 }
339
340 /** Interface for Exec NS Primitive Params */
341 export interface NSPrimitiveParams {
342     primitive_params_name: string;
343     primitive_params_value: string;
344 }
345
346 /** Interface Nodes Creation */
347 export interface COMPOSERNODES {
348     id: string;
349     reflexive: Boolean;
350     nodeTypeRef: string;
351     name?: string;
352     nodeIndex?: number;
353     selectorId?: string;
354     x?: number;
355     y?: number;
356     fx?: number;
357     fy?: number;
358     shortName?: string;
359     vimNetworkName?: string;
360     'type'?: string;
361     vnfdRef?: string;
362     memberIndex?: string;
363     vimID?: string;
364     vndfrID?: string;
365     ipAddress?: string;
366     nsID?: string;
367     vnfdID?: string;
368 }
369
370 /** Interface for the Virtual Link Info */
371 export interface VLINFO {
372     id: string;
373     name: string;
374     'type': string;
375     shortName: string;
376     vimNetworkName: string;
377 }
378
379 /** Interface for the VNFR Info */
380 export interface VNFRINFO {
381     vimID: string;
382     _id: string;
383     ip: string;
384     nsrID: string;
385     id: string;
386     vnfdRef: string;
387     vnfdId: string;
388     memberIndex: string;
389 }