diff options
author | Hesam Rahimi <hesam.rahimi@huawei.com> | 2021-11-04 11:44:51 -0400 |
---|---|---|
committer | Hesam Rahimi <hesam.rahimi@huawei.com> | 2021-11-04 11:56:17 -0400 |
commit | 22d596935f2edeefbe3f0d5acc72cf39e27e17aa (patch) | |
tree | b453f48841b2e5d8b48578084a2e3c2a5f799bf7 /platform-logic/generic-resource-api/src/main/xml/cloud_leased_line | |
parent | b7cd528f9b720b4f820ac5eb38f01df2b16c9817 (diff) |
Adding support for connecting a single ONU port to multiple clouds with different vlan-id's.
Also fixing a few bugs in cll creation and deletion.
Issue-ID: SDNC-1594
Signed-off-by: Hesam Rahimi <hesam.rahimi@huawei.com>
Change-Id: I5e1b117104ef32f5dbb9b83e2c19ba3727789fe5
Former-commit-id: af17de2185bc8e0d1a7f0cb6f965df157c893412
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/cloud_leased_line')
8 files changed, 278 insertions, 110 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-F1-Activate.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-F1-Activate.xml index 9a35f126..b2057862 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-F1-Activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-F1-Activate.xml @@ -565,7 +565,7 @@ <outcome value='success'> <block atomic="true"> <set> - <parameter name='tmp.uni-node-id-short' value='`$param-prefix-uni[$param-prefix-uni_length -3]`' /> + <parameter name='tmp.uni-node-id-short' value='`$param-prefix-uni[$param-prefix-uni_length -4]`' /> </set> </block> </outcome> @@ -828,7 +828,7 @@ <outcome value='success'> <block atomic="true"> <set> - <parameter name='tmp.uni-node-id-short' value='`$param-prefix-uni[$param-prefix-uni_length -3]`' /> + <parameter name='tmp.uni-node-id-short' value='`$param-prefix-uni[$param-prefix-uni_length -4]`' /> </set> </block> </outcome> diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-create-clean.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-create-clean.xml index 0fc5dcd4..b928dba4 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-create-clean.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-create-clean.xml @@ -492,7 +492,7 @@ $param-prefix-domainA-pnfName[8]`" />
<!--<parameter name='tmp.LEAF.pnf-name-short' value="`$param-prefix-domainA-pnfName[8]`" />-->
<parameter name='tmp.LEAF.pnf-name-short' value="`$tmp.src.pnf-name`" />
- <parameter name='tmp.LEAF.uni-p-interface-long' value="`$tmp.aai.network-route-A.next-hop`" />
+ <parameter name='tmp.LEAF.uni-p-interface-long' value="`$tmp.aai.network-route-A.next-hop + '-' + $tmp.aai.network-route-A.logical-interface-id`" />
<parameter name='tmp.LEAF.uni-tp-id' value="`$tmp.src.ltpId`" />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
@@ -693,7 +693,7 @@ $param-prefix-domainB-pnfName[8]`" />
<!--<parameter name='tmp.ROOT.pnf-name-short' value="`$param-prefix-domainB-pnfName[8]`" />-->
<parameter name='tmp.ROOT.pnf-name-short' value="`$tmp.dst.pnf-name`" />
- <parameter name='tmp.ROOT.uni-p-interface-long' value="`$tmp.aai.network-route-B.next-hop`" />
+ <parameter name='tmp.ROOT.uni-p-interface-long' value="`$tmp.aai.network-route-B.next-hop + '-' + $tmp.aai.network-route-B.logical-interface-id`" />
<parameter name='tmp.ROOT.uni-tp-id' value="`$tmp.dst.ltpId`" />
</set>
<call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-cll-logic' mode='sync' ></call>
@@ -1342,19 +1342,29 @@ <outcome value='true'>
<block atomic='true'>
<set>
- <parameter name='tmp.aai.the-vpn-binding.' value="" />
+ <parameter name='vpnNameToSearch' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].vpn-name`" />
</set>
- <set>
- <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" />
- </set>
- <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding'
- key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' >
- <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' />
- <!--<parameter name='vpn-name' value='`$prop.otn-tunnel-name`' />-->
- <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' />
- <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher + $gfp`' />
- <parameter name='operational-status' value='Modified' />
- </update>
+ <call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-cll-searchVpnName' mode='sync' ></call>
+ <switch test="`$foundVpnName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.aai.the-vpn-binding.' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding'
+ key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' >
+ <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' />
+ <!--<parameter name='vpn-name' value='`$prop.otn-tunnel-name`' />-->
+ <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' />
+ <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher + $gfp`' />
+ <parameter name='operational-status' value='Modified' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
</block>
</outcome>
<outcome value='false'></outcome>
diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-delete.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-delete.xml index dcc3d696..de311094 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-delete.xml @@ -492,7 +492,7 @@ $param-prefix-domainA-pnfName[8]`" /> <!--<parameter name='tmp.LEAF.pnf-name-short' value="`$param-prefix-domainA-pnfName[8]`" />--> <parameter name='tmp.LEAF.pnf-name-short' value="`$tmp.src.pnf-name`" /> - <parameter name='tmp.LEAF.uni-p-interface-long' value="`$tmp.aai.network-route-A.next-hop`" /> + <parameter name='tmp.LEAF.uni-p-interface-long' value="`$tmp.aai.network-route-A.next-hop + '-' + $tmp.aai.network-route-A.logical-interface-id`" /> <parameter name='tmp.LEAF.uni-tp-id' value="`$tmp.src.ltpId`" /> </set> <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > @@ -693,7 +693,7 @@ $param-prefix-domainB-pnfName[8]`" /> <!--<parameter name='tmp.ROOT.pnf-name-short' value="`$param-prefix-domainB-pnfName[8]`" />--> <parameter name='tmp.ROOT.pnf-name-short' value="`$tmp.dst.pnf-name`" /> - <parameter name='tmp.ROOT.uni-p-interface-long' value="`$tmp.aai.network-route-B.next-hop`" /> + <parameter name='tmp.ROOT.uni-p-interface-long' value="`$tmp.aai.network-route-B.next-hop + '-' + $tmp.aai.network-route-B.logical-interface-id`" /> <parameter name='tmp.ROOT.uni-tp-id' value="`$tmp.dst.ltpId`" /> </set> <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" @@ -973,19 +973,29 @@ <outcome value='true'> <block atomic='true'> <set> - <parameter name='tmp.aai.the-vpn-binding.' value="" /> + <parameter name='vpnNameToSearch' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].vpn-name`" /> </set> - <set> - <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" /> - </set> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' - key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > - <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> - <parameter name='vpn-name' value='`$tmp.aai.the-vpn-binding.vpn-name`' /> - <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> - <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher - $bwToBeDecreased`' /> - <parameter name='operational-status' value='Modified' /> - </update> + <call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-cll-searchVpnName' mode='sync' ></call> + <switch test="`$foundVpnName`"> + <outcome value='true'> + <block atomic='true'> + <set> + <parameter name='tmp.aai.the-vpn-binding.' value="" /> + </set> + <set> + <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" /> + </set> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' + key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > + <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> + <parameter name='vpn-name' value='`$tmp.aai.the-vpn-binding.vpn-name`' /> + <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> + <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher - $bwToBeDecreased`' /> + <parameter name='operational-status' value='Modified' /> + </update> + </block> + </outcome> + </switch> </block> </outcome> <outcome value='false'></outcome> diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-ROOT-conn.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-ROOT-conn.xml index bb86aacf..58104d50 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-ROOT-conn.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-ROOT-conn.xml @@ -9,6 +9,9 @@ <set> <parameter name='tmp.aai.ROOT.connectivity.' value="" /> </set> + <set> + <parameter name='tmp.aai.helper-root-all-connectivities.' value="" /> + </set> <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivities" key="selflink = 'https://aai.onap:8443/aai/v24/network/connectivities/'" diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-connectivity.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-connectivity.xml index 6e279384..87498016 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-connectivity.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-helper-find-connectivity.xml @@ -9,6 +9,9 @@ <set> <parameter name='tmp.the-connectivity.' value="" /> </set> + <set> + <parameter name='tmp.aai.helper-all-connectivities.' value="" /> + </set> <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivities" key="selflink = 'https://aai.onap:8443/aai/v24/network/connectivities/'" @@ -18,19 +21,51 @@ <block atomic="true"> <for index='helpconnidx' start='0' end='`$tmp.aai.helper-all-connectivities.connectivity_length`' > <block atomic='true'> - <switch test="`$tmp.current-provider-id == $tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].access-provider-id`"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].access-provider-id`"/> + </record> + <switch test='`length($tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].access-provider-id) == 0`'> <outcome value='true'> - <block atomic='true'> - <switch test="`$tmp.current-cvlan-id == $tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].cvlan`"> + <block></block> + </outcome> + <outcome value='false'> + <block> + <switch test="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].access-provider-id != ''`"> + <outcome value='false'> + <block></block> + </outcome> <outcome value='true'> - <block atomic='true'> - <set> - <parameter name='found-connectivity' value="true" /> - </set> - <set> - <parameter name='tmp.the-connectivity.' value="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].`" /> - </set> - <break/> + <block> + <switch test="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].vpn-type != 'mdsc' `"> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <block> + <switch test="`$tmp.current-provider-id == $tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].access-provider-id`"> + <outcome value='true'> + <block atomic='true'> + <switch test="`$tmp.current-cvlan-id == $tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].cvlan`"> + <outcome value='true'> + <block atomic='true'> + <set> + <parameter name='found-connectivity' value="true" /> + </set> + <set> + <parameter name='tmp.the-connectivity.' value="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].`" /> + </set> + <break/> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> </block> </outcome> </switch> diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-logic.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-logic.xml index a9562ab5..3ad3c860 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-logic.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-logic.xml @@ -144,6 +144,7 @@ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' > <parameter name="filename" value="`$filenamebb`" /> </execute> + <break/> </block> </outcome> </switch> @@ -190,6 +191,7 @@ </outcome> </switch> </for> + <break/> </block> </outcome> </switch> diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-modify.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-modify.xml index 76cea192..d01140f6 100644 --- a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-modify.xml +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-modify.xml @@ -492,7 +492,7 @@ $param-prefix-domainA-pnfName[8]`" /> <!--<parameter name='tmp.LEAF.pnf-name-short' value="`$param-prefix-domainA-pnfName[8]`" />--> <parameter name='tmp.LEAF.pnf-name-short' value="`$tmp.src.pnf-name`" /> - <parameter name='tmp.LEAF.uni-p-interface-long' value="`$tmp.aai.network-route-A.next-hop`" /> + <parameter name='tmp.LEAF.uni-p-interface-long' value="`$tmp.aai.network-route-A.next-hop + '-' + $tmp.aai.network-route-A.logical-interface-id`" /> <parameter name='tmp.LEAF.uni-tp-id' value="`$tmp.src.ltpId`" /> </set> <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > @@ -693,7 +693,7 @@ $param-prefix-domainB-pnfName[8]`" /> <!--<parameter name='tmp.ROOT.pnf-name-short' value="`$param-prefix-domainB-pnfName[8]`" />--> <parameter name='tmp.ROOT.pnf-name-short' value="`$tmp.dst.pnf-name`" /> - <parameter name='tmp.ROOT.uni-p-interface-long' value="`$tmp.aai.network-route-B.next-hop`" /> + <parameter name='tmp.ROOT.uni-p-interface-long' value="`$tmp.aai.network-route-B.next-hop + '-' + $tmp.aai.network-route-B.logical-interface-id`" /> <parameter name='tmp.ROOT.uni-tp-id' value="`$tmp.dst.ltpId`" /> </set> <call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-cll-logic' mode='sync' ></call> @@ -1127,64 +1127,74 @@ <outcome value='true'> <block atomic='true'> <set> - <parameter name='tmp.aai.the-vpn-binding.' value="" /> + <parameter name='vpnNameToSearch' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].vpn-name`" /> </set> - <set> - <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" /> - </set> - <for silentFailure='true' index='vpnbridx' start='0' end='`$tmp.aai.the-vpn-binding.relationship-list.relationship_length`' > - <switch test='`$tmp.aai.the-vpn-binding.relationship-list.relationship[$vpnbridx].related-to`'> - <outcome value='connectivity'> - <block atomic="true"> - <set> - <parameter name='tmp.the-connectivity.' value='' /> - </set> - <set> - <parameter name='tmp.the-connectivity.' value='`$tmp.aai.the-vpn-binding.relationship-list.relationship[$vpnbridx].relationship-data[0].relationship-value`' /> - </set> - </block> - </outcome> - </switch> - </for> - <switch test="`$tmp.isBwIncreased`"> + <call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-cll-searchVpnName' mode='sync' ></call> + <switch test="`$foundVpnName`"> <outcome value='true'> <block atomic='true'> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' - key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > - <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> - <parameter name='vpn-name' value='`$tmp.aai.the-vpn-binding.vpn-name`' /> - <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> - <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher + $tmp.delta`' /> - <parameter name='operational-status' value='Modified' /> - </update> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='connectivity' - key='connectivity.connectivity-id = $tmp.the-connectivity.connectivity-id'> - <parameter name='connectivity-id' value='`$tmp.the-connectivity.connectivity-id`' /> - <parameter name='operational-status' value='Modified' /> - <!--<parameter name='bandwidth-profile-name' value='`$gfp`' />--> - <!--<parameter name='cir' value='`$gfp *1000000`' />--> - <!--<parameter name='eir' value='`$gfp *1000000`' />--> - </update> - </block> - </outcome> - <outcome value='false'> - <block atomic='true'> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' - key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > - <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> - <parameter name='vpn-name' value='`$tmp.aai.the-vpn-binding.vpn-name`' /> - <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> - <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher - $tmp.delta`' /> - <parameter name='operational-status' value='Modified' /> - </update> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='connectivity' - key='connectivity.connectivity-id = $tmp.the-connectivity.connectivity-id'> - <parameter name='connectivity-id' value='`$tmp.the-connectivity.connectivity-id`' /> - <parameter name='operational-status' value='Modified' /> - <!--<parameter name='bandwidth-profile-name' value='`$gfp`' />--> - <!--<parameter name='cir' value='`$gfp *1000000`' />--> - <!--<parameter name='eir' value='`$gfp *1000000`' />--> - </update> + <set> + <parameter name='tmp.aai.the-vpn-binding.' value="" /> + </set> + <set> + <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" /> + </set> + <for silentFailure='true' index='vpnbridx' start='0' end='`$tmp.aai.the-vpn-binding.relationship-list.relationship_length`' > + <switch test='`$tmp.aai.the-vpn-binding.relationship-list.relationship[$vpnbridx].related-to`'> + <outcome value='connectivity'> + <block atomic="true"> + <set> + <parameter name='tmp.the-connectivity.' value='' /> + </set> + <set> + <parameter name='tmp.the-connectivity.connectivity-id' value='`$tmp.aai.the-vpn-binding.relationship-list.relationship[$vpnbridx].relationship-data[0].relationship-value`' /> + </set> + </block> + </outcome> + </switch> + </for> + <switch test="`$tmp.isBwIncreased`"> + <outcome value='true'> + <block atomic='true'> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' + key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > + <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> + <parameter name='vpn-name' value='`$tmp.aai.the-vpn-binding.vpn-name`' /> + <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> + <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher + $tmp.delta`' /> + <parameter name='operational-status' value='Modified' /> + </update> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='connectivity' + key='connectivity.connectivity-id = $tmp.the-connectivity.connectivity-id'> + <parameter name='connectivity-id' value='`$tmp.the-connectivity.connectivity-id`' /> + <parameter name='operational-status' value='Modified' /> + <!--<parameter name='bandwidth-profile-name' value='`$gfp`' />--> + <!--<parameter name='cir' value='`$gfp *1000000`' />--> + <!--<parameter name='eir' value='`$gfp *1000000`' />--> + </update> + </block> + </outcome> + <outcome value='false'> + <block atomic='true'> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' + key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > + <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> + <parameter name='vpn-name' value='`$tmp.aai.the-vpn-binding.vpn-name`' /> + <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> + <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher - $tmp.delta`' /> + <parameter name='operational-status' value='Modified' /> + </update> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='connectivity' + key='connectivity.connectivity-id = $tmp.the-connectivity.connectivity-id'> + <parameter name='connectivity-id' value='`$tmp.the-connectivity.connectivity-id`' /> + <parameter name='operational-status' value='Modified' /> + <!--<parameter name='bandwidth-profile-name' value='`$gfp`' />--> + <!--<parameter name='cir' value='`$gfp *1000000`' />--> + <!--<parameter name='eir' value='`$gfp *1000000`' />--> + </update> + </block> + </outcome> + </switch> </block> </outcome> </switch> @@ -1611,6 +1621,9 @@ <parameter name='tmp.srcTtpOtnLayer' value="`$tmp.pce-src-node`" /> </set> <call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-find-maximum-used-tpn' mode='sync' ></call> + <set> + <parameter name='tmp.aai.all-vpn-bindings.' value='' /> + </set> <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpn-bindings" key="selflink = 'https://aai.onap:8443/aai/v24/network/vpn-bindings" @@ -1625,19 +1638,29 @@ <outcome value='true'> <block atomic='true'> <set> - <parameter name='tmp.aai.the-vpn-binding.' value="" /> - </set> - <set> - <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" /> + <parameter name='vpnNameToSearch' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].vpn-name`" /> </set> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' - key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > - <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> - <!--<parameter name='vpn-name' value='`$prop.otn-tunnel-name`' />--> - <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> - <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher + $gfp`' /> - <parameter name='operational-status' value='Modified' /> - </update> + <call module='GENERIC-RESOURCE-API' rpc='cll-vnf-topology-operation-cll-searchVpnName' mode='sync' ></call> + <switch test="`$foundVpnName`"> + <outcome value='true'> + <block atomic='true'> + <set> + <parameter name='tmp.aai.the-vpn-binding.' value="" /> + </set> + <set> + <parameter name='tmp.aai.the-vpn-binding.' value="`$tmp.aai.all-vpn-bindings.vpn-binding[$vpnbidx].`" /> + </set> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' + key='vpn-binding.vpn-id = $tmp.aai.the-vpn-binding.vpn-id' > + <parameter name='vpn-id' value='`$tmp.aai.the-vpn-binding.vpn-id`' /> + <!--<parameter name='vpn-name' value='`$prop.otn-tunnel-name`' />--> + <parameter name='customer-vpn-id' value='`$newToBeUsedMaxtpn`' /> + <parameter name='route-distinguisher' value='`$tmp.aai.the-vpn-binding.route-distinguisher + $gfp`' /> + <parameter name='operational-status' value='Modified' /> + </update> + </block> + </outcome> + </switch> </block> </outcome> <outcome value='false'></outcome> diff --git a/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-searchVpnName.xml b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-searchVpnName.xml new file mode 100644 index 00000000..724f306b --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/cloud_leased_line/GENERIC-RESOURCE-API_cll-vnf-topology-operation-cll-searchVpnName.xml @@ -0,0 +1,85 @@ +<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='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='cll-vnf-topology-operation-cll-searchVpnName' mode='sync'> + <block atomic="true"> + <set> + <parameter name='foundVpnName' value='false' /> + </set> + <for silentFailure='true' index='mmridx' start='0' end='`$middle-man-conn.relationship-list.relationship_length`' > + <set> + <parameter name='tmp.aai.mmrconnectivity.' value='' /> + </set> + <switch test='`$middle-man-conn.relationship-list.relationship[$mmridx].related-to`'> + <outcome value='connectivity'> + <block atomic="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="connectivity" + key="connectivity.connectivity-id = $middle-man-conn.relationship-list.relationship[$mmridx].relationship-data[0].relationship-value" + local-only="false" + pfx="tmp.aai.mmrconnectivity" > + <outcome value='success'> + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.aai.mmrconnectivity.cvlan`"/> + <parameter name="field2" value="`$tmp.aai.network-route-LEAF.logical-interface-id`"/> + </record> + <!--<switch test="`$tmp.aai.all-connectivities.connectivity[$connidx].cvlan == $tmp.aai.network-route-LEAF.logical-interface-id `">--> + <switch test="`$tmp.aai.mmrconnectivity.cvlan == $tmp.aai.network-route-LEAF.logical-interface-id `"> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <for silentFailure='true' index='connrelidx' start='0' end='`$tmp.aai.mmrconnectivity.relationship-list.relationship_length`' > + <set> + <parameter name='tmp.aai.mmrvpn-binding.' value='' /> + </set> + <switch test='`$tmp.aai.mmrconnectivity.relationship-list.relationship[$connrelidx].related-to`'> + <outcome value='vpn-binding'> + <block atomic="true"> + <switch test='`$vpnNameToSearch == $tmp.aai.mmrconnectivity.relationship-list.relationship[$connrelidx].related-to-property[0].property-value`'> + <outcome value='true'> + <block> + <set> + <parameter name='foundVpnName' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </block> + </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> + </switch> + <switch test='`$foundVpnName`'> + <outcome value='true'> + <break/> + </outcome> + </switch> + </for> + </block> + </method> +</service-logic>
\ No newline at end of file |