aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/datachange/src/main/xml
diff options
context:
space:
mode:
authorFranklin Dsilva <franklin.dsilva@us.fujitsu.com>2020-02-20 05:14:28 +0000
committerFranklin Dsilva <franklin.dsilva@us.fujitsu.com>2020-02-20 05:14:40 +0000
commit1b4700191e39fcd7b40e8bd20270451d39d0c225 (patch)
tree4a7940b38902342e71cb3e8d8d392841aef00f50 /platform-logic/datachange/src/main/xml
parent8bbe748d631353b8c48c7d71eb733cf85712884c (diff)
Topology Discovery and optical-service DGs
to support MDONS usecase Change-Id: I1c28e799cc83325e8913d17ee8b718b0a4160cb2 Issue-ID: SDNC-928 Signed-off-by: Franklin Dsilva <franklin.dsilva@us.fujitsu.com> Former-commit-id: 6a42d5eee5d71870527c8a302308f3e49829a496
Diffstat (limited to 'platform-logic/datachange/src/main/xml')
-rw-r--r--platform-logic/datachange/src/main/xml/DataChange_esr-thirdparty-sdnc-discovery.xml356
-rw-r--r--platform-logic/datachange/src/main/xml/DataChange_msa-update-network-to-aai.xml229
2 files changed, 440 insertions, 145 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 f6cd4d19..c90a5cb2 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,148 +1,214 @@
-<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="`$prop.sdncRestApi.vendor == 'ZTE'`">
- <outcome value="false">
- <switch test="`$data-change-notification-input.aai-event-trigger`">
- <outcome value="Update">
- <block>
- <switch test="`$prop.sdncRestApi.type`">
- <outcome value="SOTN">
- <block atomic="true">
- <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties">
- <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/>
- <parameter name="contextPrefix" value="prop"/>
- </execute>
- <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.onap.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>
+<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="`$prop.sdncRestApi.vendor == 'ZTE'`">
+ <outcome value='false'>
+ <switch test="`$data-change-notification-input.aai-event-trigger`">
+ <outcome value='Update'>
+ <block>
+ <switch test="`$prop.sdncRestApi.type`">
+ <outcome value='SOTN'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <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.onap.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>
+ <switch test="`$prop.sdncRestApi.token_id`">
+ <outcome value=''>
+ <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.onap.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='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>
+ <outcome value='success'>
+ <block atomic="true">
+ <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>
+ </execute>
+ </outcome>
+ <outcome value='Other'>
+ <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.onap.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='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>
+ <outcome value='success'>
+ <block atomic="true">
+ <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>
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='input' value='ietf-subscribed-notifications:establish-subscription.input.' />
+ <parameter name="`$input + 'encoding'`" value="encode-json" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode' method='establishSubscription' >
+ <parameter name="subscriberId" value="sotn-controller" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/operations/ietf-subscribed-notifications:establish-subscription'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="sseConnectURL" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/streams/yang-push-json'`" />
+ <parameter name="dirPath" value="/opt/sdnc/restconfapi/yang/notification" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.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`" />
+ <parameter name="module" value="DataChange" />
+ <parameter name="rpc" value="sotn-notification-handler" />
+ <parameter name="mode" value="sync" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='TAPI'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/cxf/tapi/v2/topologies?topology-id-or-name=otn'`"/>
+ <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="topologies"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <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 get topology TAPI rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index='tidx' start='0' end="`$topologies.topology_length`" >
+ <block>
+ <set>
+ <parameter name='topology.' value='`$topologies.topology[$tidx].`' />
+ </set>
+ <call module='DataChange' rpc='tapi-update-network-to-aai' mode='sync' ></call>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='MSA'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/cxf/openroadm/v2/networks/otn-topology'`"/>
+ <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="networks"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.msa.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <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 get topology MSA rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <call module='DataChange' rpc='msa-update-network-to-aai' mode='sync' ></call>
+ </block>
+ </outcome>
+ </execute>
+ </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="`'Unsupported type = ' + $prop.sdncRestApi.type`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
</outcome>
- <outcome value="failure">
- <block></block>
+ <outcome value='delete'>
+ <block atomic="true"></block>
</outcome>
- </execute>
- <switch test="`$prop.sdncRestApi.token_id`">
- <outcome value="">
- <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.onap.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="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>
- <outcome value="success">
- <block atomic="true">
- <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>
- </execute>
- </outcome>
- <outcome value="Other">
- <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.onap.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="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>
- <outcome value="success">
- <block atomic="true">
- <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>
- </execute>
- </outcome>
- </switch>
- <set>
- <parameter name="ietf-subscribed-notifications_establish-subscription.input.encoding" value="encode-json"/>
- </set>
- <execute plugin="org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode" method="establishSubscription">
- <parameter name="subscriberId" value="sotn-controller"/>
- <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/operations/ietf-subscribed-notifications:establish-subscription'`"/>
- <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`"/>
- <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`"/>
- <parameter name="sseConnectURL" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/streams/yang-push-json'`"/>
- <parameter name="dirPath" value="/opt/sdnc/restconfapi/yang/notification"/>
- <parameter name="format" value="json"/>
- <parameter name="httpMethod" value="post"/>
- <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.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`"/>
- <parameter name="module" value="DataChange"/>
- <parameter name="rpc" value="sotn-notification-handler"/>
- <parameter name="mode" value="sync"/>
- </execute>
- </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="`'Unsupported type = ' + $prop.sdncRestApi.type`"/>
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value="delete">
- <block atomic="true"/>
- </outcome>
- </switch>
- </outcome>
- <outcome value="true">
- <call module="DataChange" rpc="esr-thirdparty-sdnc-of-zte" mode="sync"></call>
- </outcome>
- </switch>
- </block>
- </method>
+ </switch>
+ </outcome>
+ <outcome value='true'>
+ <call module='DataChange' rpc='esr-thirdparty-sdnc-of-zte' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </method>
</service-logic> \ No newline at end of file
diff --git a/platform-logic/datachange/src/main/xml/DataChange_msa-update-network-to-aai.xml b/platform-logic/datachange/src/main/xml/DataChange_msa-update-network-to-aai.xml
new file mode 100644
index 00000000..a370575d
--- /dev/null
+++ b/platform-logic/datachange/src/main/xml/DataChange_msa-update-network-to-aai.xml
@@ -0,0 +1,229 @@
+<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='msa-update-network-to-aai' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$networks.network-id`">
+ <outcome value='otn-topology'>
+ <block atomic='true'>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='network-resource'
+ key='network-resource.network-id = $networks.network-id' >
+ <parameter name='network-id' value='`$networks.network-id`' />
+ <parameter name='network-type' value='`$networks.network-types`' />
+ </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="network-resource" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/network-resources/network-resource/' + $networks.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="`$networks.network-id`" />
+ </save>
+ <set>
+ <parameter name='controller_id' value="`$prop.sdncRestApi.type + '_' + $prop.sdncRestApi.thirdpartySdnc.url`" />
+ </set>
+ <for index='nidx' start='0' end='`$networks.node_length`' >
+ <set>
+ <parameter name='node.' value='`$networks.node[$nidx].`' />
+ </set>
+ <switch test="`$node.node-type`">
+ <outcome value='SWITCH'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="pnfname"/>
+ </execute>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf'
+key='pnf.pnf-name = $pnfname' >
+ <parameter name='pnf-name' value='`$pnfname`' />
+ <parameter name='pnf-id' value='`$node.node-id`' />
+ <parameter name='operational-status' value='`$node.node-status`' />
+ <parameter name='in-maint' value='true' />
+ <parameter name='equip-type' value='`$node.node-type`' />
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf:relationship-list'
+ key='pnf.pnf-name = $pnfname' 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/' + $networks.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="`$networks.network-id`" />
+ </save>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$node.node-id`'/>
+ <parameter name="regex" value="-"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/cxf/openroadm/v2/networks/openroadm-network/nodes/' + $param-prefix1[0]`"/>
+ <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="cllires"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.msa.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-delete.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Getting clli failed"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name='clli' value='`$cllires.supporting-node[0].node-ref`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <for index='tpidx' start='0' end='`$node.termination-point_length`' >
+ <set>
+ <parameter name='speed-value' value='' />
+ <parameter name='available-capacity' value='' />
+ <parameter name='network-interface-type' value='' />
+ </set>
+ <set>
+ <parameter name='tp.' value='`$node.termination-point[$tpidx].`' />
+ </set>
+ <switch test="`$tp.tp-type`">
+ <outcome value='XPONDER-NETWORK'>
+ <block atomic='true'>
+ <set>
+ <parameter name='network-interface-type' value='NNI' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='XPONDER-CLIENT'>
+ <block atomic='true'>
+ <set>
+ <parameter name='network-interface-type' value='UNI' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="interfaceName"/>
+ </execute>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface'
+ key='pnf.pnf-name = $pnfname
+ AND p-interface.interface-name = $interfaceName' >
+ <parameter name='interface-name' value='`$interfaceName`' />
+ <parameter name='port-description' value='`$tp.tp-id`' />
+ <parameter name='network-ref' value='`$tp.network-ref`' />
+ <parameter name='interface-type' value='`$tp.tp-type`' />
+ <parameter name='in-maint' value="true" />
+ <parameter name='network-interface-type' value='`$network-interface-type`' />
+ <parameter name='speed-units' value="Gbps" />
+ <parameter name='speed-value' value='100' />
+ <parameter name='available-capacity' value='100' />
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='custom-query'
+ key="format='resource'"
+ force="true"
+ local-only="false"
+ pfx="data">
+ <parameter name='interface-name' value='`$interfaceName`' />
+ <parameter name='port-description' value='`$tp.tp-id`' />
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE VALUES ( $interfaceName , $tp.tp-id , $pnfname , $node.node-id , '100' , $clli , null );"></save>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ </for>
+ <for index='lidx' start='0' end='`$networks.link_length`' >
+ <set>
+ <parameter name='link.' value='`$networks.link[$lidx].`' />
+ </set>
+ <switch test="`$link.link-type`">
+ <outcome value='OTN-LINK'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$link.link-id`"/>
+ <parameter name="outputPath" value="tmp.link-id"/>
+ <parameter name="target" value="#"/>
+ <parameter name="replacement" value="_"/>
+ </execute>
+ <set>
+ <parameter name='interface1' value="`$link.source.source-tp`" />
+ <parameter name='interface2' value="`$link.destination.dest-tp`" />
+ <parameter name='pnf1' value="`$link.source.source-node`" />
+ <parameter name='pnf2' value="`$link.destination.dest-node`" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-create.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="`$pnf1`"/>
+ <parameter name="field2" value="`$interface1`"/>
+ <parameter name="field3" value="`$pnf2`"/>
+ <parameter name="field4" value="`$interface2`"/>
+ </record>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link'
+key='logical-link.link-name = $tmp.link-id' >
+ <parameter name='link-name' value='`$tmp.link-id`' />
+ <parameter name='link-type' value='`$link.link-type`' />
+ <parameter name='in-maint' value='true' />
+ <parameter name='speed-value' value='100' />
+ <parameter name='speed-units' value='Gbps' />
+ <parameter name='operational-status' value='`$link.administrative-state`' />
+ <parameter name='available-capacity' value='100' />
+ </save>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT pnf_name, interface_name
+from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
+WHERE pnf_id = $link.source.source-node
+AND interface_id = $link.source.source-tp'
+pfx='db.source'>
+ <outcome value='success'>
+ <set>
+ <parameter name='pnfname1' value='`$db.source.pnf-name`' />
+ <parameter name='pinterface1' value='`$db.source.interface-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="print direct name"/>
+ <parameter name="field2" value="`$pnfname1`"/>
+ </record>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT pnf_name, interface_name
+from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
+WHERE pnf_id = $link.destination.dest-node
+AND interface_id = $link.destination.dest-tp'
+pfx='db1.destination'>
+ <outcome value='success'>
+ <set>
+ <parameter name='pnfname2' value='`$db1.destination.pnf-name`' />
+ <parameter name='pinterface2' value='`$db1.destination.interface-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='logical-link:relationship-list'
+ key='logical-link.link-name = $tmp.link-id' 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/' + $pnfname1 + '/p-interfaces/p-interface/' + $pinterface1 `" />
+ <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="`$pnfname1`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`'/network/pnfs/pnf/' + $pnfname2 + '/p-interfaces/p-interface/' + $pinterface2 `" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="pnf.pnf-name" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$pnfname2`" />
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file