21f43ed17d24e72036cfd1567490b91c6c925deb
[vid.git] / vid-webpack-master / src / app / shared / models / vfModule.ts
1 import {NodeModel, NodeModelResponseInterface} from "./nodeModel";
2
3
4 export interface properties{
5   initialCount: number;
6   maxCountInstances: number;
7   minCountInstances: number;
8 }
9
10 export interface VFModuleResponseInterface extends NodeModelResponseInterface {
11   customizationUuid: string;
12   modelCustomizationName: string;
13   properties: properties
14 }
15
16 export class VfModule extends NodeModel {
17
18   min:number;
19   max:number;
20   vgName:string;
21   rollbackOnFailure:boolean;
22   initial:number;
23   customizationUuid: string;
24   modelCustomizationName: string;
25
26   constructor(vf?: VFModuleResponseInterface) {
27     super(vf);
28     if(vf){
29       this.customizationUuid = vf.customizationUuid;
30       this.modelCustomizationName = vf.modelCustomizationName;
31     }
32     if (vf && vf.properties) {
33       this.min = vf.properties.minCountInstances;
34       this.max = vf.properties.maxCountInstances;
35       this.initial = vf.properties.initialCount;
36       this.rollbackOnFailure = true
37     }
38   }
39 }