summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy43
3 files changed, 37 insertions, 10 deletions
diff --git a/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml b/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml
index 5bf8864351..160dfb81bf 100644
--- a/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml
+++ b/adapters/mso-vfc-adapter/WebContent/WEB-INF/web.xml
@@ -38,7 +38,7 @@
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
- <url-pattern>/rest/*</url-pattern>
+ <url-pattern>/vfcadapter/*</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
index f4c295337a..684933f3a9 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
@@ -49,7 +49,7 @@ import org.openecomp.mso.logger.MsoLogger;
* @author
* @version ONAP Amsterdam Release 2017-08-28
*/
-@Path("/v1/vfcdrivers")
+@Path("/vfcadapter/v1")
public class VfcAdapterRest {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
index 4a7f4745bc..43a2731eb6 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
@@ -25,7 +25,6 @@ import groovy.xml.XmlUtil
import groovy.json.*
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
-import org.openecomp.mso.bpmn.common.scripts.VidUtils
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.rest.APIResponse
@@ -36,7 +35,10 @@ import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.runtime.Execution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
-import org.springframework.web.util.UriUtils
+import org.springframework.web.util.UriUtils
+import org.openecomp.mso.rest.RESTClient
+import org.openecomp.mso.rest.RESTConfig
+import org.openecomp.mso.rest.APIResponse;
/**
* This groovy class supports the <class>CreateGenericE2EServiceInstance.bpmn</class> process.
@@ -44,18 +46,21 @@ import org.springframework.web.util.UriUtils
*/
public class CreateGenericE2EServiceInstance extends AbstractServiceTaskProcessor {
+ String createUrl = "/vfc/vfcadapters/v1/ns"
+
+ String instantiateUrl = "/vfcvfcadatpers/v1/ns/{nsInstanceId}/instantiate"
+
+ String queryJobUrl = "/vfc/vfcadatpers/v1/jobs/{jobId}"
+
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- VidUtils vidUtils = new VidUtils()
-
/**
* Pre Process the BPMN Flow Request
* Inclouds:
- * Deal with the parameters
- * generate the service instance id
- * generate the operation id
+ * generate the nsOperationKey
+ * generate the nsParameters
*/
public void preProcessRequest (Execution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
@@ -101,8 +106,8 @@ public class CreateGenericE2EServiceInstance extends AbstractServiceTaskProcesso
utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
-
public void createNetworkService(Execution execution) {
+
}
public void instantiateNetworkService(Execution execution) {
@@ -116,4 +121,26 @@ public class CreateGenericE2EServiceInstance extends AbstractServiceTaskProcesso
public void finishNSCreate(Execution execution) {
}
+
+ /**
+ * post request
+ * url: the url of the request
+ * requestBody: the body of the request
+ */
+ private APIResponse postRequest(String url, String requestBody){
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ taskProcessor.logDebug( " ======== Started Execute VFC adapter Post Process ======== ", isDebugEnabled)
+ taskProcessor.logDebug( "url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
+ APIResponse apiResponse = null
+ try{
+ RESTConfig config = new RESTConfig(url);
+ RESTClient client = new RESTClient(config).addHeader("X-FromAppId", "MSO").addHeader("X-TransactionId", uuid).addHeader("Accept","application/json");
+ apiResponse = client.httpPost(requestBody)
+ taskProcessor.logDebug( "======== Completed Execute VF-C adapter Post Process ======== ", isDebugEnabled)
+ }catch(Exception e){
+ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Post Call. Exception is: \n" + e, isDebugEnabled)
+ throw new BpmnError("MSOWorkflowException")
+ }
+ return apiResponse
+ }
}