aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/models/vfModule.ts
blob: 8f92ba428a199eefb25b0b9a9f775d686e3929e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {NodeModel, NodeModelResponseInterface} from "./nodeModel";
import {Utils} from "../utils/utils";


export interface Properties{
  initialCount: number;
  maxCountInstances: number;
  minCountInstances: number;
}

export interface VFModuleResponseInterface extends NodeModelResponseInterface {
  customizationUuid: string;
  modelCustomizationName: string;
  volumeGroupAllowed : boolean;
  properties: Properties
}

export class VfModule extends NodeModel {

  vgName:string;
  rollbackOnFailure:boolean;
  initial:number;
  customizationUuid: string;
  modelCustomizationName: string;
  volumeGroupAllowed : boolean;

  constructor(vf?: VFModuleResponseInterface, flags?: { [key: string]: boolean }) {
    super(vf);
    if(vf){
      this.customizationUuid = vf.customizationUuid;
      this.modelCustomizationName = vf.modelCustomizationName;
      this.volumeGroupAllowed = vf.volumeGroupAllowed || false;
    }
    if (vf && vf.properties) {
      this.min = vf.properties.minCountInstances;
      this.max = Utils.getMaxVfModule(vf.properties, flags);
      this.initial = vf.properties.initialCount;
      this.rollbackOnFailure = true
    }
  }
}