summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-11-10 12:43:10 -0500
committerRob Daugherty <rd472p@att.com>2018-11-14 20:55:38 +0000
commit6b405cd8bfab89ccc6d93eaa0e2a13cda9ecc9a3 (patch)
treea8b5732629aa9f8eee04e4f7d489e4e49ec0a17a /mso-api-handlers/mso-api-handler-common/src/main/java/org/onap
parent7feaa94e569653066c7ebff3dda3218869797f39 (diff)
accept a la carte create instance group request
Updated postBPELRequest to accept RequestClientParameter Switched to using .toString rather than .name for enum Added source to fix failing test Added action to fix failing apih tests Removed unused headers from test Removed unused import from RequestClientParameter Updated to use instanceGroupId constant Removed defaulting source in requestInfo Added validation for mandatory headers Added test case for modelVersionId in service related instance Added relatedInstance validation for create instanceGroup Added unit test cases for MembersValidation Added test cases for relatedInstances validation Added tests for add/remove member validation Added updates for deleteInstanceGroups Removed serviceProxy from test resource file Removed ServiceProxy as it is no longer needed Changed action to be removeMembers in endpoint Added removeMembers endpoint and validation Updated validation for create instanceGroups ... Change-Id: I12b14d6d81dd0690eea33dfcbf1be17c509f9832 Issue-ID: SO-1207 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-common/src/main/java/org/onap')
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/camundabeans/CamundaVIDRequest.java13
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CamundaClient.java9
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java1
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/RequestClientParameter.java13
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/Action.java4
5 files changed, 37 insertions, 3 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
}