diff options
21 files changed, 1029 insertions, 246 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index 1d77854a2a..20a404372f 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -878,3 +878,28 @@ DELETE FROM service_recipe where ACTION = 'upgradeInstance'; INSERT INTO service_recipe (ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, SERVICE_MODEL_UUID) VALUES ('upgradeInstance', '1.0', 'Gr api recipe to upgrade service-instance', '/mso/async/services/WorkflowActionBB', 180, 'd88da85c-d9e8-4f73-b837-3a72a431622b'); + +INSERT INTO building_block_rollback(BUILDING_BLOCK_NAME,ACTION,ROLLBACK_BUILDING_BLOCK_NAME,ROLLBACK_ACTION) +VALUES +('ActivateNetworkBB',NULL,'DeactivateNetworkBB',NULL), +('ActivatePnfBB',NULL,'DeactivatePnfBB',NULL), +('ActivateServiceInstanceBB',NULL,'DeactivateServiceInstanceBB',NULL), +('ActivateVfModuleBB',NULL,'DeactivateVfModuleBB',NULL), +('ActivateVnfBB',NULL,'DeactivateVnfBB',NULL), +('ActivateVolumeGroupBB',NULL,'DeactivateVolumeGroupBB',NULL), +('AssignNetworkBB',NULL,'UnassignNetworkBB',NULL), +('AssignServiceInstanceBB',NULL,'UnassignServiceInstanceBB',NULL), +('AssignVfModuleBB',NULL,'UnassignVfModuleBB',NULL), +('AssignVnfBB',NULL,'UnassignVnfBB',NULL), +('AssignVolumeGroupBB',NULL,'UnassignVolumeGroupBB',NULL), +('CreateNetworkBB',NULL,'DeleteNetworkBB',NULL), +('CreateNetworkCollectionBB',NULL,'DeleteNetworkCollectionBB',NULL), +('CreateVfModuleBB',NULL,'DeleteVfModuleBB',NULL), +('CreateVolumeGroupBB',NULL,'DeleteVolumeGroupBB',NULL), +('VNFSetInMaintFlagActivity',NULL,'VNFUnsetInMaintFlagActivity',NULL), +('VNFSetClosedLoopDisabledFlagActivity',NULL,'VNFUnsetClosedLoopDisabledFlagActivity',NULL), +('VNFLockActivity',NULL,'VNFUnlockActivity',NULL), +('VNFStopActivity',NULL,'VNFStartActivity',NULL), +('VNFQuiesceTrafficActivity',NULL,'VNFResumeTrafficActivity',NULL), +('EtsiVnfInstantiateBB',NULL,'EtsiVnfDeleteBB',NULL), +('AddFabricConfigurationBB',NULL,'DeleteFabricConfigurationBB',NULL); diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql index c1bb9ec272..6dfc863e0b 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql @@ -108,4 +108,5 @@ INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSI INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `VNF_TYPE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (13,NULL,'inPlaceSoftwareUpdate',NULL,'1','VID_DEFAULT','VID_DEFAULT recipe to update VNF software if no custom BPMN flow is found','/mso/async/services/VnfInPlaceUpdate',NULL,180,'2018-05-23 11:00:00'); INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `VNF_TYPE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (14,NULL,'applyUpdatedConfig',NULL,'1','VID_DEFAULT','VID_DEFAULT recipe to apply updated VNF config if no custom BPMN flow is found','/mso/async/services/VnfConfigUpdate',NULL,180,'2018-05-23 11:00:00'); INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `VNF_TYPE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (10030,NULL,'upgradeCnf',NULL,'1','GR-API-DEFAULT','Gr api recipe to do CNF-Upgrade','/mso/async/services/WorkflowActionBB',NULL,180,'2022-01-23 10:00:00'); +INSERT INTO `vnf_recipe` (`id`, `VF_MODULE_ID`, `ACTION`, `SERVICE_TYPE`, `VERSION_STR`, `VNF_TYPE`, `DESCRIPTION`, `ORCHESTRATION_URI`, `VNF_PARAM_XSD`, `RECIPE_TIMEOUT`, `CREATION_TIMESTAMP`) VALUES (10032,NULL,'healthCheck',NULL,'1','GR-API-DEFAULT','Gr api recipe to do CNF health check','/mso/async/services/WorkflowActionBB',NULL,180,'2022-01-05 18:52:03'); SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index 8ce4051b24..4e273d5a8e 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -34,6 +34,7 @@ import org.junit.Test; import org.onap.so.adapters.catalogdb.CatalogDbAdapterBaseTest; import org.onap.so.db.catalog.beans.AuthenticationType; import org.onap.so.db.catalog.beans.BBNameSelectionReference; +import org.onap.so.db.catalog.beans.BuildingBlockRollback; import org.onap.so.db.catalog.beans.CloudIdentity; import org.onap.so.db.catalog.beans.CloudSite; import org.onap.so.db.catalog.beans.CloudifyManager; @@ -780,5 +781,11 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertEquals(processingFlags.getEndpoint(), "TESTENDPOINT"); } + @Test + public void testGetBuildingBlocksList() { + List<BuildingBlockRollback> rollbackEntries = client.getBuildingBlockRollbackEntries(); + assertTrue(rollbackEntries.size() > 1); + } + } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index b76cf1eb5f..ed41270da9 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -23,6 +23,7 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; import java.sql.Timestamp; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.UUID; import java.util.stream.Collectors; @@ -49,6 +50,7 @@ import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.db.catalog.beans.BuildingBlockRollback; import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.db.request.beans.InfraActiveRequests; @@ -80,6 +82,9 @@ public class WorkflowActionBBTasks { private static final String VFMODULE = "VfModule"; private static final String CONFIGURATION_PATTERN = "(Ad|De)(.*)FabricConfiguration(.*)"; protected String maxRetries = "mso.rainyDay.maxRetries"; + private static final String ROLLBACK_TO_ASSIGNED = "RollbackToAssigned"; + private static final String UNASSIGN = "Unassign"; + private static final String DELETE = "Delete"; private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBTasks.class); @Autowired @@ -299,94 +304,98 @@ public class WorkflowActionBBTasks { public void rollbackExecutionPath(DelegateExecution execution) { final String action = (String) execution.getVariable(BBConstants.G_ACTION); final String resourceName = (String) execution.getVariable("resourceName"); - if (!(boolean) execution.getVariable("isRollback")) { - List<ExecuteBuildingBlock> flowsToExecute = - (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); + if ((boolean) execution.getVariable("isRollback")) { + workflowAction.buildAndThrowException(execution, + "Rollback has already been called. Cannot rollback a request that is currently in the rollback state."); + } + List<ExecuteBuildingBlock> flowsToExecute = + (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); - List<ExecuteBuildingBlock> flowsToExecuteChangeBBs = flowsToExecute.stream() - .filter(buildingBlock -> buildingBlock.getBuildingBlock().getBpmnFlowName().startsWith("Change")) - .collect(Collectors.toList()); + List<ExecuteBuildingBlock> flowsToExecuteChangeBBs = flowsToExecute.stream() + .filter(buildingBlock -> buildingBlock.getBuildingBlock().getBpmnFlowName().startsWith("Change")) + .collect(Collectors.toList()); + List<ExecuteBuildingBlock> rollbackFlows = new ArrayList<>(); + int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); + int listSize = flowsToExecute.size(); + List<BuildingBlockRollback> bbRollbackList = catalogDbClient.getBuildingBlockRollbackEntries(); - List<ExecuteBuildingBlock> rollbackFlows = new ArrayList<>(); - int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); - int listSize = flowsToExecute.size(); + for (int i = listSize - 1; i >= 0; i--) { + if (i > currentSequence - 1) { + flowsToExecute.remove(i); + } else { + // filter bbRollbackList for bbrollback, and check if action exists, then filter by action + BuildingBlock bb = flowsToExecute.get(i).getBuildingBlock(); + String flowName = bb.getBpmnFlowName(); + String scope = Objects.toString(bb.getBpmnScope(), ""); + String bbAction = Objects.toString(bb.getBpmnAction(), ""); + ExecuteBuildingBlock currentBB = (ExecuteBuildingBlock) execution.getVariable("buildingBlock"); - for (int i = listSize - 1; i >= 0; i--) { - if (i > currentSequence - 1) { - flowsToExecute.remove(i); - } else { - String flowName = flowsToExecute.get(i).getBuildingBlock().getBpmnFlowName(); - if (flowName.startsWith("Assign")) { - flowName = flowName.replaceFirst("Assign", "Unassign"); - } else if (flowName.startsWith("Create")) { - flowName = flowName.replaceFirst("Create", "Delete"); - } else if (flowName.startsWith("Activate")) { - flowName = flowName.replaceFirst("Activate", "Deactivate"); - } else if (flowName.startsWith("Add")) { - flowName = flowName.replaceFirst("Add", "Delete"); - } else if (flowName.startsWith("VNF")) { - if (flowName.startsWith("VNFSet")) { - flowName = flowName.replaceFirst("VNFSet", "VNFUnset"); - } else if (flowName.startsWith("VNFLock")) { - flowName = flowName.replaceFirst("VNFLock", "VNFUnlock"); - } else if (flowName.startsWith("VNFStop")) { - flowName = flowName.replaceFirst("VNFStop", "VNFStart"); - } else if (flowName.startsWith("VNFQuiesce")) { - flowName = flowName.replaceFirst("VNFQuiesce", "VNFResume"); - } else { - continue; - } - } else { - continue; + List<BuildingBlockRollback> filteredList = bbRollbackList.stream() + .filter(k -> k.getBuildingBlockName().equals((flowName))).collect(Collectors.toList()); + Optional<BuildingBlockRollback> matchedBBRollback = + "".equals(bbAction) ? filteredList.stream().findFirst() + : filteredList.stream().filter(k -> bbAction.equals(k.getAction())).findFirst(); + if (matchedBBRollback.isPresent()) { + final BuildingBlockRollback buildingBlockRollbackItem = matchedBBRollback.get(); + String rollbackFlow = buildingBlockRollbackItem.getRollbackBuildingBlockName(); + flowsToExecute.get(i).getBuildingBlock().setBpmnFlowName(rollbackFlow); + // if we have an action, search the filtered list for the bbrollback that matches the given action. + if (null != buildingBlockRollbackItem.getRollbackAction()) { + logger.info("Setting rollback_action {} for BB: {} action: {}", + buildingBlockRollbackItem.getRollbackAction(), + buildingBlockRollbackItem.getBuildingBlockName(), + buildingBlockRollbackItem.getAction()); + flowsToExecute.get(i).getBuildingBlock() + .setBpmnAction(buildingBlockRollbackItem.getRollbackAction()); } - flowsToExecute.get(i).getBuildingBlock().setBpmnFlowName(flowName); rollbackFlows.add(flowsToExecute.get(i)); } } + } - String handlingCode = (String) execution.getVariable(HANDLINGCODE); - List<ExecuteBuildingBlock> rollbackFlowsFiltered = new ArrayList<>(rollbackFlows); - if ("RollbackToAssigned".equals(handlingCode) || ROLLBACKTOCREATED.equals(handlingCode) - || ROLLBACKTOCREATEDNOCONFIGURATION.equals(handlingCode)) { - for (ExecuteBuildingBlock rollbackFlow : rollbackFlows) { - if (rollbackFlow.getBuildingBlock().getBpmnFlowName().contains("Unassign") - && !rollbackFlow.getBuildingBlock().getBpmnFlowName().contains("FabricConfiguration")) { - rollbackFlowsFiltered.remove(rollbackFlow); - } else if (rollbackFlow.getBuildingBlock().getBpmnFlowName().contains("Delete") - && ((!rollbackFlow.getBuildingBlock().getBpmnFlowName().contains("FabricConfiguration") - && (ROLLBACKTOCREATED.equals(handlingCode) - || ROLLBACKTOCREATEDNOCONFIGURATION.equals(handlingCode))) - || (rollbackFlow.getBuildingBlock().getBpmnFlowName() - .contains("FabricConfiguration") - && ROLLBACKTOCREATEDNOCONFIGURATION.equals(handlingCode)))) { - rollbackFlowsFiltered.remove(rollbackFlow); - } + String handlingCode = (String) execution.getVariable(HANDLINGCODE); + List<ExecuteBuildingBlock> rollbackFlowsFiltered = new ArrayList<>(rollbackFlows); + if (ROLLBACK_TO_ASSIGNED.equals(handlingCode) || ROLLBACKTOCREATED.equals(handlingCode) + || ROLLBACKTOCREATEDNOCONFIGURATION.equals(handlingCode)) { + for (ExecuteBuildingBlock rollbackFlow : rollbackFlows) { + if (rollbackFlow.getBuildingBlock().getBpmnFlowName().contains(UNASSIGN) + && !rollbackFlow.getBuildingBlock().getBpmnFlowName().contains(FABRIC_CONFIGURATION)) { + rollbackFlowsFiltered.remove(rollbackFlow); + } else if (rollbackFlow.getBuildingBlock().getBpmnFlowName().contains(DELETE) + && ((!rollbackFlow.getBuildingBlock().getBpmnFlowName().contains(FABRIC_CONFIGURATION) + && (ROLLBACKTOCREATED.equals(handlingCode) + || ROLLBACKTOCREATEDNOCONFIGURATION.equals(handlingCode))) + || (rollbackFlow.getBuildingBlock().getBpmnFlowName().contains(FABRIC_CONFIGURATION) + && ROLLBACKTOCREATEDNOCONFIGURATION.equals(handlingCode)))) { + rollbackFlowsFiltered.remove(rollbackFlow); } } + } - List<ExecuteBuildingBlock> rollbackFlowsFilteredNonChangeBBs = new ArrayList<>(); - if (action.equals(REPLACEINSTANCE) && resourceName.equals(VFMODULE)) { - for (ExecuteBuildingBlock executeBuildingBlock : rollbackFlowsFiltered) { - if (!executeBuildingBlock.getBuildingBlock().getBpmnFlowName().startsWith("Change")) { - rollbackFlowsFilteredNonChangeBBs.add(executeBuildingBlock); - } + List<ExecuteBuildingBlock> rollbackFlowsFilteredNonChangeBBs = new ArrayList<>(); + if (action.equals(REPLACEINSTANCE) && resourceName.equals(VFMODULE)) { + for (ExecuteBuildingBlock executeBuildingBlock : rollbackFlowsFiltered) { + if (!executeBuildingBlock.getBuildingBlock().getBpmnFlowName().startsWith("Change")) { + rollbackFlowsFilteredNonChangeBBs.add(executeBuildingBlock); } - rollbackFlowsFiltered.clear(); - rollbackFlowsFiltered.addAll(flowsToExecuteChangeBBs); - rollbackFlowsFiltered.addAll(rollbackFlowsFilteredNonChangeBBs); } - - workflowActionBBFailure.updateRequestErrorStatusMessage(execution); - execution.setVariable("isRollbackNeeded", !rollbackFlows.isEmpty()); - execution.setVariable("flowsToExecute", rollbackFlowsFiltered); - execution.setVariable(HANDLINGCODE, "PreformingRollback"); - execution.setVariable("isRollback", true); - execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, 0); - execution.setVariable(RETRY_COUNT, 0); - } else { - workflowAction.buildAndThrowException(execution, - "Rollback has already been called. Cannot rollback a request that is currently in the rollback state."); + rollbackFlowsFiltered.clear(); + rollbackFlowsFiltered.addAll(flowsToExecuteChangeBBs); + rollbackFlowsFiltered.addAll(rollbackFlowsFilteredNonChangeBBs); } + + logger.info("List of BuildingBlocks to execute for rollback"); + rollbackFlowsFiltered.forEach(item -> { + logger.info(item.getBuildingBlock().getBpmnFlowName()); + }); + + workflowActionBBFailure.updateRequestErrorStatusMessage(execution); + execution.setVariable("isRollbackNeeded", !rollbackFlows.isEmpty()); + execution.setVariable("flowsToExecute", rollbackFlowsFiltered); + execution.setVariable(HANDLINGCODE, "PreformingRollback"); + execution.setVariable("isRollback", true); + execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, 0); + execution.setVariable(RETRY_COUNT, 0); } protected void updateInstanceId(DelegateExecution execution) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index cbb746d514..2e4d99f9c6 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -35,6 +35,8 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import java.util.Arrays; +import java.util.Collections; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -64,6 +66,7 @@ import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; +import org.onap.so.db.catalog.beans.BuildingBlockRollback; import org.onap.so.db.catalog.beans.ConfigurationResource; import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.VnfResourceCustomization; @@ -109,6 +112,11 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { private DelegateExecution mockExecution; @Before + public void initCatalogDBRollbackTable() { + when(catalogDbClient.getBuildingBlockRollbackEntries()).thenReturn(getRollbackBuildingBlockList()); + } + + @Before public void before() throws Exception { execution = new DelegateExecutionFake(); ServiceInstance servInstance = new ServiceInstance(); @@ -614,6 +622,52 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { } @Test + public void rollbackExecutionRollbackControllerExecutionBBTest() { + execution.setVariable("isRollback", false); + execution.setVariable("handlingCode", "Rollback"); + execution.setVariable("requestAction", EMPTY_STRING); + execution.setVariable("resourceName", EMPTY_STRING); + List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>(); + BuildingBlock buildingBlock1 = new BuildingBlock().setBpmnFlowName("AssignServiceInstanceBB"); + ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock1); + flowsToExecute.add(ebb1); + + BuildingBlock buildingBlock2 = new BuildingBlock().setBpmnFlowName("AssignNetworkBB"); + ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock2); + flowsToExecute.add(ebb2); + + BuildingBlock buildingBlock3 = new BuildingBlock().setBpmnFlowName("AssignVnfBB"); + ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock3); + flowsToExecute.add(ebb3); + + BuildingBlock buildingBlock4 = new BuildingBlock().setBpmnFlowName("AssignVfModuleBB"); + ExecuteBuildingBlock ebb4 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock4); + flowsToExecute.add(ebb4); + + BuildingBlock buildingBlock5 = new BuildingBlock().setBpmnFlowName("ControllerExecutionBB"); + buildingBlock5.setBpmnScope("vnf"); + buildingBlock5.setBpmnAction("config-assign"); + ExecuteBuildingBlock ebb5 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock5); + flowsToExecute.add(ebb5); + + BuildingBlock buildingBlock6 = new BuildingBlock().setBpmnFlowName("CreateVfModuleBB"); + ExecuteBuildingBlock ebb6 = new ExecuteBuildingBlock().setBuildingBlock(buildingBlock6); + flowsToExecute.add(ebb6); + + execution.setVariable("flowsToExecute", flowsToExecute); + execution.setVariable("gCurrentSequence", 5); + + workflowActionBBTasks.rollbackExecutionPath(execution); + List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); + BuildingBlock bb = ebbs.get(0).getBuildingBlock(); + assertEquals("ControllerExecutionBB", bb.getBpmnFlowName()); + assertEquals("vnf", bb.getBpmnScope()); + assertEquals("config-unassign", bb.getBpmnAction()); + assertEquals(0, execution.getVariable("gCurrentSequence")); + assertEquals(5, ebbs.size()); + } + + @Test public void postProcessingExecuteBBActivateVfModuleNotReplaceInstanceTest() throws CloneNotSupportedException { WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); workflowResourceIds.setServiceInstanceId("1"); @@ -1061,4 +1115,40 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { execution.setVariable("homing", false); execution.setVariable("calledHoming", false); } + + private List<BuildingBlockRollback> getRollbackBuildingBlockList() { + List<BuildingBlockRollback> rollbackBBList = Collections.unmodifiableList(Arrays.asList( + new BuildingBlockRollback(1, "ActivateNetworkBB", null, "DeactivateNetworkBB", null), + new BuildingBlockRollback(2, "ActivatePnfBB", null, "DeactivatePnfBB", null), + new BuildingBlockRollback(3, "ActivateServiceInstanceBB", null, "DeactivateServiceInstanceBB", null), + new BuildingBlockRollback(4, "ActivateVfModuleBB", null, "DeactivateVfModuleBB", null), + new BuildingBlockRollback(5, "ActivateVnfBB", null, "DeactivateVnfBB", null), + new BuildingBlockRollback(6, "ActivateVolumeGroupBB", null, "DeactivateVolumeGroupBB", null), + new BuildingBlockRollback(7, "AssignNetworkBB", null, "UnassignNetworkBB", null), + new BuildingBlockRollback(8, "AssignServiceInstanceBB", null, "UnassignServiceInstanceBB", null), + new BuildingBlockRollback(9, "AssignVfModuleBB", null, "UnassignVfModuleBB", null), + new BuildingBlockRollback(10, "AssignVnfBB", null, "UnassignVnfBB", null), + new BuildingBlockRollback(11, "AssignVolumeGroupBB", null, "UnassignVolumeGroupBB", null), + new BuildingBlockRollback(12, "ControllerExecutionBB", "config-assign", "ControllerExecutionBB", + "config-unassign"), + new BuildingBlockRollback(13, "ControllerExecutionBB", "config-deploy", "ControllerExecutionBB", + "config-undeploy"), + new BuildingBlockRollback(14, "ControllerExecutionBB", "service-config-deploy", "ControllerExecutionBB", + "service-config-undeploy"), + new BuildingBlockRollback(15, "CreateNetworkBB", null, "DeleteNetworkBB", null), + new BuildingBlockRollback(16, "CreateNetworkCollectionBB", null, "DeleteNetworkCollectionBB", null), + new BuildingBlockRollback(17, "CreateVfModuleBB", null, "DeleteVfModuleBB", null), + new BuildingBlockRollback(18, "CreateVolumeGroupBB", null, "DeleteVolumeGroupBB", null), + new BuildingBlockRollback(19, "VNFSetInMaintFlagActivity", null, "VNFUnsetInMaintFlagActivity", null), + new BuildingBlockRollback(20, "VNFSetClosedLoopDisabledFlagActivity", null, + "VNFUnsetClosedLoopDisabledFlagActivity", null), + new BuildingBlockRollback(21, "VNFLockActivity", null, "VNFUnlockActivity", null), + new BuildingBlockRollback(22, "VNFStopActivity", null, "VNFStartActivity", null), + new BuildingBlockRollback(23, "VNFQuiesceTrafficActivity", null, "VNFResumeTrafficActivity", null), + new BuildingBlockRollback(24, "EtsiVnfInstantiateBB", null, "EtsiVnfDeleteBB", null), + // AddFabricConfigurationBB this does not seem to be present as a bpmn in Guilin + new BuildingBlockRollback(25, "AddFabricConfigurationBB", null, "DeleteFabricConfigurationBB", null))); + return rollbackBBList; + } + } diff --git a/common/src/test/java/org/onap/so/client/HttpClientTest.java b/common/src/test/java/org/onap/so/client/HttpClientTest.java index e9e8fe7853..3966d183f7 100644 --- a/common/src/test/java/org/onap/so/client/HttpClientTest.java +++ b/common/src/test/java/org/onap/so/client/HttpClientTest.java @@ -97,4 +97,113 @@ public class HttpClientTest { postRequestedFor(urlEqualTo("/services/sdnc/post")).withHeader("Accept", equalTo("application/json"))); } + @Test + public void testPostUsingXmlClient_success() throws MalformedURLException { + + wireMockRule.stubFor(post(urlEqualTo("/services/sdnc/post")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/xml").withBody(""))); + + URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post"); + HttpClient client = httpClientFactory.newXmlClient(url, ONAPComponents.BPMN); + + client.addBasicAuthHeader( + "97FF88AB352DA16E00DDD81E3876431DEF8744465DACA489EB3B3BE1F10F63EDA1715E626D0A4827A3E19CD88421BF", + "123"); + client.addAdditionalHeader("Accept", "application/xml"); + + client.post("{}"); + + verify(exactly(1), postRequestedFor(urlEqualTo("/services/sdnc/post"))); + } + + @Test + public void testPostUsingXmlClient_nullHeader() throws MalformedURLException { + + wireMockRule.stubFor(post(urlEqualTo("/services/sdnc/post")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/xml").withBody(""))); + + URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post"); + HttpClient client = httpClientFactory.newXmlClient(url, ONAPComponents.BPMN); + + client.accept = "application/xml"; + client.addAdditionalHeader("id", null); + + client.post("{}"); + + verify(exactly(1), + postRequestedFor(urlEqualTo("/services/sdnc/post")).withHeader("Accept", equalTo("application/xml"))); + } + + @Test + public void testPostUsingXmlClient_nullBasicAuth() throws MalformedURLException { + + wireMockRule.stubFor(post(urlEqualTo("/services/sdnc/post")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/xml").withBody(""))); + + URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post"); + HttpClient client = httpClientFactory.newXmlClient(url, ONAPComponents.BPMN); + + client.accept = "application/xml"; + client.addBasicAuthHeader("", "12345"); + + client.post("{}"); + + verify(exactly(1), + postRequestedFor(urlEqualTo("/services/sdnc/post")).withHeader("Accept", equalTo("application/xml"))); + } + + @Test + public void testPostUsingTextXmlClient_success() throws MalformedURLException { + + wireMockRule.stubFor(post(urlEqualTo("/services/sdnc/post")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "text/xml").withBody(""))); + + URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post"); + HttpClient client = httpClientFactory.newTextXmlClient(url, ONAPComponents.BPMN); + + client.addBasicAuthHeader( + "97FF88AB352DA16E00DDD81E3876431DEF8744465DACA489EB3B3BE1F10F63EDA1715E626D0A4827A3E19CD88421BF", + "123"); + client.addAdditionalHeader("Accept", "text/xml"); + + client.post("{}"); + + verify(exactly(1), postRequestedFor(urlEqualTo("/services/sdnc/post"))); + } + + @Test + public void testPostUsingTextXmlClient_nullHeader() throws MalformedURLException { + + wireMockRule.stubFor(post(urlEqualTo("/services/sdnc/post")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "text/xml").withBody(""))); + + URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post"); + HttpClient client = httpClientFactory.newTextXmlClient(url, ONAPComponents.BPMN); + + client.addAdditionalHeader("Accept", "text/xml"); + client.addAdditionalHeader("id", null); + + client.post("{}"); + + verify(exactly(1), + postRequestedFor(urlEqualTo("/services/sdnc/post")).withHeader("Accept", equalTo("text/xml"))); + } + + @Test + public void testPostUsingTextXmlClient_nullBasicAuth() throws MalformedURLException { + + wireMockRule.stubFor(post(urlEqualTo("/services/sdnc/post")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "text/xml").withBody(""))); + + URL url = new URL("http://localhost:" + wireMockRule.port() + "/services/sdnc/post"); + HttpClient client = httpClientFactory.newTextXmlClient(url, ONAPComponents.BPMN); + + client.addBasicAuthHeader("", "12345"); + client.addAdditionalHeader("Accept", "text/xml"); + + client.post("{}"); + + verify(exactly(1), + postRequestedFor(urlEqualTo("/services/sdnc/post")).withHeader("Accept", equalTo("text/xml"))); + } } diff --git a/docs/architecture/architecture.rst b/docs/architecture/architecture.rst index d59429a366..7cfb276cf7 100644 --- a/docs/architecture/architecture.rst +++ b/docs/architecture/architecture.rst @@ -9,7 +9,7 @@ SO - Architecture SO Functional View ------------------ -.. image:: ../images/SO_Architecture_1.png +.. image:: ../images/SO_Architecture_2.png SO Deployment View -------------------- @@ -110,9 +110,22 @@ SO Sub-Components * Create, Instantiate, Terminate and Delete VNF, including Granting, Subscription and Lifecycle Notifications * Tracking capability which VNFM instance has handled with which VNF instance * BPMN Building Block workflows and Java-based recipes for VNF LCM + * Conformance of SOL001 VNFD and SOL004 VNF package specifications + * Interfacing with the ETSI Catalog Manager (a.k.a. etsicatalog) for retrieving ETSI VNF descriptors and artifacts * VNFM Simulator for validating SO VNFM Adapter NBI and SBI for integration testing - * The SO ETSI CSIT Tests and running them, https://wiki.onap.org/display/DW/SO+ETSI+CSIT - * Testing the SO ETSI Alignment manually (Instantiate VNF using SVNFM), https://wiki.onap.org/pages/viewpage.action?pageId=68524128 + +.. image:: ../images/SO-SOL003-Adapter-Architecture-1.png + +**SO ETSI NFVO** + + Support ETSI NFVO functions which manages Network Service LCM + * Create, Instantiate, Terminate and Delete NS + * Decomposing an NS request into associated VNF request(s) and managing VNF LCM (Create, Instantiate, Terminate, Delete VNF) through SO VNFMN Adapter + * Leveraging SOL005 for its NBI and SOl003 for its SBI + * Conformance of SOL001 NSD and SOL007 NS package specifications + * Interfacing with the ETSI Catalog Manager (a.k.a. etsicatalog) for retrieving ETSI NS descriptors and artifacts + +.. image:: ../images/SO-NFVO-Architecture-1.png Third Party and Open Source --------------------------- diff --git a/docs/developer_info/BPMN-INFRA_Workflow_Understanding.rst b/docs/developer_info/BPMN-INFRA_Workflow_Understanding.rst index b1ef356c35..3af3dc8dc9 100644 --- a/docs/developer_info/BPMN-INFRA_Workflow_Understanding.rst +++ b/docs/developer_info/BPMN-INFRA_Workflow_Understanding.rst @@ -16,8 +16,8 @@ curl -v -H "Content-Type: application/json" -X POST --data @request_body_file_na Request Body: - { - "service":{ + { + "service":{ "name":"SliceService", "description":"SliceService", "serviceInvariantUuid":"dfcd7471-16c7-444e-8268-d4c50d90593a", @@ -62,18 +62,18 @@ curl -v -H "Content-Type: application/json" -X POST --data @request_body_file_na "nstar0_allottedresource0_providing_service_invariant_uuid": "1899e5c1-df4e-43a8-a889-48c157dad7bc" } } - } + } .. code-block:: bash Response body: - { + { "service": { "serviceId": "ebe2d37f-f65b-43d8-8906-f81811ed8f22", "operationId": "ed9b4c84-17db-4874-8896-25324a0401fe" + } } - } Code flows: @@ -120,8 +120,8 @@ Payload will be reaching to bpmn in the form of: .. code-block:: bash - { - "variables": { + { + "variables": { "bpmnRequest": { "value": { "requestDetails": { @@ -305,8 +305,8 @@ Payload will be reaching to bpmn in the form of: "value": false, "type": "Boolean" } - } - } + } + } Based on the serviceUuid which is mentioned in the request body it will call the the CreateCommunicationService.bpmn file and This CreateCommunicationService.bpmn is taken as a example to this workflow Understanding which then call the subprocess of this flow and so on. @@ -349,8 +349,8 @@ Based on the serviceUuid which is mentioned in the request body it will call the .. code-block:: bash - { - "serviceResources": { + { + "serviceResources": { "modelInfo": { "modelName": "CST", "modelUuid": "bfc2775b-64ad-41e5-95fe-d3bc57df6c73", @@ -547,8 +547,8 @@ Based on the serviceUuid which is mentioned in the request body it will call the } ], "serviceAllottedResources": [] - } - } + } + } 5. CreateCommunicationService--> prepareDoComposeE2E() @@ -572,17 +572,17 @@ Based on the serviceUuid which is mentioned in the request body it will call the d. Request body for PUT request to the AAI from bpmn: -{ - "service-instance-name": "SliceService", - "service-role": "communication-service", - "environment-context": "01-70CAA6B", - "created-at": "2020-06-23 05:02:56", - "model-invariant-id": "d4df55ca-c985-46c9-8088-f952181f553e", - "model-version-id": "bfc2775b-64ad-41e5-95fe-d3bc57df6c73", - "orchestration-status": "processing", - "input-parameters": "{ \"service\":{ \"name\":\"SliceService\", \"description\":\"SliceService\", \"serviceInvariantUuid\":\"d4df55ca-c985-46c9-8088-f952181f553e\", \"serviceUuid\":\"bfc2775b-64ad-41e5-95fe-d3bc57df6c73\", \"globalSubscriberId\":\"5GCustomer\", \"serviceType\":\"5G\", \"parameters\":{ \"locationConstraints\":[ ], \"resources\":[ { \"resourceIndex\":\"1\", \"resourceName\":\"allottedResource\", \"resourceInvariantUuid\":\"eeefcd86-7b5b-41ae-9516-08acc5d59d92\", \"resourceUuid\":\"265da937-76c7-4152-98e3-5f0d0a844b7f\", \"resourceCustomizationUuid\":\"a4eda1d9-1af4-424b-997f-12c57b74c67a\", \"parameters\":{ \"locationConstraints\":[ ], \"resources\":[ ], \"requestInputs\":{ } } } ], \"requestInputs\":{\t\t\t \"sST\": \"embb\", \"sNSSAI\": \"1-10101\", \"uEMobilityLevel\": \"stationary\", \"areaTrafficCapDL\": 123, \"maxNumberofUEs\": 1000, \"expDataRateUL\": 2000, \"plmnIdList\": \"39-00|39-01\", \"areaTrafficCapUL\": 456, \"latency\": 300, \"expDataRateDL\": 400, \"coverageAreaTAList\": 101001, \"activityFactor\": 99, \"resourceSharingLevel\": \"shared\", \"nstar0_allottedresource0_providing_service_uuid\": \"4e8d930b-7483-4b9b-8c82-4708638ade4a\", \"nstar0_allottedresource0_providing_service_invariant_uuid\": \"1899e5c1-df4e-43a8-a889-48c157dad7bc\" } } }}" - -} + { + "service-instance-name": "SliceService", + "service-role": "communication-service", + "environment-context": "01-70CAA6B", + "created-at": "2020-06-23 05:02:56", + "model-invariant-id": "d4df55ca-c985-46c9-8088-f952181f553e", + "model-version-id": "bfc2775b-64ad-41e5-95fe-d3bc57df6c73", + "orchestration-status": "processing", + "input-parameters": "{ \"service\":{ \"name\":\"SliceService\", \"description\":\"SliceService\", \"serviceInvariantUuid\":\"d4df55ca-c985-46c9-8088-f952181f553e\", \"serviceUuid\":\"bfc2775b-64ad-41e5-95fe-d3bc57df6c73\", \"globalSubscriberId\":\"5GCustomer\", \"serviceType\":\"5G\", \"parameters\":{ \"locationConstraints\":[ ], \"resources\":[ { \"resourceIndex\":\"1\", \"resourceName\":\"allottedResource\", \"resourceInvariantUuid\":\"eeefcd86-7b5b-41ae-9516-08acc5d59d92\", \"resourceUuid\":\"265da937-76c7-4152-98e3-5f0d0a844b7f\", \"resourceCustomizationUuid\":\"a4eda1d9-1af4-424b-997f-12c57b74c67a\", \"parameters\":{ \"locationConstraints\":[ ], \"resources\":[ ], \"requestInputs\":{ } } } ], \"requestInputs\":{\t\t\t \"sST\": \"embb\", \"sNSSAI\": \"1-10101\", \"uEMobilityLevel\": \"stationary\", \"areaTrafficCapDL\": 123, \"maxNumberofUEs\": 1000, \"expDataRateUL\": 2000, \"plmnIdList\": \"39-00|39-01\", \"areaTrafficCapUL\": 456, \"latency\": 300, \"expDataRateDL\": 400, \"coverageAreaTAList\": 101001, \"activityFactor\": 99, \"resourceSharingLevel\": \"shared\", \"nstar0_allottedresource0_providing_service_uuid\": \"4e8d930b-7483-4b9b-8c82-4708638ade4a\", \"nstar0_allottedresource0_providing_service_invariant_uuid\": \"1899e5c1-df4e-43a8-a889-48c157dad7bc\" } } }}" + + } Response: Response is returned with an empty entity @@ -593,7 +593,7 @@ https://aai.onap:8443/aai/v19/business/customers/customer/5GCustomer/service-sub payload: -{"profile-id":"202a5e9a-d1d7-4afd-922f-3e7a709c780c","max-number-of-UEs":1000,"latency":300,"exp-data-rate-UL":2000,"exp-data-rate-DL":400,"ue-mobility-level":"stationary","resource-sharing-level":"shared"} + {"profile-id":"202a5e9a-d1d7-4afd-922f-3e7a709c780c","max-number-of-UEs":1000,"latency":300,"exp-data-rate-UL":2000,"exp-data-rate-DL":400,"ue-mobility-level":"stationary","resource-sharing-level":"shared"} Response: Response is returned with an empty entity @@ -603,13 +603,13 @@ Response: Response is returned with an empty entity b. Response Body: - { + { "service": { "serviceId":"8a95e3ac-32cd-4ffb-b9e3-5366b393a7a2", "operationId":"a970a804-7ac5-4de9-b6db-17352afbc6fa" - } + } 9. CreateCommunicationService--> generateE2EServiceProfile() @@ -641,11 +641,10 @@ Response: Response is returned with an empty entity b. Request body: - { + { "related-link":"aai/v16/business/customers/customer/5GCustomer/service-subscriptions/service- subscription/5G/service-instances/service-instance/2e6c2d7f-85c0-4b1f-b7fd-5f2364c27ea7" - - } + } 15. CreateCommunicationService--> prepareUpdateOperationStatus() diff --git a/docs/developer_info/CSIT_Macroflow_developer_info.rst b/docs/developer_info/CSIT_Macroflow_developer_info.rst new file mode 100644 index 0000000000..d8c52a4a71 --- /dev/null +++ b/docs/developer_info/CSIT_Macroflow_developer_info.rst @@ -0,0 +1,153 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2022 Huawei Technologies Co., Ltd. + +SO CSIT (Macroflow) +======================== + +Ensure you have a healthy ONAP Deployment running. The following components will be required/used as part of this guide: + +- SO +- SDC +- AAI +- DMAAP +- SDNC +- MultiCloud + +What is Macroflow? +----------------- + +The SO building blocks are a set of database-driven, configurable and generic process steps to be leveraged through several actions defined as 'Macro' flows. For each of the macro flows, there are a set of actions to be performed which are implemented as building blocks - which then implement generic logic to handle the orchestration of services and various type of resources orchestrated by ONAP, as well as their corresponding actions. + +**Macroflow** method allows the user to build and send only one request to instantiate all objects : Service, VNFs, VFModules and Networks. + +How to run CSIT Macroflow? +-------------------------- + +The follow steps are to be installed and run on an Ubuntu 18.04 (desktop) installation. +Later versions of Ubuntu and Java may work for the tests. + +**Prerequisite:** +Install Java 11, Maven, docker, docker-compose + +Following steps need to be followed to run the CSIT Macroflow: + +First pull the CSIT repo from Gerrit, either with or without the hooks + +… code-block:: + + git clone "https://gerrit.onap.org/r/integration/csit" +or + +.. code-block:: + + git clone "https://gerrit.onap.org/r/integration/csit" && (cd "csit" && mkdir -p .git/hooks && curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit.onap.org/r/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg) + +Once this is downloaded a few more installations are required. + +Install pip (if required) + +.. code-block:: + + sudo apt install python-pip + +Install Robot Framework through pip + +.. code-block:: + + pip install robotframework + +Run Script + +Once all of this is done, then the tests should be run by calling the run-csit.sh script and giving it the location of our test folder (csit/plans/so/macroflow). + +From the csit projects root folder run the following command: + +.. code-block:: + + ./run-csit.sh plans/so/macroflow + +This should successfully run the CSIT Macroflow + +The run-csit.sh will automatically set up a Robot environment for you, and execute the test plan defined in the plans/so/macroflow directory. + +If you look at the contents of the plans/so/macroflow you will see the following: + +**setup.sh:** the shell script that starts all the necessary docker containers required by this test plan, as well as passing the necessary environment variables to Robot. +**testplan.txt:** the text file listing, in order, the test suites that should be executed by Robot for this particular test plan. This allows you to refactor test suites to be reused by multiple test plans as necessary. +**teardown.sh:** the shell script that kills all the docker containers that were started by this test plan. +**docker-compose.yml:** This lists all the requrired docker. + +How to run tests against specific SO versions +-------------------------------------------- +It is possible to run the CSIT Macroflow suite against local docker images although it is not the default. Through this method specific versions of SO can be tested. + +There are two changes required to make this work. + +1. The env file, located at [containing folder]/csit/plans/so/macroflow/config/env, first needs to be changed. The DOCKER_ENVIROMENT needs to be changed from "remote" to "local". Also the TAG value might need to be changed. This Tag relates to the version of images being used. Make sure the cnf-adapter image version also need to be changed here. + +2. Secondly all of the required docker images must be present on system. + +This should be enough to run the CSIT Macroflow test suite locally. + +CSIT Macroflow Tests High Level Scenarios +--------------------------------------------------- + +**Step 1:** + +Perform Configuration / Setup Steps prior to running tests + +**Step 2:** + +Onoboard the Macroflow Csar Package to complete the distribution from sdc-controller. This will be done by RoboFramework itlself. ASDC saves both heat and helm info into mso catalogdb. + +**Step 3:** + +Once the distribution done, next Instantiation will be executed for Macrolfow. RoboFramework is used to trigger the Instantiation flow. In this case, API handler receives the call and fetches required information from mso catalogdb. + +**Step 4:** + +Bpmn-Infra is called and fetches required information from mso catalogdb and executes all the selected building blocks which will call cnf-adapter or openstack adapter on the basis of usecase whether it is Macroflow Heat or Macroflow Helm. + +**Step 5:** + +Bpmn-Infra also fetches and updates Action infromation to the AAI-Simulator and SDNC-Simulator + +**Step 6:** + +Cnf-Adapter will then call to Multicloud (Multicloud-Simulator) and complete the Execution of Macroflow. + +Follow the diagram in the image below to understand the step + +.. image:: ../images/Architecture_flow.png + +What are the tests doing? +------------------------- +There are three tests currently being run "Distribute Service Template", "Invoke Service Instantiation". + +**Distribute Service Template** + +As the name would suggest the aim for the "Distribute Service Template" test is to distribute a service template within the SDC controller pod. Once a http session of the SDC controller is created a post request can be made to it. This post requests sends binary data from "serviceBasicVfCnfnotification.json" for Macroflow heat and "serviceBasicVfCnfWithHelm.json" for Macroflow helm. These json files contain the information of resources and artifacts required to distribute a service. These json file gather information from the Csar package which resides in the plans/so/macroflow/config/distribution-test-zip directory. Once this post request is sent, the response status code is checked to see if it is 200. If the code is not equal to 200 then the test is thought to be a failure. + +**Invoke Service Instantiation** + +The aim of the "Invoke Service Instantiation" test is to invoke the service distributed to the sdc controller in the previous test. A http session of the api handler pod is created. This session is sent a post request containing "macroflow.json" for Macroflow heat and "MacroflowWithHelm.json" for Macroflow helm. Once these request are made the response is checked if it a valid code is returned. A for loop is used to continually make calls to check the orchestration request for both the request, to check the status of service instantiation. Only once this orchestration returns either a fail or success, will we break out of the for loop. Once outside the for loop a final statement is used to check if service has been successfully instantiated. + +Troubleshooting +--------------- +There are a number of simple issues relating from Python and its libraries + +A correct installation of the robot framework to run our tests requiring python and the following pip libraries. + +- robotframework +- robotframework-extendedselenium2library +- robotframework-httplibrary +- robotframework-onap +- robotframework-requests +- robotframework-selenium2library + +To make sure each of the previous libraries is installed run the following command + +.. code-block:: + + pip -list diff --git a/docs/developer_info/Docker-Config_Understanding.rst b/docs/developer_info/Docker-Config_Understanding.rst index e684c6c480..d62503e1c8 100644 --- a/docs/developer_info/Docker-Config_Understanding.rst +++ b/docs/developer_info/Docker-Config_Understanding.rst @@ -58,132 +58,132 @@ Path:- /docker-config/volumes/so/config/api-handler-infra/onapheat/override.yaml .. code-block:: bash - server: - port: 8080 - tomcat: - max-threads: 50 - ssl-enable: false - - mso: - msoKey: 07a7159d3bf51a0e53be7a8f89699be7 - logPath: logs - site-name: onapheat - adapters: - requestDb: - endpoint: http://request-db-adapter:8083 - auth: Basic YnBlbDpwYXNzd29yZDEk - catalog: - db: - spring: - endpoint: http://catalog-db-adapter:8082 - db: - auth: Basic YnBlbDpwYXNzd29yZDEk - config: - path: /src/main/resources/ - infra: - default: - alacarte: - orchestrationUri: /mso/async/services/ALaCarteOrchestrator - recipeTimeout: 180 - testApi: VNF_API - service: - macro: - default: - testApi: GR_API - camundaURL: http://bpmn-infra:8081 - camundaAuth: AE2E9BE6EF9249085AF98689C4EE087736A5500629A72F35068FFB88813A023581DD6E765071F1C04075B36EA4213A - async: - core-pool-size: 50 - max-pool-size: 50 - queue-capacity: 500 - sdc: - client: - auth: F3473596C526938329DF877495B494DC374D1C4198ED3AD305EA3ADCBBDA1862 - activate: - instanceid: test - userid: cs0008 - endpoint: http://c1.vm1.mso.simpledemo.onap.org:28090 - tenant: - isolation: - retry: - count: 3 - aai: - endpoint: https://aai.api.simpledemo.onap.org:8443 - auth: 2630606608347B7124C244AB0FE34F6F - extApi: - endpoint: http://nbi.onap:8080/nbi/api/v3 - so: - operational-environment: - dmaap: - username: testuser - password: VjR5NDcxSzA= - host: http://c1.vm1.mso.simpledemo.onap.org:28090 - auth: 51EA5414022D7BE536E7516C4D1A6361416921849B72C0D6FC1C7F262FD9F2BBC2AD124190A332D9845A188AD80955567A4F975C84C221EEA8243BFD92FFE6896CDD1EA16ADD34E1E3D47D4A - publisher: - topic: com.att.ecomp.mso.operationalEnvironmentEvent - - spring: - datasource: - hikari: - jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb - username: cataloguser - password: catalog123 - driver-class-name: org.mariadb.jdbc.Driver - pool-name: catdb-pool - registerMbeans: true - jpa: - show-sql: true - hibernate: - dialect: org.hibernate.dialect.MySQL5Dialect - ddl-auto: validate - naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy - enable-lazy-load-no-trans: true - jersey: - type: filter - - security: - usercredentials: - - - username: sitecontrol - password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' - role: SiteControl-Client - - - username: gui - password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' - role: GUI-Client - - - username: infraportal - password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' - role: InfraPortal-Client - - - username: InfraPortalClient - password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' - role: InfraPortal-Client - - - username: bpel - password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' - role: BPEL-Client - - - username: mso_admin - password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' - role: ACTUATOR - - request: - datasource: - hikari: - jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb - username: requestuser - password: request123 - driver-class-name: org.mariadb.jdbc.Driver - pool-name: reqdb-pool - registerMbeans: true - org: - onap: - so: - cloud-owner: CloudOwner + server: + port: 8080 + tomcat: + max-threads: 50 + ssl-enable: false + + mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: logs + site-name: onapheat adapters: - network: - encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + config: + path: /src/main/resources/ + infra: + default: + alacarte: + orchestrationUri: /mso/async/services/ALaCarteOrchestrator + recipeTimeout: 180 + testApi: VNF_API + service: + macro: + default: + testApi: GR_API + camundaURL: http://bpmn-infra:8081 + camundaAuth: AE2E9BE6EF9249085AF98689C4EE087736A5500629A72F35068FFB88813A023581DD6E765071F1C04075B36EA4213A + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + sdc: + client: + auth: F3473596C526938329DF877495B494DC374D1C4198ED3AD305EA3ADCBBDA1862 + activate: + instanceid: test + userid: cs0008 + endpoint: http://c1.vm1.mso.simpledemo.onap.org:28090 + tenant: + isolation: + retry: + count: 3 + aai: + endpoint: https://aai.api.simpledemo.onap.org:8443 + auth: 2630606608347B7124C244AB0FE34F6F + extApi: + endpoint: http://nbi.onap:8080/nbi/api/v3 + so: + operational-environment: + dmaap: + username: testuser + password: VjR5NDcxSzA= + host: http://c1.vm1.mso.simpledemo.onap.org:28090 + auth: 51EA5414022D7BE536E7516C4D1A6361416921849B72C0D6FC1C7F262FD9F2BBC2AD124190A332D9845A188AD80955567A4F975C84C221EEA8243BFD92FFE6896CDD1EA16ADD34E1E3D47D4A + publisher: + topic: com.att.ecomp.mso.operationalEnvironmentEvent + + spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: true + jpa: + show-sql: true + hibernate: + dialect: org.hibernate.dialect.MySQL5Dialect + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + jersey: + type: filter + + security: + usercredentials: + - + username: sitecontrol + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SiteControl-Client + - + username: gui + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: GUI-Client + - + username: infraportal + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: InfraPortal-Client + - + username: InfraPortalClient + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: InfraPortal-Client + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + + request: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb + username: requestuser + password: request123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: reqdb-pool + registerMbeans: true + org: + onap: + so: + cloud-owner: CloudOwner + adapters: + network: + encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 @@ -245,8 +245,8 @@ Example Output: .. code-block:: bash - [ - { + [ + { "Id": "sha256:2573165483e9ac87826da9c08984a9d0e1d93a90c681b22d9b4f90ed579350dc", "RepoTags": [ "onap/so/api-handler-infra:1.3.0-SNAPSHOT", @@ -360,5 +360,5 @@ Example Output: "sha256:2163a1f989859fdb3af6e253b74094e92a0fc1ee59f5eb959971f94eb1f98094" ] } - } - ] + } + ] diff --git a/docs/developer_info/ETSI_CSIT_NFVO_VNFM.rst b/docs/developer_info/ETSI_CSIT_NFVO_VNFM.rst new file mode 100644 index 0000000000..3bc8393d56 --- /dev/null +++ b/docs/developer_info/ETSI_CSIT_NFVO_VNFM.rst @@ -0,0 +1,227 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2022 Ericsson Software Technologies + +SO ETSI CSIT (NFVO and VNFM) +============================ +This guide will go through the CSIT of the ETSI NFVO and VNFM. + +Ensure you have a healthy ONAP Deployment running. The following components will be required/used as part of this guide: + +- SO +- SDC +- AAI +- DMAAP +- Modeling + +What is ETSI? +------------- +The European Telecommunications Standards Institute (ETSI) produces globally-applicable standards +for Information and Communications Technologies. ETSI set out standards covering the functionalities +of the interfaces specified on the reference points, which use the acronym NFV-SOL +(standing for “NFV Solutions”). As of ONAPs Dublin release the SO SVNFM adapter supports +SOL003 standards for Create, Instantiate, Terminate and Delete operations with Granting, Subscription +and Notification. As of ONAP Honolulu release, the SO ETSI NFVO sub-component supports +SOL005 (NBI) and SOL003 (SBI) standards for Create, Instantiate, Terminate and Delete NS and VNF +(through the SOL003 Adapter) operations. + +How to Run CSIT Tests +--------------------- +The follow steps are to install and run on an Ubuntu 18.04 (desktop) installation. +Later versions of Ubuntu and Java may work for the tests. + +First pull the CSIT repo from Gerrit, either with or without the hooks + +.. code-block:: + + git clone "https://gerrit.onap.org/r/integration/csit" + +or + +.. code-block:: + + git clone "https://gerrit.onap.org/r/integration/csit" && (cd "csit" && mkdir -p .git/hooks && curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit.onap.org/r/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg) + +Once this is downloaded a few more installations are required. + +Install pip (if required) + +.. code-block:: + + sudo apt install python-pip + +Install Robot Framework through pip + +.. code-block:: + + pip install robotframework + +Run Script + +Once all of this is done, then the tests should be run by calling the run-csit.sh script and giving it the location of our test folder (csit/plans/so/integration-etsi-testing). +From the csit projects root folder run the following command: + +.. code-block:: + + ./run-csit.sh plans/so/integration-etsi-testing + +This should successfully run the ETSI CSIT suite + +How to run tests againt specific SO versions +-------------------------------------------- +It is possible to run the ETSI CSIT suite against local docker images although it is not the default. +Through this method specific versions of SO can be tested. +There are two changes required to make this work. +The env file, located at [containing folder]/csit/plans/so/integration-etsi-testing/config/env, +first needs to be changed. The DOCKER_ENVIROMENT needs to be changed from "remote" to "local". +Also the TAG value might need to be changed. This Tag relates to the version of images being used. + +Secondly all of the required docker images must be present on system. + +This should be enough to run the ETSI CSIT test suite locally. + +ETSI NFVO Automated CSIT Tests High Level Scenarios +--------------------------------------------------- +**Step 1:** + +Perform Configuration / Setup Steps prior to running tests + +**Step 2:** + +Onboard SOL004 Package and SOL007 directly into ETSI Catalog using ROBOT framework + +**Step 3:** + +ETSI Catalog Gets Package from SDC Simulator (New: ETSI Catalog and Modeling ETSI Catalog DB will need to be set up and spun up for CSIT. May be some impact on SDC Simulator here) + +**Step 4:** + +ETSI Catalog Stores Package in its Modeling ETSI Catalog DB + +**Step 5:** + +ROBOT framework used to trigger NS LCM requests, e.g., INSTANTIATE NS + +**Step 6:** + +ETSI NFVO NS LCM gets required data from ETSI Catalog, e.g., Get and Parse NSD + +**Step 7:** + +If e.g., a CREATE NS task, ETSI NFVO NS LCM checks to see if already exists in ETSI NFVO DB + +**Step 8:** + +Create Generic VNF and connect to Service Instance in A&AI Simulator (May be some impact on A&AI Simulator here) + +**Step 9:** + +Instantiate VNF through SOL003 Adapter + +**Step 10:** + +SOL003 Adapter processes requests through A&AI and (May be some impact on A&AI Simulator here) + +**Step 11:** + +SOL003 Adapter processes requests through ETSI-Catalog + +**Step 12:** + +SOL003 Adapter sends notification to SOL003 NBI, etc. + +What are the tests doing? +------------------------- +There are three tests currently being run "Distribute Service Template", "Invoke Service Instantiation", +"Invoke NS Instantiation", "Delete NS Instance", "Invoke VNF Instantiation", "Delete VNF Instance" and +"Delete Service Instance". + +Distribute Service Template + +As the name would suggest the aim for the "Distribute Service Template" test is to distribute a service +template within the SDC controller pod. Once a http session of the SDC controller is created a post request +can be made to it. This post requests sends binary data from "distributeServiceTemplate.json". +This json file contains resources and artifacts required to distribute a service. Once this post request +is sent, the response status code is checked to see if it is 200. If the code is not equal to 200 then +the test is thought to be a failure. + +Invoke Service Instantiation + +The aim of the "Invoke Service Instantiation" test is to invoke the service distributed to the sdc controller +in the previous test. A http session of the api handler pod is created. This session is sent a post request +containing "serviceInstantiationRequest.json". Once this request is made the response is checked if it +a valid code is returned. A for loop is used to continually make calls to check the orchestration request, +to check the status of service instantiation. Only once this orchestration returns either a fail or success, +will we break out of the for loop.Once outside the for loop a final statement is used to check if service +has been successfully instantiated. + +Invoke NS Instance + +The aim of "Invoke NS Instantiation" test is to now instantiate the NS that relates to service in the +previous test. This test requires the ID of the service instance created in the previous test. If this is +not provided then the test will fail from the get go. Once again a http session of the api handler pod is +created. Similarly a post request using the json data within "nsInstantiationRequest.json". +Once this request is made if it returns a success code then the test moves on to a for loop. Within this +for a loop an orchestration request is made each time, when this request signals that either the instantiation +request has failed or fully succeeded then the loop is escaped. The test will either be a pass or fail depending +on this final orchestration request. + +Delete NS Instance + +This test will delete the NS Instance created in the previous test. Both the ID of the NS instance created +in the previous test and the service instance created in the test before that. If either of these values is +not provided then the test will fail. This test once again makes use of a session of the api handler pod. +A post request is made using the data from "nsDeleteRequest.json". Once this request is made if it returns +a success code then the test moves on to a for loop. Within this for a loop an orchestration request is made +each time, when this request signals that either the instantiation request has failed or fully succeeded +then the loop is escaped. The test will either be a pass or fail depending on this final orchestration request. + +Invoke VNF Instance + +The aim of "Invoke VNF Instantiation" test is to now instantiate the VNF that relates to service in +the previous test. This test requires the ID of the service instance created in the previous test. +If this is not provided then the test will fail from the get go. Once again a http session of the +api handler pod is created. Similarly a post request using the json data within "vnfInstantiationRequest.json". +Once this request is made if it returns a success code then the test moves on to a for loop. Within this +for a loop an orchestration request is made each time, when this request signals that either the instantiation +request has failed or fully succeeded then the loop is escaped. The test will either be a pass or fail +depending on this final orchestration request. + +Delete VNF Instance + +This test will delete the VNF Instance created in the previous test. Both the ID of the vnf instance created +in the previous test and the service instance created in the test before that. If either of these values is +not provided then the test will fail. This test once again makes use of a session of the api handler pod. +A post request is made using the data from "vnfDeleteRequest.json". Once this request is made if it returns +a success code then the test moves on to a for loop. Within this for a loop an orchestration request is made +each time, when this request signals that either the instantiation request has failed or fully succeeded then +the loop is escaped. The test will either be a pass or fail depending on this final orchestration request. + +Delete Service Instance + +This test will delete the service instance created in earlier test. To delete the service the ID of previously + created Service Instance is required, if this is not supplied then the test will fail before starting. + A post request is then made to the API handler containing data from "serviceDeleteRquest.json". + Once this request is made if it returns a success code then the test moves on to a for loop. + Within this for a loop an orchestration request is made each time, when this request signals that either + the instantiation request has failed or fully succeeded then the loop is escaped. The test will either be + a pass or fail depending on this final orchestration request. + +Troubleshooting +--------------- +There are a number of simple issues relating from Python and its libraries + +A correct installation of the robot framework to run our tests requiring python and the following pip libraries. + +- robotframework +- robotframework-extendedselenium2library +- robotframework-httplibrary +- robotframework-onap +- robotframework-requests +- robotframework-selenium2library + +To make sure each of the previous libraries is installed run the following command + +.. code-block:: + + pip -list
\ No newline at end of file diff --git a/docs/developer_info/developer_information.rst b/docs/developer_info/developer_information.rst index e174133d6f..11b515248a 100644 --- a/docs/developer_info/developer_information.rst +++ b/docs/developer_info/developer_information.rst @@ -15,6 +15,7 @@ SO Developer Information Camunda_Cockpit_Community_Edition.rst Camunda_Cockpit_Enterprise_Edition.rst Camunda_Modeler.rst + CSIT_Macroflow_developer_info.rst BPMN_Project_Structure.rst BPMN_Main_Process_Flows.rst BPMN_Subprocess_Process_Flows.rst diff --git a/docs/images/Architecture_flow.png b/docs/images/Architecture_flow.png Binary files differnew file mode 100644 index 0000000000..112192560d --- /dev/null +++ b/docs/images/Architecture_flow.png diff --git a/docs/images/SO-NFVO-Architecture-1.png b/docs/images/SO-NFVO-Architecture-1.png Binary files differnew file mode 100644 index 0000000000..dd04a7b2e4 --- /dev/null +++ b/docs/images/SO-NFVO-Architecture-1.png diff --git a/docs/images/SO-SOL003-Adapter-Architecture-1.png b/docs/images/SO-SOL003-Adapter-Architecture-1.png Binary files differnew file mode 100644 index 0000000000..932d5d1bcd --- /dev/null +++ b/docs/images/SO-SOL003-Adapter-Architecture-1.png diff --git a/docs/images/SO_Architecture_2.png b/docs/images/SO_Architecture_2.png Binary files differnew file mode 100644 index 0000000000..45ffd953e6 --- /dev/null +++ b/docs/images/SO_Architecture_2.png diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 58902f3d27..4299041911 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -14,6 +14,127 @@ The SO provides the highest level of service orchestration in the ONAP architect Release Notes ============= +Version: 1.10.0 +============== + + :Release Date: 2022-04-08 + +SO Release Image Versions +-------------------------- + - so-bpmn-infra + + :Version: 1.10.0 + + - so-catalog-db-adapter + + :Version: 1.10.0 + + - so-admin-cockpit + + :Version: 1.8.3 + + - so-nssmf-adapter + + :Version: 1.9.1 + + - so-openstack-adapter + + :Version: 1.10.0 + + - so-request-db-adapter + + :Version: 1.10.0 + + - so-sdc-controller + + :Version: 1.10.0 + + - so-sdnc-adapter + + :Version: 1.10.0 + + - so-sol003-adapter + + :Version: 1.8.2 + + - so-api-handler + + :Version: 1.10.0 + + - so-etsi-nfvo-ns-lcm + + :Version: 1.8.2 + + - so-oof-adapter + + :Version: 1.8.3 + + - so-cnf-adapter + + :Version: 1.10.0 + +Release Purpose +---------------- +SO Jakarta Release. +The key deliverable for this release is refactoring SO for better internal architecture. + + +**Epics** + +* `REQ-890 <https://jira.onap.org/browse/REQ-890>`_ - ONAP CNF orchestration - Jakarta Enhancements +* `REQ-1041 <https://jira.onap.org/browse/REQ-1041>`_ - VNF LCM Support in SO +* `SO-3802 <https://jira.onap.org/browse/SO-3802>`_ - Global Requirements Approval +* `SO-3826 <https://jira.onap.org/browse/SO-3826>`_ - SO impacts for E2E Network Slicing in Jakarta Release + +**Stories** + +The full list of implemented tasks is available on `JIRA Jakarta STORY <https://jira.onap.org/browse/SO-3748?jql=project%20%3D%20%22Service%20Orchestrator%22%20%20AND%20issuetype%20%3D%20story%20AND%20fixVersion%20%3D%20%22Jakarta%20Release%22>`_ + + +**Tasks** + +The full list of implemented tasks is available on `JIRA Jakarta TASKS <https://jira.onap.org/browse/SO-3930?jql=project%20%3D%20%22Service%20Orchestrator%22%20%20AND%20issuetype%20%3D%20Task%20AND%20fixVersion%20%3D%20%22Jakarta%20Release%22>`_ + +**Bug Fixes** + +The full list of fixed bugs is available on `JIRA Jakarta BUGS +<https://jira.onap.org/browse/SO-3908?jql=project%20%3D%20%22Service%20Orchestrator%22%20%20AND%20issuetype%20%3D%20Bug%20AND%20fixVersion%20%3D%20%22jakarta%20Release%22>`_ + +Security Notes +-------------- + +*Fixed Security Issues* + +* `SO-3735 <https://jira.onap.org/browse/SO-3735>`_ +* `SO-3825 <https://jira.onap.org/browse/SO-3825>`_ +* `SO-3846 <https://jira.onap.org/browse/SO-3846>`_ + + +Quick Links: + +- `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`__ +- `Passing Badge information for SDC <https://bestpractices.coreinfrastructure.org/en/projects/1702>`__ + +**Known Issues** + +* `SO-3237 <https://jira.onap.org/browse/SO-3237>`_ - Exposed HTTP port. +* `SO-3745 <https://jira.onap.org/browse/SO-3745>`_ - SO images contain 1 GPLv3 lib + +**Upgrade Notes** + + N/A + +**Deprecation Notes** + + SO modules Ve-Vnfm-adapter and appc-orchestrator are deprectaed since istanbul release. + +**Other** + + N/A +*************************************************************************************** + + + Version: 1.9.2 ============== diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index 74a3b7a3fd..3b3441a807 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1 +1,3 @@ lfdocs-conf +sphinx>=4.2.0 # BSD +sphinx-rtd-theme>=1.0.0 # MIT diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index 99c0fc23fa..5bf33b417a 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -369,16 +369,7 @@ public class OrchestrationRequests { } } catch (IOException e) { - logger.error("Exception occurred", e); - ErrorLoggerInfo errorLoggerInfo = - new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError) - .build(); - ValidateException validateException = - new ValidateException.Builder("Mapping of request to JSON object failed : ", - HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).cause(e) - .errorInfo(errorLoggerInfo).build(); - - throw validateException; + logger.error(String.format("Failed to parse request (id: %s) : ", request.getRequestId()), e); } } request.setRequestDetails(requestDetails); diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockRollback.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockRollback.java index 798604e4fb..67a19c005d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockRollback.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockRollback.java @@ -65,6 +65,17 @@ public class BuildingBlockRollback implements Serializable { @Column(name = "ROLLBACK_ACTION", length = 200) private String rollbackAction; + public BuildingBlockRollback() {} + + public BuildingBlockRollback(Integer id, String buildingBlockName, String action, String rollbackBuildingBlockName, + String rollbackAction) { + this.id = id; + this.buildingBlockName = buildingBlockName; + this.action = action; + this.rollbackBuildingBlockName = rollbackBuildingBlockName; + this.rollbackAction = rollbackAction; + } + public Integer getId() { return id; } diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql index db800b2b49..cf1b188a21 100644 --- a/mso-catalog-db/src/test/resources/schema.sql +++ b/mso-catalog-db/src/test/resources/schema.sql @@ -1424,3 +1424,27 @@ CREATE TABLE IF NOT EXISTS `building_block_rollback` ( `ROLLBACK_ACTION` varchar(200) NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO building_block_rollback(BUILDING_BLOCK_NAME,ACTION,ROLLBACK_BUILDING_BLOCK_NAME,ROLLBACK_ACTION) +VALUES ("ActivateNetworkBB",NULL,"DeactivateNetworkBB",NULL), +("ActivatePnfBB",NULL,"DeactivatePnfBB",NULL), +("ActivateServiceInstanceBB",NULL,"DeactivateServiceInstanceBB",NULL), +("ActivateVfModuleBB",NULL,"DeactivateVfModuleBB",NULL), +("ActivateVnfBB",NULL,"DeactivateVnfBB",NULL), +("ActivateVolumeGroupBB",NULL,"DeactivateVolumeGroupBB",NULL), +("AssignNetworkBB",NULL,"UnassignNetworkBB",NULL), +("AssignServiceInstanceBB",NULL,"UnassignServiceInstanceBB",NULL), +("AssignVfModuleBB",NULL,"UnassignVfModuleBB",NULL), +("AssignVnfBB",NULL,"UnassignVnfBB",NULL), +("AssignVolumeGroupBB",NULL,"UnassignVolumeGroupBB",NULL), +("CreateNetworkBB",NULL,"DeleteNetworkBB",NULL), +("CreateNetworkCollectionBB",NULL,"DeleteNetworkCollectionBB",NULL), +("CreateVfModuleBB",NULL,"DeleteVfModuleBB",NULL), +("CreateVolumeGroupBB",NULL,"DeleteVolumeGroupBB",NULL), +("VNFSetInMaintFlagActivity",NULL,"VNFUnsetInMaintFlagActivity",NULL), +("VNFSetClosedLoopDisabledFlagActivity",NULL,"VNFUnsetClosedLoopDisabledFlagActivity",NULL), +("VNFLockActivity",NULL,"VNFUnlockActivity",NULL), +("VNFStopActivity",NULL,"VNFStartActivity",NULL), +("VNFQuiesceTrafficActivity",NULL,"VNFResumeTrafficActivity",NULL), +("EtsiVnfInstantiateBB", null, "EtsiVnfDeleteBB", null), +("AddFabricConfigurationBB", null, "DeleteFabricConfigurationBB", null); |