From 618ae3415a0412ba8e49985790c591f6238f7c1b Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 17 Sep 2018 09:37:20 -0400 Subject: Accept VNF Recreate Requests Updated nfRole in sample catdb json response Added gr-api-default recipe for recreate Updated description in catdb response json Updated catdb response file to have the correct action Added action to common package Removed requestor ids and source from test requests Began adding recreate endpoint and tests Began adding validation for recreate and junit tests Change-Id: I60c588be104b82b2d0dfb8587069e04f7b4710be Issue-ID: SO-1057 Signed-off-by: Benjamin, Max (mb388a) --- .../java/org/onap/so/apihandlerinfra/Action.java | 3 +- .../java/org/onap/so/apihandlerinfra/Action.java | 3 +- .../onap/so/apihandlerinfra/ServiceInstances.java | 14 +++++++++ .../validation/CloudConfigurationValidation.java | 3 ++ .../validation/ModelInfoValidation.java | 17 +++++++--- .../onap/so/apihandlerinfra/MsoRequestTest.java | 6 ++++ .../so/apihandlerinfra/ServiceInstancesTest.java | 36 ++++++++++++++++++++++ ...DeactivateAndCloudDeleteCloudConfiguration.json | 2 +- .../CloudConfiguration/VnfRecreateCloudConfig.json | 21 +++++++++++++ .../ModelInfo/VnfRecreateModelInvariantId.json | 24 +++++++++++++++ .../ModelInfo/VnfRecreateModelName.json | 24 +++++++++++++++ .../ModelInfo/VnfRecreateModelVersion.json | 24 +++++++++++++++ .../ModelInfo/VnfRecreateModelVersionId.json | 24 +++++++++++++++ .../VnfRecreateNoModelCustomizationId.json | 23 ++++++++++++++ .../DeactivateAndCloudDeleteVfModule.json | 2 +- .../resources/ServiceInstanceTest/VnfRecreate.json | 25 +++++++++++++++ .../vnfRecipe_ResponseWorkflowAction.json | 20 ++++++++++++ 17 files changed, 263 insertions(+), 8 deletions(-) create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/VnfRecreateCloudConfig.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelInvariantId.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelName.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersion.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersionId.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateNoModelCustomizationId.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/VnfRecreate.json create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/vnfRecipe_ResponseWorkflowAction.json (limited to 'mso-api-handlers') 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 8dba63b44b..3a35c23a86 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 @@ -43,5 +43,6 @@ public enum Action { compareModel, scaleInstance, deactivateAndCloudDelete, - scaleOut + scaleOut, + recreateInstance } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java index 5b08cc1b17..6013677684 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Action.java @@ -43,5 +43,6 @@ public enum Action implements Actions{ compareModel, scaleInstance, deactivateAndCloudDelete, - scaleOut + scaleOut, + recreateInstance } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java index 5d9ad767bf..bb7df4b7be 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java @@ -372,6 +372,20 @@ public class ServiceInstances { instanceIdMap.put("vnfInstanceId", vnfInstanceId); return serviceInstances(request, Action.applyUpdatedConfig, instanceIdMap, version, requestId, getRequestUri(requestContext)); } + + @POST + @Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/recreate") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value="Recreate VNF Instance",response=Response.class) + public Response recreateVnfInstance(String request, @PathParam("version") String version, @PathParam("serviceInstanceId") String serviceInstanceId, + @PathParam("vnfInstanceId") String vnfInstanceId, @Context ContainerRequestContext requestContext) throws ApiException { + String requestId = getRequestId(requestContext); + HashMap instanceIdMap = new HashMap<>(); + instanceIdMap.put("serviceInstanceId", serviceInstanceId); + instanceIdMap.put("vnfInstanceId", vnfInstanceId); + return serviceInstances(request, Action.recreateInstance, instanceIdMap, version, requestId, getRequestUri(requestContext)); + } @DELETE diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java index f366c7e74b..b0ea85779c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/CloudConfigurationValidation.java @@ -56,6 +56,9 @@ public class CloudConfigurationValidation implements ValidationRule{ if(requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && (action == Action.deactivateAndCloudDelete || action == Action.scaleOut)){ throw new ValidationException("cloudConfiguration"); } + if(requestScope.equals(ModelType.vnf.name()) && action == Action.recreateInstance){ + throw new ValidationException("cloudConfiguration", true); + } } if (cloudConfiguration == null && ((aLaCarteFlag != null && !aLaCarteFlag) && requestScope.equalsIgnoreCase (ModelType.service.name ()) && reqVersion < 5)) { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java index aa98d2abf2..c6fae6e872 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/ModelInfoValidation.java @@ -60,7 +60,7 @@ public class ModelInfoValidation implements ValidationRule{ } // modelCustomizationId or modelCustomizationName are required for VNF Replace - if(requestParameters != null && reqVersion > 4 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.replaceInstance) { + if(requestParameters != null && reqVersion > 4 && requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.replaceInstance || action == Action.recreateInstance) { if(!UUIDChecker.isValidUUID(modelInfo.getModelCustomizationId()) && modelInfo.getModelCustomizationName() == null) { throw new ValidationException("modelCustomizationId or modelCustomizationName"); } @@ -77,14 +77,16 @@ public class ModelInfoValidation implements ValidationRule{ if(empty(modelInfo.getModelInvariantId()) && (requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && action == Action.scaleOut)){ throw new ValidationException("modelInvariantId"); } - + if(empty(modelInfo.getModelInvariantId()) && (requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.recreateInstance)){ + throw new ValidationException("modelInvariantId", true); + } if (!empty (modelInfo.getModelInvariantId ()) && !UUIDChecker.isValidUUID (modelInfo.getModelInvariantId ())) { throw new ValidationException ("modelInvariantId format"); } if(reqVersion >= 4 && !(requestScope.equalsIgnoreCase(ModelType.configuration.name())) && empty (modelInfo.getModelName ()) && (action == Action.createInstance || action == Action.updateInstance || - action == Action.addRelationships || action == Action.removeRelationships || ((action == Action.deleteInstance || action == Action.scaleOut) && (requestScope.equalsIgnoreCase (ModelType.vfModule.name ()))))){ - throw new ValidationException ("modelName"); + action == Action.addRelationships || action == Action.removeRelationships || action == Action.recreateInstance || ((action == Action.deleteInstance || action == Action.scaleOut) && (requestScope.equalsIgnoreCase (ModelType.vfModule.name ()))))){ + throw new ValidationException ("modelName", true); } if (empty (modelInfo.getModelVersion ()) && !(requestScope.equalsIgnoreCase(ModelType.configuration.name())) && @@ -92,6 +94,10 @@ public class ModelInfoValidation implements ValidationRule{ && (action == Action.createInstance || action == Action.updateInstance || action == Action.addRelationships || action == Action.removeRelationships || action == Action.scaleOut))) { throw new ValidationException ("modelVersion"); } + + if(empty(modelInfo.getModelVersion()) && (requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.recreateInstance)){ + throw new ValidationException("modelVersion", true); + } // is required for serviceInstance delete macro when aLaCarte=false in v4 if (reqVersion >= 4 && empty (modelInfo.getModelVersionId()) && (((aLaCarteFlag != null && !aLaCarteFlag) && requestScope.equalsIgnoreCase(ModelType.service.name()) && action == Action.deleteInstance) || @@ -99,6 +105,9 @@ public class ModelInfoValidation implements ValidationRule{ (requestScope.equalsIgnoreCase(ModelType.configuration.name()) && (action == Action.activateInstance || action == Action.deactivateInstance))))) { throw new ValidationException ("modelVersionId"); } + if(empty(modelInfo.getModelVersionId()) && (requestScope.equalsIgnoreCase(ModelType.vnf.name()) && action == Action.recreateInstance)){ + throw new ValidationException("modelVersionId", true); + } if(empty(modelInfo.getModelVersionId()) && (requestScope.equalsIgnoreCase(ModelType.vfModule.name()) && action == Action.scaleOut)){ throw new ValidationException("modelVersionId"); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java index 63dc96f485..fa3ce07d70 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java @@ -193,6 +193,7 @@ public class MsoRequestTest extends BaseTest { {"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/InPlaceSoftwareUpdateCloudConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.inPlaceSoftwareUpdate, 6}, {"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/DeactivateAndCloudDeleteCloudConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deactivateAndCloudDelete, 7}, {"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/ScaleOutNoCloudConfig.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}, + {"No valid cloudConfiguration is specified", mapper.readValue(inputStream("/CloudConfiguration/VnfRecreateCloudConfig.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.recreateInstance, 7}, {"No valid lcpCloudRegionId is specified", mapper.readValue(inputStream("/CloudConfiguration/EmptyLcpCloudConfiguration.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, {"No valid lcpCloudRegionId is specified", mapper.readValue(inputStream("/CloudConfiguration/InPlaceSoftwareUpdateCloudRegionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.inPlaceSoftwareUpdate, 6}, {"No valid tenantId is specified", mapper.readValue(inputStream("/CloudConfiguration/EmptyTenantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, @@ -207,6 +208,7 @@ public class MsoRequestTest extends BaseTest { {"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/ModelCustomization.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.replaceInstance, 6}, {"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/ModelCustomization.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 6}, {"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/VnfModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.replaceInstance, 5}, + {"No valid modelCustomizationId or modelCustomizationName is specified", mapper.readValue(inputStream("/ModelInfo/VnfRecreateNoModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.recreateInstance, 7}, {"No valid modelCustomizationId is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}, {"No valid model-info is specified", mapper.readValue(inputStream("/ModelInfo/ModelInfoNull.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, {"No valid modelInvariantId format is specified", mapper.readValue(inputStream("/ModelInfo/InvalidModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 2}, @@ -218,13 +220,16 @@ public class MsoRequestTest extends BaseTest { {"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/v5DeactivateModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deactivateInstance, 5}, {"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/v3UpdateNetworkBad.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 4}, {"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}, + {"No valid modelInvariantId is specified", mapper.readValue(inputStream("/ModelInfo/VnfRecreateModelInvariantId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.recreateInstance, 7}, {"No valid modelName is specified", mapper.readValue(inputStream("/ModelInfo/VfModuleModelName.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.deleteInstance, 4}, {"No valid modelName is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelName.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}, + {"No valid modelName is specified", mapper.readValue(inputStream("/ModelInfo/VnfRecreateModelName.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.recreateInstance, 7}, {"No valid modelType is specified", mapper.readValue(inputStream("/ModelInfo/ModelTypeNull.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, {"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionService.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.updateInstance, 3}, {"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionVfModule.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 3}, {"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionServiceCreate.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 3}, {"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelVersion.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}, + {"No valid modelVersion is specified", mapper.readValue(inputStream("/ModelInfo/VnfRecreateModelVersion.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.recreateInstance, 7}, {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ConfigurationModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5}, {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/v2ModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 4}, @@ -235,6 +240,7 @@ public class MsoRequestTest extends BaseTest { {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ModelVersionIdCreate.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/v5ActivateModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.activateInstance, 5}, {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/ScaleOutNoModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.scaleOut, 7}, + {"No valid modelVersionId is specified", mapper.readValue(inputStream("/ModelInfo/VnfRecreateModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.recreateInstance, 7}, //ValidationException for Platform and LineOfBusiness {"No valid lineOfBusinessName is specified", mapper.readValue(inputStream("/PlatformAndLineOfBusiness/EmptyLineOfBusiness.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 5}, {"No valid platform is specified", mapper.readValue(inputStream("/PlatformAndLineOfBusiness/Platform.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.createInstance, 6}, diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java index cdb4c40981..fddd149aca 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java @@ -949,6 +949,42 @@ public class ServiceInstancesTest extends BaseTest{ assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId")); } @Test + public void recreateVnfInstance() throws IOException { + stubFor(post(urlPathEqualTo("/mso/async/services/WorkflowActionBB")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBodyFile("Camunda/TestResponse.json").withStatus(org.apache.http.HttpStatus.SC_OK))); + + stubFor(get(urlMatching(".*/vnfResourceCustomization/68dc9a92-214c-11e7-93ae-92361f002674")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("vnfResourceCustomization_Response")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + stubFor(get(urlMatching(".*/vnfResourceCustomization/68dc9a92-214c-11e7-93ae-92361f002674/vnfResources")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("vnfResources_Response.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + stubFor(get(urlMatching(".*/vnfRecipe/search/findFirstVnfRecipeByNfRoleAndAction[?]nfRole=GR-API-DEFAULT&action=recreateInstance")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(getWiremockResponseForCatalogdb("vnfRecipe_ResponseWorkflowAction.json")) + .withStatus(org.apache.http.HttpStatus.SC_OK))); + + //expected response + ServiceInstancesResponse expectedResponse = new ServiceInstancesResponse(); + RequestReferences requestReferences = new RequestReferences(); + requestReferences.setInstanceId("1882939"); + expectedResponse.setRequestReferences(requestReferences); + uri = servInstanceuri + "v7" + "/serviceInstances/f7ce78bb-423b-11e7-93f8-0050569a7968/vnfs/ff305d54-75b4-431b-adb2-eb6b9e5ff000/recreate"; + ResponseEntity response = sendRequest(inputStream("/VnfRecreate.json"), uri, HttpMethod.POST); + logger.debug(response.getBody()); + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); + ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class); + assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId")); + } + @Test public void updateVnfInstance() throws IOException { stubFor(post(urlPathEqualTo("/mso/async/services/WorkflowActionBB")) .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/DeactivateAndCloudDeleteCloudConfiguration.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/DeactivateAndCloudDeleteCloudConfiguration.json index 47b2e309d3..18d03f1472 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/DeactivateAndCloudDeleteCloudConfiguration.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/DeactivateAndCloudDeleteCloudConfiguration.json @@ -5,7 +5,7 @@ }, "requestInfo": { "source": "VID", - "requestorId": "az2016" + "requestorId": "xxxxxx" } } } \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/VnfRecreateCloudConfig.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/VnfRecreateCloudConfig.json new file mode 100644 index 0000000000..5d64500e10 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/CloudConfiguration/VnfRecreateCloudConfig.json @@ -0,0 +1,21 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelVersionId":"254583ad-b38c-498b-bdbd-b8de5e07541b", + "modelName":"vSAMP12", + "modelVersion":"2.0", + "modelCustomizationName":"vSAMP12 1", + "modelCustomizationId":"c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelInvariantId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelInvariantId.json new file mode 100644 index 0000000000..15ec1a006f --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelInvariantId.json @@ -0,0 +1,24 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelVersionId":"254583ad-b38c-498b-bdbd-b8de5e07541b", + "modelName":"vSAMP12", + "modelVersion":"2.0", + "modelCustomizationName":"vSAMP12 1", + "modelCustomizationId":"c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "cloudConfiguration":{ + "lcpCloudRegionId":"mdt1", + "tenantId":"88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelName.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelName.json new file mode 100644 index 0000000000..caa7458f9f --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelName.json @@ -0,0 +1,24 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelVersionId":"254583ad-b38c-498b-bdbd-b8de5e07541b", + "modelVersion":"2.0", + "modelCustomizationName":"vSAMP12 1", + "modelCustomizationId":"c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "cloudConfiguration":{ + "lcpCloudRegionId":"mdt1", + "tenantId":"88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersion.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersion.json new file mode 100644 index 0000000000..5049be6bca --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersion.json @@ -0,0 +1,24 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelVersionId":"254583ad-b38c-498b-bdbd-b8de5e07541b", + "modelName":"vSAMP12", + "modelCustomizationName":"vSAMP12 1", + "modelCustomizationId":"c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "cloudConfiguration":{ + "lcpCloudRegionId":"mdt1", + "tenantId":"88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersionId.json new file mode 100644 index 0000000000..99ee762da1 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateModelVersionId.json @@ -0,0 +1,24 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelName":"vSAMP12", + "modelVersion":"2.0", + "modelCustomizationName":"vSAMP12 1", + "modelCustomizationId":"c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "cloudConfiguration":{ + "lcpCloudRegionId":"mdt1", + "tenantId":"88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateNoModelCustomizationId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateNoModelCustomizationId.json new file mode 100644 index 0000000000..d98a9bc30b --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/ModelInfo/VnfRecreateNoModelCustomizationId.json @@ -0,0 +1,23 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelVersionId":"254583ad-b38c-498b-bdbd-b8de5e07541b", + "modelName":"vSAMP12", + "modelVersion":"2.0" + }, + "cloudConfiguration":{ + "lcpCloudRegionId":"mdt1", + "tenantId":"88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/DeactivateAndCloudDeleteVfModule.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/DeactivateAndCloudDeleteVfModule.json index 3d293d522b..b721583d29 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/DeactivateAndCloudDeleteVfModule.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/DeactivateAndCloudDeleteVfModule.json @@ -11,7 +11,7 @@ }, "requestInfo": { "source": "VID", - "requestorId": "az2016" + "requestorId": "xxxxxx" } } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/VnfRecreate.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/VnfRecreate.json new file mode 100644 index 0000000000..7a76c6bfee --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/VnfRecreate.json @@ -0,0 +1,25 @@ +{ + "requestDetails":{ + "modelInfo":{ + "modelType":"vnf", + "modelInvariantId":"ff5256d1-5a33-55df-13ab-12abad84e7ff", + "modelVersionId":"254583ad-b38c-498b-bdbd-b8de5e07541b", + "modelName":"vSAMP12", + "modelVersion":"2.0", + "modelCustomizationName":"vSAMP12 1", + "modelCustomizationId":"c539433a-84a6-4082-a12e-5c9b00c3b960" + }, + "cloudConfiguration":{ + "lcpCloudRegionId":"mdt1", + "tenantId":"88a6ca3ee0394ade9403f075db23167e" + }, + "requestInfo":{ + "source":"source", + "suppressRollback":false, + "requestorId":"xxxxxx" + }, + "requestParameters":{ + "rebuildVolumeGroups":false + } + } +} \ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/vnfRecipe_ResponseWorkflowAction.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/vnfRecipe_ResponseWorkflowAction.json new file mode 100644 index 0000000000..c755714633 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/vnfRecipe_ResponseWorkflowAction.json @@ -0,0 +1,20 @@ +{ + "id": 21, + "nfRole": "GR-API-DEFAULT", + "paramXsd": "", + "vfModuleId": "1882934", + "action": "recreateInstance", + "description": "gr-api-default for vnf recreate", + "orchestrationUri": "/mso/async/services/WorkflowActionBB", + "recipeTimeout": 180, + "serviceType": "GR-API-DEFAULT", + "created": "2016-06-03T04:44:10.000+0000", + "_links": { + "self": { + "href": "http://localhost:8090/vnfRecipe/21" + }, + "vnfRecipe": { + "href": "http://localhost:8090/vnfRecipe/21" + } + } +} \ No newline at end of file -- cgit 1.2.3-korg