Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 1 | import {NodeModel, NodeModelResponseInterface} from "./nodeModel"; |
| 2 | |
| 3 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 4 | export interface Properties{ |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 5 | initialCount: number; |
| 6 | maxCountInstances: number; |
| 7 | minCountInstances: number; |
| 8 | } |
| 9 | |
| 10 | export interface VFModuleResponseInterface extends NodeModelResponseInterface { |
| 11 | customizationUuid: string; |
| 12 | modelCustomizationName: string; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 13 | volumeGroupAllowed : boolean; |
| 14 | properties: Properties |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | export class VfModule extends NodeModel { |
| 18 | |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 19 | vgName:string; |
| 20 | rollbackOnFailure:boolean; |
| 21 | initial:number; |
| 22 | customizationUuid: string; |
| 23 | modelCustomizationName: string; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 24 | volumeGroupAllowed : boolean; |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 25 | |
| 26 | constructor(vf?: VFModuleResponseInterface) { |
| 27 | super(vf); |
| 28 | if(vf){ |
| 29 | this.customizationUuid = vf.customizationUuid; |
| 30 | this.modelCustomizationName = vf.modelCustomizationName; |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 31 | this.volumeGroupAllowed = vf.volumeGroupAllowed || false; |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 32 | } |
| 33 | if (vf && vf.properties) { |
| 34 | this.min = vf.properties.minCountInstances; |
| 35 | this.max = vf.properties.maxCountInstances; |
| 36 | this.initial = vf.properties.initialCount; |
| 37 | this.rollbackOnFailure = true |
| 38 | } |
| 39 | } |
| 40 | } |