summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/main/resources
diff options
context:
space:
mode:
authorDylanB95EST <dylan.byrne@est.tech>2021-07-02 13:30:42 +0100
committerDylanB95EST <dylan.byrne@est.tech>2021-08-03 16:47:24 +0100
commit4f4178c7af4ca5571a0813a5c79f35b11c825d35 (patch)
tree0167aaaf7f51498499acb572c8e7995474b9ac9f /cps-ri/src/main/resources
parent15b93e7ad7db7372d51c4c1ad45f95d463aaaffc (diff)
Implement DMI Registration (NCMP-Side)
Implementing registration of CM-Handles to NCMP from DMI CM Handles are Written to fragment tables Moved NetworkCmProxyDataServiceImplSpec.groovy as it was not in the same package as the class it was testing. Meaning it didn't cover this when it came to code coverage Have included Json structure validation also within open api Deprecating old API's along with old API Methods Issue-ID: CPS-442 Change-Id: I819b9bf65280b1d968d3b75ca5ef2f9eb5617579 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-ri/src/main/resources')
-rw-r--r--cps-ri/src/main/resources/changelog/changelog-master.yaml2
-rw-r--r--cps-ri/src/main/resources/changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml3
-rw-r--r--cps-ri/src/main/resources/changelog/db/changes/10-loadData-dmi-registry-fragment.yaml53
-rw-r--r--cps-ri/src/main/resources/changelog/db/changes/data/dmi/fragment.csv2
4 files changed, 58 insertions, 2 deletions
diff --git a/cps-ri/src/main/resources/changelog/changelog-master.yaml b/cps-ri/src/main/resources/changelog/changelog-master.yaml
index 2d997e3350..6c0158390d 100644
--- a/cps-ri/src/main/resources/changelog/changelog-master.yaml
+++ b/cps-ri/src/main/resources/changelog/changelog-master.yaml
@@ -33,3 +33,5 @@ databaseChangeLog:
file: changelog/db/changes/08-update-yang-resources.yaml
- include:
file: changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml
+ - include:
+ file: changelog/db/changes/10-loadData-dmi-registry-fragment.yaml
diff --git a/cps-ri/src/main/resources/changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml b/cps-ri/src/main/resources/changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml
index 7b56e6a65d..d9be36a155 100644
--- a/cps-ri/src/main/resources/changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml
+++ b/cps-ri/src/main/resources/changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml
@@ -111,5 +111,4 @@ databaseChangeLog:
tableName: 'anchor'
rollback:
- sql:
- sql: delete from anchor where name = 'ncmp-dmi-registry'
-
+ sql: delete from anchor where name = 'ncmp-dmi-registry' \ No newline at end of file
diff --git a/cps-ri/src/main/resources/changelog/db/changes/10-loadData-dmi-registry-fragment.yaml b/cps-ri/src/main/resources/changelog/db/changes/10-loadData-dmi-registry-fragment.yaml
new file mode 100644
index 0000000000..8325690516
--- /dev/null
+++ b/cps-ri/src/main/resources/changelog/db/changes/10-loadData-dmi-registry-fragment.yaml
@@ -0,0 +1,53 @@
+databaseChangeLog:
+ - changeSet:
+ author: cps
+ label: dmi-registry-schema-preload
+ id: 10
+ loadUpdateData:
+ encoding: UTF-8
+ file: 'changelog/db/changes/data/dmi/fragment.csv'
+ onlyUpdate: 'false'
+ primaryKey: 'id'
+ quotchar: '"'
+ separator: '|'
+ tableName: 'fragment'
+ columns:
+ - column:
+ header: id
+ name: id
+ type: NUMERIC
+ - column:
+ header: xpath
+ name: xpath
+ type: STRING
+ - column:
+ header: attributes
+ name: attributes
+ type: CLOB
+ - column:
+ header: anchor_id
+ name: anchor_id
+ type: NUMERIC
+ - column:
+ header: parent_id
+ name: parent_id
+ type: NUMERIC
+ - column:
+ header: dataspace_id
+ name: dataspace_id
+ type: NUMERIC
+ - column:
+ header: schema_node_id
+ name: schema_node_id
+ type: NUMERIC
+
+ - changeSet:
+ author: cps
+ label: dmi-registry-schema-preload
+ id: 10.1
+ changes:
+ - sql:
+ comment: Fixes the id sequence after data insert with predefined ids
+ dbms: postgresql
+ sql: ALTER SEQUENCE IF EXISTS fragment_id_seq RESTART WITH 200
+
diff --git a/cps-ri/src/main/resources/changelog/db/changes/data/dmi/fragment.csv b/cps-ri/src/main/resources/changelog/db/changes/data/dmi/fragment.csv
new file mode 100644
index 0000000000..52aef0e239
--- /dev/null
+++ b/cps-ri/src/main/resources/changelog/db/changes/data/dmi/fragment.csv
@@ -0,0 +1,2 @@
+id|xpath|attributes|anchor_id|parent_id|dataspace_id|schema_node_id
+144|/dmi-registry|{}|(select id from anchor where name='ncmp-dmi-registry')|null|(select id from dataspace where name='NCMP-Admin')|null \ No newline at end of file