Create a Reference Table for Controller Selection 83/63883/1
authorRob Daugherty <rd472p@att.com>
Thu, 30 Aug 2018 18:26:55 +0000 (14:26 -0400)
committerRob Daugherty <rd472p@att.com>
Thu, 30 Aug 2018 18:30:01 +0000 (14:30 -0400)
Also: Modify Alacarte Reference Data

This commit consolidates changes from three abandoned commits:

https://gerrit.onap.org/r/60959
https://gerrit.onap.org/r/60953
https://gerrit.onap.org/r/60397

Change-Id: I295a79cb05ca742ae5743892397e75c7c228bde3
Issue-ID: SO-763
Issue-ID: SO-676
Signed-off-by: Rob Daugherty <rd472p@att.com>
adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.7__CreateTableControllerSelectionRefence.sql [moved from adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.4__CreateTableControllerSelectionRefence.sql with 100% similarity]
adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.8__AutoScaleOutReferenceData.sql [new file with mode: 0644]
mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ControllerSelectionReferenceRepository.java
mso-catalog-db/src/test/java/org/onap/so/db/catalog/ControllerSelectionReferenceTest.java
mso-catalog-db/src/test/resources/data.sql

diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.8__AutoScaleOutReferenceData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.8__AutoScaleOutReferenceData.sql
new file mode 100644 (file)
index 0000000..c5a8dcf
--- /dev/null
@@ -0,0 +1,22 @@
+use catalogdb;
+
+INSERT INTO building_block_detail (BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION)
+VALUES
+('ConfigurationScaleOutBB', 'VF_MODULE', 'CREATE'),
+('GenericVnfHealthCheckBB', 'VF_MODULE', 'CREATE');
+
+INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, IS_TOPLEVELFLOW, MIN_API_VERSION, MAX_API_VERSION) VALUES
+('VFModule-ScaleOut', 'createInstance', 'VfModule', true, true, '7','7');
+
+INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
+('VFModule-ScaleOut', '1', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '2', 'AssignVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '3', 'CreateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '4', 'ActivateVfModuleBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '5', 'ConfigurationScaleOutBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut')),
+('VFModule-ScaleOut', '6', 'GenericVnfHealthCheckBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'VFModule-ScaleOut'));
+
+INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY)
+VALUES
+('GenericVnfHealthCheckBB', '*', '*', '*', "*" , 'Retry'),
+('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry');
index a0e2409..dbe69d9 100644 (file)
@@ -433,13 +433,6 @@ public class CatalogDbClient {
                                .queryParam(ACTION,action).build());
        }
        
-       public ControllerSelectionReference getControllerSelectionReferenceByVnfType(String vnfType) {
-               return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder
-                               .fromUri(endpoint + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfType")
-                                               .queryParam("VNF_TYPE", vnfType).build());
-
-       }
-       
        public ControllerSelectionReference getControllerSelectionReferenceByVnfTypeAndActionCategory(String vnfType, String actionCategory) {
                return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder
                                .fromUri(endpoint + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfTypeAndActionCategory")
index ad1bbc3..ad162b5 100644 (file)
@@ -29,9 +29,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
        @RepositoryRestResource(collectionResourceRel = "controllerSelectionReference", path = "controllerSelectionReference")
        public interface ControllerSelectionReferenceRepository extends JpaRepository<ControllerSelectionReference, String> {
                
-               public ControllerSelectionReference findControllerSelectionReferenceByVnfType(@Param("VNF_TYPE") String vnfType);
-               
                public ControllerSelectionReference findControllerSelectionReferenceByVnfTypeAndActionCategory(@Param("VNF_TYPE") String vnfType, 
                                @Param("ACTION_CATEGORY") String actionCategory);
                
-       }
\ No newline at end of file
+       }
index f793fd7..9aa2ca0 100644 (file)
@@ -42,16 +42,6 @@ public class ControllerSelectionReferenceTest {
        @Autowired
        private ControllerSelectionReferenceRepository controllerSelectionReferenceRepository;
        
-       
-       @Test
-       public void Find_ControllerNameByVnfType_Test() {
-               String vnfType = "vLoadBalancerMS/vLoadBalancerMS 0";
-               String controllerName = "APPC";
-               ControllerSelectionReference controller = controllerSelectionReferenceRepository.findControllerSelectionReferenceByVnfType(vnfType);
-               assertEquals(vnfType, controller.getVnfType());
-               assertEquals(controllerName, controller.getControllerName());
-       }
-       
        @Test
        public void Find_ControllerNameByVnfTypeAndAction_Test() {
                String vnfType = "vLoadBalancerMS/vLoadBalancerMS 0";
index 58bde0e..9da6d13 100644 (file)
@@ -649,4 +649,5 @@ INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `AD
 INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'mtn13', 'MTN13', '2.5', 'MDT13', 'mtn13', NULL, 'orchestrator', 'MSO_USER', '2018-07-17 14:06:28', '2018-07-17 14:06:28');
 
 INSERT INTO `controller_selection_reference` (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES
-('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'ConfigScaleOut');
+('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'ConfigScaleOut'),
+('vLoadBalancerMS/vLoadBalancerMS 0', 'APPC', 'HealthCheck');