aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql25
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V1.1__Initial_Recipe_Setup.sql1
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java7
3 files changed, 33 insertions, 0 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);
+ }
+
}