diff options
13 files changed, 805 insertions, 732 deletions
diff --git a/adapters/mso-ve-vnfm-adapter/pom.xml b/adapters/mso-ve-vnfm-adapter/pom.xml index 3518445b45..4472956eb7 100644 --- a/adapters/mso-ve-vnfm-adapter/pom.xml +++ b/adapters/mso-ve-vnfm-adapter/pom.xml @@ -59,10 +59,21 @@ </dependencies> <build> + <finalName>${project.artifactId}-${project.version}</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <mainClass>org.onap.so.adapters.vevnfm.Application</mainClass> + </configuration> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + </execution> + </executions> </plugin> </plugins> </build> diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProvider.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProvider.java index eca5240cb5..251e0c426b 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProvider.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProvider.java @@ -20,29 +20,15 @@ package org.onap.so.adapters.vevnfm.provider; -import java.util.List; -import org.apache.logging.log4j.util.Strings; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; -import org.springframework.http.HttpHeaders; public class AuthorizationHeadersProvider extends BasicHttpHeadersProvider { - private List<String> previousAuthorization; - public void addAuthorization(final String authorization) { - final HttpHeaders headers = getHttpHeaders(); - previousAuthorization = headers.get(AUTHORIZATION_HEADER); - headers.set(AUTHORIZATION_HEADER, authorization); - } - - public void resetPrevious() { - if (!isPreviousAuthorizationBlank()) { - getHttpHeaders().addAll(AUTHORIZATION_HEADER, previousAuthorization); - } + getHttpHeaders().set(AUTHORIZATION_HEADER, authorization); } - private boolean isPreviousAuthorizationBlank() { - return previousAuthorization == null || previousAuthorization.isEmpty() - || Strings.isBlank(previousAuthorization.get(0)); + public void removeAuthorization() { + getHttpHeaders().remove(AUTHORIZATION_HEADER); } } diff --git a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java index 0e77ce4073..eefd9ba93b 100644 --- a/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java +++ b/adapters/mso-ve-vnfm-adapter/src/main/java/org/onap/so/adapters/vevnfm/service/SubscriberService.java @@ -68,7 +68,7 @@ public class SubscriberService { final LccnSubscriptionRequest request = createRequest(); return sender.send(info, request); } finally { - headersProvider.resetPrevious(); + headersProvider.removeAuthorization(); } } diff --git a/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProviderTest.java b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProviderTest.java new file mode 100644 index 0000000000..64503ddfc2 --- /dev/null +++ b/adapters/mso-ve-vnfm-adapter/src/test/java/org/onap/so/adapters/vevnfm/provider/AuthorizationHeadersProviderTest.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SO + * ================================================================================ + * Copyright (C) 2020 Samsung. 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.onap.so.adapters.vevnfm.provider; + +import static org.junit.Assert.*; +import static org.onap.so.configuration.rest.BasicHttpHeadersProvider.AUTHORIZATION_HEADER; +import org.junit.Test; +import org.springframework.http.HttpHeaders; + +public class AuthorizationHeadersProviderTest { + + private static final String AUTHORIZATION_EXAMPLE = "authorization"; + + private final AuthorizationHeadersProvider provider = new AuthorizationHeadersProvider(); + + @Test + public void testSuccessValidAuthorizationAndRemoval() { + final HttpHeaders headers = provider.getHttpHeaders(); + final int size = headers.size(); + + provider.addAuthorization(AUTHORIZATION_EXAMPLE); + assertEquals(size + 1, headers.size()); + assertTrue(headers.containsKey(AUTHORIZATION_HEADER)); + + provider.removeAuthorization(); + assertEquals(size, headers.size()); + assertFalse(headers.containsKey(AUTHORIZATION_HEADER)); + } +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 80c6f0b969..2284c4af1a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -431,7 +431,12 @@ public class WorkflowAction { execution.setVariable("isRollbackComplete", false); } catch (Exception ex) { - buildAndThrowException(execution, "Exception while setting execution list. ", ex); + if (!(execution.hasVariable("WorkflowException") + || execution.hasVariable("WorkflowExceptionExceptionMessage"))) { + buildAndThrowException(execution, "Exception while setting execution list. ", ex); + } else { + throw ex; + } } } @@ -537,7 +542,7 @@ public class WorkflowAction { if (configurations.size() > 1) { String multipleRelationshipsError = "Multiple relationships exist from VNFC " + vnfc.getVnfcName() + " to Configurations"; - buildAndThrowException(dataObj.getExecution(), multipleRelationshipsError, + buildAndThrowException(dataObj.getExecution(), "Exception in getConfigBuildingBlock: ", new Exception(multipleRelationshipsError)); } for (org.onap.aai.domain.yang.Configuration configuration : configurations) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 8e47c34cb0..4fdd97d95a 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -41,6 +41,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.when; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; @@ -228,6 +229,77 @@ public class WorkflowActionTest extends BaseTaskTest { } @Test + public void selectExecutionListExceptionAlreadyBuiltTest() throws Exception { + DelegateExecution delegateExecution = new DelegateExecutionFake(); + String gAction = "deleteInstance"; + String resource = "VfModule"; + delegateExecution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688"); + delegateExecution.setVariable("requestAction", gAction); + String bpmnRequest = + new String(Files.readAllBytes(Paths.get("src/test/resources/__files/VfModuleCreateWithFabric.json"))); + delegateExecution.setVariable("bpmnRequest", bpmnRequest); + delegateExecution.setVariable("aLaCarte", true); + delegateExecution.setVariable("apiVersion", "7"); + delegateExecution.setVariable("requestUri", + "v7/serviceInstances/f647e3ef-6d2e-4cd3-bff4-8df4634208de/vnfs/b80b16a5-f80d-4ffa-91c8-bd47c7438a3d/vfModules"); + + NorthBoundRequest northBoundRequest = new NorthBoundRequest(); + List<OrchestrationFlow> orchFlows = createFlowList("DeactivateVfModuleBB", "DeleteVfModuleBB", + "UnassignVfModuleBB", "DeactivateFabricConfigurationBB", "UnassignFabricConfigurationBB"); + northBoundRequest.setOrchestrationFlowList(orchFlows); + + when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, + true, "my-custom-cloud-owner")).thenReturn(northBoundRequest); + + doAnswer(invocation -> { + DelegateExecutionFake execution = invocation.getArgument(0); + execution.setVariable("WorkflowException", "exception"); + execution.setVariable("WorkflowExceptionErrorMessage", "errorMessage"); + throw new BpmnError("WorkflowException"); + }).when(exceptionUtil).buildAndThrowWorkflowException(delegateExecution, 7000, + "Exception in getConfigBuildingBlock: Multiple relationships exist from VNFC testVnfcName to Configurations"); + + + org.onap.aai.domain.yang.GenericVnf vnf = new org.onap.aai.domain.yang.GenericVnf(); + vnf.setVnfId("vnf0"); + vnf.setModelCustomizationId("modelCustomizationId"); + when(bbSetupUtils.getAAIGenericVnf(any())).thenReturn(vnf); + + org.onap.aai.domain.yang.VfModule vfModule = new org.onap.aai.domain.yang.VfModule(); + vfModule.setModelCustomizationId("modelCustomizationId"); + when(bbSetupUtils.getAAIVfModule(any(), any())).thenReturn(vfModule); + + List<org.onap.aai.domain.yang.Vnfc> vnfcs = new ArrayList<org.onap.aai.domain.yang.Vnfc>(); + org.onap.aai.domain.yang.Vnfc vnfc = new org.onap.aai.domain.yang.Vnfc(); + vnfc.setModelInvariantId("modelInvariantId"); + vnfc.setVnfcName("testVnfcName"); + vnfcs.add(vnfc); + doReturn(vnfcs).when(SPY_workflowAction).getRelatedResourcesInVfModule(any(), any(), any(), any()); + + List<org.onap.aai.domain.yang.Configuration> configurations = + new ArrayList<org.onap.aai.domain.yang.Configuration>(); + org.onap.aai.domain.yang.Configuration configuration = new org.onap.aai.domain.yang.Configuration(); + configuration.setConfigurationId("configurationId"); + configuration.setModelCustomizationId("modelCustimizationId"); + configuration.setConfigurationName("testConfigurationName"); + configurations.add(configuration); + org.onap.aai.domain.yang.Configuration configuration1 = new org.onap.aai.domain.yang.Configuration(); + configuration1.setConfigurationId("configurationId"); + configuration1.setModelCustomizationId("modelCustimizationId"); + configuration1.setConfigurationName("testConfigurationName"); + configurations.add(configuration1); + doReturn(configurations).when(SPY_workflowAction).getRelatedResourcesInVnfc(any(), any(), any()); + + doReturn("testName").when(SPY_workflowAction).getVnfcNameForConfiguration(any()); + + thrown.expect(BpmnError.class); + SPY_workflowAction.selectExecutionList(delegateExecution); + assertEquals( + "Exception in getConfigBuildingBlock: Multiple relationships exist from VNFC testVnfcName to Configurations", + delegateExecution.getVariable("WorkflowException")); + } + + @Test public void selectExecutionListDuplicateNameExceptionTest() throws Exception { String gAction = "createInstance"; execution.setVariable("mso-request-id", "00f704ca-c5e5-4f95-a72c-6889db7b0688"); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java index dbdc274bc6..028abd6d25 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java @@ -7,12 +7,14 @@ * ================================================================================ * Modifications Copyright (c) 2019 Samsung * ================================================================================ + * Modifications Copyright (c) 2020 Nokia + * ================================================================================ * 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. @@ -133,7 +135,7 @@ public class InstanceManagement { HashMap<String, String> instanceIdMap, String version, String requestId, ContainerRequestContext requestContext) throws ApiException { String serviceInstanceId; - Boolean aLaCarte = true; + boolean aLaCarte = true; ServiceInstancesRequest sir; String apiVersion = version.substring(1); @@ -162,26 +164,14 @@ public class InstanceManagement { currentActiveReq); requestHandlerUtils.setInstanceId(currentActiveReq, requestScope, null, instanceIdMap); - int requestVersion = Integer.parseInt(version.substring(1)); - String vnfType = msoRequest.getVnfType(sir, requestScope, action, requestVersion); + String vnfType = msoRequest.getVnfType(sir, requestScope); if (requestScope.equalsIgnoreCase(ModelType.vnf.name()) && vnfType != null) { currentActiveReq.setVnfType(vnfType); } - InfraActiveRequests dup = null; - boolean inProgress = false; - - dup = requestHandlerUtils.duplicateCheck(action, instanceIdMap, null, requestScope, currentActiveReq); - - if (dup != null) { - inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq); - } + checkDuplicateAndBuildError(action, instanceIdMap, requestScope, currentActiveReq); - if (dup != null && inProgress) { - requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, null, requestScope, - dup); - } ServiceInstancesResponse serviceResponse = new ServiceInstancesResponse(); RequestReferences referencesResponse = new RequestReferences(); @@ -189,7 +179,7 @@ public class InstanceManagement { referencesResponse.setRequestId(requestId); serviceResponse.setRequestReferences(referencesResponse); - Boolean isBaseVfModule = false; + boolean isBaseVfModule = false; String workflowUuid = null; if (instanceIdMap != null) { @@ -207,17 +197,9 @@ public class InstanceManagement { vnfId = sir.getVnfInstanceId(); } - try { - infraActiveRequestsClient.save(currentActiveReq); - } catch (Exception e) { - ErrorLoggerInfo errorLoggerInfo = - new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError) - .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - throw new RequestDbFailureException.Builder(SAVE_TO_DB, e.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR, - ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).errorInfo(errorLoggerInfo).build(); - } + saveCurrentActiveRequest(currentActiveReq); - RequestClientParameter requestClientParameter = null; + RequestClientParameter requestClientParameter; try { requestClientParameter = new RequestClientParameter.Builder().setRequestId(requestId) .setBaseVfModule(isBaseVfModule).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()) @@ -237,10 +219,38 @@ public class InstanceManagement { recipeLookupResult.getOrchestrationURI(), requestScope); } + private void saveCurrentActiveRequest(InfraActiveRequests currentActiveReq) throws RequestDbFailureException { + try { + infraActiveRequestsClient.save(currentActiveReq); + } catch (Exception e) { + ErrorLoggerInfo errorLoggerInfo = + new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError) + .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); + throw new RequestDbFailureException.Builder(SAVE_TO_DB, e.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR, + ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).errorInfo(errorLoggerInfo).build(); + } + } + + private void checkDuplicateAndBuildError(Actions action, HashMap<String, String> instanceIdMap, String requestScope, + InfraActiveRequests currentActiveReq) throws ApiException { + + InfraActiveRequests dup = + requestHandlerUtils.duplicateCheck(action, instanceIdMap, null, requestScope, currentActiveReq); + if (dup == null) { + return; + } + + boolean inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq); + if (inProgress) { + requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, null, requestScope, + dup); + } + } + private Response processPNFCustomWorkflowRequest(String requestJSON, Actions action, HashMap<String, String> instanceIdMap, String version, String requestId, ContainerRequestContext requestContext) throws ApiException { - Boolean aLaCarte = false; + boolean aLaCarte = false; ServiceInstancesRequest sir; String apiVersion = version.substring(1); @@ -279,33 +289,13 @@ public class InstanceManagement { currentActiveReq); requestHandlerUtils.setInstanceId(currentActiveReq, requestScope, null, instanceIdMap); - InfraActiveRequests dup = null; - boolean inProgress = false; - - dup = requestHandlerUtils.duplicateCheck(action, instanceIdMap, null, requestScope, currentActiveReq); - - if (dup != null) { - inProgress = requestHandlerUtils.camundaHistoryCheck(dup, currentActiveReq); - } - - if (dup != null && inProgress) { - requestHandlerUtils.buildErrorOnDuplicateRecord(currentActiveReq, action, instanceIdMap, null, requestScope, - dup); - } + checkDuplicateAndBuildError(action, instanceIdMap, requestScope, currentActiveReq); RecipeLookupResult recipeLookupResult = getInstanceManagementWorkflowRecipe(currentActiveReq, workflowUuid); - try { - infraActiveRequestsClient.save(currentActiveReq); - } catch (Exception e) { - ErrorLoggerInfo errorLoggerInfo = - new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError) - .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - throw new RequestDbFailureException.Builder(SAVE_TO_DB, e.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR, - ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).errorInfo(errorLoggerInfo).build(); - } + saveCurrentActiveRequest(currentActiveReq); - RequestClientParameter requestClientParameter = null; + RequestClientParameter requestClientParameter; try { requestClientParameter = new RequestClientParameter.Builder().setRequestId(requestId) .setRecipeTimeout(recipeLookupResult.getRecipeTimeout()).setRequestAction(action.toString()) @@ -326,7 +316,7 @@ public class InstanceManagement { private RecipeLookupResult getInstanceManagementWorkflowRecipe(InfraActiveRequests currentActiveReq, String workflowUuid) throws ApiException { - RecipeLookupResult recipeLookupResult = null; + RecipeLookupResult recipeLookupResult; try { recipeLookupResult = getCustomWorkflowUri(workflowUuid); @@ -359,14 +349,12 @@ public class InstanceManagement { private RecipeLookupResult getCustomWorkflowUri(String workflowUuid) { - String recipeUri = null; Workflow workflow = catalogDbClient.findWorkflowByArtifactUUID(workflowUuid); - if (workflow == null) { - return null; - } else { + if (workflow != null) { String workflowName = workflow.getName(); - recipeUri = "/mso/async/services/" + workflowName; + String recipeUri = "/mso/async/services/" + workflowName; + return new RecipeLookupResult(recipeUri, 180); } - return new RecipeLookupResult(recipeUri, 180); + return null; } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java index c077558301..5c81f4e6a5 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java @@ -7,12 +7,14 @@ * ================================================================================ * Modifications Copyright (c) 2019 Samsung * ================================================================================ + * Modifications Copyright (c) 2020 Nokia + * ================================================================================ * 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. @@ -30,7 +32,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; +import java.util.Optional; import java.util.StringTokenizer; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; @@ -69,7 +71,6 @@ import org.onap.so.db.request.client.RequestsDbClient; import org.onap.so.exceptions.ValidationException; import org.onap.so.logger.LogConstants; import org.onap.so.serviceinstancebeans.CloudConfiguration; -import org.onap.so.serviceinstancebeans.InstanceDirection; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.PolicyException; @@ -148,7 +149,6 @@ public class MsoRequest { } - // Parse request JSON public void parse(ServiceInstancesRequest sir, HashMap<String, String> instanceIdMap, Actions action, String version, String originalRequestJSON, int reqVersion, Boolean aLaCarteFlag) @@ -222,44 +222,31 @@ public class MsoRequest { } } - public Map<String, List<String>> getOrchestrationFilters(MultivaluedMap<String, String> queryParams) - throws ValidationException { - - String queryParam = null; + public Map<String, List<String>> getOrchestrationFilters(MultivaluedMap<String, String> queryParams) { + final String FILTER_KEY = "filter"; Map<String, List<String>> orchestrationFilterParams = new HashMap<>(); + Optional.ofNullable(queryParams.get(FILTER_KEY)).ifPresent(listValues -> listValues + .forEach(value -> addValueToOrchestrationFilterParamsMap(orchestrationFilterParams, value))); - for (Entry<String, List<String>> entry : queryParams.entrySet()) { - queryParam = entry.getKey(); - - try { - if ("filter".equalsIgnoreCase(queryParam)) { - for (String value : entry.getValue()) { - StringTokenizer st = new StringTokenizer(value, ":"); - - int counter = 0; - String mapKey = null; - List<String> orchestrationList = new ArrayList<>(); - while (st.hasMoreElements()) { - if (counter == 0) { - mapKey = st.nextElement() + ""; - } else { - orchestrationList.add(st.nextElement() + ""); - } - counter++; - } - orchestrationFilterParams.put(mapKey, orchestrationList); - } - } + return orchestrationFilterParams; + } - } catch (Exception e) { - throw new ValidationException("QueryParam ServiceInfo", e); - } + private void addValueToOrchestrationFilterParamsMap(Map<String, List<String>> orchestrationFilterParams, + String value) { + final String TOKEN_DELIMITER = ":"; + StringTokenizer stringTokenizer = new StringTokenizer(value, TOKEN_DELIMITER); + if (!stringTokenizer.hasMoreTokens()) { + return; + } + String mapKey = stringTokenizer.nextToken(); + List<String> orchestrationList = new ArrayList<>(); + while (stringTokenizer.hasMoreTokens()) { + orchestrationList.add(stringTokenizer.nextToken()); } - - return orchestrationFilterParams; + orchestrationFilterParams.put(mapKey, orchestrationList); } public InfraActiveRequests createRequestObject(ServiceInstancesRequest servInsReq, Actions action, String requestId, @@ -465,7 +452,6 @@ public class MsoRequest { } - public Response buildResponse(int httpResponseCode, String errorCode, InfraActiveRequests inProgress) { return buildResponseWithError(httpResponseCode, errorCode, inProgress, null); } @@ -474,7 +460,6 @@ public class MsoRequest { String errorString) { - // Log the failed request into the MSO Requests database return Response.status(httpResponseCode).entity(null).build(); @@ -487,7 +472,6 @@ public class MsoRequest { } - public String getServiceType(VnfInputs vnfInputs) { if (vnfInputs.getServiceType() != null) return vnfInputs.getServiceType(); @@ -625,156 +609,78 @@ public class MsoRequest { } - public String getVfModuleType(ServiceInstancesRequest sir, String requestScope, Actions action, int reqVersion) { + public String getVfModuleType(ServiceInstancesRequest sir, String requestScope) { - String serviceInstanceType = null; - - String vnfType = null; + String vnfType; String vfModuleType = null; - String vfModuleModelName = null; + String vfModuleModelName; ModelInfo modelInfo = sir.getRequestDetails().getModelInfo(); RelatedInstanceList[] instanceList = sir.getRequestDetails().getRelatedInstanceList(); String serviceModelName = null; String vnfModelName = null; - String asdcServiceModelVersion = null; String volumeGroupId = null; - boolean isRelatedServiceInstancePresent = false; - boolean isRelatedVnfInstancePresent = false; - boolean isSourceVnfPresent = false; - boolean isDestinationVnfPresent = false; - boolean isConnectionPointPresent = false; - - if (instanceList != null) { - for (RelatedInstanceList relatedInstanceList : instanceList) { - RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); - ModelInfo relatedInstanceModelInfo = relatedInstance.getModelInfo(); - - if (action != Action.deleteInstance) { - - if (ModelType.configuration.name().equalsIgnoreCase(requestScope)) { - if (InstanceDirection.source.equals(relatedInstance.getInstanceDirection()) - && relatedInstanceModelInfo.getModelType().equals(ModelType.vnf)) { - isSourceVnfPresent = true; - } else if (InstanceDirection.destination.equals(relatedInstance.getInstanceDirection()) - && (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf) - || (relatedInstanceModelInfo.getModelType().equals(ModelType.pnf) - && reqVersion == 6))) { - isDestinationVnfPresent = true; - } - } - if (ModelType.connectionPoint.equals(relatedInstanceModelInfo.getModelType()) - && ModelType.configuration.name().equalsIgnoreCase(requestScope)) { - isConnectionPointPresent = true; - } - } - - - if (relatedInstanceModelInfo.getModelType().equals(ModelType.service)) { - isRelatedServiceInstancePresent = true; - serviceModelName = relatedInstanceModelInfo.getModelName(); - asdcServiceModelVersion = relatedInstanceModelInfo.getModelVersion(); - } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf) - && !(ModelType.configuration.name().equalsIgnoreCase(requestScope))) { - isRelatedVnfInstancePresent = true; - vnfModelName = relatedInstanceModelInfo.getModelCustomizationName(); - } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.volumeGroup)) { - volumeGroupId = relatedInstance.getInstanceId(); - } + if (instanceList == null) { + return null; + } + for (RelatedInstanceList relatedInstanceList : instanceList) { + RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); + ModelInfo relatedInstanceModelInfo = relatedInstance.getModelInfo(); + + if (relatedInstanceModelInfo.getModelType().equals(ModelType.service)) { + serviceModelName = relatedInstanceModelInfo.getModelName(); + } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf) + && !(ModelType.configuration.name().equalsIgnoreCase(requestScope))) { + vnfModelName = relatedInstanceModelInfo.getModelCustomizationName(); + } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.volumeGroup)) { + volumeGroupId = relatedInstance.getInstanceId(); } - - if (requestScope.equalsIgnoreCase(ModelType.volumeGroup.name())) { - serviceInstanceType = serviceModelName; - vnfType = serviceModelName + "/" + vnfModelName; - } else if (requestScope.equalsIgnoreCase(ModelType.vfModule.name())) { - vfModuleModelName = modelInfo.getModelName(); - serviceInstanceType = serviceModelName; - vnfType = serviceModelName + "/" + vnfModelName; - vfModuleType = vnfType + "::" + vfModuleModelName; - sir.setVolumeGroupInstanceId(volumeGroupId); - } else if (requestScope.equalsIgnoreCase(ModelType.vnf.name())) - vnfType = serviceModelName + "/" + sir.getRequestDetails().getModelInfo().getModelCustomizationName(); - + } + if (requestScope.equalsIgnoreCase(ModelType.vfModule.name())) { + vfModuleModelName = modelInfo.getModelName(); + vnfType = serviceModelName + "/" + vnfModelName; + vfModuleType = vnfType + "::" + vfModuleModelName; + sir.setVolumeGroupInstanceId(volumeGroupId); } return vfModuleType; } - public String getVnfType(ServiceInstancesRequest sir, String requestScope, Actions action, int reqVersion) { + public String getVnfType(ServiceInstancesRequest sir, String requestScope) { - String serviceInstanceType = null; - String networkType = null; String vnfType = null; - String vfModuleType = null; - String vfModuleModelName = null; - ModelInfo modelInfo = sir.getRequestDetails().getModelInfo(); RelatedInstanceList[] instanceList = sir.getRequestDetails().getRelatedInstanceList(); String serviceModelName = null; String vnfModelName = null; - String asdcServiceModelVersion = null; String volumeGroupId = null; - boolean isRelatedServiceInstancePresent = false; - boolean isRelatedVnfInstancePresent = false; - boolean isSourceVnfPresent = false; - boolean isDestinationVnfPresent = false; - boolean isConnectionPointPresent = false; - - if (instanceList != null) { - for (RelatedInstanceList relatedInstanceList : instanceList) { - RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); - ModelInfo relatedInstanceModelInfo = relatedInstance.getModelInfo(); - - if (action != Action.deleteInstance) { - - if (ModelType.configuration.name().equalsIgnoreCase(requestScope)) { - if (InstanceDirection.source.equals(relatedInstance.getInstanceDirection()) - && relatedInstanceModelInfo.getModelType().equals(ModelType.vnf)) { - isSourceVnfPresent = true; - } else if (InstanceDirection.destination.equals(relatedInstance.getInstanceDirection()) - && (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf) - || (relatedInstanceModelInfo.getModelType().equals(ModelType.pnf) - && reqVersion == 6))) { - isDestinationVnfPresent = true; - } - } - if (ModelType.connectionPoint.equals(relatedInstanceModelInfo.getModelType()) - && ModelType.configuration.name().equalsIgnoreCase(requestScope)) { - isConnectionPointPresent = true; - } - } - - - if (relatedInstanceModelInfo.getModelType().equals(ModelType.service)) { - isRelatedServiceInstancePresent = true; - serviceModelName = relatedInstanceModelInfo.getModelName(); - asdcServiceModelVersion = relatedInstanceModelInfo.getModelVersion(); - } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf) - && !(ModelType.configuration.name().equalsIgnoreCase(requestScope))) { - isRelatedVnfInstancePresent = true; - vnfModelName = relatedInstanceModelInfo.getModelCustomizationName(); - } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.volumeGroup)) { - volumeGroupId = relatedInstance.getInstanceId(); - } + if (instanceList == null) { + return null; + } + for (RelatedInstanceList relatedInstanceList : instanceList) { + RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); + ModelInfo relatedInstanceModelInfo = relatedInstance.getModelInfo(); + + if (relatedInstanceModelInfo.getModelType().equals(ModelType.service)) { + serviceModelName = relatedInstanceModelInfo.getModelName(); + } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.vnf) + && !(ModelType.configuration.name().equalsIgnoreCase(requestScope))) { + vnfModelName = relatedInstanceModelInfo.getModelCustomizationName(); + } else if (relatedInstanceModelInfo.getModelType().equals(ModelType.volumeGroup)) { + volumeGroupId = relatedInstance.getInstanceId(); } - - if (requestScope.equalsIgnoreCase(ModelType.volumeGroup.name())) { - serviceInstanceType = serviceModelName; - vnfType = serviceModelName + "/" + vnfModelName; - } else if (requestScope.equalsIgnoreCase(ModelType.vfModule.name())) { - vfModuleModelName = modelInfo.getModelName(); - serviceInstanceType = serviceModelName; - vnfType = serviceModelName + "/" + vnfModelName; - vfModuleType = vnfType + "::" + vfModuleModelName; - sir.setVolumeGroupInstanceId(volumeGroupId); - } else if (requestScope.equalsIgnoreCase(ModelType.vnf.name())) - vnfType = serviceModelName + "/" + sir.getRequestDetails().getModelInfo().getModelCustomizationName(); - } - return vnfType; + if (requestScope.equalsIgnoreCase(ModelType.volumeGroup.name())) { + vnfType = serviceModelName + "/" + vnfModelName; + } else if (requestScope.equalsIgnoreCase(ModelType.vfModule.name())) { + vnfType = serviceModelName + "/" + vnfModelName; + sir.setVolumeGroupInstanceId(volumeGroupId); + } else if (requestScope.equalsIgnoreCase(ModelType.vnf.name())) + vnfType = serviceModelName + "/" + sir.getRequestDetails().getModelInfo().getModelCustomizationName(); + return vnfType; } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java index 65537cbba0..a15d9cfd48 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ResumeOrchestrationRequest.java @@ -251,25 +251,22 @@ public class ResumeOrchestrationRequest { } try { - requestClientParameter = - new RequestClientParameter.Builder().setRequestId(currentActiveRequest.getRequestId()) - .setBaseVfModule(isBaseVfModule).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()) - .setRequestAction(infraActiveRequest.getRequestAction()) - .setServiceInstanceId(infraActiveRequest.getServiceInstanceId()) - .setPnfCorrelationId(pnfCorrelationId).setVnfId(infraActiveRequest.getVnfId()) - .setVfModuleId(infraActiveRequest.getVfModuleId()) - .setVolumeGroupId(infraActiveRequest.getVolumeGroupId()) - .setNetworkId(infraActiveRequest.getNetworkId()) - .setServiceType(infraActiveRequest.getServiceType()) - .setVnfType(infraActiveRequest.getVnfType()) - .setVfModuleType(msoRequest.getVfModuleType(sir, infraActiveRequest.getRequestScope(), - action, Integer.parseInt(version))) - .setNetworkType(infraActiveRequest.getNetworkType()) - .setRequestDetails(requestHandlerUtils - .mapJSONtoMSOStyle(infraActiveRequest.getRequestBody(), sir, aLaCarte, action)) - .setApiVersion(version).setALaCarte(aLaCarte) - .setRequestUri(currentActiveRequest.getRequestUrl()) - .setInstanceGroupId(infraActiveRequest.getInstanceGroupId()).build(); + requestClientParameter = new RequestClientParameter.Builder() + .setRequestId(currentActiveRequest.getRequestId()).setBaseVfModule(isBaseVfModule) + .setRecipeTimeout(recipeLookupResult.getRecipeTimeout()) + .setRequestAction(infraActiveRequest.getRequestAction()) + .setServiceInstanceId(infraActiveRequest.getServiceInstanceId()) + .setPnfCorrelationId(pnfCorrelationId).setVnfId(infraActiveRequest.getVnfId()) + .setVfModuleId(infraActiveRequest.getVfModuleId()) + .setVolumeGroupId(infraActiveRequest.getVolumeGroupId()) + .setNetworkId(infraActiveRequest.getNetworkId()).setServiceType(infraActiveRequest.getServiceType()) + .setVnfType(infraActiveRequest.getVnfType()) + .setVfModuleType(msoRequest.getVfModuleType(sir, infraActiveRequest.getRequestScope())) + .setNetworkType(infraActiveRequest.getNetworkType()) + .setRequestDetails(requestHandlerUtils.mapJSONtoMSOStyle(infraActiveRequest.getRequestBody(), sir, + aLaCarte, action)) + .setApiVersion(version).setALaCarte(aLaCarte).setRequestUri(currentActiveRequest.getRequestUrl()) + .setInstanceGroupId(infraActiveRequest.getInstanceGroupId()).build(); } catch (IOException e) { logger.error("IOException while generating requestClientParameter to send to BPMN", e); ErrorLoggerInfo errorLoggerInfo = 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 175b212c86..33eae43e44 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 @@ -844,17 +844,15 @@ public class ServiceInstances extends AbstractRestHandler { } requestHandlerUtils.setInstanceId(currentActiveReq, requestScope, null, instanceIdMap); - - int requestVersion = Integer.parseInt(version.substring(1)); String instanceName = null; if (sir.getRequestDetails().getRequestInfo() != null) { instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName(); } boolean alaCarteFlag = msoRequest.getAlacarteFlag(sir); - String vnfType = msoRequest.getVnfType(sir, requestScope, action, requestVersion); + String vnfType = msoRequest.getVnfType(sir, requestScope); String networkType = msoRequest.getNetworkType(sir, requestScope); String sdcServiceModelVersion = msoRequest.getSDCServiceModelVersion(sir); - String vfModuleType = msoRequest.getVfModuleType(sir, requestScope, action, requestVersion); + String vfModuleType = msoRequest.getVfModuleType(sir, requestScope); if (requestScope.equalsIgnoreCase(ModelType.vnf.name()) && vnfType != null) { currentActiveReq.setVnfType(vnfType); @@ -935,7 +933,7 @@ public class ServiceInstances extends AbstractRestHandler { } - RequestClientParameter requestClientParameter = null; + RequestClientParameter requestClientParameter; try { requestClientParameter = new RequestClientParameter.Builder().setRequestId(requestId) .setBaseVfModule(isBaseVfModule).setRecipeTimeout(recipeLookupResult.getRecipeTimeout()) diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OrchestrationTaskRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OrchestrationTaskRepository.java new file mode 100644 index 0000000000..1093c79638 --- /dev/null +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/OrchestrationTaskRepository.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2019 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.onap.so.db.request.data.repository; + +import org.onap.so.db.request.beans.OrchestrationTask; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import java.util.List; + +@RepositoryRestResource(collectionResourceRel = "orchestrationTask", path = "orchestrationTask") +public interface OrchestrationTaskRepository extends JpaRepository<OrchestrationTask, String> { + + public List<OrchestrationTask> findByStatus(@Param("status") String status); +} diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index f29a4451f6..c78979eccb 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -1,47 +1,47 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.onap.so</groupId> - <artifactId>packages</artifactId> - <version>1.4.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.onap.so</groupId> + <artifactId>packages</artifactId> + <version>1.4.0-SNAPSHOT</version> + </parent> - <packaging>pom</packaging> - <artifactId>docker</artifactId> - <name>Docker Images</name> - <description>Docker Images</description> + <packaging>pom</packaging> + <artifactId>docker</artifactId> + <name>Docker Images</name> + <description>Docker Images</description> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <so.project.version>${project.version}</so.project.version> - <docker.skip>false</docker.skip> - <docker.skip.build>false</docker.skip.build> - <docker.skip.push>false</docker.skip.push> - <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry> - <docker.push.registry>nexus3.onap.org:10003</docker.push.registry> - <docker.image.prefix>onap/so</docker.image.prefix> - <docker.push.phase>deploy</docker.push.phase> - </properties> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <so.project.version>${project.version}</so.project.version> + <docker.skip>false</docker.skip> + <docker.skip.build>false</docker.skip.build> + <docker.skip.push>false</docker.skip.push> + <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry> + <docker.push.registry>nexus3.onap.org:10003</docker.push.registry> + <docker.image.prefix>onap/so</docker.image.prefix> + <docker.push.phase>deploy</docker.push.phase> + </properties> - <build> - <finalName>${project.artifactId}-${project.version}</finalName> - <plugins> - <plugin> - <groupId>org.codehaus.groovy.maven</groupId> - <artifactId>gmaven-plugin</artifactId> - <version>1.0</version> - <executions> - <execution> - <phase>validate</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <source> + <build> + <finalName>${project.artifactId}-${project.version}</finalName> + <plugins> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source> println 'Project version: ' + project.properties['so.project.version']; def versionArray; if ( project.properties['so.project.version'] != null ) { @@ -56,439 +56,469 @@ println 'New tag for docker: ' + project.properties['project.docker.latesttag.version']; </source> - </configuration> - </execution> - </executions> - </plugin> + </configuration> + </execution> + </executions> + </plugin> - <plugin> - <groupId>io.fabric8</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>0.31.0</version> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.31.0</version> - <configuration> - <verbose>true</verbose> - <apiVersion>1.23</apiVersion> - <pullRegistry>${docker.pull.registry}</pullRegistry> - <pushRegistry>${docker.push.registry}</pushRegistry> + <configuration> + <verbose>true</verbose> + <apiVersion>1.23</apiVersion> + <pullRegistry>${docker.pull.registry}</pullRegistry> + <pushRegistry>${docker.push.registry}</pushRegistry> - <images> - <image> - <name>${docker.image.prefix}/base-image:1.0</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-base-image</dockerFile> - </build> - </image> - <image> - <name>${docker.image.prefix}/vnfm-adapter</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:mso-vnfm-etsi-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/catalog-db-adapter</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:mso-catalog-db-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/request-db-adapter</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:mso-requests-db-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/sdnc-adapter</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so:mso-sdnc-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/openstack-adapter</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so:mso-openstack-adapters</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/vfc-adapter</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:mso-vfc-adapter</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/so-appc-orchestrator</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.adapters:so-appc-orchestrator</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/sdc-controller</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so:asdc-controller</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/bpmn-infra</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so:mso-infrastructure-bpmn</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/api-handler-infra</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so:mso-api-handler-infra</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/so-monitoring</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so.monitoring:so-monitoring-service</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - <image> - <name>${docker.image.prefix}/so-simulator</name> - <build> - <cleanup>try</cleanup> - <dockerFileDir>docker-files</dockerFileDir> - <dockerFile>Dockerfile.so-app</dockerFile> - <tags> - <tag>${project.version}</tag> - <tag>${project.version}-${maven.build.timestamp}</tag> - <tag>${project.docker.latesttag.version}</tag> - </tags> - <assembly> - <inline> - <dependencySets> - <dependencySet> - <includes> - <include>org.onap.so:so-simulator</include> - </includes> - <outputFileNameMapping>app.jar</outputFileNameMapping> - </dependencySet> - </dependencySets> - </inline> - </assembly> - </build> - </image> - </images> - </configuration> + <images> + <image> + <name>${docker.image.prefix}/base-image:1.0</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-base-image</dockerFile> + </build> + </image> + <image> + <name>${docker.image.prefix}/vnfm-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-vnfm-etsi-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/ve-vnfm-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-ve-vnfm-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/catalog-db-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-catalog-db-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/request-db-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-requests-db-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/sdnc-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so:mso-sdnc-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/openstack-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so:mso-openstack-adapters</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/vfc-adapter</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:mso-vfc-adapter</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/so-appc-orchestrator</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.adapters:so-appc-orchestrator</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/sdc-controller</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so:asdc-controller</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/bpmn-infra</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so:mso-infrastructure-bpmn</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/api-handler-infra</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so:mso-api-handler-infra</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/so-monitoring</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.monitoring:so-monitoring-service</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + <image> + <name>${docker.image.prefix}/so-simulator</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>docker-files</dockerFileDir> + <dockerFile>Dockerfile.so-app</dockerFile> + <tags> + <tag>${project.version}</tag> + <tag>${project.version}-${maven.build.timestamp}</tag> + <tag>${project.docker.latesttag.version}</tag> + </tags> + <assembly> + <inline> + <dependencySets> + <dependencySet> + <includes> + <include>org.onap.so.simulator:so-simulator</include> + </includes> + <outputFileNameMapping>app.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> + </inline> + </assembly> + </build> + </image> + </images> + </configuration> - <executions> - <execution> - <id>clean-images</id> - <phase>pre-clean</phase> - <goals> - <goal>remove</goal> - </goals> - <configuration> - <removeAll>true</removeAll> - </configuration> - </execution> + <executions> + <execution> + <id>clean-images</id> + <phase>pre-clean</phase> + <goals> + <goal>remove</goal> + </goals> + <configuration> + <removeAll>true</removeAll> + </configuration> + </execution> - <execution> - <id>generate-images</id> - <phase>generate-sources</phase> - <goals> - <goal>build</goal> - </goals> - </execution> + <execution> + <id>generate-images</id> + <phase>generate-sources</phase> + <goals> + <goal>build</goal> + </goals> + </execution> - <execution> - <id>push-images</id> - <phase>${docker.push.phase}</phase> - <goals> - <goal>build</goal> - <goal>push</goal> - </goals> - <configuration> - <image>${docker.image.prefix}/catalog-db-adapter,${docker.image.prefix}/request-db-adapter,${docker.image.prefix}/sdnc-adapter,${docker.image.prefix}/openstack-adapter,${docker.image.prefix}/vfc-adapter,${docker.image.prefix}/sdc-controller,${docker.image.prefix}/bpmn-infra,${docker.image.prefix}/api-handler-infra,${docker.image.prefix}/so-monitoring,${docker.image.prefix}/so-simulator</image> - </configuration> - </execution> - </executions> - </plugin> + <execution> + <id>push-images</id> + <phase>${docker.push.phase}</phase> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + <configuration> + <image>${docker.image.prefix}/catalog-db-adapter,${docker.image.prefix}/request-db-adapter,${docker.image.prefix}/sdnc-adapter,${docker.image.prefix}/openstack-adapter,${docker.image.prefix}/vfc-adapter,${docker.image.prefix}/sdc-controller,${docker.image.prefix}/bpmn-infra,${docker.image.prefix}/api-handler-infra,${docker.image.prefix}/so-monitoring,${docker.image.prefix}/so-simulator</image> + </configuration> + </execution> + </executions> + </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <version>2.8</version> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - </plugins> - </build> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8</version> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> - <dependencies> - <dependency> - <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vnfm-etsi-adapter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-catalog-db-adapter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-requests-db-adapter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so</groupId> - <artifactId>mso-sdnc-adapter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so</groupId> - <artifactId>mso-openstack-adapters</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so.adapters</groupId> - <artifactId>mso-vfc-adapter</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so.adapters</groupId> - <artifactId>so-appc-orchestrator</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so</groupId> - <artifactId>asdc-controller</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so</groupId> - <artifactId>mso-infrastructure-bpmn</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so</groupId> - <artifactId>mso-api-handler-infra</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so.monitoring</groupId> - <artifactId>so-monitoring-service</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.onap.so</groupId> - <artifactId>so-simulator</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>mso-vnfm-etsi-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>mso-ve-vnfm-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>mso-catalog-db-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>mso-requests-db-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>mso-sdnc-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>mso-openstack-adapters</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>mso-vfc-adapter</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.adapters</groupId> + <artifactId>so-appc-orchestrator</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>asdc-controller</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>mso-infrastructure-bpmn</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>mso-api-handler-infra</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.monitoring</groupId> + <artifactId>so-monitoring-service</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.onap.so.simulator</groupId> + <artifactId>so-simulator</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> </project> @@ -32,8 +32,8 @@ <module>cloudify-client</module> <module>cxf-logging</module> <module>so-monitoring</module> - <module>packages</module> <module>so-simulator</module> + <module>packages</module> </modules> <properties> <project.mso.base.folder>.</project.mso.base.folder> |