X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2FMSOCommonBPMN%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fonap%2Fso%2Fbpmn%2Fcommon%2Fscripts%2FUpdateAAIGenericVnf.groovy;h=3e7c4f2d49fb27c734edd7c70ac66dc72d5f5594;hb=6ba0a22bc952232d14d2d24c5f73a42aae2791a9;hp=7d7b9e103fe6c97a9b8234ca88256f14e4a3ea7d;hpb=58c1d90a787979e507f559d7075aac8a1428df42;p=so.git diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy index 7d7b9e103f..3e7c4f2d49 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy @@ -24,6 +24,10 @@ 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.client.graphinventory.entities.uri.Depth import org.onap.so.rest.APIResponse import org.springframework.web.util.UriUtils import org.onap.so.logger.MessageEnum @@ -129,10 +133,10 @@ public class UpdateAAIGenericVnf 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") + "?depth=1" - + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) + uri.depth(Depth.ONE) + String endPoint = aaiUriUtil.createAaiUri(uri) + try { msoLogger.debug('sending GET to AAI endpoint \'' + endPoint + '\'') msoLogger.debug("Sending GET to AAI endpoint: " + endPoint) @@ -246,9 +250,8 @@ public class UpdateAAIGenericVnf 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") + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) + String endPoint = aaiUriUtil.createAaiUri(uri) try { msoLogger.debug('sending PATCH to AAI endpoint \'' + endPoint + '\'' + 'with payload \n' + payload)