Datachange DG to handle ESR third party event
[sdnc/oam.git] / platform-logic / datachange / src / main / xml / DataChange_esr-thirdparty-sdnc.xml
diff --git a/platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc.xml b/platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc.xml
new file mode 100644 (file)
index 0000000..33d91a7
--- /dev/null
@@ -0,0 +1,50 @@
+<service-logic\r
+    xmlns='http://www.onap.org/sdnc/svclogic'\r
+    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='DataChange' version='${project.version}'>\r
+    <method rpc='esr-thirdparty-sdnc' mode='sync'>\r
+        <block atomic="true">\r
+            <call module='DataChange' rpc='validate-esr-thirdparty-sdnc-input' mode='sync' ></call>\r
+            <for index='idx' start='0' end='`$data-change-notification-input.key-data_length`' >\r
+                <block>\r
+                    <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'service-url'`">\r
+                        <outcome value='true'>\r
+                            <set>\r
+                                <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='`$data-change-notification-input.key-data[$idx].key-value`' />\r
+                            </set>\r
+                        </outcome>\r
+                    </switch>\r
+                    <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'user-name'`">\r
+                        <outcome value='true'>\r
+                            <set>\r
+                                <parameter name='prop.sdncRestApi.thirdpartySdnc.user' value='`$data-change-notification-input.key-data[$idx].key-value`' />\r
+                            </set>\r
+                        </outcome>\r
+                    </switch>\r
+                    <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'password'`">\r
+                        <outcome value='true'>\r
+                            <set>\r
+                                <parameter name='prop.sdncRestApi.thirdpartySdnc.password' value='`$data-change-notification-input.key-data[$idx].key-value`' />\r
+                            </set>\r
+                        </outcome>\r
+                    </switch>\r
+                    <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'esr-system-info-id'`">\r
+                        <outcome value='true'>\r
+                            <set>\r
+                                <parameter name='prop.sdncRestApi.thirdpartySdnc.id' value='`$data-change-notification-input.key-data[$idx].key-value`' />\r
+                            </set>\r
+                        </outcome>\r
+                    </switch>\r
+                </block>\r
+            </for>\r
+            <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">\r
+                <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/>\r
+                <parameter name="field1" value="__TIMESTAMP__"/>\r
+                <parameter name="field2" value="data-change-notification"/>\r
+                <parameter name="field3" value="Config"/>\r
+                <parameter name="field4" value="`service-url`"/>\r
+                <parameter name="field5" value="`$prop.sdncRestApi.thirdpartySdnc.url`"/>\r
+            </record>\r
+            <call module='DataChange' rpc='esr-thirdparty-sdnc-discovery' mode='sync' ></call>\r
+        </block>\r
+    </method>\r
+</service-logic>
\ No newline at end of file