summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/factories
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/factories
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/factories')
-rw-r--r--vid-webpack-master/src/app/factories/models/requestDetails.model.ts3
-rw-r--r--vid-webpack-master/src/app/factories/mso.factory.spec.ts31
-rw-r--r--vid-webpack-master/src/app/factories/mso.factory.ts26
3 files changed, 26 insertions, 34 deletions
diff --git a/vid-webpack-master/src/app/factories/models/requestDetails.model.ts b/vid-webpack-master/src/app/factories/models/requestDetails.model.ts
index 4ccc4781b..1663f7af7 100644
--- a/vid-webpack-master/src/app/factories/models/requestDetails.model.ts
+++ b/vid-webpack-master/src/app/factories/models/requestDetails.model.ts
@@ -14,6 +14,7 @@ export class ModelInfo {
modelVersion: string;
modelCustomizationId: string;
modelCustomizationName: string;
+ customizationUuid: string;
}
export class RequestParameters {
@@ -109,7 +110,7 @@ export class RootObject {
// “relatedInstance”: {
// “instanceId”: “{instanceGroupId}”,
// “modelInfo”: {
-// “modelType”: “networkCollection”,
+// “modelType”: “networkInstanceGroup”,
// “modelInvariantId”: “9ea660dc-155f-44d3-b45c-cc7648b4f31c”,
// “modelVersionId”: “bb07aad1-ce2d-40c1-85cb-5392f76bb1ef”,
// “modelName”: “{network collection model name}”,
diff --git a/vid-webpack-master/src/app/factories/mso.factory.spec.ts b/vid-webpack-master/src/app/factories/mso.factory.spec.ts
index 16efd2970..75f205804 100644
--- a/vid-webpack-master/src/app/factories/mso.factory.spec.ts
+++ b/vid-webpack-master/src/app/factories/mso.factory.spec.ts
@@ -1,24 +1,25 @@
import {createRequest} from './mso.factory';
-sessionStorage.setItem("msoRequestParametersTestApiValue","GR_API");
+
describe('Vlantagging', () => {
- it('should create a correct request', (done: DoneFn) => {
+ test('should create a correct request', () => {
+ sessionStorage.setItem("msoRequestParametersTestApiValue","GR_API");
let userInputs_withEcompGeneratedNaming = {
"productFamily": "e433710f-9217-458d-a79d-1c7aff376d89",
- "lcpRegion": "AAIAIC25",
+ "lcpRegion": "JANET25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"aicZone": "YYY1",
"platformName": "plat1",
- "lineOfBusiness": "ecomp"
+ "lineOfBusiness": "onap"
};
let userInputs_withoutEcompGeneratedNaming = {
"instanceName": "New Name",
"productFamily": "e433710f-9217-458d-a79d-1c7aff376d89",
- "lcpRegion": "AAIAIC25",
+ "lcpRegion": "JANET25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"aicZone": "YYY1",
"platformName": "plat1",
- "lineOfBusiness": "ecomp"
+ "lineOfBusiness": "onap"
};
let service = {
"service": {
@@ -249,9 +250,9 @@ describe('Vlantagging', () => {
"requestorId": "az2016",
"suppressRollback": false
},
- "lineOfBusiness": Object({ lineOfBusinessName: "ecomp" }),
+ "lineOfBusiness": Object({ lineOfBusinessName: "onap" }),
"cloudConfiguration": {
- "lcpCloudRegionId": "AAIAIC25",
+ "lcpCloudRegionId": "JANET25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86"
},
"platform": Object({ platformName: "plat1" }),
@@ -285,11 +286,7 @@ describe('Vlantagging', () => {
"relatedInstance": {
"instanceId": "AAI-12002-test3-vm230w",
"modelInfo": {
- "modelName": "oam_group",
- "modelType": "networkCollection",
- "modelVersion": "1",
- "modelVersionId": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
- "modelInvariantId": "9384abf9-1231-4da4-bd8d-89e4d2f8a749"
+ "modelType": "networkInstanceGroup"
}
}
},
@@ -297,11 +294,7 @@ describe('Vlantagging', () => {
"relatedInstance": {
"instanceId": "AAI-12002-test3-vm230w",
"modelInfo": {
- "modelName": "oam_group",
- "modelType": "networkCollection",
- "modelVersion": "1",
- "modelVersionId": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
- "modelInvariantId": "9384abf9-1231-4da4-bd8d-89e4d2f8a749"
+ "modelType": "networkInstanceGroup"
}
}
}
@@ -314,6 +307,6 @@ describe('Vlantagging', () => {
expectedResult["requestInfo"]["instanceName"] = "New Name";
let actualResult_withoutEcompGeneratedNaming = <any>createRequest("az2016",userInputs_withoutEcompGeneratedNaming, service, serviceInstanceId, networkInstanceGroups,'vDBE 0','1');
expect(actualResult_withoutEcompGeneratedNaming).toEqual(expectedResult);
- done();
+ sessionStorage.removeItem("msoRequestParametersTestApiValue");
});
});
diff --git a/vid-webpack-master/src/app/factories/mso.factory.ts b/vid-webpack-master/src/app/factories/mso.factory.ts
index c26296edf..ebca83412 100644
--- a/vid-webpack-master/src/app/factories/mso.factory.ts
+++ b/vid-webpack-master/src/app/factories/mso.factory.ts
@@ -1,4 +1,12 @@
-import { RequestInfo, RequestDetails, ModelInfo, CloudConfiguration, LineOfBusiness, Platform, RelatedInstanceList, VfcModel } from "./models/requestDetails.model";
+import {
+ CloudConfiguration,
+ LineOfBusiness,
+ ModelInfo,
+ Platform,
+ RelatedInstanceList,
+ RequestDetails,
+ RequestInfo
+} from "./models/requestDetails.model";
import * as _ from "lodash";
function extractModelInfoFromNodeTemplate(node: any, type: string) {
@@ -33,10 +41,6 @@ function extractPlatform(userInputs: any): Platform {
return platform;
}
-function extractVfcGroupModelAccordingToUuid(vnfModel: any, vfcUuid: string) {
- return _.find(vnfModel.vfcInstanceGroups, { uuid: vfcUuid });
-}
-
function extractLineOfBusiness(userInputs: any) {
let lob: LineOfBusiness = <LineOfBusiness>{};
lob.lineOfBusinessName = userInputs["lineOfBusiness"];
@@ -50,13 +54,9 @@ function extractCloudConfiguration(userInputs: any) {
return cloudConfig;
}
-function extractModelInfoFromVfcNode(vfcModel: VfcModel): ModelInfo {
+function extractModelInfoFromVfcNode(): ModelInfo {
let modelinfo: ModelInfo = <ModelInfo>{};
- modelinfo.modelName = vfcModel.name;
- modelinfo.modelType = "networkCollection";
- modelinfo.modelVersion = vfcModel.version;
- modelinfo.modelVersionId = vfcModel.uuid;
- modelinfo.modelInvariantId = vfcModel.invariantUuid;
+ modelinfo.modelType = "networkInstanceGroup";
return modelinfo;
}
@@ -77,12 +77,10 @@ export function createRequest(userId: string, userInputs: any, service: any, ser
};
request.relatedInstanceList.push(serviceRelatedInstance);
_.forOwn(networkInstanceGroups, function(group) {
- let modelUuid = group["instance-group"]["model-version-id"];
- let vfcModel = extractVfcGroupModelAccordingToUuid(service.vnfs[vnfCustomizationName], modelUuid);
let networkInstanceGroup: RelatedInstanceList = {
relatedInstance: {
instanceId: group["instance-group"].id,
- modelInfo: extractModelInfoFromVfcNode(vfcModel)
+ modelInfo: extractModelInfoFromVfcNode()
}
};
request.relatedInstanceList.push(networkInstanceGroup);