Merge "Blueprint for configuring a PNF"
authorDan Timoney <dtimoney@att.com>
Mon, 11 Mar 2019 17:33:35 +0000 (17:33 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 11 Mar 2019 17:33:35 +0000 (17:33 +0000)
12 files changed:
components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Definitions/activation-blueprint.json
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/baseconfiguration/Environments/source-db.properties [new file with mode: 0644]
components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json
components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json
components/model-catalog/definition-type/starter-type/node_type/component-resource-resolution.json
components/model-catalog/definition-type/starter-type/node_type/component-restconf-executor.json
components/model-catalog/definition-type/starter-type/node_type/source-primary-db.json
components/model-catalog/resource-dictionary/starter-dictionary/service-instance-id.json
components/parent/pom.xml
components/scripts/python/ccsdk_netconf/common.py

index 138260f..7a92398 100644 (file)
       "file": "Definitions/policy_types.json"
     }
   ],
-  "dsl_definitions" : {
+  "dsl_definitions": {
+    "dynamic-netconf-properties": {
+      "device-name": "netconf device",
+      "host-name": "sample-host"
+    },
     "dynamic-rest-source": {
-      "type" : "basic-type",
-      "url" : "http://localhost:8080",
-      "userId" : {
+      "type": "basic-type",
+      "url": "http://localhost:8080",
+      "userId": {
         "get_input": "rest-user-name"
       }
+    },
+    "dynamic-db-source": {
+      "type": "maria-db",
+      "url": "jdbc:mysql://localhost:3306/sdnctl",
+      "username": "sdnctl",
+      "password": {
+        "get_attribute": [
+          "BPP",
+          "dynamic-db-source.password"
+        ]
+      }
     }
   },
   "topology_template": {
                   "script-type": "jython",
                   "script-class-reference": "Scripts/python/NetconfRpcExample.py",
                   "instance-dependencies": [
-                  ]
+                  ],
+                  "dynamic-properties": "*dynamic-netconf-properties"
                 },
                 "outputs": {
                   "response-data": "",
index 3912a47..8f6c44f 100644 (file)
                   "entry_schema": {
                     "type": "string"
                   }
+                },
+                "dynamic-properties": {
+                  "description": "Dynamic Json Content or DSL Json reference.",
+                  "required": false,
+                  "type": "json"
                 }
               },
               "outputs": {
                   "entry_schema": {
                     "type": "string"
                   }
+                },
+                "dynamic-properties": {
+                  "description": "Dynamic Json Content or DSL Json reference.",
+                  "required": false,
+                  "type": "json"
                 }
               },
               "outputs": {
                   "description": "Action Name of the process",
                   "required": false,
                   "type": "string"
+                },
+                "dynamic-properties": {
+                  "description": "Dynamic Json Content or DSL Json reference.",
+                  "required": false,
+                  "type": "json"
                 }
               },
               "outputs": {
       },
       "derived_from": "tosca.nodes.ResourceSource"
     },
+    "source-primary-db": {
+      "description": "This is Database Resource Source Node Type",
+      "version": "1.0.0",
+      "properties": {
+        "type": {
+          "required": true,
+          "type": "string",
+          "constraints": [
+            {
+              "valid_values": [
+                "SQL",
+                "PLSQL"
+              ]
+            }
+          ]
+        },
+        "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"
+    },
     "source-rest": {
       "description": "This is Rest Resource Source Node Type",
       "version": "1.0.0",
           ],
           "default": "JSON"
         },
+        "endpoint-selector": {
+          "required": false,
+          "type": "string"
+        },
         "url-path": {
           "required": true,
           "type": "string"
index ace1a94..eaf45b3 100644 (file)
       "input": {
         "type": "source-input",
         "properties": {}
+      },
+      "primary-db": {
+        "type": "source-primary-db",
+        "properties": {
+          "endpoint-selector": "dynamic-db-source",
+          "query": "SELECT artifact_name FROM sdnctl.BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
+          "input-key-mapping": {
+          },
+          "output-key-mapping": {
+            "service-instance-id": "artifact_name"
+          },
+          "key-dependencies" : []
+        }
       }
     }
   },
diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Environments/source-db.properties b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Environments/source-db.properties
new file mode 100644 (file)
index 0000000..49a7eb4
--- /dev/null
@@ -0,0 +1 @@
+dynamic-db-source.password=sdnctl
\ No newline at end of file
index af8aae1..5a024a7 100644 (file)
               "entry_schema": {
                 "type": "string"
               }
+            },
+            "dynamic-properties": {
+              "description": "Dynamic Json Content or DSL Json reference.",
+              "required": false,
+              "type": "json"
             }
           },
           "outputs": {
index 85b69b0..7e429c0 100644 (file)
                 }\r
               ]\r
             },\r
+            "dynamic-properties": {
+              "description": "Resolvable dynamic property.",
+              "required": false,
+              "type": "string"
+            },
             "script-class-reference": {\r
               "description": "Kotlin Script class name or jython script name.",\r
               "required": true,\r
               "entry_schema": {\r
                 "type": "string"\r
               }\r
+            },\r
+            "dynamic-properties": {\r
+              "description": "Dynamic Json Content or DSL Json reference.",\r
+              "required": false,\r
+              "type": "json"\r
             }\r
           },\r
           "outputs": {\r
index 7e3065a..f437a79 100644 (file)
       "operations": {
         "process": {
           "inputs": {
+            "resolution-key": {
+              "description": "Key for service instance related correlation.",
+              "required": false,
+              "type": "string"
+            },
+            "store-result": {
+              "description": "Whether or not to store the output.",
+              "required": false,
+              "type": "boolean"
+            },
             "resource-type": {
               "description": "Request type.",
               "required": false,
               "description": "Action Name of the process",
               "required": false,
               "type": "string"
+            },
+            "dynamic-properties": {
+              "description": "Dynamic Json Content or DSL Json reference.",
+              "required": false,
+              "type": "json"
             }
           },
           "outputs": {
index 192ed25..cb28a4a 100644 (file)
               "entry_schema": {
                 "type": "string"
               }
+            },
+            "dynamic-properties": {
+              "description": "Dynamic Json Content or DSL Json reference.",
+              "required": false,
+              "type": "json"
             }
           },
           "outputs": {
index 661a950..702748f 100644 (file)
         }
       ]
     },
+    "endpoint-selector": {
+      "required": false,
+      "type": "string"
+    },
     "query": {
       "required": true,
       "type": "string"
index 37b9868..cb97043 100755 (executable)
     "input" : {
       "type" : "source-input",
       "properties" : { }
+    },
+    "any-db": {
+      "type": "source-primary-db",
+      "properties": {
+        "query": "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
+        "input-key-mapping": {
+        },
+        "output-key-mapping": {
+          "service-instance-id": "artifact_name"
+        }
+      }
+    },
+    "primary-db": {
+      "type": "source-primary-db",
+      "properties": {
+        "query": "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"",
+        "input-key-mapping": {
+        },
+        "output-key-mapping": {
+          "service-instance-id": "artifact_name"
+        }
+      }
     }
   }
 }
\ No newline at end of file
index 94a06a1..1d633ef 100644 (file)
     <packaging>pom</packaging>
     <properties>
         <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
-        <spring.boot.version>2.1.2.RELEASE</spring.boot.version>
-        <spring.version>5.1.4.RELEASE</spring.version>
-        <kotlin.version>1.3.20</kotlin.version>
-        <kotlin.maven.version>1.3.20</kotlin.maven.version>
+        <spring.boot.version>2.1.3.RELEASE</spring.boot.version>
+        <spring.version>5.1.5.RELEASE</spring.version>
+        <kotlin.version>1.3.21</kotlin.version>
+        <kotlin.maven.version>1.3.21</kotlin.maven.version>
         <kotlin.couroutines.version>1.1.1</kotlin.couroutines.version>
         <grpc.version>1.18.0</grpc.version>
         <protobuff.java.utils.version>3.6.1</protobuff.java.utils.version>
index 25244b1..f161e29 100644 (file)
@@ -23,3 +23,6 @@ class ResolutionHelper:
   def resolve_and_generate_message(self, artifact_mapping, artifact_template):
     return self.component_function.resolveAndGenerateMessage(artifact_mapping,
                                                              artifact_template)
+
+  def retrieve_resolved_template_from_database(self, key, artifact_template):
+    return self.component_function.resolveFromDatabase(key, artifact_template)