aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/services/aaiService
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/shared/services/aaiService')
-rw-r--r--vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts230
-rw-r--r--vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts272
2 files changed, 192 insertions, 310 deletions
diff --git a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
index 9f19f6259..5cff00b7e 100644
--- a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
@@ -65,10 +65,10 @@ describe("AaiService", () => {
aaiService.retrieveServiceInstanceTopology(serviceInstanceId, subscriberId, serviceType).subscribe((result: ServiceInstance) => {
expect(result.instanceName).toEqual("mCaNkinstancename");
expect(result.modelInavariantId).toEqual("6b528779-44a3-4472-bdff-9cd15ec93450");
- expect(result.vnfs["2017-388_ADIOD-vPE 0"].instanceName).toEqual("2017388_ADIODvPEmCaNkinstanceName");
- expect(result.vnfs["2017-488_ADIOD-vPE 0"].
- vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]
- ["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].instanceName
+ expect(result.vnfs["2017-388_PASQUALE-vPE 0"].instanceName).toEqual("2017388_PASQUALEvPEmCaNkinstanceName");
+ expect(result.vnfs["2017-488_PASQUALE-vPE 0"].
+ vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]
+ ["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].instanceName
).toEqual("VFinstancenameZERO");
});
@@ -88,10 +88,10 @@ describe("AaiService", () => {
aaiService.retrieveServiceInstanceRetryTopology(jobId).subscribe((result: ServiceInstance) => {
expect(result.instanceName).toEqual("mCaNkinstancename");
expect(result.modelInavariantId).toEqual("6b528779-44a3-4472-bdff-9cd15ec93450");
- expect(result.vnfs["2017-388_ADIOD-vPE 0"].instanceName).toEqual("2017388_ADIODvPEmCaNkinstanceName");
- expect(result.vnfs["2017-488_ADIOD-vPE 0"].
- vfModules["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0"]
- ["2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot"].instanceName
+ expect(result.vnfs["2017-388_PASQUALE-vPE 0"].instanceName).toEqual("2017388_PASQUALEvPEmCaNkinstanceName");
+ expect(result.vnfs["2017-488_PASQUALE-vPE 0"].
+ vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"]
+ ["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot"].instanceName
).toEqual("VFinstancenameZERO");
});
@@ -104,9 +104,9 @@ describe("AaiService", () => {
describe('# get optional group members tests', () =>{
test('aai service get getOptionalGroupMembers and return list of VnfMember', () => {
jest.spyOn(store, 'dispatch');
- jest.spyOn(store, 'getState').mockReturnValue({
+ jest.spyOn(store, 'getState').mockReturnValue( <any>{
service :{
- serviceInstance : {
+ serviceInstance :{
"serviceModelId" : {
optionalGroupMembersMap : {}
}
@@ -132,6 +132,24 @@ describe("AaiService", () => {
req.flush(mockedResult);
});
});
+
+
+ describe('# get active networks', () =>{
+ test('aai service get active networks', () => {
+ const mockedResult = getMockActiveNetworks();
+ const cloudRegion: string = "cloudRegion";
+ const tenantId: string = "tenantId";
+ aaiService.retrieveActiveNetwork(cloudRegion, tenantId).subscribe((res)=>{
+ expect(res.length).toEqual(mockedResult.length);
+ });
+
+ const req = httpMock.expectOne(`${Constants.Path.AAI_GET_ACTIVE_NETWORKS_PATH}?cloudRegion=${cloudRegion}&tenantId=${tenantId}`);
+ expect(req.request.method).toEqual('GET');
+ req.flush(mockedResult);
+ });
+ });
+
+
describe('#cloud owner tests', () => {
let featureFlagToLcpRegionName = [
['aai service extract lcpRegion, flag is true=> lcp region include cloud owner', true, 'id (OWNER)' ],
@@ -158,38 +176,38 @@ describe("AaiService", () => {
function getTopology() {
return {
"vnfs": {
- "2017-388_ADIOD-vPE 0": {
+ "2017-388_PASQUALE-vPE 0": {
"vfModules": {},
"uuid": "afacccf6-397d-45d6-b5ae-94c39734b168",
"productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89",
- "lcpCloudRegionId": "JANET25",
+ "lcpCloudRegionId": "AAIAIC25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"lineOfBusiness": "ONAP",
"platformName": "platform",
"modelInfo": {
"modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8",
"modelVersionId": "afacccf6-397d-45d6-b5ae-94c39734b168",
- "modelName": "2017-388_ADIOD-vPE",
+ "modelName": "2017-388_PASQUALE-vPE",
"modelVersion": "4.0",
"modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c",
- "modelCustomizationName": "2017-388_ADIOD-vPE 0",
+ "modelCustomizationName": "2017-388_PASQUALE-vPE 0",
"uuid": "afacccf6-397d-45d6-b5ae-94c39734b168"
},
- "instanceName": "2017388_ADIODvPEmCaNkinstanceName",
+ "instanceName": "2017388_PASQUALEvPEmCaNkinstanceName",
"legacyRegion": "some legacy region"
},
- "2017-488_ADIOD-vPE 0": {
+ "2017-488_PASQUALE-vPE 0": {
"vfModules": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot": {
"instanceName": "VFinstancenameZERO",
"modelInfo": {
"modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091",
"modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db",
- "modelName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0",
+ "modelName": "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0",
"modelVersion": "5",
"modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3",
- "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0",
+ "modelCustomizationName": "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0",
"uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db"
},
"uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db",
@@ -198,8 +216,8 @@ describe("AaiService", () => {
"inMaint": true
}
},
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1fshmc": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
"instanceName": "VFinstancename",
"volumeGroupName": "VFinstancename_vol_abc",
"orchStatus": "Create",
@@ -208,10 +226,10 @@ describe("AaiService", () => {
"modelInfo": {
"modelInvariantId": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1",
"modelVersionId": "25284168-24bb-4698-8cb4-3f509146eca5",
- "modelName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1",
+ "modelName": "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
"modelVersion": "6",
"modelCustomizationId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401",
- "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1",
+ "modelCustomizationName": "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
"uuid": "25284168-24bb-4698-8cb4-3f509146eca5"
},
"uuid": "25284168-24bb-4698-8cb4-3f509146eca5"
@@ -220,54 +238,54 @@ describe("AaiService", () => {
},
"uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09",
"productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89",
- "lcpCloudRegionId": "JANET25",
+ "lcpCloudRegionId": "AAIAIC25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"lineOfBusiness": "ONAP",
"platformName": "platform",
"modelInfo": {
"modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8",
"modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09",
- "modelName": "2017-488_ADIOD-vPE",
+ "modelName": "2017-488_PASQUALE-vPE",
"modelVersion": "5.0",
"modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45",
- "modelCustomizationName": "2017-488_ADIOD-vPE 0",
+ "modelCustomizationName": "2017-488_PASQUALE-vPE 0",
"uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09"
},
"orchStatus": "Created",
"inMaint": false,
- "instanceName": "2017488_ADIODvPEVNFinstancename",
+ "instanceName": "2017488_PASQUALEvPEVNFinstancename",
"legacyRegion": "some legacy region"
},
- "2017-488_ADIOD-vPE 0:0001": {
+ "2017-488_PASQUALE-vPE 0:0001": {
"vfModules": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot": {
"instanceName": "VFinstancenameZERO_001",
"provStatus": "Prov Status",
"inMaint": true,
"modelInfo": {
"modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091",
"modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db",
- "modelName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0",
+ "modelName": "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0",
"modelVersion": "5",
"modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3",
- "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0",
+ "modelCustomizationName": "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0",
"uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db"
},
"uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db"
}
},
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1fshmc": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
"instanceName": "VFinstancename_001",
"volumeGroupName": "VFinstancename_vol_abc_001",
"modelInfo": {
"modelInvariantId": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1",
"modelVersionId": "25284168-24bb-4698-8cb4-3f509146eca5",
- "modelName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1",
+ "modelName": "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
"modelVersion": "6",
"modelCustomizationId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401",
- "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1",
+ "modelCustomizationName": "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
"uuid": "25284168-24bb-4698-8cb4-3f509146eca5"
},
"uuid": "25284168-24bb-4698-8cb4-3f509146eca5"
@@ -277,50 +295,50 @@ describe("AaiService", () => {
"uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09",
"productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89",
- "lcpCloudRegionId": "JANET25",
+ "lcpCloudRegionId": "AAIAIC25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"lineOfBusiness": "ONAP",
"platformName": "platform",
"modelInfo": {
"modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8",
"modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09",
- "modelName": "2017-488_ADIOD-vPE",
+ "modelName": "2017-488_PASQUALE-vPE",
"modelVersion": "5.0",
"modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45",
- "modelCustomizationName": "2017-488_ADIOD-vPE 0",
+ "modelCustomizationName": "2017-488_PASQUALE-vPE 0",
"uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09"
},
- "instanceName": "2017488_ADIODvPEVNFinstancename_001",
+ "instanceName": "2017488_PASQUALEvPEVNFinstancename_001",
"legacyRegion": "some legacy region"
},
- "2017-488_ADIOD-vPE 0:0002": {
+ "2017-488_PASQUALE-vPE 0:0002": {
"vfModules": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0uvfot": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot": {
"instanceName": "VFinstancenameZERO_002",
"modelInfo": {
"modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091",
"modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db",
- "modelName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0",
+ "modelName": "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0",
"modelVersion": "5",
"modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3",
- "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0",
+ "modelCustomizationName": "2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0",
"uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db"
},
"uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db"
}
},
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": {
- "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1fshmc": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1": {
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc": {
"instanceName": "VFinstancename_002",
"volumeGroupName": "VFinstancename_vol_abc_002",
"modelInfo": {
"modelInvariantId": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1",
"modelVersionId": "25284168-24bb-4698-8cb4-3f509146eca5",
- "modelName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1",
+ "modelName": "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
"modelVersion": "6",
"modelCustomizationId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401",
- "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1",
+ "modelCustomizationName": "2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
"uuid": "25284168-24bb-4698-8cb4-3f509146eca5"
},
"uuid": "25284168-24bb-4698-8cb4-3f509146eca5"
@@ -329,20 +347,20 @@ describe("AaiService", () => {
},
"uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09",
"productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89",
- "lcpCloudRegionId": "JANET25",
+ "lcpCloudRegionId": "AAIAIC25",
"tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"lineOfBusiness": "ONAP",
"platformName": "platform",
"modelInfo": {
"modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8",
"modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09",
- "modelName": "2017-488_ADIOD-vPE",
+ "modelName": "2017-488_PASQUALE-vPE",
"modelVersion": "5.0",
"modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45",
- "modelCustomizationName": "2017-488_ADIOD-vPE 0",
+ "modelCustomizationName": "2017-488_PASQUALE-vPE 0",
"uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09"
},
- "instanceName": "2017488_ADIODvPEVNFinstancename_002",
+ "instanceName": "2017488_PASQUALEvPEVNFinstancename_002",
"legacyRegion": "some legacy region"
}
},
@@ -380,6 +398,110 @@ describe("AaiService", () => {
}
}
+ function getMockActiveNetworks(){
+ return [
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_1",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 1", "network role 2"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_2",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 1", "network role 3"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_3",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 4", "network role 8"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_4",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: [],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_5",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 6", "network role 1"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_6",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 5"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_7",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 3"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_8",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: ["network role 4"],
+ },
+ {
+ networkInstanceName: "networkInstanceName",
+ instanceVersion: "instanceVersion",
+ networkModel: "networkModel",
+ instanceUUID: "instanceUUID_9",
+ provStatus: "provStatus",
+ orchStatus: "orchStatus",
+ serviceInstanceName: "serviceInstanceName",
+ serviceUUID: "serviceUUID",
+ roles: [],
+ }
+ ]
+ }
+
const getMockMembers = (): any[] => {
return [
{
diff --git a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts
index 1b102e623..4e7e4dad8 100644
--- a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts
+++ b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts
@@ -41,7 +41,8 @@ import {updateModel, createServiceInstance} from "../../storeUtil/utils/service/
import {FeatureFlagsService, Features} from "../featureFlag/feature-flags.service";
import {VnfMember} from "../../models/VnfMember";
import {setOptionalMembersVnfGroupInstance} from "../../storeUtil/utils/vnfGroup/vnfGroup.actions";
-import {Observable} from "rxjs";
+import {Observable} from "rxjs";import {NetworkModalRow} from "../../../drawingBoard/service-planning/objectsToTree/models/vrf/vrfModal/networkStep/network.step.model";
+import {VPNModalRow} from "../../../drawingBoard/service-planning/objectsToTree/models/vrf/vrfModal/vpnStep/vpn.step.model";
@Injectable()
export class AaiService {
@@ -217,7 +218,7 @@ export class AaiService {
};
public static formatCloudOwnerTrailer(cloudOwner: string):string {
- return " ("+ cloudOwner.trim().toLowerCase().replace(/^att-/, "").toUpperCase() + ")";
+ return " ("+ cloudOwner.trim().toLowerCase().replace(/^[^-]*-/, "").toUpperCase() + ")";
}
getServiceTypes = (subscriberId): Observable<ServiceType[]> => {
@@ -235,7 +236,7 @@ export class AaiService {
};
getSubscriberDetails = (subscriberId): Observable<GetSubDetailsResponse> => {
- let pathQuery: string = Constants.Path.AAI_SUB_DETAILS_PATH + subscriberId + Constants.Path.ASSIGN + Math.random();
+ let pathQuery: string = Constants.Path.AAI_SUB_DETAILS_PATH + subscriberId + Constants.Path.ASSIGN + Math.random() + Constants.Path.AAI_OMIT_SERVICE_INSTANCES + true;
if (subscriberId != null) {
return this.http.get<GetSubDetailsResponse>(pathQuery);
@@ -257,6 +258,16 @@ export class AaiService {
return this.http.get<ServiceInstance>(pathQuery);
}
+ public retrieveActiveNetwork(cloudRegion : string, tenantId: string) : Observable<NetworkModalRow[]>{
+ let pathQuery: string = `${Constants.Path.AAI_GET_ACTIVE_NETWORKS_PATH}?cloudRegion=${cloudRegion}&tenantId=${tenantId}`;
+ return this.http.get<NetworkModalRow[]>(pathQuery);
+ }
+
+ public retrieveActiveVPNs() : Observable<VPNModalRow[]>{
+ let pathQuery: string = `${Constants.Path.AAI_GET_VPNS_PATH}`;
+ return this.http.get<VPNModalRow[]>(pathQuery);
+ }
+
public retrieveAndStoreServiceInstanceTopology(serviceInstanceId: string, subscriberId: string, serviceType: string, serviceModeId: string):Observable<ServiceInstance> {
return this.retrieveServiceInstanceTopology(serviceInstanceId, subscriberId, serviceType).do((service:ServiceInstance) => {
this.store.dispatch(createServiceInstance(service, serviceModeId));
@@ -268,257 +279,6 @@ export class AaiService {
let pathQuery: string = `${Constants.Path.SERVICES_RETRY_TOPOLOGY}/${jobId}`;
return this.http.get<ServiceInstance>(pathQuery);
- // return of(
- // <any>{
- // "action": "None",
- // "instanceName": "LXzQMx9clZl7D6ckJ",
- // "instanceId": "service-instance-id",
- // "orchStatus": "GARBAGE DATA",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelInvariantId": "d27e42cf-087e-4d31-88ac-6c4b7585f800",
- // "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
- // "modelName": "vf_vEPDG",
- // "modelType": "service",
- // "modelVersion": "5.0"
- // },
- // "globalSubscriberId": "global-customer-id",
- // "subscriptionServiceType": "service-instance-type",
- // "owningEntityId": null,
- // "owningEntityName": null,
- // "tenantName": null,
- // "aicZoneId": null,
- // "aicZoneName": null,
- // "projectName": null,
- // "rollbackOnFailure": null,
- // "isALaCarte": false,
- // "vnfs": {
- // "1e918ade-3dc6-4cec-b952-3ff94ed82d1c": {
- // "action": "None",
- // "instanceName": "DgZuxjJy5LMIc3755",
- // "instanceId": "1e918ade-3dc6-4cec-b952-3ff94ed82d1c",
- // "orchStatus": null,
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelInvariantId": "vnf-instance-model-invariant-id",
- // "modelVersionId": "vnf-instance-model-version-id",
- // "modelType": "vnf"
- // },
- // "instanceType": "SXDBMhwdR9iO0g1Uv",
- // "provStatus": null,
- // "inMaint": false,
- // "uuid": "vnf-instance-model-version-id",
- // "originalName": null,
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "1e918ade-3dc6-4cec-b952-3ff94ed82d1c",
- // "vfModules": {},
- // "networks": {
- // "ff464c97-ea9c-4165-996a-fe400499af3e": {
- // "action": "None",
- // "instanceName": "ZI0quzIpu8TNXS7nl",
- // "instanceId": "ff464c97-ea9c-4165-996a-fe400499af3e",
- // "orchStatus": "Assigned",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelInvariantId": "network-instance-model-invariant-id",
- // "modelVersionId": "network-instance-model-version-id",
- // "modelType": "network"
- // },
- // "instanceType": "CONTRAIL30_BASIC",
- // "provStatus": "prov",
- // "inMaint": false,
- // "uuid": "network-instance-model-version-id",
- // "originalName": null,
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "ff464c97-ea9c-4165-996a-fe400499af3e",
- // "isFailed": true
- // },
- // "3e41d57c-8bb4-443e-af02-9f86487ba938": {
- // "action": "None",
- // "instanceName": "0i9asscqSLm7Poeb8",
- // "instanceId": "3e41d57c-8bb4-443e-af02-9f86487ba938",
- // "orchStatus": "Created",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelInvariantId": "network-instance-model-invariant-id",
- // "modelVersionId": "network-instance-model-version-id",
- // "modelType": "network"
- // },
- // "instanceType": "CONTRAIL30_BASIC",
- // "provStatus": "prov",
- // "inMaint": false,
- // "uuid": "network-instance-model-version-id",
- // "originalName": null,
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "3e41d57c-8bb4-443e-af02-9f86487ba938",
- // "isFailed": true
- // }
- // },
- // "isFailed": true
- // },
- // "9a9b2705-c569-4f1b-9a67-13e9f86e6c55": {
- // "isFailed": true,
- // "action": "None",
- // "instanceName": "TFn0SYhrCUs7L3qWS",
- // "instanceId": "9a9b2705-c569-4f1b-9a67-13e9f86e6c55",
- // "orchStatus": null,
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelCustomizationName": "VF_vMee 0",
- // "modelInvariantId": "vnf-instance-model-invariant-id",
- // "modelVersionId": "d6557200-ecf2-4641-8094-5393ae3aae60",
- // "modelType": "vnf"
- // },
- // "instanceType": "WIT68GUnH34VaGZgp",
- // "provStatus": null,
- // "inMaint": true,
- // "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
- // "originalName": "VF_vMee 0",
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "9a9b2705-c569-4f1b-9a67-13e9f86e6c55",
- // "vfModules": {
- // "vf_vmee0..VfVmee..vmme_vlc..module-1": {
- // "2c1ca484-cbc2-408b-ab86-25a2c15ce280": {
- // "action": "None",
- // "instanceName": "ss820f_0918_db",
- // "instanceId": "2c1ca484-cbc2-408b-ab86-25a2c15ce280",
- // "orchStatus": "deleted",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
- // "modelCustomizationId": "b200727a-1bf9-4e7c-bd06-b5f4c9d920b9",
- // "modelInvariantId": "09edc9ef-85d0-4b26-80de-1f569d49e750",
- // "modelVersionId": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
- // "modelType": "vfModule"
- // },
- // "instanceType": null,
- // "provStatus": null,
- // "inMaint": true,
- // "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
- // "originalName": "VfVmee..vmme_vlc..module-1",
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "2c1ca484-cbc2-408b-ab86-25a2c15ce280",
- // "isBase": false,
- // "volumeGroupName": null,
- // "isFailed": true
- // }
- // },
- // "dc229cd8-c132-4455-8517-5c1787c18b14": {
- // "3ef042c4-259f-45e0-9aba-0989bd8d1cc5": {
- // "action": "None",
- // "instanceName": "ss820f_0918_base",
- // "instanceId": "3ef042c4-259f-45e0-9aba-0989bd8d1cc5",
- // "orchStatus": "Assigned",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelCustomizationId": "8ad8670b-0541-4499-8101-275bbd0e8b6a",
- // "modelInvariantId": "1e463c9c-404d-4056-ba56-28fd102608de",
- // "modelVersionId": "dc229cd8-c132-4455-8517-5c1787c18b14",
- // "modelType": "vfModule"
- // },
- // "instanceType": null,
- // "provStatus": null,
- // "inMaint": false,
- // "uuid": "dc229cd8-c132-4455-8517-5c1787c18b14",
- // "originalName": null,
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "3ef042c4-259f-45e0-9aba-0989bd8d1cc5",
- // "isBase": true,
- // "volumeGroupName": null
- // }
- // }
- // },
- // "networks": {}
- // }
- // },
- // "networks": {
- // "e1edb09e-e68b-4ebf-adb8-e2587be56257": {
- // "action": "None",
- // "instanceName": "cNpGlYQDsmrUDK5iG",
- // "instanceId": "e1edb09e-e68b-4ebf-adb8-e2587be56257",
- // "orchStatus": "Created",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelInvariantId": "network-instance-model-invariant-id",
- // "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
- // "modelType": "network"
- // },
- // "instanceType": "CONTRAIL30_HIMELGUARD",
- // "provStatus": "preprov",
- // "inMaint": false,
- // "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
- // "originalName": null,
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "e1edb09e-e68b-4ebf-adb8-e2587be56257"
- // },
- // "de4b5203-ad1c-4f2b-8843-5236fb8dc9ba": {
- // "action": "None",
- // "instanceName": "EI9QlSRVK0lon54Cb",
- // "instanceId": "de4b5203-ad1c-4f2b-8843-5236fb8dc9ba",
- // "orchStatus": "Assigned",
- // "productFamilyId": null,
- // "lcpCloudRegionId": null,
- // "tenantId": null,
- // "modelInfo": {
- // "modelInvariantId": "network-instance-model-invariant-id",
- // "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
- // "modelType": "network"
- // },
- // "instanceType": "CONTRAIL30_BASIC",
- // "provStatus": "nvtprov",
- // "inMaint": false,
- // "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
- // "originalName": null,
- // "legacyRegion": null,
- // "lineOfBusiness": null,
- // "platformName": null,
- // "trackById": "de4b5203-ad1c-4f2b-8843-5236fb8dc9ba",
- // "isFailed": true
- // }
- // },
- // "vnfGroups": {},
- // "validationCounter": 0,
- // "existingVNFCounterMap": {
- // "vnf-instance-model-version-id": 1,
- // "d6557200-ecf2-4641-8094-5393ae3aae60": 1
- // },
- // "existingNetworksCounterMap": {
- // "ddc3f20c-08b5-40fd-af72-c6d14636b986": 2
- // },
- // "existingVnfGroupCounterMap": {}
- // }
- // );
-
}
public retrieveAndStoreServiceInstanceRetryTopology(jobId: string, serviceModeId : string):Observable<ServiceInstance> {
@@ -561,7 +321,7 @@ export class AaiService {
"instanceId":"VNF1_INSTANCE_ID",
"orchStatus":null,
"productFamilyId":null,
- "lcpCloudRegionId":"mtn23b",
+ "lcpCloudRegionId":"hvf23b",
"tenantId":"3e9a20a3e89e45f884e09df0cc2d2d2a",
"tenantName":"APPC-24595-T-IST-02C",
"modelInfo":{
@@ -589,7 +349,7 @@ export class AaiService {
"instanceId":"VNF2_INSTANCE_ID",
"orchStatus":null,
"productFamilyId":null,
- "lcpCloudRegionId":"mtn23b",
+ "lcpCloudRegionId":"hvf23b",
"tenantId":"3e9a20a3e89e45f884e09df0cc2d2d2a",
"tenantName":"APPC-24595-T-IST-02C",
"modelInfo":{