diff options
author | 2017-09-06 11:03:15 -0400 | |
---|---|---|
committer | 2017-09-06 19:17:34 -0400 | |
commit | 79a537071550d5ae0df0c58572ff2b5aa3065c72 (patch) | |
tree | 75d0cc1e0e0a0c0fdc09c1a6e932f8f72d9c106b /platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml | |
parent | 98ddb133dec262b727b93eab40f384b88fed864a (diff) |
Add generic-resource-api DG seed code
Add seed code for generic-resource-api directed graphs.
Change-Id: I51df937740d54d6f907c79fe322e4ffafe53537c
Issue-ID: SDNC-45
Signed-off-by: Dan Timoney <dtimoney@att.com>
Former-commit-id: b014b942536d93f55664b67a36436168e623bcec
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml')
-rwxr-xr-x | platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml new file mode 100755 index 00000000..dde17098 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml @@ -0,0 +1,97 @@ +<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='generate-panorama-name' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.trust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_T' />
+<parameter name='tmp.untrust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_U' />
+</set><set>
+<parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\."/>
+ <parameter name="limit" value="2" />
+ <parameter name="ctx_memory_result_key" value="splits" />
+
+</execute><switch test='`$splits_length`'>
+<outcome value='1'>
+<set>
+<parameter name='new-name' value='`$splits[0]`' />
+</set></outcome><outcome value='2'>
+<set>
+<parameter name='new-name' value='`$splits[1]`' />
+</set></outcome><outcome value='Other'>
+<return status='failure'>
+<parameter name='error-code' value='500' />
+<parameter name='error-message' value='Unexpected network role used for panorama naming' />
+</return></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' >
+ <parameter name="source" value="`$new-name`" />
+ <parameter name="outputPath" value="tmp.strlen"/>
+
+</execute><switch test='`$tmp.strlen > 14`'>
+<outcome value='true'>
+<block atomic="true"><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' >
+ <parameter name="string" value="`$new-name`" />
+ <parameter name="result" value="new-name"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="14" />
+
+</execute></block></outcome><outcome value='false'>
+<block atomic="true"><set>
+<parameter name='new-name' value='`$new-name`' />
+</set></block></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.trust-sz`"/>
+ <parameter name="outputPath" value="tmp.trust-sz"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.untrust-sz`"/>
+ <parameter name="outputPath" value="tmp.untrust-sz"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+
+</execute><set>
+<parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\."/>
+ <parameter name="limit" value="2" />
+ <parameter name="ctx_memory_result_key" value="splits" />
+
+</execute><switch test='`$splits_length`'>
+<outcome value='1'>
+<set>
+<parameter name='new-name' value='`$splits[0]`' />
+</set></outcome><outcome value='2'>
+<set>
+<parameter name='new-name' value='`$splits[1]`' />
+</set></outcome><outcome value='Other'>
+<return status='failure'>
+<parameter name='error-code' value='500' />
+<parameter name='error-message' value='Unexpected network role used for panorama naming' />
+</return></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' >
+ <parameter name="source" value="`$new-name`" />
+ <parameter name="outputPath" value="tmp.strlen"/>
+
+</execute><switch test='`$tmp.strlen > 14`'>
+<outcome value='true'>
+<block atomic="true"><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' >
+ <parameter name="string" value="`$new-name`" />
+ <parameter name="result" value="new-name"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="14" />
+
+</execute></block></outcome><outcome value='false'>
+<block atomic="true"><set>
+<parameter name='new-name' value='`$new-name`' />
+</set></block></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.trust-sz`"/>
+ <parameter name="outputPath" value="tmp.trust-sz"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.untrust-sz`"/>
+ <parameter name="outputPath" value="tmp.untrust-sz"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+
+</execute></block></method></service-logic> |