X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bpmn%2FMSOCommonBPMN%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fonap%2Fso%2Fbpmn%2Fcommon%2Fscripts%2FUpdateAAIVfModule.groovy;h=c455ae90ce30f914a33a96d483b006de72e64c1c;hb=6ba0a22bc952232d14d2d24c5f73a42aae2791a9;hp=68b2df213a724d888dc6af21e4ceacfdd0ba41e3;hpb=58c1d90a787979e507f559d7075aac8a1428df42;p=so.git diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy index 68b2df213a..c455ae90ce 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy @@ -24,6 +24,9 @@ import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.UrnPropertiesReader +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.rest.APIResponse import org.springframework.web.util.UriUtils import org.onap.so.logger.MessageEnum @@ -104,12 +107,10 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor { def vnfId = execution.getVariable('UAAIVfMod_vnfId') def vfModuleId = execution.getVariable('UAAIVfMod_vfModuleId') - // Construct endpoint AaiUtil aaiUriUtil = new AaiUtil(this) - def aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution) - msoLogger.debug('AAI URI is: ' + aai_uri) - String endPoint = UrnPropertiesReader.getVariable("aai.endpoint", execution) + aai_uri + '/' + UriUtils.encode(vnfId, "UTF-8") + '/vf-modules/vf-module/' + UriUtils.encode(vfModuleId, "UTF-8") - + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId) + String endPoint = aaiUriUtil.createAaiUri(uri) + try { msoLogger.debug('sending GET to AAI endpoint \'' + endPoint + '\'') msoLogger.debug("UpdateAAIVfModule sending GET to AAI endpoint: " + endPoint) @@ -202,12 +203,9 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor { } """ - - // Construct endpoint AaiUtil aaiUriUtil = new AaiUtil(this) - def aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution) - msoLogger.debug('AAI URI is: ' + aai_uri) - String endPoint = UrnPropertiesReader.getVariable("aai.endpoint", execution) + aai_uri + '/' + UriUtils.encode(vnfId, "UTF-8") + '/vf-modules/vf-module/' + UriUtils.encode(vfModuleId, "UTF-8") + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId) + String endPoint = aaiUriUtil.createAaiUri(uri) try { msoLogger.debug('sending PATCH to AAI endpoint \'' + endPoint + '\'' + 'with payload \n' + payload)