summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java27
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java117
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java14
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy30
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java11
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java21
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy24
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy18
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn3
-rw-r--r--docs/BPMN_Subprocess_Process_Flows.rst2
-rw-r--r--docs/Install_Configure_SO.rst2
-rw-r--r--docs/SO_R1_Interface.rst8
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java16
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java8
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java109
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java22
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java5
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java14
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClientParamater.java242
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaClientTest.java24
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java81
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java88
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java102
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java78
-rw-r--r--mso-catalog-db/src/main/resources/ArRecipe.hbm.xml4
-rw-r--r--mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml4
-rw-r--r--mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml4
-rw-r--r--mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml2
-rw-r--r--mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml2
-rw-r--r--mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml2
32 files changed, 561 insertions, 530 deletions
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 ebbcf1b1ff..c1f19b7ffb 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
@@ -180,6 +180,33 @@ public class VfcAdapterRest {
}
}
+ /**
+ * Scale NS instance
+ * <br>
+ *
+ * @param servletReq The http request
+ * @param nsInstanceId The NS instance id
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ @POST
+ @Path("/ns/{nsInstanceId}/scale")
+ @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
+ public Response scaleNfvoNs(String data, @PathParam("nsInstanceId") String nsInstanceId) {
+ try {
+ ValidateUtil.assertObjectNotNull(data);
+ LOGGER.debug("Scale Ns Request Received.Body from request is {}" + data);
+ NSResourceInputParameter nsInput = JsonUtil.unMarshal(data, NSResourceInputParameter.class);
+ RestfulResponse rsp = driverMgr.scaleNs(nsInstanceId, nsInput);
+ return buildResponse(rsp);
+ } catch(ApplicationException e) {
+ LOGGER.debug("ApplicationException: ", e);
+ return e.buildErrorResponse();
+ }
+ }
+
+
/**
* build response from restful response <br>
*
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
index d76fbc2133..01e4c718d2 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
@@ -345,68 +345,65 @@ public class VfcManager {
* @return
* @since ONAP Amsterdam Release
*/
- public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId)
- throws ApplicationException {
-
- ValidateUtil.assertObjectNotNull(jobId);
- // Step 1: query the current resource operation status
- ResourceOperationStatus nsOperInfo =
- (RequestsDatabase.getInstance()).getResourceOperationStatus(nsOperationKey.getServiceId(),
- nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID());
-
- // Step 2: start query
- LOGGER.info("query ns status -> begin");
- String url = getUrl(jobId, CommonConstant.Step.QUERY);
- String methodType = CommonConstant.MethodType.GET;
- // prepare restful parameters and options
- RestfulResponse rsp = RestfulUtil.send(url, methodType, "");
- ValidateUtil.assertObjectNotNull(rsp);
- LOGGER.info("query ns progress response status is : {}", rsp.getStatus());
- LOGGER.info("query ns progress response content is : {}", rsp.getResponseContent());
- // Step 3:check the response staus
- if (!HttpCode.isSucess(rsp.getStatus())) {
- LOGGER.info("fail to query job status");
- nsOperInfo.setErrorCode(String.valueOf(rsp.getStatus()));
- nsOperInfo.setStatus(RequestsDbConstant.Status.ERROR);
- nsOperInfo.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);
- (RequestsDatabase.getInstance()).updateResOperStatus(nsOperInfo);
- throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
- DriverExceptionID.FAIL_TO_QUERY_JOB_STATUS);
- }
- // Step 4: Process Network Service Instantiate Response
- NsProgressStatus nsProgress =
- JsonUtil.unMarshal(rsp.getResponseContent(), NsProgressStatus.class);
- ResponseDescriptor rspDesc = nsProgress.getResponseDescriptor();
- // Step 5: update segment operation progress
-
- nsOperInfo.setProgress(rspDesc.getProgress());
- nsOperInfo.setStatusDescription(rspDesc.getStatusDescription());
- (RequestsDatabase.getInstance()).updateResOperStatus(nsOperInfo);
+ public RestfulResponse getNsProgress (NsOperationKey nsOperationKey, String jobId) throws ApplicationException {
+
+ ValidateUtil.assertObjectNotNull (jobId);
+ // Step 1: query the current resource operation status
+ ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance ()).getResourceOperationStatus (
+ nsOperationKey.getServiceId (), nsOperationKey.getOperationId (), nsOperationKey.getNodeTemplateUUID ());
+
+ // Step 2: start query
+ LOGGER.info ("query ns status -> begin");
+ String url = getUrl (jobId, CommonConstant.Step.QUERY);
+ String methodType = CommonConstant.MethodType.GET;
+ // prepare restful parameters and options
+ RestfulResponse rsp = RestfulUtil.send (url, methodType, "");
+ ValidateUtil.assertObjectNotNull (rsp);
+ LOGGER.info ("query ns progress response status is : {}", rsp.getStatus ());
+ LOGGER.info ("query ns progress response content is : {}", rsp.getResponseContent ());
+ // Step 3:check the response staus
+ if (!HttpCode.isSucess (rsp.getStatus ())) {
+ LOGGER.info ("fail to query job status");
+ nsOperInfo.setErrorCode (String.valueOf (rsp.getStatus ()));
+ nsOperInfo.setStatus (RequestsDbConstant.Status.ERROR);
+ nsOperInfo.setStatusDescription (CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);
+ (RequestsDatabase.getInstance ()).updateResOperStatus (nsOperInfo);
+ throw new ApplicationException (HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.FAIL_TO_QUERY_JOB_STATUS);
+ }
+ // Step 4: Process Network Service Instantiate Response
+ NsProgressStatus nsProgress = JsonUtil.unMarshal (rsp.getResponseContent (), NsProgressStatus.class);
+ ResponseDescriptor rspDesc = nsProgress.getResponseDescriptor ();
+ // Step 5: update segment operation progress
+
+ nsOperInfo.setProgress (rspDesc.getProgress ());
+ nsOperInfo.setStatusDescription (rspDesc.getStatusDescription ());
+ (RequestsDatabase.getInstance ()).updateResOperStatus (nsOperInfo);
+
+ // Step 6: update segment operation status
+ if (RequestsDbConstant.Progress.ONE_HUNDRED.equals (rspDesc.getProgress ())
+ && RequestsDbConstant.Status.FINISHED.equals (rspDesc.getStatus ())) {
+ LOGGER.info ("job result is succeeded, operType is {}", nsOperInfo.getOperType ());
+ nsOperInfo.setErrorCode (String.valueOf (rsp.getStatus ()));
+ String operType = nsOperInfo.getOperType ();
+ if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase (operType)
+ || "createInstance".equalsIgnoreCase (operType)) {
+ nsOperInfo.setStatus (RequestsDbConstant.Status.FINISHED);
+ }
+ (RequestsDatabase.getInstance ()).updateResOperStatus (nsOperInfo);
+ } else if (RequestsDbConstant.Status.ERROR.equals (rspDesc.getStatus ())) {
+ LOGGER.error ("job result is failed, operType is {}", nsOperInfo.getOperType ());
+ nsOperInfo.setErrorCode (String.valueOf (rsp.getStatus ()));
+ nsOperInfo.setStatusDescription (CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);
+ nsOperInfo.setStatus (RequestsDbConstant.Status.ERROR);
+ (RequestsDatabase.getInstance ()).updateResOperStatus (nsOperInfo);
+ throw new ApplicationException (HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.JOB_STATUS_ERROR);
+ } else {
+ LOGGER.error ("unexcepted response status");
+ }
+ LOGGER.info ("query ns status -> end");
- // Step 6: update segment operation status
- if (RequestsDbConstant.Progress.ONE_HUNDRED.equals(rspDesc.getProgress())
- && RequestsDbConstant.Status.FINISHED.equals(rspDesc.getStatus())) {
- LOGGER.info("job result is succeeded, operType is {}", nsOperInfo.getOperType());
- nsOperInfo.setErrorCode(String.valueOf(rsp.getStatus()));
- if(RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(nsOperInfo.getOperType())) {
- nsOperInfo.setStatus(RequestsDbConstant.Status.FINISHED);
- }
- (RequestsDatabase.getInstance()).updateResOperStatus(nsOperInfo);
- } else if (RequestsDbConstant.Status.ERROR.equals(rspDesc.getStatus())) {
- LOGGER.error("job result is failed, operType is {}", nsOperInfo.getOperType());
- nsOperInfo.setErrorCode(String.valueOf(rsp.getStatus()));
- nsOperInfo.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED);
- nsOperInfo.setStatus(RequestsDbConstant.Status.ERROR);
- (RequestsDatabase.getInstance()).updateResOperStatus(nsOperInfo);
- throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR,
- DriverExceptionID.JOB_STATUS_ERROR);
- } else {
- LOGGER.error("unexcepted response status");
+ return rsp;
}
- LOGGER.info("query ns status -> end");
-
- return rsp;
- }
/**
* Scale NS instance
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
index 0bedd12eb1..5168de85cc 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
@@ -38,11 +38,11 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.openecomp.mso.adapters.vfc.model.RestfulResponse;
-import org.openecomp.mso.logger.MessageEnum;
import org.openecomp.mso.logger.MsoAlarmLogger;
-import org.openecomp.mso.logger.MsoLogger;
import org.openecomp.mso.properties.MsoPropertiesException;
import org.openecomp.mso.properties.MsoPropertiesFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* <br>
@@ -58,7 +58,7 @@ public class RestfulUtil {
/**
* Log service
*/
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+ private static final Logger LOGGER = LoggerFactory.getLogger(RestfulUtil.class);
private static final MsoAlarmLogger ALARMLOGGER = new MsoAlarmLogger();
@@ -83,7 +83,7 @@ public class RestfulUtil {
msbPort = msoPropertiesFactory.getMsoJavaProperties("MSO_PROP_TOPOLOGY").getProperty("msb-port", DEFAULT_MSB_PORT);
}
} catch(MsoPropertiesException e) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, "Get msb properties failed",e);
+ LOGGER.error("Get msb properties failed",e);
e.printStackTrace();
}
return "http://" + msbIp + ":" + msbPort;
@@ -95,7 +95,7 @@ public class RestfulUtil {
public static RestfulResponse send(String url, String methodType, String content) {
String msbUrl = getMsbHost() + url;
- LOGGER.info(MessageEnum.RA_NS_EXC, "Begin to sent message " + methodType +": " + msbUrl, "org.openecomp.mso.adapters.vfc.util.RestfulUtil","VFC Adapter");
+ LOGGER.info("Begin to sent message " + methodType +": " + msbUrl);
HttpRequestBase method = null;
HttpResponse httpResponse = null;
@@ -196,12 +196,12 @@ public class RestfulUtil {
}
private static void logError(String errMsg, Throwable t) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, errMsg, t);
+ LOGGER.error(errMsg, t);
ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, errMsg);
}
private static void logError(String errMsg) {
- LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, errMsg);
+ LOGGER.error(errMsg);
ALARMLOGGER.sendAlarm("MsoInternalError", MsoAlarmLogger.CRITICAL, errMsg);
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy
index 4b2b0e20ac..f07a477bb3 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofUtils.groovy
@@ -60,13 +60,19 @@ class OofUtils {
ServiceInstance serviceInstance = decomposition.getServiceInstance()
def serviceInstanceId = ""
def serviceInstanceName = ""
- if (serviceInstance == null) {
- utils.log("DEBUG", "Unable to obtain Service Instance Id, ServiceInstance Object is null", isDebugEnabled)
+
+ serviceInstanceId = execution.getVariable("serviceInstanceId")
+ serviceInstanceName = execution.getVariable("serviceInstanceName")
+
+ if (serviceInstanceId == null || serviceInstanceId == "null") {
+ utils.log("DEBUG", "Unable to obtain Service Instance Id", isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " +
- "obtain Service Instance Id, ServiceInstance Object is null")
- } else {
- serviceInstanceId = serviceInstance.getInstanceId()
- serviceInstanceName = serviceInstance.getInstanceName()
+ "obtain Service Instance Id, execution.getVariable(\"serviceInstanceName\") is null")
+ }
+ if (serviceInstanceName == null || serviceInstanceName == "null") {
+ utils.log("DEBUG", "Unable to obtain Service Instance Name", isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - Unable to " +
+ "obtain Service Instance Name, execution.getVariable(\"serviceInstanceName\") is null")
}
//Model Info
ModelInfo model = decomposition.getModelInfo()
@@ -115,7 +121,7 @@ class OofUtils {
def resouceModelVersion = resourceModelInfo.getModelVersion()
def resouceModelVersionId = resourceModelInfo.getModelUuid()
def resouceModelType = resourceModelInfo.getModelType()
- def tenantId = execution.getTenantId()
+ def tenantId = "" //Optional
def requiredCandidatesJson = ""
requiredCandidatesJson = createCandidateJson(
@@ -143,6 +149,7 @@ class OofUtils {
placementDemands = placementDemands.substring(0, placementDemands.length() - 1)
}
+ /* Commenting Out Licensing as OOF doesn't support for Beijing
String licenseDemands = ""
sb = new StringBuilder()
if (vnfResourceList.isEmpty() || vnfResourceList == null) {
@@ -185,7 +192,7 @@ class OofUtils {
licenseDemands = sb.append(licenseDemand)
}
licenseDemands = licenseDemands.substring(0, licenseDemands.length() - 1)
- }
+ }*/
String request =
"{\n" +
@@ -225,12 +232,7 @@ class OofUtils {
" \"modelVersion\": \"${modelVersion}\",\n" +
" \"modelCustomizationName\": \"\"\n" +
" }\n" +
- " },\n" +
- " \"licenseInfo\": {\n" +
- " \"licenseDemands\": [\n" +
- " ${licenseDemands}\n" +
- " }]\n" +
- " }\n" +
+ " }\n" +
"}"
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
index 3515aa9218..4255df3e87 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java
@@ -142,10 +142,17 @@ public class ApplicationControllerClient {
Properties properties = new Properties();
Map<String, String> globalProperties = PropertyConfiguration.getInstance()
.getProperties("mso.bpmn.urn.properties");
- properties.put("topic.read", globalProperties.get("appc.client.topic.read"));
- properties.put("topic.write", globalProperties.get("appc.client.topic.write"));
+ if (controllerType==null || controllerType.length()==0 || controllerType.equalsIgnoreCase("appc")) {
+ properties.put("topic.read", globalProperties.get("appc.client.topic.read"));
+ properties.put("topic.write", globalProperties.get("appc.client.topic.write"));
+ } else {
+ properties.put("topic.read", globalProperties.get("appc.client.topic." + controllerType + ".read"));
+ properties.put("topic.write", globalProperties.get("appc.client.topic." + controllerType + ".write"));
+ }
properties.put("topic.sdnc.read", globalProperties.get("appc.client.topic.sdnc.read"));
properties.put("topic.sdnc.write", globalProperties.get("appc.client.topic.sdnc.write"));
+ properties.put("sdnc-topic.read", globalProperties.get("appc.client.topic.sdnc.read"));
+ properties.put("sdnc-topic.write", globalProperties.get("appc.client.topic.sdnc.write"));
properties.put("topic.read.timeout", globalProperties.get("appc.client.topic.read.timeout"));
properties.put("client.response.timeout", globalProperties.get("appc.client.response.timeout"));
properties.put("poolMembers", globalProperties.get("appc.client.poolMembers"));
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java
index d7239fe0c1..283f3c6116 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/OofHomingTest.java
@@ -549,7 +549,8 @@ public class OofHomingTest extends WorkflowTest {
variables.put("isDebugLogEnabled", "true");
// variables.put("mso-request-id", "testRequestId");
variables.put("msoRequestId", "testRequestId");
- variables.put("serviceInstanceId", "testServiceInstanceId");
+ variables.put("serviceInstanceId", "testServiceInstanceId123");
+ variables.put("serviceInstanceName", "testServiceName");
variables.put("serviceDecomposition", serviceDecomposition);
variables.put("subscriberInfo", subscriber2);
}
@@ -590,7 +591,8 @@ public class OofHomingTest extends WorkflowTest {
variables.put("cloudRegionId", "TNZED");
variables.put("isDebugLogEnabled", "true");
variables.put("msoRequestId", "testRequestId");
- variables.put("serviceInstanceId", "testServiceInstanceId");
+ variables.put("serviceInstanceId", "testServiceInstanceId123");
+ variables.put("serviceInstanceName", "testServiceName");
variables.put("serviceDecomposition", serviceDecomposition);
variables.put("subscriberInfo", subscriber2);
}
@@ -610,7 +612,8 @@ public class OofHomingTest extends WorkflowTest {
variables.put("isDebugLogEnabled", "true");
// variables.put("mso-request-id", "testRequestId");
variables.put("msoRequestId", "testRequestId");
- variables.put("serviceInstanceId", "testServiceInstanceId");
+ variables.put("serviceInstanceId", "testServiceInstanceId123");
+ variables.put("serviceInstanceName", "testServiceName");
variables.put("serviceDecomposition", null);
variables.put("subscriberInfo", subscriber2);
}
@@ -719,23 +722,19 @@ public class OofHomingTest extends WorkflowTest {
"{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\"," +
"\"subscriberCommonSiteId\":\"\"},\"placementDemands\":[{\"resourceModuleName\":\"ALLOTTED_RESOURCE\"" +
",\"serviceResourceId\":\"testResourceIdAR\",\"tenantId\":" +
- "\"null\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR\"," +
+ "\"\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR\"," +
"\"modelVersionId\":\"testARModelUuid\",\"modelName\":\"testModelNameAR\",\"modelType\":" +
"\"testModelTypeAR\",\"modelVersion\":\"testModelVersionAR\",\"modelCustomizationName\":\"\"}}," +
"{\"resourceModuleName\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\"," +
- "\"tenantId\":\"null\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR2\"," +
+ "\"tenantId\":\"\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR2\"," +
"\"modelVersionId\":\"testAr2ModelUuid\",\"modelName\":\"testModelNameAR2\"," +
"\"modelType\":\"testModelTypeAR2\",\"modelVersion\":\"testModelVersionAR2\"," +
"\"modelCustomizationName\":\"\"}}]},\"serviceInfo\":" +
"{\"serviceInstanceId\":\"testServiceInstanceId123\"," +
- "\"serviceName\":\"null\",\"modelInfo\":{\"modelType\":\"\",\"modelInvariantId\":" +
+ "\"serviceName\":\"testServiceName\",\"modelInfo\":{\"modelType\":\"\",\"modelInvariantId\":" +
"\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\"," +
"\"modelVersion\":\"testModelVersion\",\"modelCustomizationName\":\"" +
- "\"}},\"licenseInfo\":{\"licenseDemands\":[{\"resourceModuleName\":\"VNF\",\"serviceResourceId\":" +
- "\"testResourceIdVNF\",\"resourceInstanceType\":\"VNF\",\"resourceModelInfo\":{\"modelInvariantId\":" +
- "\"testModelInvariantIdVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelName\":" +
- "\"testModelNameVNF\",\"modelType\":\"testModelTypeVNF\",\"modelVersion\":\"testModelVersionVNF\"," +
- "\"modelCustomizationName\":\"\"}}]}}";
+ "\"}}}";
return request;
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
index a834431356..bbf61744a8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
@@ -361,24 +361,28 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
List<Resource> deleteResourceList = serviceDecomposition.getServiceResources()
String serviceRelationShip = execution.getVariable("serviceRelationShip")
def jsonSlurper = new JsonSlurper()
- def jsonOutput = new JsonOutput()
- List relationShipList = jsonSlurper.parseText(serviceRelationShip)
-
-
+ def jsonOutput = new JsonOutput()
+
+ List relationShipList = null
+ if (serviceRelationShip != null) {
+ relationShipList = jsonSlurper.parseText(serviceRelationShip)
+ }
+
//Set the real resource instance id to the decomosed resource list
- for(Resource resource: deleteResourceList){
- //reset the resource instance id , because in the decompose flow ,its a random one.
- resource.setResourceId("");
+ for (Resource resource: deleteResourceList) {
+ //reset the resource instance id , because in the decompose flow ,its a random one.
+ resource.setResourceId("");
//match the resource-instance-name and the model name
if (relationShipList != null) {
relationShipList.each {
- if(StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())){
- resource.setResourceId(it.resourceInstanceId);
- }
+ if (StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())) {
+ resource.setResourceId(it.resourceInstanceId);
+ }
}
}
}
execution.setVariable("deleteResourceList", deleteResourceList)
+ utils.log("DEBUG", "delete resource list : " + deleteResourceList, isDebugEnabled)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage()
utils.log("DEBUG", exceptionMessage, isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
index 9e3f78bbda..0e4aea00ae 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
@@ -123,7 +123,7 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
String isScaleFinished = ""
// query the requested network service scale status, if finished, then start the next one, otherwise, wait
- while (isScaleFinished != "finished"){
+ while (isScaleFinished != "finished" && isScaleFinished != "error"){
timeDelay()
queryNSProgress(execution)
isScaleFinished = execution.getVariable("operationStatus")
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index 05c3fa2d5b..ce117d3655 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -74,6 +74,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable("brgWanMacAddress", "")
execution.setVariable("customerLocation", "")
execution.setVariable("homingService", "")
+ execution.setVariable("cloudOwner", "")
+ execution.setVariable("cloudRegionId", "")
//TODO
execution.setVariable("sdncVersion", "1707")
@@ -127,6 +129,11 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
serviceInstanceId = UriUtils.encode(serviceInstanceId, "UTF-8")
execution.setVariable("serviceInstanceId", serviceInstanceId)
+ utils.log("DEBUG", "Incoming serviceInstanceId is: " + serviceInstanceId, isDebugEnabled)
+
+ String serviceInstanceName = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.instanceName")
+ execution.setVariable("serviceInstanceName", serviceInstanceName)
+ utils.log("DEBUG", "Incoming serviceInstanceName is: " + serviceInstanceName, isDebugEnabled)
String requestAction = execution.getVariable("requestAction")
execution.setVariable("requestAction", requestAction)
@@ -169,6 +176,17 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable("subscriberInfo", subscriberInfo)
utils.log("DEBUG", "Incoming subscriberInfo is: " + subscriberInfo, isDebugEnabled)
+ // extract cloud configuration, split vid_ID into cloudOwner and cloudRegionId
+ String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+ "requestDetails.cloudConfiguration.lcpCloudRegionId")
+ def cloudRegion = vimId.split("_")
+ def cloudOwner = cloudRegion[0].toString()
+ def cloudRegionId = cloudRegion[1].toString()
+ execution.setVariable("cloudOwner", cloudOwner)
+ utils.log("DEBUG","cloudOwner: " + cloudOwner, isDebugEnabled)
+ execution.setVariable("cloudRegionId", cloudRegionId)
+ utils.log("DEBUG","cloudRegionId: " + cloudRegionId, isDebugEnabled)
+
/*
* Extracting User Parameters from incoming Request and converting into a Map
*/
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
index d1019887b0..9342e34f59 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
@@ -449,6 +449,9 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
<camunda:in source="subscriberInfo" target="subscriberInfo" />
<camunda:in source="homingService" target="homingService" />
<camunda:in source="customerLocation" target="customerLocation" />
+ <camunda:in source="cloudOwner" target="cloudOwner" />
+ <camunda:in source="cloudRegionId" target="cloudRegionId" />
+ <camunda:in source="serviceInstanceName" target="serviceInstanceName" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_11efpvh</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1jbuf1t</bpmn2:outgoing>
diff --git a/docs/BPMN_Subprocess_Process_Flows.rst b/docs/BPMN_Subprocess_Process_Flows.rst
index cf2da40e87..fc36cc54c9 100644
--- a/docs/BPMN_Subprocess_Process_Flows.rst
+++ b/docs/BPMN_Subprocess_Process_Flows.rst
@@ -22,7 +22,7 @@ Characteristics
The current best practice for reporting errors from subprocess is described here:
- * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.
+ * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.
* The WorkflowException object contains an error code and an error message.
* The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.
diff --git a/docs/Install_Configure_SO.rst b/docs/Install_Configure_SO.rst
index 3f7b903ac8..eb33b38dc2 100644
--- a/docs/Install_Configure_SO.rst
+++ b/docs/Install_Configure_SO.rst
@@ -12,7 +12,7 @@ Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS
Get VirtualBox and VirtualBox Guest Additions
---------------------------------------------
Make sure you have the VirtualBox Guest Additions ISO for your version of VirtualBox. I'm using VirtualBox 5.1.28. Save the Guest Additions ISO on your host computer along with the Ubuntu ISO. Get the Guest Additions ISO from here:
- http://download.virtualbox.org/virtualbox
+ http://download.virtualbox.org/virtualbox
*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3. If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.
Create a new VM in VirtualBox for Ubuntu
diff --git a/docs/SO_R1_Interface.rst b/docs/SO_R1_Interface.rst
index 8346e2b98c..bd654083e3 100644
--- a/docs/SO_R1_Interface.rst
+++ b/docs/SO_R1_Interface.rst
@@ -2,13 +2,13 @@
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2017 Huawei Technologies Co., Ltd.
-SO Amsterdam Interfaces
-================
+SO Interfaces
+================================
.. image:: images/SO_R1_1.png
SO APIs
-============
+=================================
North Bound APIs
----------------
@@ -1026,7 +1026,7 @@ Request Object
+-------------------+---------+-----------+--------------------------+-------------------------------------------+
|Attribute |Qualifier|Cardinality|Content |Description |
+===================+=========+===========+==========================+===========================================+
-|requestId |M |1 |String |Request Id. |
+|requestId |M |1 |String |Request Id. |
+-------------------+---------+-----------+--------------------------+-------------------------------------------+
|startTime |M |1 |request Object |Start time. |
+-------------------+---------+-----------+--------------------------+-------------------------------------------+
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java
index 9f30e67897..faa669133f 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java
@@ -34,7 +34,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
CommonConstants.REQUEST_ID_HEADER,
CommonConstants.IS_BASE_VF_MODULE_VARIABLE, CommonConstants.RECIPE_TIMEOUT_VARIABLE,
CommonConstants.REQUEST_ACTION_VARIABLE, CommonConstants.SERVICE_INSTANCE_ID_VARIABLE,
- CommonConstants.CORRELATION_ID, CommonConstants.VNF_ID_VARIABLE, CommonConstants.VF_MODULE_ID_VARIABLE,
+ CommonConstants.VNF_ID_VARIABLE, CommonConstants.VF_MODULE_ID_VARIABLE,
CommonConstants.VOLUME_GROUP_ID_VARIABLE, CommonConstants.NETWORK_ID_VARIABLE,
CommonConstants.CONFIGURATION_ID_VARIABLE, CommonConstants.SERVICE_TYPE_VARIABLE,
CommonConstants.VNF_TYPE_VARIABLE, CommonConstants.VF_MODULE_TYPE_VARIABLE,
@@ -55,6 +55,7 @@ public class CamundaVIDRequest {
@JsonProperty(CommonConstants.REQUEST_ID_HEADER)
private CamundaInput msoRequestId;
+
@JsonProperty(CommonConstants.IS_BASE_VF_MODULE_VARIABLE)
private CamundaBooleanInput isBaseVfModule;
@@ -67,9 +68,6 @@ public class CamundaVIDRequest {
@JsonProperty(CommonConstants.SERVICE_INSTANCE_ID_VARIABLE)
private CamundaInput serviceInstanceId;
- @JsonProperty(CommonConstants.CORRELATION_ID)
- private CamundaInput correlationId;
-
@JsonProperty(CommonConstants.VNF_ID_VARIABLE)
private CamundaInput vnfId;
@@ -179,16 +177,6 @@ public class CamundaVIDRequest {
this.serviceInstanceId = serviceInstanceId;
}
- @JsonProperty(CommonConstants.CORRELATION_ID)
- public CamundaInput getCorrelationId() {
- return correlationId;
- }
-
- @JsonProperty(CommonConstants.CORRELATION_ID)
- public void setCorrelationId(CamundaInput correlationId) {
- this.correlationId = correlationId;
- }
-
@JsonProperty(CommonConstants.VNF_ID_VARIABLE)
public CamundaInput getVnfId() {
return vnfId;
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java
index 85fe52f24c..1a086ac35c 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java
@@ -85,10 +85,14 @@ public class BPELRestClient extends RequestClient {
}
@Override
- public HttpResponse post(RequestClientParamater params) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
return null;
}
-
+
@Override
public HttpResponse get() {
return null;
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
index d03aaef258..9cc89530c4 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
@@ -20,12 +20,13 @@
package org.openecomp.mso.apihandler.common;
+
import java.io.IOException;
import javax.xml.bind.DatatypeConverter;
-import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
+import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.openecomp.mso.apihandler.camundabeans.CamundaBooleanInput;
@@ -50,7 +51,8 @@ public class CamundaClient extends RequestClient{
@Override
public HttpResponse post(String camundaReqXML, String requestId,
- String requestTimeout, String schemaVersion, String serviceInstanceId, String action) throws IOException {
+ String requestTimeout, String schemaVersion, String serviceInstanceId, String action)
+ throws ClientProtocolException, IOException{
HttpPost post = new HttpPost(url);
msoLogger.debug(CAMUNDA_URL_MESAGE + url);
String jsonReq = wrapRequest(camundaReqXML, requestId, serviceInstanceId, requestTimeout, schemaVersion);
@@ -75,7 +77,7 @@ public class CamundaClient extends RequestClient{
}
@Override
- public HttpResponse post(String jsonReq) throws IOException {
+ public HttpResponse post(String jsonReq) throws ClientProtocolException, IOException{
HttpPost post = new HttpPost(url);
msoLogger.debug(CAMUNDA_URL_MESAGE + url);
@@ -100,13 +102,21 @@ public class CamundaClient extends RequestClient{
}
@Override
- public HttpResponse post(RequestClientParamater params) throws IOException {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd)
+ throws ClientProtocolException, IOException{
HttpPost post = new HttpPost(url);
msoLogger.debug(CAMUNDA_URL_MESAGE + url);
- String jsonReq = wrapVIDRequest(params);
+ String jsonReq = wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction,
+ serviceInstanceId, vnfId, vfModuleId, volumeGroupId, networkId, configurationId,
+ serviceType, vnfType, vfModuleType, networkType, requestDetails, recipeParamXsd);
StringEntity input = new StringEntity(jsonReq);
input.setContentType(CommonConstants.CONTENT_TYPE_JSON);
+
String encryptedCredentials;
if(props!=null){
encryptedCredentials = props.getProperty(CommonConstants.CAMUNDA_AUTH,null);
@@ -118,10 +128,12 @@ public class CamundaClient extends RequestClient{
}
}
}
+
post.setEntity(input);
+
return client.execute(post);
}
-
+
@Override
public HttpResponse get() {
return null;
@@ -138,6 +150,8 @@ public class CamundaClient extends RequestClient{
if(schemaVersion == null){
schemaVersion = "";
}
+
+
try{
CamundaRequest camundaRequest = new CamundaRequest();
CamundaInput camundaInput = new CamundaInput();
@@ -169,8 +183,52 @@ public class CamundaClient extends RequestClient{
return jsonReq;
}
- private String wrapVIDRequest(RequestClientParamater requestClientParamater) {
+ private String wrapVIDRequest(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParams){
String jsonReq = null;
+ if(requestId == null){
+ requestId ="";
+ }
+ if(requestAction == null){
+ requestAction ="";
+ }
+ if(serviceInstanceId == null){
+ serviceInstanceId ="";
+ }
+ if(vnfId == null){
+ vnfId ="";
+ }
+ if(vfModuleId == null){
+ vfModuleId ="";
+ }
+ if(volumeGroupId == null){
+ volumeGroupId ="";
+ }
+ if(networkId == null){
+ networkId ="";
+ }
+ if(configurationId == null){
+ configurationId ="";
+ }
+ if(serviceType == null){
+ serviceType ="";
+ }
+ if(vnfType == null){
+ vnfType ="";
+ }
+ if(vfModuleType == null){
+ vfModuleType ="";
+ }
+ if(networkType == null){
+ networkType ="";
+ }
+ if(requestDetails == null){
+ requestDetails ="";
+ }
+
try{
CamundaVIDRequest camundaRequest = new CamundaVIDRequest();
CamundaInput serviceInput = new CamundaInput();
@@ -180,7 +238,6 @@ public class CamundaClient extends RequestClient{
CamundaIntegerInput recipeTimeoutInput = new CamundaIntegerInput();
CamundaInput requestActionInput = new CamundaInput();
CamundaInput serviceInstanceIdInput = new CamundaInput();
- CamundaInput correlationIdInput = new CamundaInput();
CamundaInput vnfIdInput = new CamundaInput();
CamundaInput vfModuleIdInput = new CamundaInput();
CamundaInput volumeGroupIdInput = new CamundaInput();
@@ -191,23 +248,23 @@ public class CamundaClient extends RequestClient{
CamundaInput vfModuleTypeInput = new CamundaInput();
CamundaInput networkTypeInput = new CamundaInput();
CamundaInput recipeParamsInput = new CamundaInput();
- requestIdInput.setValue(StringUtils.defaultString(requestClientParamater.getRequestId()));
- isBaseVfModuleInput.setValue(requestClientParamater.isBaseVfModule());
- recipeTimeoutInput.setValue(requestClientParamater.getRecipeTimeout());
- requestActionInput.setValue(StringUtils.defaultString(requestClientParamater.getRequestAction()));
- serviceInstanceIdInput.setValue(StringUtils.defaultString(requestClientParamater.getServiceInstanceId()));
- correlationIdInput.setValue(StringUtils.defaultString(requestClientParamater.getCorrelationId()));
- vnfIdInput.setValue(StringUtils.defaultString(requestClientParamater.getVnfId()));
- vfModuleIdInput.setValue(StringUtils.defaultString(requestClientParamater.getVfModuleId()));
- volumeGroupIdInput.setValue(StringUtils.defaultString(requestClientParamater.getVolumeGroupId()));
- networkIdInput.setValue(StringUtils.defaultString(requestClientParamater.getNetworkId()));
- configurationIdInput.setValue(StringUtils.defaultString(requestClientParamater.getConfigurationId()));
- serviceTypeInput.setValue(StringUtils.defaultString(requestClientParamater.getServiceType()));
- vnfTypeInput.setValue(StringUtils.defaultString(requestClientParamater.getVnfType()));
- vfModuleTypeInput.setValue(StringUtils.defaultString(requestClientParamater.getVfModuleType()));
- networkTypeInput.setValue(StringUtils.defaultString(requestClientParamater.getNetworkType()));
- recipeParamsInput.setValue(requestClientParamater.getRecipeParamXsd());
- serviceInput.setValue(StringUtils.defaultString(requestClientParamater.getRequestDetails()));
+ host.setValue(parseURL());
+ requestIdInput.setValue(requestId);
+ isBaseVfModuleInput.setValue(isBaseVfModule);
+ recipeTimeoutInput.setValue(recipeTimeout);
+ requestActionInput.setValue(requestAction);
+ serviceInstanceIdInput.setValue(serviceInstanceId);
+ vnfIdInput.setValue(vnfId);
+ vfModuleIdInput.setValue(vfModuleId);
+ volumeGroupIdInput.setValue(volumeGroupId);
+ networkIdInput.setValue(networkId);
+ configurationIdInput.setValue(configurationId);
+ serviceTypeInput.setValue(serviceType);
+ vnfTypeInput.setValue(vnfType);
+ vfModuleTypeInput.setValue(vfModuleType);
+ networkTypeInput.setValue(networkType);
+ recipeParamsInput.setValue(recipeParams);
+ serviceInput.setValue(requestDetails);
camundaRequest.setServiceInput(serviceInput);
camundaRequest.setHost(host);
camundaRequest.setRequestId(requestIdInput);
@@ -216,7 +273,6 @@ public class CamundaClient extends RequestClient{
camundaRequest.setRecipeTimeout(recipeTimeoutInput);
camundaRequest.setRequestAction(requestActionInput);
camundaRequest.setServiceInstanceId(serviceInstanceIdInput);
- camundaRequest.setCorrelationId(correlationIdInput);
camundaRequest.setVnfId(vnfIdInput);
camundaRequest.setVfModuleId(vfModuleIdInput);
camundaRequest.setVolumeGroupId(volumeGroupIdInput);
@@ -250,4 +306,5 @@ public class CamundaClient extends RequestClient{
return host;
}
+
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
index 845b140348..3941e1e5af 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
@@ -25,6 +25,7 @@ import java.io.IOException;
import javax.xml.bind.DatatypeConverter;
import org.apache.http.HttpResponse;
+import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
@@ -38,7 +39,8 @@ public class CamundaTaskClient extends RequestClient{
}
@Override
- public HttpResponse post(String jsonReq) throws IOException{
+ public HttpResponse post(String jsonReq)
+ throws ClientProtocolException, IOException{
HttpPost post = new HttpPost(url);
msoLogger.debug("Camunda Task url is: "+ url);
@@ -63,18 +65,25 @@ public class CamundaTaskClient extends RequestClient{
@Override
public HttpResponse post(String camundaReqXML, String requestId,
- String requestTimeout, String schemaVersion, String serviceInstanceId, String action) {
+ String requestTimeout, String schemaVersion, String serviceInstanceId, String action)
+ throws ClientProtocolException, IOException{
msoLogger.debug("Method not supported");
return null;
}
-
+
@Override
- public HttpResponse post(RequestClientParamater params) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd)
+ throws ClientProtocolException, IOException{
+ msoLogger.debug("Method not supported");
return null;
}
-
+
@Override
- public HttpResponse get() throws IOException{
+ public HttpResponse get() throws ClientProtocolException, IOException{
HttpGet get = new HttpGet(url);
msoLogger.debug("Camunda Task url is: "+ url);
String encryptedCredentials;
@@ -88,6 +97,7 @@ public class CamundaTaskClient extends RequestClient{
}
}
}
+
return client.execute(get);
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java
index daa411a963..4dac998527 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java
@@ -25,11 +25,13 @@ public final class CommonConstants {
public static final String DEFAULT_BPEL_AUTH = "admin:admin";
public static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+
public static final String REQUEST_ID_HEADER = "mso-request-id";
public static final String REQUEST_TIMEOUT_HEADER = "mso-service-request-timeout";
public static final String SCHEMA_VERSION_HEADER = "mso-schema-version";
public static final String SERVICE_INSTANCE_ID_HEADER = "mso-service-instance-id";
public static final String ACTION_HEADER = "mso-action";
+
public static final String CAMUNDA_SERVICE_INPUT = "bpmnRequest";
public static final String CAMUNDA_ROOT_INPUT = "variables";
public static final String CONTENT_TYPE_JSON= "application/json";
@@ -45,12 +47,13 @@ public final class CommonConstants {
public static final int CAMUNDA = 1;
public static final int CAMUNDATASK = 2;
public static final String CAMUNDA_HOST = "host";
+ public static final String SDNC_UUID_HEADER = "mso-sdnc-request-id";
+
public static final String REQUEST_ID_VARIABLE = "requestId";
public static final String IS_BASE_VF_MODULE_VARIABLE = "isBaseVfModule";
public static final String RECIPE_TIMEOUT_VARIABLE = "recipeTimeout";
public static final String REQUEST_ACTION_VARIABLE = "requestAction";
public static final String SERVICE_INSTANCE_ID_VARIABLE = "serviceInstanceId";
- public static final String CORRELATION_ID = "correlationId";
public static final String VNF_ID_VARIABLE = "vnfId";
public static final String VF_MODULE_ID_VARIABLE = "vfModuleId";
public static final String VOLUME_GROUP_ID_VARIABLE = "volumeGroupId";
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java
index ed5d076d8c..d702a63fda 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java
@@ -67,11 +67,17 @@ public abstract class RequestClient {
public abstract HttpResponse post(String request, String requestId, String requestTimeout, String schemaVersion, String serviceInstanceId, String action) throws ClientProtocolException, IOException;
- public abstract HttpResponse post(String request) throws IOException;
-
- public abstract HttpResponse post(RequestClientParamater params) throws IOException;
+ public abstract HttpResponse post(String request) throws ClientProtocolException, IOException;
+
+ public abstract HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd)
+ throws ClientProtocolException, IOException;
- public abstract HttpResponse get() throws IOException;
+ public abstract HttpResponse get()
+ throws ClientProtocolException, IOException;
protected String getEncryptedPropValue (String prop, String defaultValue, String encryptionKey) {
try {
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClientParamater.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClientParamater.java
deleted file mode 100644
index 4db69199da..0000000000
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClientParamater.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.apihandler.common;
-
-public class RequestClientParamater {
-
- private String requestId;
- private boolean isBaseVfModule;
- private int recipeTimeout;
- private String requestAction;
- private String serviceInstanceId;
- private String correlationId;
- private String vnfId;
- private String vfModuleId;
- private String volumeGroupId;
- private String networkId;
- private String configurationId;
- private String serviceType;
- private String vnfType;
- private String vfModuleType;
- private String networkType;
- private String requestDetails;
- private String recipeParamXsd;
-
- private RequestClientParamater(Builder builder) {
- requestId = builder.requestId;
- isBaseVfModule = builder.isBaseVfModule;
- recipeTimeout = builder.recipeTimeout;
- requestAction = builder.requestAction;
- serviceInstanceId = builder.serviceInstanceId;
- correlationId = builder.correlationId;
- vnfId = builder.vnfId;
- vfModuleId = builder.vfModuleId;
- volumeGroupId = builder.volumeGroupId;
- networkId = builder.networkId;
- configurationId = builder.configurationId;
- serviceType = builder.serviceType;
- vnfType = builder.vnfType;
- vfModuleType = builder.vfModuleType;
- networkType = builder.networkType;
- requestDetails = builder.requestDetails;
- recipeParamXsd = builder.recipeParamXsd;
- }
-
- public String getRequestId() {
- return requestId;
- }
-
- public boolean isBaseVfModule() {
- return isBaseVfModule;
- }
-
- public int getRecipeTimeout() {
- return recipeTimeout;
- }
-
- public String getRequestAction() {
- return requestAction;
- }
-
- public String getServiceInstanceId() {
- return serviceInstanceId;
- }
-
- public String getCorrelationId() {
- return correlationId;
- }
-
- public String getVnfId() {
- return vnfId;
- }
-
- public String getVfModuleId() {
- return vfModuleId;
- }
-
- public String getVolumeGroupId() {
- return volumeGroupId;
- }
-
- public String getNetworkId() {
- return networkId;
- }
-
- public String getConfigurationId() {
- return configurationId;
- }
-
- public String getServiceType() {
- return serviceType;
- }
-
- public String getVnfType() {
- return vnfType;
- }
-
- public String getVfModuleType() {
- return vfModuleType;
- }
-
- public String getNetworkType() {
- return networkType;
- }
-
- public String getRequestDetails() {
- return requestDetails;
- }
-
- public String getRecipeParamXsd() {
- return recipeParamXsd;
- }
-
- public static class Builder {
- private String requestId;
- private boolean isBaseVfModule;
- private int recipeTimeout;
- private String requestAction;
- private String serviceInstanceId;
- private String correlationId;
- private String vnfId;
- private String vfModuleId;
- private String volumeGroupId;
- private String networkId;
- private String configurationId;
- private String serviceType;
- private String vnfType;
- private String vfModuleType;
- private String networkType;
- private String requestDetails;
- private String recipeParamXsd;
-
- public Builder setRequestId(String requestId) {
- this.requestId = requestId;
- return this;
- }
-
- public Builder setBaseVfModule(boolean baseVfModule) {
- isBaseVfModule = baseVfModule;
- return this;
- }
-
- public Builder setRecipeTimeout(int recipeTimeout) {
- this.recipeTimeout = recipeTimeout;
- return this;
- }
-
- public Builder setRequestAction(String requestAction) {
- this.requestAction = requestAction;
- return this;
- }
-
- public Builder setServiceInstanceId(String serviceInstanceId) {
- this.serviceInstanceId = serviceInstanceId;
- return this;
- }
-
- public Builder setCorrelationId(String correlationId) {
- this.correlationId = correlationId;
- return this;
- }
-
- public Builder setVnfId(String vnfId) {
- this.vnfId = vnfId;
- return this;
- }
-
- public Builder setVfModuleId(String vfModuleId) {
- this.vfModuleId = vfModuleId;
- return this;
- }
-
- public Builder setVolumeGroupId(String volumeGroupId) {
- this.volumeGroupId = volumeGroupId;
- return this;
- }
-
- public Builder setNetworkId(String networkId) {
- this.networkId = networkId;
- return this;
- }
-
- public Builder setConfigurationId(String configurationId) {
- this.configurationId = configurationId;
- return this;
- }
-
- public Builder setServiceType(String serviceType) {
- this.serviceType = serviceType;
- return this;
- }
-
- public Builder setVnfType(String vnfType) {
- this.vnfType = vnfType;
- return this;
- }
-
- public Builder setVfModuleType(String vfModuleType) {
- this.vfModuleType = vfModuleType;
- return this;
- }
-
- public Builder setNetworkType(String networkType) {
- this.networkType = networkType;
- return this;
- }
-
- public Builder setRequestDetails(String requestDetails) {
- this.requestDetails = requestDetails;
- return this;
- }
-
- public Builder setRecipeParamXsd(String recipeParamXsd) {
- this.recipeParamXsd = recipeParamXsd;
- return this;
- }
-
- public RequestClientParamater build(){
- return new RequestClientParamater(this);
- }
- }
-
-
-}
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaClientTest.java
index 69927e2126..8bfc4ced76 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaClientTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaClientTest.java
@@ -24,6 +24,7 @@ package org.openecomp.mso.camunda.tests;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
+import java.util.UUID;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@@ -41,9 +42,12 @@ import org.mockito.MockitoAnnotations;
import org.openecomp.mso.apihandler.common.CommonConstants;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.RequestClientParamater;
import org.openecomp.mso.properties.MsoJavaProperties;
+import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+
+
/**
* This class implements test methods of Camunda Beans.
*
@@ -62,7 +66,8 @@ public class CamundaClientTest {
}
@Test
- public void tesCamundaPost() throws IOException {
+ public void tesCamundaPost() throws JsonGenerationException,
+ JsonMappingException, IOException {
String responseBody ="{\"links\":[{\"method\":\"GET\",\"href\":\"http://localhost:9080/engine-rest/process-instance/2047c658-37ae-11e5-9505-7a1020524153\",\"rel\":\"self\"}],\"id\":\"2047c658-37ae-11e5-9505-7a1020524153\",\"definitionId\":\"dummy:10:73298961-37ad-11e5-9505-7a1020524153\",\"businessKey\":null,\"caseInstanceId\":null,\"ended\":true,\"suspended\":false}";
HttpResponse mockResponse = createResponse(200, responseBody);
@@ -101,6 +106,8 @@ public class CamundaClientTest {
mockHttpClient = Mockito.mock(HttpClient.class);
Mockito.when(mockHttpClient.execute(Mockito.any(HttpPost.class)))
.thenReturn(mockResponse);
+
+ String reqXML = "<xml>test</xml>";
String orchestrationURI = "/engine-rest/process-definition/key/dummy/start";
MsoJavaProperties props = new MsoJavaProperties();
@@ -108,7 +115,9 @@ public class CamundaClientTest {
RequestClient requestClient = RequestClientFactory.getRequestClient(orchestrationURI, props);
requestClient.setClient(mockHttpClient);
- HttpResponse response = requestClient.post(createParams());
+ HttpResponse response = requestClient.post("mso-req-id", false, 180,
+ "createInstance", "svc-inst-id", "vnf-id", "vf-module-id", "vg-id", "nw-id", "conf-id", "svc-type",
+ "vnf-type", "vf-module-type", "nw-type", "", "");
assertEquals(requestClient.getType(), CommonConstants.CAMUNDA);
assertEquals(response.getStatusLine().getStatusCode(), HttpStatus.SC_OK);
}
@@ -128,15 +137,6 @@ public class CamundaClientTest {
return response;
}
- private RequestClientParamater createParams(){
- return new RequestClientParamater.Builder().setRequestId("mso-req-id").setBaseVfModule(false).
- setRecipeTimeout(180).setRequestAction("createInstance").setServiceInstanceId("svc-inst-id").
- setVnfId("vnf-id").setVfModuleId("vf-module-id").setVolumeGroupId("vg-id").setNetworkId("nw-id").
- setConfigurationId("conf-id").setServiceType("svc-type").setVnfType("vnf-type").
- setVfModuleType("vf-module-type").setNetworkType("nw-type").setRequestDetails("").
- setRecipeParamXsd("").build();
- }
-
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
index dca2069cec..23adafd08e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
@@ -43,7 +43,6 @@ import org.json.JSONObject;
import org.openecomp.mso.apihandler.common.ErrorNumbers;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.RequestClientParamater;
import org.openecomp.mso.apihandler.common.ResponseHandler;
import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.CompareModelsRequest;
import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;
@@ -83,6 +82,8 @@ public class E2EServiceInstances {
private ServiceInstancesRequest sir = null;
public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
+ public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";
+ public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";
/**
* POST Requests for E2E Service create Instance on a version provided
@@ -227,6 +228,7 @@ public class E2EServiceInstances {
// Define RecipeLookupResult info here instead of query DB for efficiency
String workflowUrl = "/mso/async/services/CompareModelofE2EServiceInstance";
+ int recipeTimeout = 180;
RequestClient requestClient = null;
HttpResponse response = null;
@@ -237,15 +239,14 @@ public class E2EServiceInstances {
requestClient = RequestClientFactory.getRequestClient(workflowUrl, MsoPropertiesUtils.loadMsoProperties());
JSONObject jjo = new JSONObject(requestJSON);
+ String bpmnRequest = jjo.toString();
// Capture audit event
msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- RequestClientParamater requestClientParamater = new RequestClientParamater.Builder().setRequestId(requestId).
- setBaseVfModule(false).setRecipeTimeout(180).setRequestAction(action.name()).
- setServiceInstanceId(instanceIdMap.get("serviceId")).setServiceType(e2eCompareModelReq.getServiceType()).
- setRequestDetails(jjo.toString()).build();
-
- response = requestClient.post(requestClientParamater);
+ String serviceId = instanceIdMap.get("serviceId");
+ String serviceType = e2eCompareModelReq.getServiceType();
+ response = requestClient.post(requestId, false, recipeTimeout, action.name(), serviceId, null, null, null,
+ null, null, serviceType, null, null, null, bpmnRequest, null);
msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
"Successfully received response from BPMN engine", "BPMN", workflowUrl, null);
@@ -439,6 +440,8 @@ public class E2EServiceInstances {
HttpResponse response = null;
long subStartTime = System.currentTimeMillis();
+ // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
try {
requestClient = RequestClientFactory.getRequestClient(
recipeLookupResult.getOrchestrationURI(),
@@ -446,16 +449,19 @@ public class E2EServiceInstances {
JSONObject jjo = new JSONObject(requestJSON);
jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+
+ String bpmnRequest = jjo.toString();
+
// Capture audit event
msoLogger
.debug("MSO API Handler Posting call to BPEL engine for url: "
+ requestClient.getUrl());
-
- RequestClientParamater requestClientParamater = new RequestClientParamater.Builder().setRequestId(requestId).
- setBaseVfModule(false).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()).
- setRequestAction(action.name()).setServiceType(e2eDelReq.getServiceType()).
- setRequestDetails(jjo.toString()).setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
- response = requestClient.post(requestClientParamater);
+ String serviceId = instanceIdMap.get("serviceId");
+ String serviceInstanceType = e2eDelReq.getServiceType();
+ response = requestClient.post(requestId, false,
+ recipeLookupResult.getRecipeTimeout(), action.name(),
+ serviceId, null, null, null, null, null, serviceInstanceType,
+ null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
msoLogger.recordMetricEvent(subStartTime,
MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
@@ -558,6 +564,12 @@ public class E2EServiceInstances {
return response;
}
+ //check for the current operation status
+// Response resp = checkE2ESvcInstStatus(action, serviceId, startTime, msoRequest);
+// if(resp != null && resp.getStatus() != 200) {
+// return resp;
+// }
+
CatalogDatabase db = null;
RecipeLookupResult recipeLookupResult = null;
try {
@@ -603,19 +615,18 @@ public class E2EServiceInstances {
HttpResponse response = null;
long subStartTime = System.currentTimeMillis();
+ String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
try {
requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
MsoPropertiesUtils.loadMsoProperties());
// Capture audit event
msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- RequestClientParamater requestClientParamater = new RequestClientParamater.Builder().setRequestId(requestId).
- setBaseVfModule(false).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()).setRequestAction(action.name()).
- setServiceInstanceId(serviceId).setServiceType(serviceInstanceType).
- setRequestDetails(mapReqJsonToSvcInstReq(e2eSir, requestJSON)).
- setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
- response = requestClient.post(requestClientParamater);
+ response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+ serviceId, null, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson,
+ recipeLookupResult.getRecipeParamXsd());
msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
"Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
@@ -741,23 +752,25 @@ public class E2EServiceInstances {
return response;
}
+ String serviceInstanceType = e2eSir.getService().getServiceType();
+
+ String serviceId = "";
RequestClient requestClient = null;
HttpResponse response = null;
long subStartTime = System.currentTimeMillis();
+ String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
try {
requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
MsoPropertiesUtils.loadMsoProperties());
// Capture audit event
msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- RequestClientParamater requestClientParamater = new RequestClientParamater.Builder().setRequestId(requestId).
- setBaseVfModule(false).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()).setRequestAction(action.name()).
- setServiceInstanceId("").setServiceType(e2eSir.getService().getServiceType()).
- setRequestDetails(mapReqJsonToSvcInstReq(e2eSir, requestJSON)).
- setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
- response = requestClient.post(requestClientParamater);
+ response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+ serviceId, null, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson,
+ recipeLookupResult.getRecipeParamXsd());
msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
"Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
@@ -884,6 +897,8 @@ public class E2EServiceInstances {
HttpResponse response = null;
long subStartTime = System.currentTimeMillis();
+ // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
try {
requestClient = RequestClientFactory.getRequestClient(
recipeLookupResult.getOrchestrationURI(),
@@ -892,18 +907,18 @@ public class E2EServiceInstances {
JSONObject jjo = new JSONObject(requestJSON);
jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+ String bpmnRequest = jjo.toString();
+
// Capture audit event
msoLogger
.debug("MSO API Handler Posting call to BPEL engine for url: "
+ requestClient.getUrl());
- RequestClientParamater requestClientParamater = new RequestClientParamater.Builder().setRequestId(requestId).
- setBaseVfModule(false).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()).setRequestAction(action.name()).
- setServiceInstanceId(instanceIdMap.get("serviceId")).
- setServiceType(e2eScaleReq.getService().getServiceType()).
- setRequestDetails(jjo.toString()).
- setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
-
- response = requestClient.post(requestClientParamater);
+ String serviceId = instanceIdMap.get("serviceId");
+ String serviceInstanceType = e2eScaleReq.getService().getServiceType();
+ response = requestClient.post(requestId, false,
+ recipeLookupResult.getRecipeTimeout(), action.name(),
+ serviceId, null, null, null, null, null, serviceInstanceType,
+ null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
msoLogger.recordMetricEvent(subStartTime,
MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
index 3f6cc35432..2f2ef313f4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
@@ -85,6 +85,7 @@ public class MsoRequest {
private String requestId;
private String requestXML;
+ private String requestJSON;
private String requestUri;
private VnfRequest vnfReq;
private RequestInfo requestInfo;
@@ -117,6 +118,8 @@ public class MsoRequest {
private OwningEntity owningEntity;
private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH);
+ private static final String NOT_PROVIDED = "not provided";
+
protected AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager ();
MsoRequest (String requestId) {
@@ -1150,7 +1153,7 @@ public class MsoRequest {
mapper.setSerializationInclusion(Include.NON_NULL);
//mapper.configure(Feature.WRAP_ROOT_VALUE, true);
msoLogger.debug ("building sir from object " + sir);
- String requestJSON = mapper.writeValueAsString(sir);
+ requestJSON = mapper.writeValueAsString(sir);
// Perform mapping from VID-style modelInfo fields to ASDC-style modelInfo fields
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
index 581ad34939..e16963db3b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
@@ -20,7 +20,6 @@
*/
package org.openecomp.mso.apihandlerinfra;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -43,7 +42,6 @@ import org.openecomp.mso.apihandler.common.CommonConstants;
import org.openecomp.mso.apihandler.common.ErrorNumbers;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.RequestClientParamater;
import org.openecomp.mso.apihandler.common.ResponseHandler;
import org.openecomp.mso.apihandler.common.ValidationException;
import org.openecomp.mso.serviceinstancebeans.ModelInfo;
@@ -692,7 +690,37 @@ public class ServiceInstances {
}
db.close();
- msoLogger.debug ("requestId is: " + msoRequest.getRequestId());
+
+ String serviceInstanceId = "";
+ String vnfId = "";
+ String vfModuleId = "";
+ String volumeGroupId = "";
+ String networkId = "";
+ ServiceInstancesRequest siReq = msoRequest.getServiceInstancesRequest();
+
+ if(siReq.getServiceInstanceId () != null){
+ serviceInstanceId = siReq.getServiceInstanceId ();
+ }
+
+ if(siReq.getVnfInstanceId () != null){
+ vnfId = siReq.getVnfInstanceId ();
+ }
+
+ if(siReq.getVfModuleInstanceId () != null){
+ vfModuleId = siReq.getVfModuleInstanceId ();
+ }
+
+ if(siReq.getVolumeGroupInstanceId () != null){
+ volumeGroupId = siReq.getVolumeGroupInstanceId ();
+ }
+
+ if(siReq.getNetworkInstanceId () != null){
+ networkId = siReq.getNetworkInstanceId ();
+ }
+
+
+ requestId = msoRequest.getRequestId ();
+ msoLogger.debug ("requestId is: " + requestId);
msoLogger.debug ("About to insert a record");
try {
@@ -708,32 +736,15 @@ public class ServiceInstances {
return response;
}
- return postBPELRequest(action, startTime, msoRequest, recipeLookupResult.getOrchestrationURI(),
- recipeLookupResult.getRecipeTimeout(), isBaseVfModule);
+ return postBPELRequest(action, requestId, startTime, msoRequest, recipeLookupResult.getOrchestrationURI(), recipeLookupResult.getRecipeTimeout(),
+ isBaseVfModule, serviceInstanceId, vnfId, vfModuleId, volumeGroupId, networkId, null,
+ msoRequest.getServiceInstanceType(), msoRequest.getVnfType(), msoRequest.getVfModuleType(), msoRequest.getNetworkType());
}
- private RequestClientParamater buildRequestClientParameter(MsoRequest msoRequest, boolean isBaseVfModule,
- int timeOut, String requestAction) throws IOException {
- return new RequestClientParamater.Builder().
- setRequestId(msoRequest.getRequestId()).
- setBaseVfModule(isBaseVfModule).setRecipeTimeout(timeOut).
- setRequestAction(requestAction).
- setServiceInstanceId(msoRequest.getServiceInstancesRequest().getServiceInstanceId()).
- setCorrelationId(msoRequest.getServiceInstancesRequest().getCorrelationId()).
- setVnfId(msoRequest.getServiceInstancesRequest().getVnfInstanceId()).
- setVfModuleId(msoRequest.getServiceInstancesRequest().getVfModuleInstanceId()).
- setVolumeGroupId(msoRequest.getServiceInstancesRequest().getVolumeGroupInstanceId()).
- setNetworkId(msoRequest.getServiceInstancesRequest().getNetworkInstanceId()).
- setConfigurationId(msoRequest.getServiceInstancesRequest().getConfigurationId()).
- setServiceType(msoRequest.getServiceInstanceType()).
- setVnfType(msoRequest.getVnfType()).
- setVfModuleType(msoRequest.getVfModuleType()).
- setNetworkType(msoRequest.getNetworkType()).
- setRequestDetails(msoRequest.getRequestJSON()).build();
- }
-
- private Response postBPELRequest(Action action, long startTime, MsoRequest msoRequest,
- String orchestrationUri, int timeOut, Boolean isBaseVfModule) {
+ private Response postBPELRequest(Action action, String requestId, long startTime, MsoRequest msoRequest,
+ String orchestrationUri, int timeOut, Boolean isBaseVfModule,
+ String serviceInstanceId, String vnfId, String vfModuleId, String volumeGroupId, String networkId,
+ String configurationId, String serviceInstanceType, String vnfType, String vfModuleType, String networkType) {
RequestClient requestClient = null;
HttpResponse response = null;
long subStartTime = System.currentTimeMillis();
@@ -743,7 +754,12 @@ public class ServiceInstances {
System.out.println("URL : " + requestClient.getUrl ());
- response = requestClient.post(buildRequestClientParameter(msoRequest, isBaseVfModule, timeOut, action.name()));
+ response = requestClient.post(requestId, isBaseVfModule, timeOut, action.name (),
+ serviceInstanceId, vnfId, vfModuleId, volumeGroupId, networkId, configurationId,
+ msoRequest.getServiceInstanceType (),
+ msoRequest.getVnfType (), msoRequest.getVfModuleType (),
+ msoRequest.getNetworkType (), msoRequest.getRequestJSON(), null);
+
msoLogger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from BPMN engine", "BPMN", orchestrationUri, null);
} catch (Exception e) {
msoLogger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN", orchestrationUri, null);
@@ -1175,6 +1191,7 @@ public class ServiceInstances {
return new RecipeLookupResult (vnfRecipe.getOrchestrationUri(), vnfRecipe.getRecipeTimeout());
}
+
private RecipeLookupResult getNetworkUri (CatalogDatabase db, MsoRequest msoRequest, Action action) throws Exception {
String defaultNetworkType = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
@@ -1282,6 +1299,18 @@ public class ServiceInstances {
return response;
}
+
+ String serviceInstanceId = "";
+ String configurationId = "";
+ ServiceInstancesRequest siReq = msoRequest.getServiceInstancesRequest();
+
+ if(siReq.getServiceInstanceId () != null){
+ serviceInstanceId = siReq.getServiceInstanceId ();
+ }
+
+ if(siReq.getConfigurationId() != null){
+ configurationId = siReq.getConfigurationId();
+ }
requestId = msoRequest.getRequestId ();
msoLogger.debug ("requestId is: " + requestId);
@@ -1299,6 +1328,7 @@ public class ServiceInstances {
return response;
}
- return postBPELRequest(action, startTime, msoRequest, orchestrationUri, Integer.parseInt(timeOut), false);
+ return postBPELRequest(action, requestId, startTime, msoRequest, orchestrationUri, Integer.parseInt(timeOut), false,
+ serviceInstanceId, null, null, null, null, configurationId, null, null, null, null);
}
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
index 901e03fc17..60ac6b98c9 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
@@ -40,12 +40,12 @@ import org.junit.Test;
import org.openecomp.mso.apihandler.common.CamundaClient;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.RequestClientParamater;
import org.openecomp.mso.apihandler.common.ValidationException;
import org.openecomp.mso.db.AbstractSessionFactoryManager;
import org.openecomp.mso.db.catalog.CatalogDatabase;
import org.openecomp.mso.db.catalog.beans.Service;
import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
+import org.openecomp.mso.properties.MsoDatabaseException;
import org.openecomp.mso.properties.MsoJavaProperties;
import org.openecomp.mso.properties.MsoPropertiesFactory;
import org.openecomp.mso.requestsdb.OperationStatus;
@@ -194,7 +194,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -253,7 +258,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 500,
"test response");
@@ -313,7 +323,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 500,
"test response");
@@ -373,7 +388,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
HttpResponse resp = null;
return resp;
}
@@ -605,7 +625,12 @@ public class E2EServiceInstancesTest {
final MockUp<CamundaClient> mockCmaundaClient = new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd)
+ throws ClientProtocolException, IOException {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -797,7 +822,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -858,7 +888,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -920,7 +955,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -987,7 +1027,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -1048,7 +1093,12 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -1110,7 +1160,12 @@ public class E2EServiceInstancesTest {
MockUp<CamundaClient> client = new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) throws Exception {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) throws Exception {
throw new Exception();
}
};
@@ -1137,7 +1192,13 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) throws IOException {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd)
+ throws ClientProtocolException, IOException {
+
throw new ClientProtocolException();
}
};
@@ -1155,7 +1216,13 @@ public class E2EServiceInstancesTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd)
+ throws ClientProtocolException, IOException {
+
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"compareModelwithTargetVersion, test response");
@@ -1224,7 +1291,12 @@ public class E2EServiceInstancesTest {
final MockUp<CamundaClient> mockCamundaClient = new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction,
+ String serviceInstanceId, String vnfId, String vfModuleId,
+ String volumeGroupId, String networkId, String configurationId, String serviceType,
+ String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
index 938a1038a4..50f00ef6a4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
@@ -21,16 +21,6 @@
package org.openecomp.mso.apihandlerinfra;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import javax.ws.rs.core.Response;
-import mockit.Mock;
-import mockit.MockUp;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.entity.BasicHttpEntity;
@@ -40,23 +30,33 @@ import org.hibernate.criterion.Order;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
+
+import javax.ws.rs.core.Response;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
import org.openecomp.mso.apihandler.common.CamundaClient;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.RequestClientParamater;
import org.openecomp.mso.db.catalog.CatalogDatabase;
-import org.openecomp.mso.db.catalog.beans.Service;
-import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
-import org.openecomp.mso.db.catalog.beans.VfModule;
-import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;
-import org.openecomp.mso.db.catalog.beans.VnfComponentsRecipe;
-import org.openecomp.mso.db.catalog.beans.VnfRecipe;
-import org.openecomp.mso.db.catalog.beans.VnfResource;
+import org.openecomp.mso.db.catalog.beans.*;
import org.openecomp.mso.properties.MsoJavaProperties;
+import org.openecomp.mso.properties.MsoPropertiesException;
import org.openecomp.mso.properties.MsoPropertiesFactory;
import org.openecomp.mso.requestsdb.InfraActiveRequests;
import org.openecomp.mso.requestsdb.RequestsDatabase;
+import mockit.Mock;
+import mockit.MockUp;
+
public class ServiceInstanceTest {
/*** Create Service Instance Test Cases ***/
@@ -225,7 +225,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -291,7 +295,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -358,7 +366,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -425,7 +437,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater){
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
return null;
}
};
@@ -907,7 +923,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -1072,7 +1092,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater){
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -1119,7 +1143,11 @@ public class ServiceInstanceTest {
new MockUp<CamundaClient>() {
@Mock
- public HttpResponse post(RequestClientParamater requestClientParamater) {
+ public HttpResponse post(String requestId, boolean isBaseVfModule,
+ int recipeTimeout, String requestAction, String serviceInstanceId,
+ String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,
+ String serviceType, String vnfType, String vfModuleType, String networkType,
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
diff --git a/mso-catalog-db/src/main/resources/ArRecipe.hbm.xml b/mso-catalog-db/src/main/resources/ArRecipe.hbm.xml
index fedfe31551..a840093561 100644
--- a/mso-catalog-db/src/main/resources/ArRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/ArRecipe.hbm.xml
@@ -37,7 +37,7 @@
<column name="MODEL_NAME" not-null="true" length="20"/>
</property>
<property name="action" type="string" >
- <column name="ACTION" not-null="true" length="20"/>
+ <column name="ACTION" not-null="true" length="40"/>
</property>
<property name="version" type="string">
<column name="VERSION_STR" not-null="true" length="20"/>
@@ -59,4 +59,4 @@
</property>
</class>
-</hibernate-mapping> \ No newline at end of file
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml b/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml
index 2332324370..4a0b5fbf2a 100644
--- a/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/ModelRecipe.hbm.xml
@@ -70,7 +70,7 @@
<column name="MODEL_ID" not-null="true"/>
</property>
<property name="action" type="string" >
- <column name="ACTION" not-null="true" length="20"/>
+ <column name="ACTION" not-null="true" length="40"/>
</property>
</properties>
<property name="schemaVersion" column="SCHEMA_VERSION" type="string" length="20"/>
@@ -84,4 +84,4 @@
<column name="CREATION_TIMESTAMP" default="CURRENT_TIMESTAMP"/>
</property>
</class>
-</hibernate-mapping> \ No newline at end of file
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml b/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
index 4490dbadd0..9081bb8732 100644
--- a/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/NetworkRecipe.hbm.xml
@@ -36,7 +36,7 @@
<column name="MODEL_NAME" not-null="true" length="20"/>
</property>
<property name="action" type="string" >
- <column name="ACTION" not-null="true" length="20"/>
+ <column name="ACTION" not-null="true" length="40"/>
</property>
<property name="version" type="string">
<column name="VERSION_STR" not-null="true" length="20"/>
@@ -58,4 +58,4 @@
</property>
</class>
-</hibernate-mapping> \ No newline at end of file
+</hibernate-mapping>
diff --git a/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml b/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml
index 75be1c71b0..bdd54f7832 100644
--- a/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/ServiceRecipe.hbm.xml
@@ -44,7 +44,7 @@
<column name="CREATION_TIMESTAMP" default="CURRENT_TIMESTAMP"/>
</property>
- <property name="action" column="ACTION" type="string" length="20" insert="false" update="false" />
+ <property name="action" column="ACTION" type="string" length="40" insert="false" update="false" />
<property name="version" column="VERSION_STR" type="string" length="20"/>
<property name="description" column="DESCRIPTION" type="string" length="1200"/>
<property name="serviceParamXSD" column="SERVICE_PARAM_XSD" type="string" length="2048"/>
diff --git a/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml b/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
index d2ca635c9a..8bb138a313 100644
--- a/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfComponentsRecipe.hbm.xml
@@ -37,7 +37,7 @@
<column name="VNF_COMPONENT_TYPE" not-null="true" length="45"/>
</property>
<property name="action" type="string">
- <column name="ACTION" not-null="true" length="20"/>
+ <column name="ACTION" not-null="true" length="40"/>
</property>
<property name="serviceType" column="SERVICE_TYPE" type="string" length="45"/>
<property name="version" column="VERSION" type="string" length="20"/>
diff --git a/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml b/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml
index 910cb9bf5c..08570708dd 100644
--- a/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml
+++ b/mso-catalog-db/src/main/resources/VnfRecipe.hbm.xml
@@ -37,7 +37,7 @@
<column name="VF_MODULE_ID" not-null="false" length="100" />
</property>
<property name="action" type="string">
- <column name="ACTION" not-null="true" length="20" />
+ <column name="ACTION" not-null="true" length="40" />
</property>
<property name="version" type="string">
<column name="VERSION_STR" not-null="true" length="20" />