diff options
author | shashikanth.vh <shashikanth.vh@huawei.com> | 2018-07-23 14:42:56 +0530 |
---|---|---|
committer | shashikanth.vh <shashikanth.vh@huawei.com> | 2018-07-23 14:43:03 +0530 |
commit | bac0f1769ea3070fc81163715862dc27a44bd780 (patch) | |
tree | 66ceb4ea7129de7f7df6f1c37c6dfd0f186a03e8 /platform-logic/datachange/src/main/xml | |
parent | a3f3de2ecf7d2122d02b09250a867e36b621a3af (diff) |
Datachange DG to handle ESR third party event
SDNC's AAI event consumer of esr-thirdparty information will
post the event to DataChange API. DataChangeProvider DG is requried
to process the event
Change-Id: Ic4857e32bd6941628e297aefefd2c697255f3ca2
Issue-ID: SDNC-386
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Former-commit-id: 9e66dd112e232dab7baabdc6415ccdd7c23c0f31
Diffstat (limited to 'platform-logic/datachange/src/main/xml')
5 files changed, 262 insertions, 0 deletions
diff --git a/platform-logic/datachange/src/main/xml/DataChange_data-change-notification.xml b/platform-logic/datachange/src/main/xml/DataChange_data-change-notification.xml new file mode 100644 index 00000000..76f2fe89 --- /dev/null +++ b/platform-logic/datachange/src/main/xml/DataChange_data-change-notification.xml @@ -0,0 +1,27 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='DataChange' version='${project.version}'>
+ <method rpc='data-change-notification' mode='sync'>
+ <block atomic="true">
+ <switch test='`$data-change-notification-input.aai-node-type`'>
+ <outcome value='esr-thirdparty-sdnc'>
+ <block atomic="true">
+ <call module='DataChange' rpc='esr-thirdparty-sdnc' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI node type not supported" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc-discovery.xml b/platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc-discovery.xml new file mode 100644 index 00000000..ba2ea398 --- /dev/null +++ b/platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc-discovery.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='DataChange' version='${project.version}'>
+ <method rpc='esr-thirdparty-sdnc-discovery' mode='sync'>
+ <block atomic="true">
+ <switch test="`$data-change-notification-input.aai-event-trigger`">
+ <outcome value='Update'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/v2/tokens'`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="token-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.data.token_id`' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/ietf-network:networks'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="get"/>
+ <parameter name="responsePrefix" value="topology"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vpn rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <for index='nidx' start='0' end='`$topology.networks.network_length`' >
+ <block>
+ <set>
+ <parameter name='network.' value='`$topology.networks.network[$nidx].`' />
+ </set>
+ <call module='DataChange' rpc='update-network-to-aai' mode='sync' ></call>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file 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 index 00000000..33d91a7c --- /dev/null +++ b/platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc.xml @@ -0,0 +1,50 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='DataChange' version='${project.version}'>
+ <method rpc='esr-thirdparty-sdnc' mode='sync'>
+ <block atomic="true">
+ <call module='DataChange' rpc='validate-esr-thirdparty-sdnc-input' mode='sync' ></call>
+ <for index='idx' start='0' end='`$data-change-notification-input.key-data_length`' >
+ <block>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'service-url'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='`$data-change-notification-input.key-data[$idx].key-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'user-name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.user' value='`$data-change-notification-input.key-data[$idx].key-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'password'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.password' value='`$data-change-notification-input.key-data[$idx].key-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'esr-system-info-id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.id' value='`$data-change-notification-input.key-data[$idx].key-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="data-change-notification"/>
+ <parameter name="field3" value="Config"/>
+ <parameter name="field4" value="`service-url`"/>
+ <parameter name="field5" value="`$prop.sdncRestApi.thirdpartySdnc.url`"/>
+ </record>
+ <call module='DataChange' rpc='esr-thirdparty-sdnc-discovery' mode='sync' ></call>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/datachange/src/main/xml/DataChange_update-network-to-aai.xml b/platform-logic/datachange/src/main/xml/DataChange_update-network-to-aai.xml new file mode 100644 index 00000000..cdd0edb9 --- /dev/null +++ b/platform-logic/datachange/src/main/xml/DataChange_update-network-to-aai.xml @@ -0,0 +1,69 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='DataChange' version='${project.version}'>
+ <method rpc='update-network-to-aai' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$network.network-id`"/>
+ <parameter name="outputPath" value="tmp.network-id"/>
+ <parameter name="target" value="/"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='zone'
+ key='zone.zone-id = $tmp.network-id' >
+ <parameter name='zone-id' value='`$tmp.network-id`' />
+ <parameter name='zone-name' value='`$network.client-id`' />
+ <parameter name='design-type' value='`$network.te-topology-id`' />
+ <parameter name='zone-context' value='`$network.provider-id`' />
+ </save>
+ <for index='pidx' start='0' end='`$network.node_length`' >
+ <set>
+ <parameter name='node.' value='`$network.node[$pidx].`' />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf'
+ key='pnf.pnf-name = $node.node-id' >
+ <parameter name='pnf-name' value='`$node.node-id`' />
+ <parameter name='pnf-id' value='`$node.node-id`' />
+ <parameter name='in-maint' value='true' />
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf:relationship-list'
+ key='pnf.pnf-name = $node.node-id' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="zone" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/zones/zone/' + $tmp.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="zone.zone-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.network-id`" />
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='esr-thirdparty-sdnc:relationship-list'
+ key='esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.sdncRestApi.thirdpartySdnc.id'
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="pnf" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $node.node-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="pnf.pnf-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$node.node-id`" />
+ </save>
+ <for index='tidx' start='0' end='`$node.termination-point_length`' >
+ <set>
+ <parameter name='tp.' value='`$node.termination-point[$tidx].`' />
+ </set>
+ <set>
+ <parameter name='unique-ltpId' value="`'nodeId-' + $node.node-id + '-ltpId-' + $tp.te-tp-id`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link'
+ key='logical-link.link-name = $unique-ltpId' >
+ <parameter name='link-name' value='`$unique-ltpId`' />
+ <parameter name='link-type' value='VL' />
+ <parameter name='speed-value' value='`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`' />
+ <parameter name='in-maint' value='`$tp.svc.supported-classification.transparent`' />
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf:relationship-list'
+ key='pnf.pnf-name = $node.node-id' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="logical-link" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/logical-links/logical-link/' + $unique-ltpId`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="logical-link.link-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$unique-ltpId`" />
+ </save>
+ </for>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/datachange/src/main/xml/DataChange_validate-esr-thirdparty-sdnc-input.xml b/platform-logic/datachange/src/main/xml/DataChange_validate-esr-thirdparty-sdnc-input.xml new file mode 100644 index 00000000..9c4443c3 --- /dev/null +++ b/platform-logic/datachange/src/main/xml/DataChange_validate-esr-thirdparty-sdnc-input.xml @@ -0,0 +1,49 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='DataChange' version='${project.version}'>
+ <method rpc='validate-esr-thirdparty-sdnc-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$data-change-notification-input.aai-event-trigger`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="data-change-notification-input.aai-event-trigger is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$data-change-notification-input.aai-node-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="data-change-notification-input.aai-node-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$data-change-notification-input.key-data_length`' >
+ <block>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'service-url'`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="data-change-notification-input.key-data.key-data.service-url is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'user-name'`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ <switch test="`$data-change-notification-input.key-data[$idx].key-name == 'password'`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file |