* ============LICENSE_END=========================================================
*/
-package com.att.bpm.scripts
+package org.openecomp.mso.bpmn.common.scripts
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
-import org.apache.commons.codec.binary.Base64
import org.apache.commons.lang3.*
-
-import org.openecomp.mso.bpmn.core.WorkflowException
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.runtime.Execution
import org.openecomp.mso.rest.APIResponse
-import org.openecomp.mso.rest.RESTClient
-import org.openecomp.mso.rest.RESTConfig
-
import org.springframework.web.util.UriUtils
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getSearchNodesQueryEndpoint(execution)
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+
+ utils.logAudit("GenericGetService AAI Endpoint: " + aai_endpoint)
String path = "${aai_uri}?search-node-type=service-instance&filter=service-instance-id:EQUALS:${serviceInstanceId}"
//String url = "${aai_endpoint}${path}" host name needs to be removed from property
APIResponse response = aaiUriUtil.executeAAIGetCall(execution, url)
int responseCode = response.getStatusCode()
execution.setVariable("GENGS_obtainSIUrlResponseCode", responseCode)
- utils.log("DEBUG", " DELETE Service Instance response code is: " + responseCode, isDebugEnabled)
+ utils.log("DEBUG", " GET Service Instance response code is: " + responseCode, isDebugEnabled)
+ utils.logAudit("GenericGetService AAI GET Response Code: " + responseCode)
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
execution.setVariable("GENGS_obtainSIUrlResponse", aaiResponse)
-
+ utils.logAudit("GenericGetService AAI Response: " + aaiResponse)
//Process Response
if(responseCode == 200){
utils.log("DEBUG", " Query for Service Instance Url Received a Good Response Code", isDebugEnabled)
String url = "${path}"
execution.setVariable("GENGS_obtainSIUrlPath", url)
+ utils.logAudit("GenericGetService AAI Endpoint: " + aai_endpoint)
APIResponse response = aaiUriUtil.executeAAIGetCall(execution, url)
int responseCode = response.getStatusCode()
execution.setVariable("GENGS_obtainSIUrlResponseCode", responseCode)
- utils.log("DEBUG", " DELETE Service Instance response code is: " + responseCode, isDebugEnabled)
-
+ utils.log("DEBUG", " GET Service Instance response code is: " + responseCode, isDebugEnabled)
+ utils.logAudit("GenericGetService AAI Response Code: " + responseCode)
+
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
execution.setVariable("GENGS_obtainSIUrlResponse", aaiResponse)
-
+ utils.logAudit("GenericGetService AAI Response: " + aaiResponse)
//Process Response
if(responseCode == 200){
utils.log("DEBUG", " Query for Service Instance Url Received a Good Response Code", isDebugEnabled)
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
String serviceEndpoint = ""
-
+
+ utils.logAudit("GenericGetService getServiceObject AAI Endpoint: " + aai_endpoint)
if(type.equalsIgnoreCase("service-instance")){
String siResourceLink = execution.getVariable("GENGS_siResourceLink")
if(isBlank(siResourceLink)){
int responseCode = response.getStatusCode()
execution.setVariable("GENGS_getServiceResponseCode", responseCode)
utils.log("DEBUG", " GET Service response code is: " + responseCode, isDebugEnabled)
-
+ utils.logAudit("GenericGetService AAI Response Code: " + responseCode)
+
String aaiResponse = response.getResponseBodyAsString()
aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
execution.setVariable("GENGS_getServiceResponse", aaiResponse)
-
+ utils.logAudit("GenericGetService AAI Response: " + aaiResponse)
+
//Process Response
if(responseCode == 200 || responseCode == 202){
utils.log("DEBUG", "GET Service Received a Good Response Code", isDebugEnabled)