diff options
author | Alexey Sandler <alexey.sandler@intl.att.com> | 2019-08-27 09:08:53 +0300 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2019-08-27 09:10:20 +0300 |
commit | 230d95f0e16cd685f315f6dbc8204438b10e0c3c (patch) | |
tree | d3ea3cdc647af77fbd062e6dff17bac88b42a9cb /vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js | |
parent | cf543614765d41f49c8934e6d2b4a776b6bdff32 (diff) |
get cloudOptionId from getHomingData
Issue-ID: VID-378
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: Ifa5cb0a827161f62b104bf18605531a2ebb29494
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js')
-rwxr-xr-x | vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js index e940183af..0d0fa6d0a 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js @@ -430,6 +430,7 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE }, getLcpCloudRegionTenantList : function(globalCustomerId, serviceType, successCallbackFunction) { + let self = this; $log .debug("AaiService:getLcpCloudRegionTenantList: globalCustomerId: " + globalCustomerId); @@ -447,12 +448,12 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) { var cloudOwner = aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_OWNER]; var cloudRegionId = aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID]; - var cloudRegionOptionId = 'option-' + cloudOwner + '-' + cloudRegionId; + var cloudRegionOptionId = self.cloudRegionOptionId(cloudOwner, cloudRegionId); lcpCloudRegionTenants.push({ "cloudOwner": cloudOwner, "cloudRegionId": cloudRegionId, - "cloudRegionOptionId": cloudRegionOptionId.toLowerCase(), + "cloudRegionOptionId": cloudRegionOptionId, "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME], "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID], "isPermitted": aaiLcpCloudRegionTenants[i][COMPONENT.IS_PERMITTED]}); @@ -760,7 +761,12 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE }); }, + cloudRegionOptionId: function (cloudOwner, cloudRegionId) { + return ('option-' + cloudOwner + '-' + cloudRegionId).toLowerCase(); + }, + getHomingData: function(vnfInstanceId, vfModuleId) { + let self = this; var url = COMPONENT.AAI_GET_HOMING_DATA.replace('@vnfInstanceId', vnfInstanceId) .replace('@vfModuleId', vfModuleId); @@ -768,6 +774,14 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE $http.get(url) .success(function (response) { + var cloudOwner = response[COMPONENT.CLOUD_OWNER]; + var cloudRegionId = response[COMPONENT.CLOUD_REGION_ID]; + if (cloudOwner && cloudRegionId) { + response["cloudRegionOptionId"] = self.cloudRegionOptionId(cloudOwner, cloudRegionId); + } else { + response["cloudRegionOptionId"] = null; + } + deferred.resolve({data: response}); }).error(function (data, status, headers, config) { deferred.reject({message: data, status: status}); |