diff options
author | Rob Daugherty <rd472p@att.com> | 2018-10-31 10:21:22 -0400 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-10-31 10:38:00 -0400 |
commit | 6b4910cc194286bccb2a63f63d12bfefcdb7fb3f (patch) | |
tree | f140576b3c42c0b575bfe5ab0cf11bffc23f708e /bpmn/so-bpmn-infrastructure-common/src/main | |
parent | 9390b58f5e502bfdf5d0127a4cc5b45e12f17cb6 (diff) | |
parent | a233b62a56517e06ce63b8d801bcdebd6df18af5 (diff) |
10/31: merge casablanca to master
Commit: 649c4e85cc991ffe9c13fd3fab4cc3a303faa656
Subject: Fix Error, Check that vimID is present
Issue: SO-1156
https://gerrit.onap.org/r/#/c/71247/
Commit: 959493d3274d2f2749586248cf31ee12b730e2af
Subject: Bug fixes October 26th
Issue: SO-1169
https://gerrit.onap.org/r/#/c/71343/
Commit: 373c057bfa82583f615ea46814ad3cdf9ea8d669
Subject: Resolve vf_module_id setting bug
Issue: SO-1165
https://gerrit.onap.org/r/#/c/71270/
Commit: 6c2c8a66fade016f74b51bdfea3ba04494530b97
Issue: SO-1102
Subject: Pnf Spring Environment correction
https://gerrit.onap.org/r/#/c/71137/
Change-Id: I22b4566050f627e1f1428aacdb52ec4d4fe75733
Issue-ID: SO-1173
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main')
3 files changed, 55 insertions, 23 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy index 82e27ec116..0f9a0ad292 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy @@ -29,10 +29,13 @@ import org.onap.so.bpmn.common.scripts.MsoUtils import org.onap.so.bpmn.common.scripts.VfModuleBase import org.onap.so.bpmn.core.UrnPropertiesReader; import org.onap.so.bpmn.core.WorkflowException +import org.onap.so.client.aai.AAIObjectType +import org.onap.so.client.aai.entities.uri.AAIResourceUri +import org.onap.so.client.aai.entities.uri.AAIUriFactory +import org.onap.so.constants.Defaults import org.onap.so.logger.MessageEnum import org.onap.so.logger.MsoLogger import org.onap.so.rest.APIResponse -import org.springframework.web.util.UriUtils class UpdateVfModuleVolume extends VfModuleBase { private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModuleVolume.class); @@ -172,14 +175,15 @@ class UpdateVfModuleVolume extends VfModuleBase { try { def volumeGroupId = execution.getVariable('UPDVfModVol_volumeGroupId') def aicCloudRegion = execution.getVariable('UPDVfModVol_aicCloudRegion') - def endPoint = UrnPropertiesReader.getVariable("aai.endpoint", execution) + - '/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/' + UriUtils.encode(aicCloudRegion, "UTF-8") + - '/volume-groups/volume-group/' + UriUtils.encode(volumeGroupId, "UTF-8") + + AaiUtil aaiUtil = new AaiUtil(this) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), aicCloudRegion, volumeGroupId) + String endPoint = aaiUtil.createAaiUri(uri) + msoLogger.debug('Sending GET to AAI endpoint \'' + endPoint + '\'') msoLogger.debug("UpdateVfModuleVolume sending GET for quering AAI endpoint: " + endPoint) - AaiUtil aaiUtil = new AaiUtil(this) APIResponse response = aaiUtil.executeAAIGetCall(execution, endPoint) def int statusCode = response.getStatusCode() def responseData = response.getResponseBodyAsString() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index beac679691..1a47ef88e2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -176,17 +176,30 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("subscriberInfo", subscriberInfo) msoLogger.debug("Incoming subscriberInfo is: " + subscriberInfo) - // extract cloud configuration, split vid_ID into cloudOwner and cloudRegionId + // extract cloud configuration - if underscore "_" is present treat as vimId else it's a cloudRegion String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId") - def cloudRegion = vimId.split("_") - def cloudOwner = cloudRegion[0].toString() - def cloudRegionId = cloudRegion[1].toString() - execution.setVariable("cloudOwner", cloudOwner) - utils.log("DEBUG","cloudOwner: " + cloudOwner, isDebugEnabled) - execution.setVariable("cloudRegionId", cloudRegionId) - utils.log("DEBUG","cloudRegionId: " + cloudRegionId, isDebugEnabled) - + if (vimId.contains("_") && vimId.split("_").length == 2 ) { + def cloudRegion = vimId.split("_") + def cloudOwner = cloudRegion[0] + def cloudRegionId = cloudRegion[1] + execution.setVariable("cloudOwner", cloudOwner) + msoLogger.debug("cloudOwner: " + cloudOwner) + execution.setVariable("cloudRegionId", cloudRegionId) + msoLogger.debug("cloudRegionId: " + cloudRegionId) + } else { + msoLogger.debug("vimId is not present - setting cloudRegion/cloudOwner from request.") + String cloudOwner = jsonUtil.getJsonValue(createVcpeServiceRequest, + "requestDetails.cloudConfiguration.cloudOwner") + if (!cloudOwner?.empty && cloudOwner != "") + { + execution.setVariable("cloudOwner", cloudOwner) + msoLogger.debug("cloudOwner: " + cloudOwner) + } + def cloudRegionId = vimId + execution.setVariable("cloudRegionId", cloudRegionId) + msoLogger.debug("cloudRegionId: " + cloudRegionId) + } /* * Extracting User Parameters from incoming Request and converting into a Map */ @@ -592,16 +605,32 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { msoLogger.debug(" vnfModelInfoString :" + vnfModelInfoString) - // extract cloud configuration + // extract cloud configuration - if underscore "_" is present treat as vimId else it's a cloudRegion String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId") - def cloudRegion = vimId.split("_") - execution.setVariable("cloudOwner", cloudRegion[0]) - msoLogger.debug("cloudOwner: "+ cloudRegion[0]) - execution.setVariable("cloudRegionId", cloudRegion[1]) - msoLogger.debug("cloudRegionId: "+ cloudRegion[1]) - execution.setVariable("lcpCloudRegionId", cloudRegion[1]) - msoLogger.debug("lcpCloudRegionId: "+ cloudRegion[1]) + if (vimId.contains("_") && vimId.split("_").length == 2 ) { + def cloudRegion = vimId.split("_") + execution.setVariable("cloudOwner", cloudRegion[0]) + msoLogger.debug("cloudOwner: " + cloudRegion[0]) + execution.setVariable("cloudRegionId", cloudRegion[1]) + msoLogger.debug("cloudRegionId: " + cloudRegion[1]) + execution.setVariable("lcpCloudRegionId", cloudRegion[1]) + msoLogger.debug("lcpCloudRegionId: " + cloudRegion[1]) + } else { + msoLogger.debug("vimId is not present - setting cloudRegion/cloudOwner from request.") + String cloudOwner = jsonUtil.getJsonValue(createVcpeServiceRequest, + "requestDetails.cloudConfiguration.cloudOwner") + if (!cloudOwner?.empty && cloudOwner != "") + { + execution.setVariable("cloudOwner", cloudOwner) + msoLogger.debug("cloudOwner: " + cloudOwner) + } + execution.setVariable("cloudRegionId", vimId) + msoLogger.debug("cloudRegionId: " + vimId) + execution.setVariable("lcpCloudRegionId", vimId) + msoLogger.debug("lcpCloudRegionId: " + vimId) + } + String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.tenantId") execution.setVariable("tenantId", tenantId) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java index 9cd28a24f4..8e57121876 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java @@ -20,7 +20,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate; -import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_IP; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; |