diff options
author | Rob Daugherty <rd472p@att.com> | 2018-11-15 00:37:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-15 00:37:03 +0000 |
commit | ce7d16089439d570c1c12764f7cd2372547d69f1 (patch) | |
tree | 233c2b4bdc1c0debb115b630cf5cbdee896dec69 /mso-api-handlers/mso-api-handler-common | |
parent | 9f934386f04d1583d1a1833f025a0eed396507ea (diff) | |
parent | 6b405cd8bfab89ccc6d93eaa0e2a13cda9ecc9a3 (diff) |
Merge "accept a la carte create instance group request"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-common')
7 files changed, 40 insertions, 5 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java index 9099b48f11..829f8ce30c 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java @@ -109,6 +109,9 @@ public class CamundaVIDRequest { @JsonProperty(CommonConstants.REQUEST_URI) private CamundaInput requestUri; + + @JsonProperty(CommonConstants.INSTANCE_GROUP_ID) + private CamundaInput instanceGroupId; @JsonProperty(CommonConstants.CAMUNDA_SERVICE_INPUT) public CamundaInput getServiceInput() { @@ -326,6 +329,14 @@ public class CamundaVIDRequest { public void setRecipeParams(CamundaInput recipeParams) { this.recipeParams = recipeParams; } + @JsonProperty(CommonConstants.INSTANCE_GROUP_ID) + public void setInstanceGroupId(CamundaInput instanceGroupIdInput) { + this.instanceGroupId = instanceGroupIdInput; + } + @JsonProperty(CommonConstants.INSTANCE_GROUP_ID) + public CamundaInput getInstanceGroupId() { + return instanceGroupId; + } @Override public String toString() { @@ -335,4 +346,6 @@ public class CamundaVIDRequest { return "CamundaRequest"; } + + } diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java index 3936cca08d..34cfe18508 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java @@ -129,7 +129,8 @@ public class CamundaClient extends RequestClient{ msoLogger.debug(CAMUNDA_URL_MESAGE+ url); String jsonReq = wrapVIDRequest(parameterObject.getRequestId(), parameterObject.isBaseVfModule(), parameterObject.getRecipeTimeout(), parameterObject.getRequestAction(), parameterObject.getServiceInstanceId(), parameterObject.getCorrelationId(), parameterObject.getVnfId(), parameterObject.getVfModuleId(), parameterObject.getVolumeGroupId(), parameterObject.getNetworkId(), parameterObject.getConfigurationId(), - parameterObject.getServiceType(), parameterObject.getVnfType(), parameterObject.getVfModuleType(), parameterObject.getNetworkType(), parameterObject.getRequestDetails(), parameterObject.getApiVersion(), parameterObject.isaLaCarte(), parameterObject.getRequestUri(), parameterObject.getRecipeParamXsd()); + parameterObject.getServiceType(), parameterObject.getVnfType(), parameterObject.getVfModuleType(), parameterObject.getNetworkType(), parameterObject.getRequestDetails(), parameterObject.getApiVersion(), parameterObject.isaLaCarte(), parameterObject.getRequestUri(), parameterObject.getRecipeParamXsd(), + parameterObject.getInstanceGroupId()); StringEntity input = new StringEntity(jsonReq); input.setContentType(CommonConstants.CONTENT_TYPE_JSON); @@ -200,7 +201,8 @@ public class CamundaClient extends RequestClient{ int recipeTimeout, String requestAction, String serviceInstanceId, String correlationId, String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId, String serviceType, String vnfType, String vfModuleType, String networkType, - String requestDetails, String apiVersion, boolean aLaCarte, String requestUri, String paramXsd){ + String requestDetails, String apiVersion, boolean aLaCarte, String requestUri, String paramXsd, + String instanceGroupId){ String jsonReq = null; try{ @@ -226,6 +228,7 @@ public class CamundaClient extends RequestClient{ CamundaInput apiVersionInput = new CamundaInput(); CamundaInput requestUriInput = new CamundaInput(); CamundaInput recipeParamsInput = new CamundaInput(); + CamundaInput instanceGroupIdInput = new CamundaInput(); //host.setValue(parseURL()); requestIdInput.setValue(StringUtils.defaultString(requestId)); @@ -247,6 +250,7 @@ public class CamundaClient extends RequestClient{ apiVersionInput.setValue(StringUtils.defaultString(apiVersion)); requestUriInput.setValue(StringUtils.defaultString(requestUri)); recipeParamsInput.setValue(paramXsd); + instanceGroupIdInput.setValue(StringUtils.defaultString(instanceGroupId)); serviceInput.setValue(requestDetails); camundaRequest.setServiceInput(serviceInput); @@ -271,6 +275,7 @@ public class CamundaClient extends RequestClient{ camundaRequest.setApiVersion(apiVersionInput); camundaRequest.setRequestUri(requestUriInput); camundaRequest.setRecipeParams(recipeParamsInput); + camundaRequest.setInstanceGroupId(instanceGroupIdInput); ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java index d1b629f60c..b75ad9e415 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java @@ -79,6 +79,7 @@ public final class CommonConstants { public static final String X_MINOR_VERSION = "X-MinorVersion"; public static final String X_PATCH_VERSION = "X-PatchVersion"; public static final String X_LATEST_VERSION = "X-LatestVersion"; + public static final String INSTANCE_GROUP_ID = "instanceGroupId"; private CommonConstants () { // prevent creating an instance of this class diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java index 89db934985..1d18e2b02c 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java @@ -43,6 +43,7 @@ public class RequestClientParameter { private boolean aLaCarte; private String recipeParamXsd; private String requestUri; + private String instanceGroupId; private RequestClientParameter(Builder builder) { requestId = builder.requestId; @@ -65,6 +66,7 @@ public class RequestClientParameter { apiVersion = builder.apiVersion; aLaCarte = builder.aLaCarte; requestUri = builder.requestUri; + instanceGroupId = builder.instanceGroupId; } @@ -147,6 +149,10 @@ public class RequestClientParameter { public String getRequestUri() { return requestUri; } + + public String getInstanceGroupId() { + return instanceGroupId; + } public static class Builder { private String requestId; @@ -169,6 +175,7 @@ public class RequestClientParameter { private boolean aLaCarte = false; private String recipeParamXsd; private String requestUri; + private String instanceGroupId; public Builder setRequestId(String requestId) { this.requestId = requestId; @@ -269,10 +276,16 @@ public class RequestClientParameter { this.requestUri = requestUri; return this; } + + public Builder setInstanceGroupId(String instanceGroupId) { + this.instanceGroupId = instanceGroupId; + return this; + } public RequestClientParameter build(){ return new RequestClientParameter(this); } + } diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java index 3a35c23a86..03d68f88e8 100644 --- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java +++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java @@ -44,5 +44,7 @@ public enum Action { scaleInstance, deactivateAndCloudDelete, scaleOut, - recreateInstance + recreateInstance, + addMembers, + removeMembers } diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java index 247a62ec81..7a03ce0542 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaClientTest.java @@ -162,10 +162,11 @@ public class CamundaClientTest{ String apiVersion = "6"; boolean aLaCarte = true; String requestUri = "v7/serviceInstances/assign"; + String instanceGroupId = "ff305d54-75b4-431b-adb2-eb6b9e5ff000"; String testResult = testClient.wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction, serviceInstanceId, correlationId, vnfId, vfModuleId, volumeGroupId, networkId, configurationId, serviceType, - vnfType, vfModuleType, networkType, requestDetails, apiVersion, aLaCarte, requestUri, ""); + vnfType, vfModuleType, networkType, requestDetails, apiVersion, aLaCarte, requestUri, "", instanceGroupId); String expected = inputStream("/WrappedVIDRequest.json"); assertEquals(expected, testResult); diff --git a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json index c4c7b030f9..4c716c2ae3 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json +++ b/mso-api-handlers/mso-api-handler-common/src/test/resources/CamundaClientTest/WrappedVIDRequest.json @@ -1 +1 @@ -{"variables":{"bpmnRequest":{"value":"{requestDetails: }","type":"String"},"requestId":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"mso-request-id":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"isBaseVfModule":{"value":true,"type":"Boolean"},"recipeTimeout":{"value":10000,"type":"Integer"},"requestAction":{"value":"createInstance","type":"String"},"serviceInstanceId":{"value":"12345679","type":"String"},"correlationId":{"value":"12345679","type":"String"},"vnfId":{"value":"234567891","type":"String"},"vfModuleId":{"value":"345678912","type":"String"},"volumeGroupId":{"value":"456789123","type":"String"},"networkId":{"value":"567891234","type":"String"},"configurationId":{"value":"678912345","type":"String"},"serviceType":{"value":"testService","type":"String"},"vnfType":{"value":"testVnf","type":"String"},"vfModuleType":{"value":"vfModuleType","type":"String"},"networkType":{"value":"networkType","type":"String"},"recipeParams":{"value":"","type":"String"},"host":{"value":null,"type":"String"},"apiVersion":{"value":"6","type":"String"},"aLaCarte":{"value":true,"type":"Boolean"},"requestUri":{"value":"v7/serviceInstances/assign","type":"String"}}}
\ No newline at end of file +{"variables":{"bpmnRequest":{"value":"{requestDetails: }","type":"String"},"requestId":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"mso-request-id":{"value":"f7ce78bb-423b-11e7-93f8-0050569a796","type":"String"},"isBaseVfModule":{"value":true,"type":"Boolean"},"recipeTimeout":{"value":10000,"type":"Integer"},"requestAction":{"value":"createInstance","type":"String"},"serviceInstanceId":{"value":"12345679","type":"String"},"correlationId":{"value":"12345679","type":"String"},"vnfId":{"value":"234567891","type":"String"},"vfModuleId":{"value":"345678912","type":"String"},"volumeGroupId":{"value":"456789123","type":"String"},"networkId":{"value":"567891234","type":"String"},"configurationId":{"value":"678912345","type":"String"},"serviceType":{"value":"testService","type":"String"},"vnfType":{"value":"testVnf","type":"String"},"vfModuleType":{"value":"vfModuleType","type":"String"},"networkType":{"value":"networkType","type":"String"},"recipeParams":{"value":"","type":"String"},"host":{"value":null,"type":"String"},"apiVersion":{"value":"6","type":"String"},"aLaCarte":{"value":true,"type":"Boolean"},"requestUri":{"value":"v7/serviceInstances/assign","type":"String"},"instanceGroupId":{"value":"ff305d54-75b4-431b-adb2-eb6b9e5ff000","type":"String"}}}
\ No newline at end of file |