Fix: Enrichment fails for processor-db source 82/87782/3
authorSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Wed, 15 May 2019 15:23:18 +0000 (11:23 -0400)
committerSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Wed, 15 May 2019 19:28:49 +0000 (15:28 -0400)
Change-Id: I7a426323dc22cb19a1c3eb77f7f4f30cf7da32e0
Issue-ID: CCSDK-1324
Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com>
31 files changed:
components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/node_types.json
components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/resources_definition_types.json
components/model-catalog/blueprint-model/test-blueprint/capability_python/Definitions/resources_definition_types.json
components/model-catalog/definition-type/starter-type/node_type/source-primary-db.json [deleted file]
components/model-catalog/definition-type/starter-type/node_type/source-processor-db.json
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/mock/Mock.kt
ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/BlueprintJythonServiceTest.kt
ms/controllerblueprints/application/src/main/resources/application-dev.properties
ms/controllerblueprints/application/src/main/resources/application.properties
ms/controllerblueprints/application/src/test/resources/application.properties
ms/controllerblueprints/modules/resource-dict/load/model_type/node_type/source-processor-db.json [moved from ms/controllerblueprints/modules/resource-dict/load/model_type/node_type/source-primary-db.json with 100% similarity]
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/nf-role.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/nfc-naming-code.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/onap_private_net_cidr.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/primary-db-source.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/private-prefix-id.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/protected-prefix-id.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/protected_private_net_cidr.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/unprotected-prefix-id.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/unprotected_private_net_cidr.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vf-module-label.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vf-module-type.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vf-naming-policy.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vf-nf-code.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vfccustomizationuuid.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vm-type.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vnfc-model-invariant-uuid.json
ms/controllerblueprints/modules/resource-dict/load/resource_dictionary/vnfc-model-version.json
ms/controllerblueprints/modules/resource-dict/src/test/java/org/onap/ccsdk/cds/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactoryTest.java
ms/controllerblueprints/modules/resource-dict/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/ResourceDictionaryTestUtils.kt
ms/controllerblueprints/modules/service/src/test/resources/application.properties

index 07e4df1..8e9d13e 100644 (file)
       },
       "derived_from": "tosca.nodes.ResourceSource"
     },
-    "source-primary-db": {
+    "source-processor-db": {
       "description": "This is Database Resource Source Node Type",
       "version": "1.0.0",
       "properties": {
index b771d25..fe364f9 100644 (file)
@@ -27,7 +27,7 @@
         "properties": {}
       },
       "processor-db": {
-        "type": "source-primary-db",
+        "type": "source-processor-db",
         "properties": {
           "endpoint-selector": "dynamic-db-source",
           "query": "SELECT artifact_name FROM sdnctl.BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
index d2c470f..265377b 100755 (executable)
@@ -13,7 +13,7 @@
         "properties" : { }
       },
       "primary-db": {
-        "type": "source-primary-db",
+        "type": "source-processor-db",
         "properties": {
           "query": "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
           "input-key-mapping": {
diff --git a/components/model-catalog/definition-type/starter-type/node_type/source-primary-db.json b/components/model-catalog/definition-type/starter-type/node_type/source-primary-db.json
deleted file mode 100644 (file)
index 6f03dbf..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-{
-  "description": "This is Database Resource Source Node Type",
-  "version": "1.0.0",
-  "properties": {
-    "type": {
-      "required": true,
-      "default": "SQL",
-      "type": "string",
-      "constraints": [
-        {
-          "valid_values": [
-            "SQL"
-          ]
-        }
-      ]
-    },
-    "endpoint-selector": {
-      "required": false,
-      "type": "string"
-    },
-    "query": {
-      "required": true,
-      "type": "string"
-    },
-    "input-key-mapping": {
-      "required": false,
-      "type": "map",
-      "entry_schema": {
-        "type": "string"
-      }
-    },
-    "output-key-mapping": {
-      "required": false,
-      "type": "map",
-      "entry_schema": {
-        "type": "string"
-      }
-    },
-    "key-dependencies": {
-      "required": true,
-      "type": "list",
-      "entry_schema": {
-        "type": "string"
-      }
-    }
-  },
-  "derived_from": "tosca.nodes.ResourceSource"
-}
\ No newline at end of file
index 702748f..02e403b 100644 (file)
@@ -4,6 +4,7 @@
   "properties": {
     "type": {
       "required": true,
+      "default": "SQL",
       "type": "string",
       "constraints": [
         {
index dab2419..29d4f48 100644 (file)
@@ -54,7 +54,7 @@ open class MockResourceSource {
     @Bean(name = [
         "rr-processor-source-input",
         "rr-processor-source-default",
-        "rr-processor-source-primary-db",
+        "rr-processor-source-processor-db",
         "rr-processor-source-rest"])
     open fun sourceInstance(): ResourceAssignmentProcessor {
         return mockk<ResourceAssignmentProcessor>()
index ae7b7b2..fd18baf 100644 (file)
@@ -50,23 +50,23 @@ class BlueprintJythonServiceTest {
     
     @Test
     fun testGetAbstractPythonPlugin() {
-        val content = JacksonUtils.getClassPathFileContent("scripts/SamplePythonComponentNode.py")
-        val dependencies: MutableMap<String, Any> = hashMapOf()
+            val content = JacksonUtils.getClassPathFileContent("scripts/SamplePythonComponentNode.py")
+            val dependencies: MutableMap<String, Any> = hashMapOf()
 
-        val abstractPythonPlugin = blueprintJythonService
-                .jythonInstance<AbstractComponentFunction>(blueprintContext, "SamplePythonComponentNode",
-                        content, dependencies)
+            val abstractPythonPlugin = blueprintJythonService
+                    .jythonInstance<AbstractComponentFunction>(blueprintContext, "SamplePythonComponentNode",
+                            content, dependencies)
 
-        assertNotNull(abstractPythonPlugin, "failed to get python component")
+            assertNotNull(abstractPythonPlugin, "failed to get python component")
     }
 
     @Test
     fun testGetAbstractJythonComponent() {
-        val scriptInstance = "test-classes/scripts/SamplePythonComponentNode.py"
+            val scriptInstance = "test-classes/scripts/SamplePythonComponentNode.py"
 
-        val abstractJythonComponent = blueprintJythonService.jythonComponentInstance(blueprintContext, scriptInstance)
+            val abstractJythonComponent = blueprintJythonService.jythonComponentInstance(blueprintContext, scriptInstance)
 
-        assertNotNull(abstractJythonComponent, "failed to get Jython component")
+            assertNotNull(abstractJythonComponent, "failed to get Jython component")
 
     }
 }
\ No newline at end of file
index 68d7633..09d10dc 100755 (executable)
@@ -49,7 +49,7 @@ spring.jpa.hibernate.ddl-auto=none
 spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
 # Load Resource Source Mappings
-resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,primary-aai-data=source-rest,capability=source-capability
+resourceSourceMappings=processor-db=source-processor-db,primary-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,primary-aai-data=source-rest,capability=source-capability
 # Controller Blueprints Core Configuration
 controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy
 controllerblueprints.blueprintArchivePath=/etc/blueprints/archive
index b9c1d4f..4be06d8 100755 (executable)
@@ -52,7 +52,7 @@ spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
 spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
 
 # Load Resource Source Mappings
-resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability
+resourceSourceMappings=processor-db=source-processor-db,primary-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,primary-aai-data=source-rest,capability=source-capability
 
 # Controller Blueprints Core Configuration
 controllerblueprints.blueprintDeployPath=/etc/blueprints/deploy
index 9c5d35c..0e96343 100755 (executable)
@@ -33,7 +33,7 @@ swagger.contact.url=www.onap.com
 swagger.contact.email=brindasanth@onap.com\r
 \r
 # Load Resource Source Mappings\r
-resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,primary-aai-data=source-rest,capability=source-capability\r
+resourceSourceMappings=processor-db=source-processor-db,primary-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,primary-aai-data=source-rest,capability=source-capability\r
 \r
 # Controller Blueprints Core Configuration\r
 controllerblueprints.blueprintDeployPath=./target/blueprints/deploy\r
index 6da5ea2..9b20c1d 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODEL.nf_role as vf_model_role from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnfmodelcustomizationuuid",
index 4e1ba2b..97d591b 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select nfc_naming_code as nfc_naming_code from sdnctl.VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index b359320..87448eb 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = private",
index 26e62e8..0fd436b 100644 (file)
@@ -8,7 +8,7 @@
   "tags": "bundle-id, brindasanth@onap.com",
   "sources": {
     "primary-db": {
-      "type": "source-primary-db",
+      "type": "source-processor-db",
       "properties": {
         "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
         "input-key-mapping": {
index 4f4868d..5776b1b 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = private",
index dd418d5..d291715 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = protected",
index dcd32c7..bea7f25 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = protected",
index 1e4cd7b..b4bf22e 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix_id as prefix_id from sdnctl.IPAM_IP_POOL where description = unprotected",
index 241147c..362f627 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.IPAM_IP_POOL.prefix as prefix from sdnctl.IPAM_IP_POOL where description = unprotected",
index faa7ea4..0389218 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid",
index dbd51bb..c06e307 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid",
index 70792f8..e332d3b 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid",
index a21982c..52359a4 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODEL.nf_code as vf_nf_code from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:customizationid",
index 9f3e7cf..b87473c 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select sdnctl.VF_MODULE_TO_VFC_MAPPING.vfc_customization_uuid as vnf_customid from sdnctl.VF_MODULE_TO_VFC_MAPPING where vm_count = 1 and sdnctl.VF_MODULE_TO_VFC_MAPPING.vf_module_customization_uuid=:vfmodulecustomizationuuid",
index dabb238..b0d2a01 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select vfc_model.vm_type as vm_type from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index 8ce692c..44a5c99 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select vfc_model.invariant_uuid as vfc_invariant_uuid from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index d74a6ba..267dea3 100644 (file)
@@ -8,7 +8,7 @@
   },
   "sources" : {
     "primary-db" : {
-      "type" : "source-primary-db",
+      "type" : "source-processor-db",
       "properties" : {
         "type" : "SQL",
         "query" : "select vfc_model.version as vnfc_model_version from VFC_MODEL where customization_uuid=:vfccustomizationuuid",
index 6c75f0b..8c41731 100644 (file)
@@ -25,10 +25,12 @@ public class ResourceSourceMappingFactoryTest {
     @Test
     public void testRegisterResourceMapping() {
 
-        ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("primary-db", "source-primary-db");
+        ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("primary-db", "source-processor-db");
+        ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("processor-db", "source-processor-db");
         ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("input", "source-input");
         ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("default", "source-default");
         ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("primary-config-data", "source-rest");
+        ResourceSourceMappingFactory.INSTANCE.registerSourceMapping("primary-aai-data", "source-rest");
 
         String nodeTypeName = ResourceSourceMappingFactory.INSTANCE.getRegisterSourceMapping("primary-db");
         Assert.notNull(nodeTypeName, "Failed to get primary-db mapping");
index a2d525a..5739417 100644 (file)
@@ -22,7 +22,8 @@ object ResourceDictionaryTestUtils {
 
     @JvmStatic
     fun setUpResourceSourceMapping() {
-        ResourceSourceMappingFactory.registerSourceMapping("primary-db", "source-primary-db")
+        ResourceSourceMappingFactory.registerSourceMapping("primary-db", "source-processor-db")
+        ResourceSourceMappingFactory.registerSourceMapping("processor-db", "source-processor-db")
         ResourceSourceMappingFactory.registerSourceMapping("input", "source-input")
         ResourceSourceMappingFactory.registerSourceMapping("default", "source-default")
         ResourceSourceMappingFactory.registerSourceMapping("primary-config-data", "source-rest")
index 19430ad..2b16fc0 100755 (executable)
@@ -20,7 +20,7 @@ logging.level.org.springframework.web=INFO
 logging.level.org.hibernate.SQL=warn
 logging.level.org.hibernate.type.descriptor.sql=debug
 # Load Resource Source Mappings
-resourceSourceMappings=processor-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,capability=source-capability
+resourceSourceMappings=processor-db=source-processor-db,primary-db=source-processor-db,input=source-input,default=source-default,primary-config-data=source-rest,primary-aai-data=source-rest,capability=source-capability
 # Controller Blueprints Core Configuration
 controllerblueprints.blueprintDeployPath=./target/blueprints/deploy
 controllerblueprints.blueprintArchivePath=./target/blueprints/archive