From 6d038c291eeefe7ef6688ca05d108d85631297d8 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 9 Nov 2017 17:13:47 -0500 Subject: 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 --- .../infrastructure/scripts/DoDeleteVnfAndModules.groovy | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src') 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) -- cgit 1.2.3-korg