summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-15 08:36:28 -0500
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-15 08:36:28 -0500
commit2e94232cddeb3de3aab4b9eda07ca830845ad259 (patch)
treebe86bc1ca822e17bb12e59a57b0385147639c842 /ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db
parentcbbe0eac48b8df6e616f56a8ef51fbc7c955d171 (diff)
Blueprints Processor Microservice
Refactor functon module as seperate module project. Change-Id: I392fc62e6dfb6c5f38f478c00e46460d5084f85c Issue-ID: CCSDK-688 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json35
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json27
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json26
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json15
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json22
5 files changed, 125 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json
new file mode 100644
index 000000000..679b92db4
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-array.json
@@ -0,0 +1,35 @@
+{
+ "locations": {
+ "name": "locations",
+ "data-type": "list",
+ "entry-schema": "dt-location",
+ "source": {
+ "db": {
+ "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"
+ }
+ }
+ },
+ "candidate-dependency": {
+ "db": {
+ "names": [
+ "profile_name"
+ ]
+ }
+ }
+ },
+ "profile_name": {
+ "name": "profile_name",
+ "data-type": "string",
+ "source": {
+ "input": {
+
+ }
+ }
+ }
+}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json
new file mode 100644
index 000000000..32d04b690
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-complex.json
@@ -0,0 +1,27 @@
+{
+ "location": {
+ "name": "location",
+ "data-type": "dt-location",
+ "source": {
+ "db": {
+ "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"
+ }
+ }
+ }
+ },
+ "profile_name": {
+ "name": "profile_name",
+ "data-type": "string",
+ "source": {
+ "input": {
+
+ }
+ }
+ }
+}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json
new file mode 100644
index 000000000..841404f22
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/db-simple.json
@@ -0,0 +1,26 @@
+{
+ "country": {
+ "name": "country",
+ "data-type": "string",
+ "source": {
+ "db": {
+ "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
+ "input-key-mapping": {
+ "profile_name": "profile_name"
+ },
+ "output-key-mapping": {
+ "country": "country"
+ }
+ }
+ }
+ },
+ "profile_name": {
+ "name": "profile_name",
+ "data-type": "string",
+ "source": {
+ "input": {
+
+ }
+ }
+ }
+}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/dt-location.json
new file mode 100644
index 000000000..52e0a7967
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/resource-resolution/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/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json
new file mode 100644
index 000000000..ddcf32eed
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/db/resource-assignments-simple.json
@@ -0,0 +1,22 @@
+[
+ {
+ "name": "country",
+ "input-param": true,
+ "property": {
+ "type": "string"
+ },
+ "dictionary-name": "country",
+ "dictionary-source": "db",
+ "dependencies": ["state"]
+ },
+ {
+ "name": "state",
+ "input-param": true,
+ "property": {
+ "type": "string"
+ },
+ "dictionary-name": "state",
+ "dictionary-source": "input",
+ "dependencies": []
+ }
+]