summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/models/nodeModel.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2018-08-29 17:01:32 +0300
committerIttay Stern <ittay.stern@att.com>2019-02-18 18:35:30 +0200
commit6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch)
tree936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/src/app/shared/models/nodeModel.ts
parent67d99f816cc583643c35193197594cf78d8ce60a (diff)
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/models/nodeModel.ts')
-rw-r--r--vid-webpack-master/src/app/shared/models/nodeModel.ts66
1 files changed, 65 insertions, 1 deletions
diff --git a/vid-webpack-master/src/app/shared/models/nodeModel.ts b/vid-webpack-master/src/app/shared/models/nodeModel.ts
index 4b22b8d91..ee57ec038 100644
--- a/vid-webpack-master/src/app/shared/models/nodeModel.ts
+++ b/vid-webpack-master/src/app/shared/models/nodeModel.ts
@@ -1,12 +1,27 @@
+import {VfcInstanceGroupMap} from "./vfcInstanceGroupMap";
+
export interface NodeModelResponseInterface {
+ customizationUuid: string;
name: string;
version: string;
description: string;
category: string;
uuid: string;
invariantUuid: string;
+ max: number;
+ min:number;
+}
+export interface Level1ModelResponseInterface extends NodeModelResponseInterface{
+ serviceType: string;
+ serviceRole: string;
+ subCategory: string;
+ customizationUuid: string;
+ serviceEcompNaming: boolean;
+ type: string;
+ modelCustomizationName: string;
+ vfcInstanceGroups: VfcInstanceGroupMap;
+ properties: Level1ModelProperties;
}
-
export class NodeModel {
name: string;
version: string;
@@ -14,16 +29,65 @@ export class NodeModel {
category: string;
uuid: string;
invariantUuid: string;
+ max: number;
+ min: number;
+ customizationUuid?: string;
constructor(serviceJson?: NodeModelResponseInterface) {
if (serviceJson) {
+ this.customizationUuid = serviceJson.customizationUuid;
this.name = serviceJson.name;
this.version = serviceJson.version;
this.description = serviceJson.description;
this.category = serviceJson.category;
this.uuid = serviceJson.uuid;
this.invariantUuid = serviceJson.invariantUuid;
+ this.max = serviceJson.max;
+ this.min = serviceJson.min;
}
}
}
+export class Level1ModelProperties {
+ max_instances : number;
+ min_instances : number;
+}
+
+
+
+export class Level1Model extends NodeModel{
+ serviceType: string;
+ serviceRole: string;
+ subCategory: string;
+ customizationUuid: string;
+ serviceEcompNaming: boolean;
+ type: string;
+ modelCustomizationName: string;
+ vfcInstanceGroups: VfcInstanceGroupMap;
+ isEcompGeneratedNaming: boolean;
+ constructor(nodeJson?: Level1ModelResponseInterface) {
+ super(nodeJson);
+ if (nodeJson) {
+ this.serviceType = nodeJson.serviceType;
+ this.serviceRole = nodeJson.serviceRole;
+ this.subCategory = nodeJson.subCategory;
+ this.customizationUuid = nodeJson.customizationUuid;
+ this.isEcompGeneratedNaming = this.getIsEcompGeneratedNaming(nodeJson);
+ this.type = nodeJson.type;
+ this.modelCustomizationName = nodeJson.modelCustomizationName;
+ this.vfcInstanceGroups = nodeJson.vfcInstanceGroups;
+ this.max = 1;
+ this.min = 0;
+ if (nodeJson.properties) {
+ this.min = nodeJson.properties.min_instances || 0;
+ this.max = nodeJson.properties.max_instances || 1;
+ }
+
+
+ }
+ }
+ private getIsEcompGeneratedNaming(vnfJson) {
+ const ecompGeneratedNaming = vnfJson.properties.ecomp_generated_naming;
+ return ecompGeneratedNaming === "true";
+ };
+}