summaryrefslogtreecommitdiffstats
path: root/blueprints-processor/plugin/assignment-provider/src/test/resources
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2018-09-04 21:28:52 -0400
committerSingal, Kapil (ks220y) <ks220y@att.com>2018-09-04 21:28:52 -0400
commit5256b3654a73d4c7e566c18e728cde153483a9f5 (patch)
treea5b96166707040beae240baed05afafd033b92be /blueprints-processor/plugin/assignment-provider/src/test/resources
parentd2cc0336c4dd9875e717e096d8f9bf815cb783b7 (diff)
SDN Controller Blueprints DB Resource Assignment
Creating SDN Controller Blueprints DB Resource Assignment Processor Change-Id: I2ae2d8f1b38c37fed12d11cf0ae48d47c9a1ccda Issue-ID: CCSDK-497 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'blueprints-processor/plugin/assignment-provider/src/test/resources')
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json40
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json37
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json36
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json15
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json15
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json12
-rw-r--r--blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json12
7 files changed, 167 insertions, 0 deletions
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json
new file mode 100644
index 000000000..bab783544
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json
@@ -0,0 +1,40 @@
+{
+ "locations": {
+ "name": "locations",
+ "property": {
+ "type": "list",
+ "entry_schema": {
+ "type": "dt-location"
+ }
+ },
+ "sources": {
+ "db": {
+ "type": "source-sdnctl-db",
+ "properties": {
+ "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
+ "input-key-mapping": {
+ "profile_name": "profile_name"
+ },
+ "output-key-mapping": {
+ "db-country": "country",
+ "db-state": "state"
+ },
+ "key-dependencies": [
+ "profile_name"
+ ]
+ }
+ }
+ }
+ },
+ "profile_name": {
+ "name": "profile_name",
+ "property": {
+ "type": "string"
+ },
+ "sources": {
+ "input": {
+ "type": "source-input"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json
new file mode 100644
index 000000000..7310500e3
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json
@@ -0,0 +1,37 @@
+{
+ "location": {
+ "name": "location",
+ "property": {
+ "type": "dt-location"
+ },
+ "sources": {
+ "db": {
+ "type": "source-sdnctl-db",
+ "properties": {
+ "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
+ "input-key-mapping": {
+ "profile_name": "profile_name"
+ },
+ "output-key-mapping": {
+ "db-country": "country",
+ "db-state": "state"
+ },
+ "key-dependencies": [
+ "profile_name"
+ ]
+ }
+ }
+ }
+ },
+ "profile_name": {
+ "name": "profile_name",
+ "property": {
+ "type": "string"
+ },
+ "sources": {
+ "input": {
+ "type": "source-input"
+ }
+ }
+ }
+}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json
new file mode 100644
index 000000000..86d29c751
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json
@@ -0,0 +1,36 @@
+{
+ "country": {
+ "name": "country",
+ "property": {
+ "type": "string"
+ },
+ "sources": {
+ "db": {
+ "type": "source-sdnctl-db",
+ "properties": {
+ "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
+ "input-key-mapping": {
+ "profile_name": "profile_name"
+ },
+ "output-key-mapping": {
+ "country": "country"
+ },
+ "key-dependencies": [
+ "profile_name"
+ ]
+ }
+ }
+ }
+ },
+ "profile_name": {
+ "name": "profile_name",
+ "property": {
+ "type": "string"
+ },
+ "sources": {
+ "input": {
+ "type": "source-input"
+ }
+ }
+ }
+}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json
new file mode 100644
index 000000000..52e0a7967
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json
@@ -0,0 +1,15 @@
+{
+ "version": "1.0.0",
+ "description": "test Data Type",
+ "properties": {
+ "country": {
+ "required": true,
+ "type": "string"
+ },
+ "state": {
+ "required": false,
+ "type": "string"
+ }
+ },
+ "derived_from": "tosca.datatypes.Root"
+}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json
new file mode 100644
index 000000000..c82f9addc
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json
@@ -0,0 +1,15 @@
+[
+ {
+ "name": "locations",
+ "input-param": true,
+ "property": {
+ "type": "list",
+ "entry_schema": {
+ "type": "dt-location"
+ }
+ },
+ "dictionary-name": "locations",
+ "dictionary-source": "db",
+ "dependencies": []
+ }
+]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json
new file mode 100644
index 000000000..4cca99bde
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json
@@ -0,0 +1,12 @@
+[
+ {
+ "name": "location",
+ "input-param": true,
+ "property": {
+ "type": "dt-location"
+ },
+ "dictionary-name": "location",
+ "dictionary-source": "db",
+ "dependencies": []
+ }
+]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json
new file mode 100644
index 000000000..02ce68be4
--- /dev/null
+++ b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json
@@ -0,0 +1,12 @@
+[
+ {
+ "name": "country",
+ "input-param": true,
+ "property": {
+ "type": "string"
+ },
+ "dictionary-name": "country",
+ "dictionary-source": "db",
+ "dependencies": []
+ }
+]