From: Jim Hahn Date: Thu, 9 Nov 2017 22:13:47 +0000 (-0500) Subject: Added authentication info to DoDeleteVnfAndModules X-Git-Tag: v1.1.0~15 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F29%2F23029%2F2;p=so.git Added authentication info to DoDeleteVnfAndModules Modified code to use AaiUtil.executeAAIGetCall() to make the the call to AAI, thus shortening the code while gaining the benefits of the common module (e.g., setting authentication info). Change-Id: Ic0e671c0301c78b14a2234efec3cc7064162d4ad Issue-Id: SO-326 Signed-off-by: Jim Hahn --- diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy index 8c158db1da..3f7ffbf28c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy @@ -230,19 +230,10 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor { utils.logAudit("AAI endPoint: " + endPoint) try { - RESTConfig config = new RESTConfig(endPoint); - def responseData = '' - def aaiRequestId = UUID.randomUUID().toString() - RESTClient client = new RESTClient(config). - addHeader('X-TransactionId', aaiRequestId). - addHeader('X-FromAppId', 'MSO'). - addHeader('Content-Type', 'application/xml'). - addHeader('Accept','application/xml'); - logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled) - APIResponse response = client.httpGet() utils.logAudit("createVfModule - invoking httpGet() to AAI") + APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint) - responseData = response.getResponseBodyAsString() + def responseData = response.getResponseBodyAsString() if (responseData != null) { logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)