diff options
author | Hesam Rahimi <hesam.rahimi@huawei.com> | 2020-04-08 22:53:30 +0000 |
---|---|---|
committer | Hesam Rahimi <hesam.rahimi@huawei.com> | 2020-04-08 22:53:30 +0000 |
commit | 7dc3fff566f520cd9adc5bcbd373a2a76f6910a9 (patch) | |
tree | 445bbbc200db89b6f4cee848395fd8cb01cce178 /platform-logic/datachange/src/main/xml | |
parent | f95f1130ce08bd4d85e92b24e61b30cd0950cb96 (diff) |
Cross-domain topology discovery for ACTN, bug fixing.
Issue-ID: SDNC-899
Signed-off-by: Hesam Rahimi <hesam.rahimi@huawei.com>
Change-Id: I3b399f1c8f4ded5ea7fea5dd3fbdec71b11a7601
Former-commit-id: 6f6176c4f74c5cf128077a14b9dd085ec0f346e9
Diffstat (limited to 'platform-logic/datachange/src/main/xml')
4 files changed, 613 insertions, 516 deletions
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 index a80f8710..81e8bd20 100644 --- 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 @@ -1,6 +1,6 @@ <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}'>
+ 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="`$prop.sdncRestApi.vendor == 'ZTE'`">
@@ -64,94 +64,68 @@ <call module='DataChange' rpc='update-network-to-aai' mode='sync' ></call>
</block>
</for>
- <switch test='`$topology.networks.network_length`'>
- <outcome value='2'>
- <switch test='`$topology.networks.network[0].network-types`'>
- <outcome value='ethernet-topology'>
- <switch test='`$topology.networks.network[1].network-types`'>
- <outcome value='otn-topology'>
+ <switch test='`$topology.networks.network_length >= 2`'>
+ <outcome value='true'>
+ <for index='netidx' start='0' end='`$topology.networks.network_length`' >
+ <block>
+ <set>
+ <parameter name='network.' value='' />
+ </set>
+ <set>
+ <parameter name='network.' value='`$topology.networks.network[$netidx].`' />
+ </set>
+ <switch test='`$network.te-topology-id`'>
+ <outcome value='11'>
<block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="networks_length" />
+ <parameter name="field3" value="`$topology.networks.network_length`" />
+ <parameter name="field4" value="network-type-is" />
+ <parameter name="field5" value="OTN" />
+ </record>
<set>
- <parameter name='network-eth.' value='`$topology.networks.network[0].`' />
- <parameter name='network-otn.' value='`$topology.networks.network[1].`' />
+ <parameter name='network-otn.' value='`$topology.networks.network[$netidx].`' />
</set>
- <call module='DataChange' rpc='update-tp-ttp-relationship' mode='sync' ></call>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='otn-topology'>
- <switch test='`$topology.networks.network[1].network-types`'>
- <outcome value='ethernet-topology'>
+ <outcome value='33'>
<block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="networks_length" />
+ <parameter name="field3" value="`$topology.networks.network_length`" />
+ <parameter name="field4" value="network-type-is" />
+ <parameter name="field5" value="ETH" />
+ </record>
<set>
- <parameter name='network.eth' value='`$topology.networks.network[1].`' />
- <parameter name='network.otn' value='`$topology.networks.network[0].`' />
+ <parameter name='network-eth.' value='`$topology.networks.network[$netidx].`' />
</set>
- <call module='DataChange' rpc='update-tp-ttp-relationship' mode='sync' ></call>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
</switch>
- </outcome>
- </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field6" value="network-otn-is" />
+ <parameter name="field7" value="`$network-otn.te-topology-id`" />
+ <parameter name="field8" value="network-eth-is" />
+ <parameter name="field9" value="`$network-eth.te-topology-id`" />
+ </record>
+ <call module='DataChange' rpc='update-tp-ttp-relationship' mode='sync' ></call>
+ </block>
+ </for>
</outcome>
- </switch>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="network-resources"
- pfx='tmp.aai.network-resources' local-only='false' >
- <outcome value='success'>
- <switch test='tmp.aai.network-resources_length'>
- <outcome value='4'>
- <block atomic='true'>
- <for index='nridx' start='0' end='`$tmp.aai.network-resources.network-resource_length`' >
- <block>
- <set>
- <parameter name='otnidx' value='0' />
- </set>
- <switch test='`$tmp.aai.network-resources.network-resource[$nridx].network-type`'>
- <outcome value='otn-topology'>
- <block>
- <set>
- <parameter name='network-resource-otn[$otnidx].' value='`$tmp.aai.network-resources.network-resource[$nridx].`' />
- </set>
- <set>
- <parameter name='otnidx' value='`$otnidx + 1`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <call module='DataChange' rpc='update-open-ended-links' mode='sync' ></call>
- </block>
- </outcome>
- </switch>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
+ <outcome value='false'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="networks_length" />
+ <parameter name="field3" value="`$topology.networks.network_length`" />
+ </record>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- </get-resource>
+ </switch>
</block>
</outcome>
</execute>
@@ -186,94 +160,68 @@ <call module='DataChange' rpc='update-network-to-aai' mode='sync' ></call>
</block>
</for>
- <switch test='`$topology.networks.network_length`'>
- <outcome value='2'>
- <switch test='`$topology.networks.network[0].network-types`'>
- <outcome value='ethernet-topology'>
- <switch test='`$topology.networks.network[1].network-types`'>
- <outcome value='otn-topology'>
+ <switch test='`$topology.networks.network_length >= 2`'>
+ <outcome value='true'>
+ <for index='netidx' start='0' end='`$topology.networks.network_length`' >
+ <block>
+ <set>
+ <parameter name='network.' value='' />
+ </set>
+ <set>
+ <parameter name='network.' value='`$topology.networks.network[$netidx].`' />
+ </set>
+ <switch test='`$network.te-topology-id`'>
+ <outcome value='11'>
<block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="networks_length" />
+ <parameter name="field3" value="`$topology.networks.network_length`" />
+ <parameter name="field4" value="network-type-is" />
+ <parameter name="field5" value="OTN" />
+ </record>
<set>
- <parameter name='network-eth.' value='`$topology.networks.network[0].`' />
- <parameter name='network-otn.' value='`$topology.networks.network[1].`' />
+ <parameter name='network-otn.' value='`$topology.networks.network[$netidx].`' />
</set>
- <call module='DataChange' rpc='update-tp-ttp-relationship' mode='sync' ></call>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='otn-topology'>
- <switch test='`$topology.networks.network[1].network-types`'>
- <outcome value='ethernet-topology'>
+ <outcome value='33'>
<block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="networks_length" />
+ <parameter name="field3" value="`$topology.networks.network_length`" />
+ <parameter name="field4" value="network-type-is" />
+ <parameter name="field5" value="ETH" />
+ </record>
<set>
- <parameter name='network.eth' value='`$topology.networks.network[1].`' />
- <parameter name='network.otn' value='`$topology.networks.network[0].`' />
+ <parameter name='network-eth.' value='`$topology.networks.network[$netidx].`' />
</set>
- <call module='DataChange' rpc='update-tp-ttp-relationship' mode='sync' ></call>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
</switch>
- </outcome>
- </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field6" value="network-otn-is" />
+ <parameter name="field7" value="`$network-otn.te-topology-id`" />
+ <parameter name="field8" value="network-eth-is" />
+ <parameter name="field9" value="`$network-eth.te-topology-id`" />
+ </record>
+ <call module='DataChange' rpc='update-tp-ttp-relationship' mode='sync' ></call>
+ </block>
+ </for>
</outcome>
- </switch>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="network-resources"
- pfx='tmp.aai.network-resources' local-only='false' >
- <outcome value='success'>
- <switch test='tmp.aai.network-resources_length'>
- <outcome value='4'>
- <block atomic='true'>
- <for index='nridx' start='0' end='`$tmp.aai.network-resources.network-resource_length`' >
- <block>
- <set>
- <parameter name='otnidx' value='0' />
- </set>
- <switch test='`$tmp.aai.network-resources.network-resource[$nridx].network-type`'>
- <outcome value='otn-topology'>
- <block>
- <set>
- <parameter name='network-resource-otn[$otnidx].' value='`$tmp.aai.network-resources.network-resource[$nridx].`' />
- </set>
- <set>
- <parameter name='otnidx' value='`$otnidx + 1`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <call module='DataChange' rpc='update-open-ended-links' mode='sync' ></call>
- </block>
- </outcome>
- </switch>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
+ <outcome value='false'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logSdncDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="networks_length" />
+ <parameter name="field3" value="`$topology.networks.network_length`" />
+ </record>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- </get-resource>
+ </switch>
</block>
</outcome>
</execute>
diff --git a/platform-logic/datachange/src/main/xml/DataChange_update-network-links-to-aai.xml b/platform-logic/datachange/src/main/xml/DataChange_update-network-links-to-aai.xml index 8777891a..b867b56a 100644 --- a/platform-logic/datachange/src/main/xml/DataChange_update-network-links-to-aai.xml +++ b/platform-logic/datachange/src/main/xml/DataChange_update-network-links-to-aai.xml @@ -1,193 +1,290 @@ -<service-logic xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="DataChange" version="${project.version}"> - <method rpc="update-network-links-to-aai" mode="sync"> - <block atomic="true"> - <for index="pidx" start="0" end="`$network.link_length`"> - <set> - <parameter name="link." value="`$network.link[$pidx].`"/> - <parameter name="unique-networkId" value="`$tmp.network-id`"/> - </set> - <set> - <parameter name="unique-linkId" value="`'networkId-' + $unique-networkId + '-linkId-' + $link.link-id`"/> - <parameter name="src-tpId" value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.source.source-node + '-ltpId-' + $link.source.source-tp`"/> - <parameter name="unique-src-node-Id" value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.source.source-node`"/> - </set> - <switch test="`$link.destination`"> - <outcome value=""> - <block> - <set> - <parameter name="is-open-ended-link" value="true"/> - </set> - <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="p-interface" key="pnf.pnf-name = $unique-src-node-Id and p-interface.interface-name = $src-tpId" local-only="false" pfx="tmp.aai.p-interface"> - <outcome value="success"> - <set> - <parameter name="alt-unique-linkId" value="`$tmp.aai.p-interface.inter-domain-plug-id`"/> - </set> - </outcome> - <outcome value="not-found"> - <return status="failure"> - <parameter name="ack-final" value="Y"/> - <parameter name="error-code" value="500"/> - <parameter name="error-message" value="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.l3vpn.pe1_id`"/> - </return> - </outcome> - <outcome value="failure"> - <return status="failure"> - <parameter name="error-code" value=""/> - <parameter name="error-message" value=""/> - </return> - </outcome> - </get-resource> - </block> - </outcome> - <outcome value="Other"> - <set> - <parameter name="dst-tpId" value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.destination.dest-node + '-ltpId-' + $link.destination.dest-tp`"/> - <parameter name="unique-dst-node-Id" value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.destination.dest-node`"/> - <parameter name="is-open-ended-link" value="false"/> - </set> - </outcome> - </switch> - <switch test="`$is-open-ended-link`"> - <outcome value="true"> - <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link" key="logical-link.link-name = $alt-unique-linkId" local-only="false" pfx="tmp.aai.logical-link"> - <outcome value="success"> - <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link:relationship-list" key="logical-link.link-name = $alt-unique-linkId" force="true" pfx="tmp.AnAI-data"> - <!-- - <parameter name="relationship-list.relationship[0].related-to" value="p-interface" /> - --> - <!-- - <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`" /> - --> - <!-- - <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" /> - --> - <!-- - <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`" /> - --> - <parameter name="relationship-list.relationship[1].related-to" value="p-interface"/> - <parameter name="relationship-list.relationship[1].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`"/> - <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="p-interface.interface-name"/> - <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$src-tpId`"/> - </update> - </outcome> - <outcome value="not-found"> - <block atomic="true"> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link" key="logical-link.link-name = $alt-unique-linkId"> - <parameter name="link-name" value="`$alt-unique-linkId`"/> - <parameter name="link-id" value="`$link.link-id`"/> - <parameter name="link-type" value="`$link.te.te-link-attributes.access-type`"/> - </save> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link:relationship-list" key="logical-link.link-name = $unique-linkId" force="true" pfx="tmp.AnAI-data"> - <parameter name="relationship-list.relationship[0].related-to" value="p-interface"/> - <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`"/> - <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name"/> - <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`"/> - </save> - <switch test="`$link.te.te-link-attributes.label-restriction`"> - <outcome value=""> - <block/> - </outcome> - <outcome value="Other"> - <for index="tidx" start="0" end="`$link.te.te-link-attributes.label-restriction_length`"> - <set> - <parameter name="label-restriction." value="`$link.te.te-link-attributes.label-restriction[$tidx].`"/> - <parameter name="unique-lrId" value="`$alt-unique-linkId + '-lrId-' + $label-restriction.index`"/> - </set> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="label-restriction" key="logical-link.link-name = $alt-unique-linkId AND label-restriction.id = $unique-lrId"> - <parameter name="id" value="`$unique-lrId`"/> - <parameter name="label-start" value="`$label-restriction.label-start`"/> - <parameter name="label-end" value="`$label-restriction.label-end`"/> - <parameter name="range-bitmap" value="`$label-restriction.range-bitmap`"/> - <parameter name="label-step" value="`$label-restriction.label-step`"/> - <parameter name="inclusive-exclusive" value="`$label-restriction.inclusive-exclusive`"/> - <outcome value="success"> - <block/> - </outcome> - <outcome value="failure"> - <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="label-restriction" key="logical-link.link-name = $alt-unique-linkId AND label-restriction.id = $unique-lrId"> - <parameter name="id" value="`$unique-lrId`"/> - <parameter name="label-start" value="`$label-restriction.label-start`"/> - <parameter name="label-end" value="`$label-restriction.label-end`"/> - <parameter name="range-bitmap" value="`$label-restriction.range-bitmap`"/> - <parameter name="label-step" value="`$label-restriction.label-step`"/> - <parameter name="inclusive-exclusive" value="`$label-restriction.inclusive-exclusive`"/> - </update> - </outcome> - </save> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link:relationship-list" key="logical-link.link-name = $alt-unique-linkId" force="true" pfx="tmp.AnAI-data"> - <parameter name="relationship-list.relationship[$tidx].related-to" value="label-restriction"/> - <parameter name="relationship-list.relationship[$tidx].related-link" value="`'/network/label-restrictions/label-restriction/' + $unique-lrId`"/> - <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-key" value="label-restriction.id"/> - <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-value" value="`$unique-lrId`"/> - </save> - </for> - </outcome> - </switch> - </block> - </outcome> - </get-resource> - </outcome> - <outcome value="false"> - <block atomic="true"> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link" key="logical-link.link-name = $unique-linkId"> - <parameter name="link-name" value="`$unique-linkId`"/> - <parameter name="link-id" value="`$link.link-id`"/> - <parameter name="link-type" value="`$link.te.te-link-attributes.access-type`"/> - </save> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link:relationship-list" key="logical-link.link-name = $unique-linkId" force="true" pfx="tmp.AnAI-data"> - <parameter name="relationship-list.relationship[0].related-to" value="p-interface"/> - <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`"/> - <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name"/> - <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`"/> - <parameter name="relationship-list.relationship[1].related-to" value="p-interface"/> - <parameter name="relationship-list.relationship[1].related-link" value="`'/network/pnfs/pnf/' + $unique-dst-node-Id + '/p-interfaces/p-interface/' + $dst-tpId`"/> - <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="p-interface.interface-name"/> - <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$dst-tpId`"/> - </save> - <switch test="`$link.te.te-link-attributes.label-restriction`"> - <outcome value=""> - <block/> - </outcome> - <outcome value="Other"> - <for index="tidx" start="0" end="`$link.te.te-link-attributes.label-restriction_length`"> - <set> - <parameter name="label-restriction." value="`$link.te.te-link-attributes.label-restriction[$tidx].`"/> - <parameter name="unique-lrId" value="`$unique-linkId + '-lrId-' + $label-restriction.index`"/> - </set> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="label-restriction" key="logical-link.link-name = $unique-linkId AND label-restriction.id = $unique-lrId"> - <parameter name="id" value="`$unique-lrId`"/> - <parameter name="label-start" value="`$label-restriction.label-start`"/> - <parameter name="label-end" value="`$label-restriction.label-end`"/> - <parameter name="range-bitmap" value="`$label-restriction.range-bitmap`"/> - <parameter name="label-step" value="`$label-restriction.label-step`"/> - <parameter name="inclusive-exclusive" value="`$label-restriction.inclusive-exclusive`"/> - <outcome value="success"> - <block/> - </outcome> - <outcome value="failure"> - <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="label-restriction" key="logical-link.link-name = $unique-linkId AND label-restriction.id = $unique-lrId"> - <parameter name="id" value="`$unique-lrId`"/> - <parameter name="label-start" value="`$label-restriction.label-start`"/> - <parameter name="label-end" value="`$label-restriction.label-end`"/> - <parameter name="range-bitmap" value="`$label-restriction.range-bitmap`"/> - <parameter name="label-step" value="`$label-restriction.label-step`"/> - <parameter name="inclusive-exclusive" value="`$label-restriction.inclusive-exclusive`"/> - </update> - </outcome> - </save> - <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="logical-link:relationship-list" key="logical-link.link-name = $unique-linkId" force="true" pfx="tmp.AnAI-data"> - <parameter name="relationship-list.relationship[$tidx].related-to" value="label-restriction"/> - <parameter name="relationship-list.relationship[$tidx].related-link" value="`'/network/label-restrictions/label-restriction/' + $unique-lrId`"/> - <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-key" value="label-restriction.id"/> - <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-value" value="`$unique-lrId`"/> - </save> - </for> - </outcome> - </switch> - </block> - </outcome> - </switch> - </for> - </block> - </method> +<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-links-to-aai' mode='sync'>
+ <block atomic="true">
+ <for index='pidx' start='0' end='`$network.link_length`' >
+ <set>
+ <parameter name='link.' value='' />
+ <parameter name='dst-tpId' value='' />
+ <parameter name='unique-dst-node-Id' value='' />
+ <parameter name='is-open-ended-link' value='false' />
+ <parameter name='is-invalid-open-ended-link' value='false' />
+ </set>
+ <set>
+ <parameter name='link.' value='`$network.link[$pidx].`' />
+ <parameter name='unique-networkId' value='`$tmp.network-id`' />
+ </set>
+ <set>
+ <parameter name='unique-linkId' value="`'networkId-' + $unique-networkId + '-linkId-' + $link.link-id`" />
+ <parameter name='src-tpId' value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.source.source-node + '-ltpId-' + $link.source.source-tp`" />
+ <parameter name='unique-src-node-Id' value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.source.source-node`" />
+ </set>
+ <switch test='`$link.destination.dest-node`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='is-open-ended-link' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.aai.p-interface' value='' />
+ <parameter name='tmp.aai.p-interface.inter-domain-plug-id' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="p-interface"
+ key="pnf.pnf-name = $unique-src-node-Id
+ and p-interface.interface-name = $src-tpId"
+ local-only="false"
+ pfx="tmp.aai.p-interface" >
+ <outcome value='success'>
+ <switch test='`$tmp.aai.p-interface.inter-domain-plug-id`'>
+ <outcome value=''>
+ <set>
+ <parameter name='is-open-ended-link' value='false' />
+ <parameter name='is-invalid-open-ended-link' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='alt-unique-linkId' value="`$tmp.aai.p-interface.inter-domain-plug-id`" />
+ <!--<parameter name='alt-unique-linkId' value="`'networkId-' + $unique-networkId + '-linkId-' + $tmp.aai.p-interface.inter-domain-plug-id`" />-->
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.l3vpn.pe1_id`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='dst-tpId' value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.destination.dest-node + '-ltpId-' + $link.destination.dest-tp`" />
+ <parameter name='unique-dst-node-Id' value="`'networkId-' + $unique-networkId + '-nodeId-' + $link.destination.dest-node`" />
+ <parameter name='is-open-ended-link' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$is-invalid-open-ended-link`'>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$is-open-ended-link`'>
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $alt-unique-linkId"
+ local-only="false"
+ pfx="tmp.aai.logical-link" >
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logMerge.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="altUniqueLinkId" />
+ <parameter name="field3" value="`$alt-unique-linkId`" />
+ <parameter name="field4" value="srcTpId" />
+ <parameter name="field5" value="`$src-tpId`" />
+ <parameter name="field6" value="relationship-value" />
+ <parameter name="field7" value='`$tmp.aai.logical-link.relationship-list.relationship[0].relationship-data[1].relationship-value`' />
+ </record>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link:relationship-list'
+ key='logical-link.link-name = $alt-unique-linkId' force="true" pfx="tmp.AnAI-data">
+ <!--<parameter name="relationship-list.relationship[0].related-to" value="p-interface" />-->
+ <!--<parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`" />-->
+ <!--<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" />-->
+ <!--<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`" />-->
+ <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`" />
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logMergeSuccess.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="altUniqueLinkId" />
+ <parameter name="field3" value="`$alt-unique-linkId`" />
+ <parameter name="field4" value="srcTpId" />
+ <parameter name="field5" value="`$src-tpId`" />
+ <parameter name="field6" value="relationship-value" />
+ <parameter name="field7" value='`$tmp.aai.logical-link.relationship-list.relationship[0].relationship-data[1].relationship-value`' />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logMergeFailure.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="altUniqueLinkId" />
+ <parameter name="field3" value="`$alt-unique-linkId`" />
+ <parameter name="field4" value="srcTpId" />
+ <parameter name="field5" value="`$src-tpId`" />
+ <parameter name="field6" value="relationship-value" />
+ <parameter name="field7" value='`$tmp.aai.logical-link.relationship-list.relationship[0].relationship-data[1].relationship-value`' />
+ </record>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link'
+ key='logical-link.link-name = $alt-unique-linkId' >
+ <parameter name='link-name' value='`$alt-unique-linkId`' />
+ <parameter name='link-id' value='`$link.link-id`' />
+ <parameter name='link-type' value='`$link.te.te-link-attributes.access-type`' />
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link:relationship-list'
+ key='logical-link.link-name = $alt-unique-linkId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`" />
+ </save>
+ <switch test='`$link.te.te-link-attributes.label-restriction`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='tidx' start='0' end='`$link.te.te-link-attributes.label-restriction_length`' >
+ <set>
+ <parameter name='label-restriction.' value='`$link.te.te-link-attributes.label-restriction[$tidx].`' />
+ <parameter name='unique-lrId' value="`$alt-unique-linkId + '-lrId-' + $label-restriction.index`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='label-restriction'
+ key='logical-link.link-name = $alt-unique-linkId
+ AND label-restriction.id = $unique-lrId' >
+ <parameter name='id' value='`$unique-lrId`' />
+ <parameter name='label-start' value='`$label-restriction.label-start`' />
+ <parameter name='label-end' value='`$label-restriction.label-end`' />
+ <parameter name='range-bitmap' value='`$label-restriction.range-bitmap`' />
+ <parameter name='label-step' value='`$label-restriction.label-step`' />
+ <parameter name='inclusive-exclusive' value='`$label-restriction.inclusive-exclusive`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='label-restriction'
+ key='logical-link.link-name = $alt-unique-linkId
+ AND label-restriction.id = $unique-lrId' >
+ <parameter name='id' value='`$unique-lrId`' />
+ <parameter name='label-start' value='`$label-restriction.label-start`' />
+ <parameter name='label-end' value='`$label-restriction.label-end`' />
+ <parameter name='range-bitmap' value='`$label-restriction.range-bitmap`' />
+ <parameter name='label-step' value='`$label-restriction.label-step`' />
+ <parameter name='inclusive-exclusive' value='`$label-restriction.inclusive-exclusive`' />
+ </update>
+ </outcome>
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link:relationship-list'
+ key='logical-link.link-name = $alt-unique-linkId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[$tidx].related-to" value="label-restriction" />
+ <parameter name="relationship-list.relationship[$tidx].related-link" value="`'/network/label-restrictions/label-restriction/' + $unique-lrId`" />
+ <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-key" value="label-restriction.id" />
+ <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-value" value="`$unique-lrId`" />
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link'
+ key='logical-link.link-name = $unique-linkId' >
+ <parameter name='link-name' value='`$unique-linkId`' />
+ <parameter name='link-id' value='`$link.link-id`' />
+ <parameter name='link-type' value='`$link.te.te-link-attributes.access-type`' />
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logTopologyDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="uniqueLinkId" />
+ <parameter name="field3" value="`$unique-linkId`" />
+ <parameter name="field4" value="srcTpId" />
+ <parameter name="field5" value="`$src-tpId`" />
+ <parameter name="field6" value="dstTpId" />
+ <parameter name="field7" value="`$dst-tpId`" />
+ </record>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link:relationship-list'
+ key='logical-link.link-name = $unique-linkId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $unique-src-node-Id + '/p-interfaces/p-interface/' + $src-tpId`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-tpId`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`'/network/pnfs/pnf/' + $unique-dst-node-Id + '/p-interfaces/p-interface/' + $dst-tpId`" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="p-interface.interface-name" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$dst-tpId`" />
+ </save>
+ <switch test='`$link.te.te-link-attributes.label-restriction`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='tidx' start='0' end='`$link.te.te-link-attributes.label-restriction_length`' >
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link:relationship-list'
+ key='logical-link.link-name = $unique-linkId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[$tidx].related-to" value="label-restriction" />
+ <parameter name="relationship-list.relationship[$tidx].related-link" value="`'/network/label-restrictions/label-restriction/' + $unique-lrId`" />
+ <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-key" value="label-restriction.id" />
+ <parameter name="relationship-list.relationship[$tidx].relationship-data[0].relationship-value" value="`$unique-lrId`" />
+ </save>
+ <set>
+ <parameter name='label-restriction.' value='`$link.te.te-link-attributes.label-restriction[$tidx].`' />
+ <parameter name='unique-lrId' value="`$unique-linkId + '-lrId-' + $label-restriction.index`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='label-restriction'
+ key='logical-link.link-name = $unique-linkId
+ AND label-restriction.id = $unique-lrId' >
+ <parameter name='id' value='`$unique-lrId`' />
+ <parameter name='label-start' value='`$label-restriction.label-start`' />
+ <parameter name='label-end' value='`$label-restriction.label-end`' />
+ <parameter name='range-bitmap' value='`$label-restriction.range-bitmap`' />
+ <parameter name='label-step' value='`$label-restriction.label-step`' />
+ <parameter name='inclusive-exclusive' value='`$label-restriction.inclusive-exclusive`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='label-restriction'
+ key='logical-link.link-name = $unique-linkId
+ AND label-restriction.id = $unique-lrId' >
+ <parameter name='id' value='`$unique-lrId`' />
+ <parameter name='label-start' value='`$label-restriction.label-start`' />
+ <parameter name='label-end' value='`$label-restriction.label-end`' />
+ <parameter name='range-bitmap' value='`$label-restriction.range-bitmap`' />
+ <parameter name='label-step' value='`$label-restriction.label-step`' />
+ <parameter name='inclusive-exclusive' value='`$label-restriction.inclusive-exclusive`' />
+ </update>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </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 index 17be19ec..f9b7d997 100644 --- 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 @@ -1,141 +1,187 @@ -<service-logic xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="DataChange" version="${project.version}">
- <method rpc="update-network-to-aai" mode="sync">
+<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">
+ <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="network-resource" key="network-resource.network-id = $tmp.network-id">
- <parameter name="network-id" value="`$tmp.network-id`"/>
- <parameter name="client-id" value="`$network.client-id`"/>
- <parameter name="te-topo-id" value="`$network.te-topology-id`"/>
- <parameter name="provider-id" value="`$network.provider-id`"/>
- <parameter name="network-type" value="`$network.network-types`"/>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='network-resource'
+ key='network-resource.network-id = $tmp.network-id' >
+ <parameter name='network-id' value='`$tmp.network-id`' />
+ <parameter name='client-id' value='`$network.client-id`' />
+ <parameter name='te-topo-id' value='`$network.te-topology-id`' />
+ <parameter name='provider-id' value='`$network.provider-id`' />
+ <parameter name='network-type' value='`$network.network-types`' />
</save>
- <for index="pidx" start="0" end="`$network.node_length`">
+ <for index='pidx' start='0' end='`$network.node_length`' >
<set>
- <parameter name="node." value="`$network.node[$pidx].`"/>
- <parameter name="unique-networkId" value="`$tmp.network-id`"/>
+ <parameter name='node.' value='' />
</set>
<set>
- <parameter name="unique-nodeId" value="`'networkId-' + $unique-networkId + '-nodeId-' + $node.node-id`"/>
+ <parameter name='node.' value='`$network.node[$pidx].`' />
+ <parameter name='unique-networkId' value='`$tmp.network-id`' />
</set>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $unique-nodeId">
- <parameter name="pnf-name" value="`$unique-nodeId`"/>
- <parameter name="pnf-id" value="`$node.node-id`"/>
- <parameter name="operational-status" value="`$node.te.oper-status`"/>
- <parameter name="admin-status" value="`$node.te.te-node-attributes.admin-status`"/>
- <parameter name="in-maint" value="true"/>
+ <set>
+ <parameter name='unique-nodeId' value="`'networkId-' + $unique-networkId + '-nodeId-' + $node.node-id`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf'
+ key='pnf.pnf-name = $unique-nodeId' >
+ <parameter name='pnf-name' value='`$unique-nodeId`' />
+ <parameter name='pnf-id' value='`$node.node-id`' />
+ <parameter name='operational-status' value='`$node.te.oper-status`' />
+ <parameter name='admin-status' value='`$node.te.te-node-attributes.admin-status`' />
+ <parameter name='in-maint' value='true' />
</save>
- <switch test="`$node.te.tunnel-termination-point_length`">
- <outcome value="">
- <block/>
+ <switch test='`$node.te.tunnel-termination-point_length`'>
+ <outcome value=''>
+ <block></block>
</outcome>
- <outcome value="0">
- <block/>
+ <outcome value='0'>
+ <block></block>
</outcome>
- <outcome value="Other">
- <for index="ttidx" start="0" end="`$node.te.tunnel-termination-point_length`">
+ <outcome value='Other'>
+ <for index='ttidx' start='0' end='`$node.te.tunnel-termination-point_length`' >
+ <set>
+ <parameter name='ttp.' value='' />
+ </set>
<set>
- <parameter name="ttp." value="`$node.te.tunnel-termination-point[$ttidx].`"/>
+ <parameter name='ttp.' value='`$node.te.tunnel-termination-point[$ttidx].`' />
</set>
<set>
- <parameter name="unique-ttpId" value="`$unique-nodeId + '-ttpId-' + $ttp.tunnel-tp-id`"/>
+ <parameter name='unique-ttpId' value="`$unique-nodeId + '-ttpId-' + $ttp.tunnel-tp-id`" />
</set>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="tunnel-termination-point" key="pnf.pnf-name = $unique-nodeId AND tunnel-termination-point.ttp-id = $unique-ttpId">
- <parameter name="ttp-id" value="`$unique-ttpId`"/>
- <parameter name="tunnel-tp-id" value="`$ttp.tunnel-tp-id`"/>
- <parameter name="name" value="`$ttp.name`"/>
- <parameter name="admin-status" value="`$ttp.admin-status`"/>
- <parameter name="oper-status" value="`$ttp.oper-status`"/>
- <parameter name="inter-layer-lock-id" value="`$ttp.inter-layer-lock-id`"/>
- <parameter name="switching-capability" value="`$ttp.switching-capability`"/>
- <parameter name="protection-type" value="`$ttp.protection-type`"/>
- <parameter name="encoding" value="`$ttp.encoding`"/>
- <outcome value="success">
- <block/>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='tunnel-termination-point'
+ key='tunnel-termination-point.ttp-id = $unique-ttpId' >
+ <parameter name='ttp-id' value='`$unique-ttpId`' />
+ <parameter name='tunnel-tp-id' value='`$ttp.tunnel-tp-id`' />
+ <parameter name='name' value='`$ttp.name`' />
+ <parameter name='admin-status' value='`$ttp.admin-status`' />
+ <parameter name='oper-status' value='`$ttp.oper-status`' />
+ <parameter name='inter-layer-lock-id' value='`$ttp.inter-layer-lock-id`' />
+ <parameter name='switching-capability' value='`$ttp.switching-capability`' />
+ <parameter name='protection-type' value='`$ttp.protection-type`' />
+ <parameter name='encoding' value='`$ttp.encoding`' />
+ <outcome value='success'>
+ <block></block>
</outcome>
- <outcome value="failure">
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="tunnel-termination-point" key="pnf.pnf-name = $unique-nodeId AND tunnel-termination-point.ttp-id = $unique-ttpId">
- <parameter name="ttp-id" value="`$unique-ttpId`"/>
- <parameter name="tunnel-tp-id" value="`$ttp.tunnel-tp-id`"/>
- <parameter name="name" value="`$ttp.name`"/>
- <parameter name="admin-status" value="`$ttp.admin-status`"/>
- <parameter name="oper-status" value="`$ttp.oper-status`"/>
- <parameter name="inter-layer-lock-id" value="`$ttp.inter-layer-lock-id`"/>
- <parameter name="switching-capability" value="`$ttp.switching-capability`"/>
- <parameter name="protection-type" value="`$ttp.protection-type`"/>
- <parameter name="encoding" value="`$ttp.encoding`"/>
+ <outcome value='failure'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='tunnel-termination-point'
+ key='tunnel-termination-point.ttp-id = $unique-ttpId' >
+ <parameter name='ttp-id' value='`$unique-ttpId`' />
+ <parameter name='tunnel-tp-id' value='`$ttp.tunnel-tp-id`' />
+ <parameter name='name' value='`$ttp.name`' />
+ <parameter name='admin-status' value='`$ttp.admin-status`' />
+ <parameter name='oper-status' value='`$ttp.oper-status`' />
+ <parameter name='inter-layer-lock-id' value='`$ttp.inter-layer-lock-id`' />
+ <parameter name='switching-capability' value='`$ttp.switching-capability`' />
+ <parameter name='protection-type' value='`$ttp.protection-type`' />
+ <parameter name='encoding' value='`$ttp.encoding`' />
</update>
</outcome>
</save>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf:relationship-list" key="pnf.pnf-name = $unique-nodeId" force="true" pfx="tmp.AnAI-data">
- <parameter name="relationship-list.relationship[$ttidx].related-to" value="tunnel-termination-point"/>
- <parameter name="relationship-list.relationship[$ttidx].related-link" value="`'/network/network-resources/network-resource/' + $tmp.network-id + '/pnfs/pnf/' + $node.node-id '/tunnel-termination-points/tunnel-termination-point/' + $unique-ttpId`"/>
- <parameter name="relationship-list.relationship[$ttidx].relationship-data[0].relationship-key" value="tunnel-termination-point.ttp-id"/>
- <parameter name="relationship-list.relationship[$ttidx].relationship-data[0].relationship-value" value="`$unique-ttpId`"/>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf:relationship-list'
+ key='pnf.pnf-name = $unique-nodeId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="`relationship-list.relationship[$ttidx].related-to`" value="tunnel-termination-point" />
+ <!--<parameter name="relationship-list.relationship[$ttidx].related-link" value="`'/network/network-resources/network-resource/' + $tmp.network-id + '/pnfs/pnf/' + $node.node-id '/tunnel-termination-points/tunnel-termination-point/' + $unique-ttpId`" />-->
+ <parameter name="`relationship-list.relationship[$ttidx].related-link`" value="`'/network/tunnel-termination-points/tunnel-termination-point/' + $unique-ttpId`" />
+ <parameter name="`relationship-list.relationship[$ttidx].relationship-data[0].relationship-key`" value="tunnel-termination-point.ttp-id" />
+ <parameter name="`relationship-list.relationship[$ttidx].relationship-data[0].relationship-value`" value="`$unique-ttpId`" />
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logTopologyDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="sucess executing Hesam log file" />
+ <parameter name="field3" value="`$node.te.tunnel-termination-point_length`" />
+ <parameter name="field4" value="`$node.termination-point_length`" />
+ <parameter name="field5" value="sucessfully saved ttp" />
+ <parameter name="field6" value="`relationship-list.relationship[$ttidx].related-link`" />
+ </record>
+ </outcome>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/onap/logTopologyDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="sucess executing Hesam log file" />
+ <parameter name="field3" value="`$node.te.tunnel-termination-point_length`" />
+ <parameter name="field4" value="`$node.termination-point_length`" />
+ <parameter name="field5" value="failuire on saving ttp" />
+ <parameter name="field6" value="`relationship-list.relationship[$ttidx].related-link`" />
+ </record>
+ </outcome>
</save>
</for>
</outcome>
</switch>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
- <parameter name="file" value="/opt/onap/hesamlogx.txt"/>
- <parameter name="field1" value="__TIMESTAMP__"/>
- <parameter name="field2" value="sucess executing Hesam hesam log file"/>
- <parameter name="field3" value="`$node.te.tunnel-termination-point_length`"/>
- <parameter name="field4" value="`$node.termination-point_length`"/>
+ <parameter name="file" value="/opt/onap/logTopologyDiscovery.txt" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="sucess executing Hesam log file" />
+ <parameter name="field3" value="`$node.te.tunnel-termination-point_length`" />
+ <parameter name="field4" value="`$node.termination-point_length`" />
</record>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf:relationship-list" key="pnf.pnf-name = $unique-nodeId" force="true" pfx="tmp.AnAI-data">
- <parameter name="relationship-list.relationship[0].related-to" value="network-resource"/>
- <parameter name="relationship-list.relationship[0].related-link" value="`'/network/network-resources/network-resource/' + $tmp.network-id`"/>
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-resource.network-id"/>
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.network-id`"/>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf:relationship-list'
+ key='pnf.pnf-name = $unique-nodeId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="network-resource" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/network-resources/network-resource/' + $tmp.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-resource.network-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 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>
- <switch test="`$node.termination-point_length`">
- <outcome value="">
- <block/>
+ <switch test='`$node.termination-point_length`'>
+ <outcome value=''>
+ <block></block>
</outcome>
- <outcome value="0">
- <block/>
+ <outcome value='0'>
+ <block></block>
</outcome>
- <outcome value="Other">
- <for index="tidx" start="0" end="`$node.termination-point_length`">
+ <outcome value='Other'>
+ <for index='tidx' start='0' end='`$node.termination-point_length`' >
+ <set>
+ <parameter name='tp.' value='' />
+ </set>
<set>
- <parameter name="tp." value="`$node.termination-point[$tidx].`"/>
+ <parameter name='tp.' value='`$node.termination-point[$tidx].`' />
</set>
<set>
- <parameter name="unique-ltpId" value="`$unique-nodeId + '-ltpId-' + $tp.te-tp-id`"/>
+ <parameter name='unique-ltpId' value="`$unique-nodeId + '-ltpId-' + $tp.te-tp-id`" />
</set>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="p-interface" key="pnf.pnf-name = $unique-nodeId AND p-interface.interface-name = $unique-ltpId">
- <parameter name="interface-name" value="`$unique-ltpId`"/>
- <parameter name="network-ref" value="`$tp.supporting-termination-point[0].network-ref`"/>
- <parameter name="transparent" value="`$tp.svc.supported-classification.transparent`"/>
- <parameter name="speed-value" value="`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`"/>
- <parameter name="operational-status" value="`$tp.te.oper-status`"/>
- <parameter name="in-maint" value="true"/>
- <parameter name="inter-layer-lock-id" value="`$tp.te.inter-layer-lock-id[0]`"/>
- <parameter name="inter-domain-plug-id" value="`$tp.te.inter-domain-plug-id`"/>
- <outcome value="success">
- <block/>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface'
+ key='pnf.pnf-name = $unique-nodeId
+ AND p-interface.interface-name = $unique-ltpId' >
+ <parameter name='interface-name' value='`$unique-ltpId`' />
+ <parameter name='network-ref' value='`$tp.supporting-termination-point[0].network-ref`' />
+ <parameter name='transparent' value='`$tp.svc.supported-classification.transparent`' />
+ <parameter name='speed-value' value='`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`' />
+ <parameter name='operational-status' value='`$tp.te.oper-status`' />
+ <parameter name='in-maint' value="true" />
+ <parameter name='inter-layer-lock-id' value='`$tp.te.inter-layer-lock-id[0]`' />
+ <parameter name='inter-domain-plug-id' value='`$tp.te.inter-domain-plug-id`' />
+ <outcome value='success'>
+ <block></block>
</outcome>
- <outcome value="failure">
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="p-interface" key="pnf.pnf-name = $unique-nodeId AND p-interface.interface-name = $unique-ltpId">
- <parameter name="interface-name" value="`$unique-ltpId`"/>
- <parameter name="network-ref" value="`$tp.supporting-termination-point[0].network-ref`"/>
- <parameter name="transparent" value="`$tp.svc.supported-classification.transparent`"/>
- <parameter name="speed-value" value="`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`"/>
- <parameter name="operational-status" value="`$tp.te.oper-status`"/>
- <parameter name="in-maint" value="true"/>
- <parameter name="inter-layer-lock-id" value="`$tp.te.inter-layer-lock-id[0]`"/>
- <parameter name="inter-domain-plug-id" value="`$tp.te.inter-domain-plug-id`"/>
+ <outcome value='failure'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface'
+ key='pnf.pnf-name = $unique-nodeId
+ AND p-interface.interface-name = $unique-ltpId' >
+ <parameter name='interface-name' value='`$unique-ltpId`' />
+ <parameter name='network-ref' value='`$tp.supporting-termination-point[0].network-ref`' />
+ <parameter name='transparent' value='`$tp.svc.supported-classification.transparent`' />
+ <parameter name='speed-value' value='`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`' />
+ <parameter name='operational-status' value='`$tp.te.oper-status`' />
+ <parameter name='in-maint' value="true" />
+ <parameter name='inter-layer-lock-id' value='`$tp.te.inter-layer-lock-id[0]`' />
+ <parameter name='inter-domain-plug-id' value='`$tp.te.inter-domain-plug-id`' />
</update>
</outcome>
</save>
@@ -143,7 +189,7 @@ </outcome>
</switch>
</for>
- <call module="DataChange" rpc="update-network-links-to-aai" mode="sync"/>
+ <call module='DataChange' rpc='update-network-links-to-aai' mode='sync' ></call>
</block>
</method>
</service-logic>
\ No newline at end of file diff --git a/platform-logic/datachange/src/main/xml/DataChange_update-tp-ttp-relationship.xml b/platform-logic/datachange/src/main/xml/DataChange_update-tp-ttp-relationship.xml index 786265b8..f009a801 100644 --- a/platform-logic/datachange/src/main/xml/DataChange_update-tp-ttp-relationship.xml +++ b/platform-logic/datachange/src/main/xml/DataChange_update-tp-ttp-relationship.xml @@ -1,71 +1,77 @@ -<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-tp-ttp-relationship' mode='sync'> - <block atomic="true"> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > - <parameter name="source" value="`$network-eth.network-id`"/> - <parameter name="outputPath" value="tmp.network-eth.network-id"/> - <parameter name="target" value="/"/> - <parameter name="replacement" value="-"/> - </execute> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > - <parameter name="source" value="`$network-otn.network-id`"/> - <parameter name="outputPath" value="tmp.network-otn.network-id"/> - <parameter name="target" value="/"/> - <parameter name="replacement" value="-"/> - </execute> - <for index='pethidx' start='0' end='`$network-eth.node_length`' > - <set> - <parameter name='node-eth.' value='`$network-eth.node[$pethidx].`' /> - </set> - <set> - <parameter name='unique-network-ethId' value='`$tmp.network-eth.network-id`' /> - <parameter name='unique-node-ethId' value="`'networkId-' + $unique-network-ethId + '-nodeId-' + $node-eth.node-id`" /> - </set> - <for index='tidx' start='0' end='`$node-eth.termination-point_length`' > - <set> - <parameter name='tp-eth.' value='`$node-eth.termination-point[$tidx].`' /> - </set> - <set> - <parameter name='unique-ltpethId' value="`$unique-node-ethId + '-ltpId-' + $tp-eth.te-tp-id`" /> - </set> - <set> - <parameter name='tp-inter-layer-lock-id' value='`$node-eth.termination-point[$tidx].te.inter-layer-lock-id[0]`' /> - </set> - <for index='potnidx' start='0' end='`$network-otn.node_length`' > - <set> - <parameter name='node-otn.' value='`$network-otn.node[$potnidx].`' /> - </set> - <set> - <parameter name='unique-network-otnId' value='`$tmp.network-otn.network-id`' /> - <parameter name='unique-node-otnId' value="`'networkId-' + $unique-network-otnId + '-nodeId-' + $node-otn.node-id`" /> - </set> - <for index='ttidx' start='0' end='`$node.te.tunnel-termination-point_length`' > - <set> - <parameter name='ttp.' value='`$node-otn.te.tunnel-termination-point[$ttidx].`' /> - </set> - <set> - <parameter name='unique-ttpId' value="`$unique-node-otnId + '-ttpId-' + $ttp.tunnel-tp-id`" /> - </set> - <set> - <parameter name='ttp-inter-layer-lock-id' value='`$node-otn.te.tunnel-termination-point[$ttidx].inter-layer-lock-id`' /> - </set> - <switch test='tp-inter-layer-lock-id'> - <outcome value='ttp-inter-layer-lock-id'> - <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface:relationship-list' - key='p-interface.interface-name = $unique-ltpethId' force="true" pfx="tmp.AnAI-data"> - <parameter name="relationship-list.relationship[1].related-to" value="tunnel-termination-point" /> - <parameter name="relationship-list.relationship[1].related-link" value="/network/tunnel-termination-points/tunnel-termination-point/ + `$unique-ttpId`" /> - <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="tunnel-termination-point.tunnel-tp-id" /> - <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$unique-ttpId`" /> - </save> - </outcome> - </switch> - </for> - </for> - </for> - </for> - </block> - </method> +<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-tp-ttp-relationship' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$network-eth.network-id`"/>
+ <parameter name="outputPath" value="tmp.network-eth.network-id"/>
+ <parameter name="target" value="/"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$network-otn.network-id`"/>
+ <parameter name="outputPath" value="tmp.network-otn.network-id"/>
+ <parameter name="target" value="/"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <for index='pethidx' start='0' end='`$network-eth.node_length`' >
+ <set>
+ <parameter name='node-eth.' value='`$network-eth.node[$pethidx].`' />
+ </set>
+ <set>
+ <parameter name='unique-network-ethId' value='`$tmp.network-eth.network-id`' />
+ <parameter name='unique-node-ethId' value="`'networkId-' + $unique-network-ethId + '-nodeId-' + $node-eth.node-id`" />
+ </set>
+ <for index='tidx' start='0' end='`$node-eth.termination-point_length`' >
+ <set>
+ <parameter name='tp-eth.' value='' />
+ </set>
+ <set>
+ <parameter name='tp-eth.' value='`$node-eth.termination-point[$tidx].`' />
+ </set>
+ <set>
+ <parameter name='unique-ltpethId' value="`$unique-node-ethId + '-ltpId-' + $tp-eth.te-tp-id`" />
+ </set>
+ <set>
+ <parameter name='tp-inter-layer-lock-id' value='`$node-eth.termination-point[$tidx].te.inter-layer-lock-id[0]`' />
+ </set>
+ <for index='potnidx' start='0' end='`$network-otn.node_length`' >
+ <set>
+ <parameter name='node-otn.' value='`$network-otn.node[$potnidx].`' />
+ </set>
+ <set>
+ <parameter name='unique-network-otnId' value='`$tmp.network-otn.network-id`' />
+ <parameter name='unique-node-otnId' value="`'networkId-' + $unique-network-otnId + '-nodeId-' + $node-otn.node-id`" />
+ </set>
+ <for index='ttidx' start='0' end='`$node.te.tunnel-termination-point_length`' >
+ <set>
+ <parameter name='ttp.' value='' />
+ </set>
+ <set>
+ <parameter name='ttp.' value='`$node-otn.te.tunnel-termination-point[$ttidx].`' />
+ </set>
+ <set>
+ <parameter name='unique-ttpId' value="`$unique-node-otnId + '-ttpId-' + $ttp.tunnel-tp-id`" />
+ </set>
+ <set>
+ <parameter name='ttp-inter-layer-lock-id' value='`$node-otn.te.tunnel-termination-point[$ttidx].inter-layer-lock-id`' />
+ </set>
+ <switch test='tp-inter-layer-lock-id'>
+ <outcome value='ttp-inter-layer-lock-id'>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface:relationship-list'
+ key='p-interface.interface-name = $unique-ltpethId' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[1].related-to" value="tunnel-termination-point" />
+ <parameter name="relationship-list.relationship[1].related-link" value="/network/tunnel-termination-points/tunnel-termination-point/ + `$unique-ttpId`" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="tunnel-termination-point.tunnel-tp-id" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$unique-ttpId`" />
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ </block>
+ </method>
</service-logic>
\ No newline at end of file |