diff options
Diffstat (limited to 'ms/generic-resource-api/src/test/resources/svclogic')
222 files changed, 74658 insertions, 0 deletions
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-aic-zone.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-aic-zone.xml new file mode 100755 index 0000000..5f174c6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-aic-zone.xml @@ -0,0 +1,124 @@ +<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='aai-get-aic-zone' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.cloud-zone' value='' />
+ <parameter name='aaiapi.output.complex-name' value='' />
+ <parameter name='aaiapi.output.aic-clli' value='' />
+ </set>
+ <switch test='`$aaiapi.input.cloud-owner`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$aaiapi.input.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $aaiapi.input.cloud-owner AND
+ cloud-region.cloud-region-id = $aaiapi.input.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region not found in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving cloud region from AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.complex-found' value='true' />
+ </set>
+ <set>
+ <parameter name='aaiapi.output.aic-clli' value='`$aai.complex.physical-location-id`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' local-only='false' ></get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$tmp.complex-found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='aaiapi.output.cloud-zone' value='`$aai.cloud-region.cloud-zone`' />
+ <parameter name='aaiapi.output.complex-name' value='`$aai.cloud-region.complex-name`' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml new file mode 100755 index 0000000..7383c3f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml @@ -0,0 +1,95 @@ +<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='aai-get-network-instance-group' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection-customization-uuid' value='' />
+ <parameter name='aaiapi.output.collection-name' value='' />
+ <parameter name='aaiapi.output.collection-function' value='' />
+ <parameter name='aaiapi.output.collection.collection-id' value='' />
+ </set>
+ <switch test='`$aaiapi.input.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $aaiapi.input.network-instance-group-id"
+ local-only="false"
+ pfx="tmp.AnAI.networkInstanceGroup">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving network instance group with id=' + $aaiapi.input.network-instance-group-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network instance group id: ' + $aaiapi.input.network-instance-group-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='ridx' start='0' end="`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship_length`" >
+ <for silentFailure='true' index='rdidx' start='0' end="`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='collection.collection-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection.collection-id' value='`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$aaiapi.output.collection.collection-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network instance group id: ' + $aaiapi.input.network-instance-group-id + ' collection not found in AnAI'`" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aaiapi.output.collection.collection-id"
+ local-only="false"
+ pfx="tmp.AnAI.collection">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving collection with id=' + $aaiapi.output.collection.collection-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'collection: ' + $aaiapi.output.collection.collection-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection-customization-uuid' value='`$tmp.AnAI.collection.collection-customization-id`' />
+ <parameter name='aaiapi.output.collection-name' value='`$tmp.AnAI.collection.collection-name`' />
+ <parameter name='aaiapi.output.collection-function' value='`$tmp.AnAI.collection.collection-function`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml new file mode 100644 index 0000000..658cee1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml @@ -0,0 +1,560 @@ +<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='api-contrail-route-topology-operation-activate' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$cto-api.contrail-route-allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$cto-api.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + ', expecting Created.'`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.src-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='src-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$src-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to source network" /> + </return> + </outcome> + </execute> + <set> + <parameter name='src-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='apply' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to apply policy in Contrail to source network" /> + </return> + </outcome> + </execute> + <switch test='`$ar-assignments.dest-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Destination network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.dest-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='dest-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + <parameter name='dest-default-project' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 2]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$dest-default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$dest-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to destination network" /> + </return> + </outcome> + </execute> + <set> + <parameter name='dest-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='apply' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to apply policy in Contrail to destination network" /> + </return> + </block> + </outcome> + </execute> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy:relationship-list" + key="network-policy.network-policy-id = $ar-assignments.contrail-id" > + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].related-link" +value="`'/aai/v$/network/l3-networks/l3-network/' + $ar-assignments.source-network.network-id`" /> + <parameter name="relationship-list.relationship[1].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[1].related-link" +value="`'/aai/v$/network/l3-networks/l3-network/' + $ar-assignments.dest-network.network-id`" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.parent-service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="in-service-path" /> + <parameter name="orchestration-status" value="activated" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + </execute> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml new file mode 100644 index 0000000..674e547 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml @@ -0,0 +1,1443 @@ +<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='api-contrail-route-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='cto-api.parent-service-instance-id' />
+ <parameter name='field4' value='`$cto-api.parent-service-instance-id`' />
+ <parameter name='field5' value='cto-api.default-domain' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='cto-api.port-mirror-configuration-instance-id' />
+ <parameter name='field8' value='`$cto-api.port-mirror-configuration-instance-id`' />
+ <parameter name='field9' value='cto-api.service-type' />
+ <parameter name='field10' value='`$cto-api.service-type`' />
+ <parameter name='field11' value='cto-api.source-network-role' />
+ <parameter name='field12' value='`$cto-api.source-network-fole`' />
+ <parameter name='field13' value='cto-api.collector-network-role' />
+ <parameter name='field14' value='`$cto-api.collector-network-4ole`' />
+ <parameter name='field15' value='cto-api.default-project' />
+ <parameter name='field16' value='`$cto-api.default-project`' />
+ <parameter name='field17' value='cto-api.cloud-region-id' />
+ <parameter name='field18' value='`$cto-api.cloud-region-id`' />
+ <parameter name='field19' value='cto-api.cloud-owner' />
+ <parameter name='field20' value='`$cto-api.cloud-owner`' />
+ <parameter name='field21' value='cto-api.isTest' />
+ <parameter name='field22' value='`$cto-api.isTest`' />
+ <parameter name='field23' value='cto-api.owning-entity' />
+ <parameter name='field24' value='`$cto-api.owning-entity`' />
+ </record>
+ <set>
+ <parameter name="ctotmp." value="" />
+ <parameter name="ar-request-information." value="" />
+ <parameter name="ar-created" value="" />
+ <parameter name="ar-aai-created" value="" />
+ <parameter name="np-aai-created" value="" />
+ <parameter name="contrail-created" value="" />
+ </set>
+ <set>
+ <parameter name="ctotmp.s-l3-network" value="" />
+ <parameter name="ctotmp.num-s-network" value="0" />
+ <parameter name="ctotmp.s-network-policy" value="" />
+ <parameter name="ctotmp.num-s-np" value="0" />
+ <parameter name="ctotmp.c-l3-network" value="" />
+ <parameter name="ctotmp.num-c-network" value="0" />
+ <parameter name="ctotmp.c-network-policy" value="" />
+ <parameter name="ctotmp.num-c-np" value="0" />
+ <parameter name="ctotmp.s-network-policy-list_length" value="0" />
+ <parameter name="ctotmp.c-network-policy-list_length" value="0" />
+ <parameter name="ctotmp.network-policy-id" value="" />
+ <parameter name="ctotmp.action" value="create" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="ctotmp.aai.source-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $cto-api.cloud-owner + '/' + $cto-api.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $cto-api.source-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Failed to get source network from aai" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Source network not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for index='ctotmp.sidx' start='0' end='`$ctotmp.aai.source-network.results_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.s-network-policy-list[$ctotmp.num-s-np].network-policy-id" value="`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.num-s-np" value="`$ctotmp.num-s-np+1`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.s-network-policy-list_length" value="`$ctotmp.num-s-np`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.s-l3-network." value="`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.`" />
+ <parameter name="ctotmp.num-s-network" value="`$ctotmp.num-s-network+1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ctotmp.num-s-network`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Source network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name="ctotmp.source-network.network-id" value="`$ctotmp.s-l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Too many networks returned for source network from aai" />
+ </return>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="ctotmp.aai.collector-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $cto-api.cloud-owner + '/' + $cto-api.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $cto-api.collector-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Failed to get collector network from aai" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for index='ctotmp.cidx' start='0' end='`$ctotmp.aai.collector-network.results_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.c-l3-network." value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.`" />
+ <parameter name="ctotmp.num-c-network" value="`$ctotmp.num-c-network+1`" />
+ </set>
+ <for index='ridx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='service-instance'>
+ <block atomic="true">
+ <for index='rdidx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <block atomic="true">
+ <set>
+ <parameter name="collector-service-instance-id" value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='network-policy'>
+ <block atomic="true">
+ <for index='rdidx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='network-policy.network-policy-id'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.c-network-policy-list[$ctotmp.num-c-np].network-policy-id" value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.num-c-np" value="`$ctotmp.num-c-np+1`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.c-network-policy-list_length" value="`$ctotmp.num-c-np`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ctotmp.num-c-network`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name="ctotmp.dest-network.network-id" value="`$ctotmp.c-l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Too many networks returned for collector network from aai" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ctotmp.spidx' start='0' end='`$ctotmp.s-network-policy-list_length`' >
+ <for index='ctotmp.cpidx' start='0' end='`$ctotmp.c-network-policy-list_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.s-network-policy-list[$ctotmp.spidx].network-policy-id == $ctotmp.c-network-policy-list[$ctotmp.cpidx].network-policy-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.network-policy-id" value="`$ctotmp.s-network-policy-list[$ctotmp.spidx].network-policy-id`" />
+ <parameter name="ctotmp.existing-network-policy-found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <switch test='`$ctotmp.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="existing policy - error" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar-request-information.source' value="SDNC" />
+ </set>
+ <set>
+ <parameter name='ar-contrail-route-request-input.source-network.network-role' value="`$cto-api.source-network-role`" />
+ <parameter name='ar-contrail-route-request-input.source-network.network-id' value="`$ctotmp.source-network.network-id`" />
+ <parameter name='ar-contrail-route-request-input.dest-network.network-role' value="`$cto-api.collector-network-role`" />
+ <parameter name='ar-contrail-route-request-input.dest-network.network-id' value="`$ctotmp.dest-network.network-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-allottedresource-id' mode='sync' ></call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.return.generate-allottedresource-id.id`" />
+ <parameter name='ar-identifiers.allotted-resource-type' value="contrail-route" />
+ <parameter name='ar-identifiers.parent-service-instance-id' value="`$cto-api.parent-service-instance-id`" />
+ <parameter name='ar-identifiers.consuming-service-instance-id' value="`$cto-api.service-instance-id` " />
+ <parameter name="tmp.ar.allotted-resource-id" value="`$tmp.return.generate-allottedresource-id.id`" />
+ <parameter name='tmp.ar.allotted-resource-type' value="contrail-route" />
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$cto-api.parent-service-instance-id`" />
+ <!-- <parameter name='tmp.ar.contrail-applied-service-instance-id' value='' /> -->
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$cto-api.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network`"/>
+ <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$cto-api.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: Existing contrail route allotted resource" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <!--
+<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /><parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /><parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+-->
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.parent-ar-url`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$source-network-name_$cloud-region-id_$source-network-role_$collector-network-role _policy_' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$source-network-name"/>
+ <parameter name="replacement" value="`$ctotmp.s-l3-network.network-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$cloud-region-id"/>
+ <parameter name="replacement" value="`$cto-api.cloud-region-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$source-network-role"/>
+ <parameter name="replacement" value="`$cto-api.source-network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$collector-network-role"/>
+ <parameter name="replacement" value="`$cto-api.collector-network-role`"/>
+ </execute>
+ <set>
+ <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
+ <parameter name='generate-unique-name-input.index-length' value='2' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="tmp.ar-name="/>
+ <parameter name="field3" value="`$tmp.ar-name`"/>
+ <parameter name="field4" value="generate-unique-name-input.prefix" />
+ <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
+ </record>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.ar-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.'
+value="`$ar-identifiers.`" />
+ </set>
+ <set>
+ <parameter name='ar-assignments.source-network.network-id' value="`$ctotmp.s-l3-network.network-id` " />
+ <parameter name='ar-assignments.source-network.network-role' value="`$cto-api.source-network-role` " />
+ <parameter name='ar-assignments.dest-network.network-id' value="`$ctotmp.c-l3-network.network-id` " />
+ <parameter name='ar-assignments.dest-network.network-role' value="`$cto-api.collector-network-role` " />
+ </set>
+ <set>
+ <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultDomain"/>
+ <parameter name="replacement" value="`$cto-api.default-domain`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultProject"/>
+ <parameter name="replacement" value="`$cto-api.default-project`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$sdncNetworkPolicy"/>
+ <parameter name="replacement" value="`$tmp.ar-name`"/>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <switch test='`$cto-api.isTest`'>
+ <outcome value=''>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field9' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field10' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='<>' />
+ <parameter name='field12' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='policy-name' value='`$tmp.fq-name`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <!-- <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> -->
+ <parameter name='dst-virtual-network' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='<>' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="contrail-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='TESTcreate' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field10' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field12' value='<>' />
+ <parameter name='field13' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="dummy12345" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field9' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field10' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='<>' />
+ <parameter name='field12' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='policy-name' value='`$tmp.fq-name`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <!-- <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> -->
+ <parameter name='dst-virtual-network' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='<>' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="contrail-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.'
+value="`$ar-assignments.`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <!-- Create network-policy object -->
+ <parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" />
+ <parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="np-aai-created" value="" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save network-policy in AAI"/>
+ </set>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save network-policy in AAI"/>
+ </set>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $cto-api.service-type AND
+ service-instance.service-instance-id = $cto-api.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="id" value="`$tmp.ar.allotted-resource-id`" />
+ <parameter name="description" value="`$tmp.ar.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="order-status" value="Created" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="ar-aai-created" value="" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save allotted resource in AAI"/>
+ </set>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save allotted resource in AAI"/>
+ </set>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.cidx' value="`0`" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$cidx`' />
+ <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+ <parameter name='tmp.found-cidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-cidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tmp.ar.allotted-resource-type` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error updating md-sal for contrail-route-allotted-resource"/>
+ </set>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error updating md-sal for contrail-route-allotted-resource"/>
+ </set>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="ar-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='cto-api.contrail-route-allotted-instance-id' value='`$tmp.ar.allotted-resource-id`' />
+ </set>
+ <set>
+ <parameter name='ctotmp.' value='' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml new file mode 100644 index 0000000..c49f2eb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml @@ -0,0 +1,618 @@ +<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='api-contrail-route-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$cto-api.contrail-route-allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$cto-api.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Active'> + <block></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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.src-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='src-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$src-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to source network" /> + </return> + </outcome> + </execute> + <set> + <parameter name='src-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from source network" /> + </return> + </outcome> + </execute> + <switch test='`$ar-assignments.dest-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Dest network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </block> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'> + <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' /> + <parameter name='original_string' value='`$aai.dest-network.contrail-network-fqdn`' /> + <parameter name='regex' value=':' /> + </execute> + <switch test='`$virtual-network-fqdn-split_length`'> + <outcome value='0'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' /> + </return> + </block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='dest-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' /> + <parameter name='dest-default-project' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 2]`' /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='fqname-to-uuid' /> + <parameter name='api-action' value='get' /> + <parameter name='resp-prefix' value='uuidresp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$dest-default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='fqname-type' value='virtual-network' /> + <parameter name='policy-name' value='`$dest-virtual-network-fqname`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to find network uuid for Contrail to destination network" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='dest-uuid' value='`$uuidresp.uuid`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" /> + </return> + </block> + </outcome> + </execute> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy:relationship-list" + key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " > + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </block> + </outcome> + </delete> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.parent-service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <parameter name="orchestration-status" value="deactivated" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </block> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$src-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' /> + <parameter name='default-project' value='`$cto-api.default-project`' /> + <parameter name='default-domain' value='`$cto-api.default-domain`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' /> + <outcome value='Other'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </block> + </outcome> + </execute> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml new file mode 100644 index 0000000..d1ef588 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml @@ -0,0 +1,332 @@ +<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='api-contrail-route-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.api-contrail-route-topology-operation-delete"/>
+ <parameter name='field3' value='cto-api.parent-service-instance-id' />
+ <parameter name='field4' value='`$cto-api.parent-service-instance-id`' />
+ <parameter name='field5' value='cto-api.default-domain' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='cto-api.port-mirror-configuration-instance-id' />
+ <parameter name='field8' value='`$cto-api.port-mirror-configuration-instance-id`' />
+ <parameter name='field9' value='cto-api.service-type' />
+ <parameter name='field10' value='`$cto-api.service-type`' />
+ <parameter name='field11' value='cto-api.source-network-role' />
+ <parameter name='field12' value='`$cto-api.source-network-fole`' />
+ <parameter name='field13' value='cto-api.collector-network-role' />
+ <parameter name='field14' value='`$cto-api.collector-network-4ole`' />
+ <parameter name='field15' value='cto-api.default-project' />
+ <parameter name='field16' value='`$cto-api.default-project`' />
+ <parameter name='field17' value='cto-api.cloud-region-id' />
+ <parameter name='field18' value='`$cto-api.cloud-region-id`' />
+ <parameter name='field19' value='cto-api.cloud-owner' />
+ <parameter name='field20' value='`$cto-api.cloud-owner`' />
+ <parameter name='field21' value='cto-api.isTest' />
+ <parameter name='field22' value='`$cto-api.isTest`' />
+ <parameter name='field23' value='service-data.service-information.global-customer-id' />
+ <parameter name='field24' value='`$service-data.service-information.global-customer-id`' />
+ </record>
+ <set>
+ <parameter name="ctotmp." value="" />
+ </set>
+ <set>
+ <parameter name="ctotmp.action" value="delete" />
+ <parameter name="ctotmp.config-count" value="0" />
+ <parameter name="ctotmp.config-found" value="true" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id"
+ pfx='aai.ar' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <switch test='`$cto-api.rollback-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.ar.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.ar.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.ar.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='configuration.configuration-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='ctotmp.config-count' value='`$ctotmp.config-count+1`' />
+ </set>
+ <switch test='`$aai.ar.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $cto-api.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='ctotmp.config-found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test="`$ctotmp.config-count > 1`">
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI Allotted Resource is tied to more than one configuration object" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ctotmp.config-count == 1 and $ctotmp.config-found == 'true'`">
+ <outcome value='false'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI Allotted resource is not tied to configuration object" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$cto-api.contrail-route-allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found in md-sal" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found in md-sal" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to delete policy in Contrail" />
+ </return>
+ </outcome>
+ </execute>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to delete network policy in AAI" />
+ </return>
+ </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="Failed to delete network policy in AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </delete>
+ <for silentFailure='true' index='snidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$sdix].allotted-resource-id == $cto-api.contrail-route-allotted-resource-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.sdidx" value="`$snidx`"/>
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.consumed-allotted-resources." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.sdidx + 1`' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.newidx]." value="$service-data.consumed-allotted-resources.consumed-allotted-resource[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_assign-vlan-tags.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_assign-vlan-tags.xml new file mode 100755 index 0000000..f23891c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_assign-vlan-tags.xml @@ -0,0 +1,441 @@ +<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='assign-vlan-tags' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnics.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.vlan-vnics.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.`' />
+ </set>
+ <set>
+ <parameter name='total-subs' value='`$get-data-from-policy-output.precreate-sub-intf-num`' />
+ </set>
+ <switch test='`$total-subs > ( $tmp.vlan-vnics.vlan-vnic_length * $get-data-from-policy-output.max-num-sub-intf )`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='total-subs' value='`$tmp.vlan-vnics.vlan-vnic_length * $get-data-from-policy-output.max-num-sub-intf`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='cur-tag-id' value='`$get-data-from-policy-output.vlan-tag-start + $get-data-from-policy-output.vlan-tag-offset`' />
+ </set>
+ <set>
+ <parameter name='sub-index' value='0' />
+ <parameter name='vnic-index' value='0' />
+ </set>
+ <while test='`$total-subs > 0`'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id'
+ value='`$cur-tag-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length'
+ value='`$sub-index + 1`' />
+ </set>
+ <set>
+ <parameter name='cur-tag-id' value='`$cur-tag-id + 1`' />
+ </set>
+ <set>
+ <parameter name='vnic-index' value='`$vnic-index + 1`' />
+ </set>
+ <switch test='`$vnic-index == $tmp.vlan-vnics.vlan-vnic_length`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnic-index' value='0' />
+ </set>
+ <set>
+ <parameter name='sub-index' value='`$sub-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='total-subs' value='`$total-subs - 1`' />
+ </set>
+ </block>
+ </while>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $db.group-uuids[$group-index].network-collection-function
+ AND instance-group.instance-group-type = 'L3-NETWORK'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].network-collection-function
+ + ' and instance-group-type L3-NETWORK'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error getting AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].network-collection-function
+ + ' and instance-group-type L3-NETWORK'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='found-instance-group' value='false' />
+ </set>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='aai-ig-index' value='`$ig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$found-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-instance-group-id' value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id'
+ value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ </set>
+ <set>
+ <parameter name='network-instance-group-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$network-instance-group-id
+== $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-instance-group-index' value='`$nig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-instance-group-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network instance group ID '
+ + $network-instance-group-id
+ + ' in network-instance-groups'`" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-index' value='-1' />
+ <parameter name='unassigned-network-index' value='-1' />
+ </set>
+ <for index='n-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network_length`' >
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id
+ == $service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$n-index].vlan-tag-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-index' value='`$n-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$unassigned-network-index`">
+ <outcome value='-1'>
+ <switch test='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$n-index].network-status`'>
+ <outcome value='unassigned'>
+ <set>
+ <parameter name='unassigned-network-index' value='`$n-index`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-index`'>
+ <outcome value='-1'>
+ <switch test='`$unassigned-network-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="L3-network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].vlan-tag-id'
+ value='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id`' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].network-status'
+ value='assigned' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$network-index].network-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for index='vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <for index='n-index' start='0' end='`$service-data.networks.network_length`' >
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id
+ == $service-data.networks.network[$n-index].network-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-name'
+ value='`$service-data.networks.network[$n-index].network-data.network-topology.network-topology-identifier-structure.network-name`' />
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-role'
+ value='`$service-data.networks.network[$n-index].network-data.network-topology.network-topology-identifier-structure.network-role`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to find a network name for network id '
+ + $service-data.networks.network[$n-index].network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-collection' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$idx].network-instance-group-function
+ == $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-collection' value='true' />
+ </set>
+ <set>
+ <parameter name='vnc-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-collection`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find vnf-network-collection for network-instance-group-function '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$idx].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='nig-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network-instance-group for network-instance-group-id '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <switch test='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv4-address`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='VIP' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vt-ip.ip-version'
+ value='ipv4' />
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[0].vnic-sub-interface.sub-interface-network-data[0].network-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value='2' />
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='plan-1' />
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value='vm-type-1|zmtn6nf-code-16code-1001|network-role-1|subnet-role-1|FIXED|4|1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-type' value='FIXED' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-prefix' value="`'34.52.87.1' + $counter`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-version' value='4' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv4-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vlan-vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].floating-ips.floating-ip-v4'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv6-address`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='VIP' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vt-ip.ip-version'
+ value='ipv6' />
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[0].vnic-sub-interface.sub-interface-network-data[0].network-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value='2' />
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='plan-1' />
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='6' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value='vm-type-1|zmtn6nf-code-16code-1001|network-role-1|subnet-role-1|FIXED|4|1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-type' value='FIXED' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-prefix' value="`'cafe:1111' + $counter`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-version' value='6' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv6-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vlan-vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].floating-ips.floating-ip-v6'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.'
+ value='`$tmp.vlan-vnics.`' />
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_auto-ip-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_auto-ip-assignment.xml new file mode 100644 index 0000000..77fdb44 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_auto-ip-assignment.xml @@ -0,0 +1,1593 @@ +<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='auto-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <switch test='`$auto-ip-assignment-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.aic-cloud-region is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.vf-module.model-customization-uuid`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.vf-module.model-customization-uuid is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.vf-module-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.vf-module-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.service-instance-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.service-instance-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $auto-ip-assignment-input.vf-module.model-customization-uuid'
+ pfx='db1.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vnf-topology-operation-input.vnf-request-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $auto-ip-assignment-input.vf-module.model-customization-uuid
+ AND vm_count > 0'
+ pfx='db1.vf-module-to-vfc-mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $auto-ip-assignment-input.aic-cloud-region AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value = '0' />
+ <parameter name='query-aai-l3-network-by-network-role-output.' value = '' />
+ </set>
+ <set>
+ <parameter name='qridx' value = '0' />
+ </set>
+ <set>
+ <parameter name='pidx' value = '0' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$db1.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vm-type-loop' value = 'START' />
+ <parameter name='tmp.vm-type' value = '`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.' value = '' />
+ </set>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping.' value = '' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db1.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid
+ AND (ipv4_count > 0 OR ipv6_count > 0 OR ipv4_floating_count > 0 OR ipv6_floating_count > 0)'
+ pfx='db1.vfc-to-network-role-mapping[]'>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <for index='network-role-index' start='0' end='`$db1.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-loop' value = 'START' />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'false' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role-tag' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role-tag`' />
+ </set>
+ <block atomic='true'>
+ <block>
+ <for index='q' start='0' end='`$tmp.network-role-query-results_length`' >
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <switch test='`$tmp.qresult.network-role == $tmp.db1.network-role`' >
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'true' />
+ </set>
+ <set>
+ <parameter name='query-results-found-index' value = '`$q`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.network-role.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.service-instance-id'
+ value='`$auto-ip-assignment-input.service-instance-id`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+filter options: service-instance-id, aic-cloud-region, null, Other (or any string)
+ - null or Other will filter by aic-cloud-region first, then service-instance-id
+<parameter name='query-aai-l3-network-by-network-role-input.filter'
+ value='service-instance-id' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='query-aai-l3-network-by-network-role' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while querying AAI to retrieve l3-network by network-role: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.`' />
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.network-role-tag'
+ value='`$tmp.db1.network-role-tag`' />
+ <!--
+<parameter name='tmp.network-role-query-results[$qridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' /><parameter name='tmp.network-role-query-results[$qridx].network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='query-aai-l3-network-by-network-role-output.l3-network.' />
+ </set>
+ <set>
+ <parameter name='qridx' value='`$qridx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='`$qridx`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='tmp.network-role-query-results[$query-results-found-index].l3-network.' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for index='vm-type-index' start='0' end='`$db1.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vm-type-floating-loop' value = 'START' />
+ <parameter name='tmp.vm-type' value = '`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping.' value = '' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db1.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid
+ AND (ipv4_count > 0 OR ipv6_count > 0 OR ipv4_floating_count > 0 OR ipv6_floating_count > 0)'
+ pfx='db1.vfc-to-network-role-mapping[]'>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '' />
+ </set>
+ <for index='network-role-index' start='0' end='`$db1.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-loop' value = 'START' />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'false' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ </set>
+ <block atomic="true">
+ <block>
+ <for index='q' start='0' end='`$tmp.network-role-query-results_length`' >
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <switch test='`$tmp.qresult.network-role == $tmp.db1.network-role`' >
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'true' />
+ </set>
+ <set>
+ <parameter name='query-results-found-index' value = '`$q`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.network-role.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.service-instance-id'
+ value='`$auto-ip-assignment-input.service-instance-id`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+filter options: service-instance-id, aic-cloud-region, null, Other (or any string)
+ - null or Other will filter by aic-cloud-region first, then service-instance-id
+<parameter name='query-aai-l3-network-by-network-role-input.filter'
+ value='service-instance-id' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='query-aai-l3-network-by-network-role' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while querying AAI to retrieve l3-network by network-role: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.`' />
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.network-role-tag'
+ value='`$tmp.db1.network-role-tag`' />
+ <!--
+<parameter name='tmp.network-role-query-results[$qridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' /><parameter name='tmp.network-role-query-results[$qridx].network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='query-aai-l3-network-by-network-role-output.l3-network.' />
+ </set>
+ <set>
+ <parameter name='qridx' value='`$qridx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='`$qridx`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq < 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='tmp.network-role-query-results[$query-results-found-index].l3-network.' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-floating-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='VIP' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].group-number'
+ value='1' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].group-number + '|0001'`" />
+ <!-- rdn|data|static|FIXED|4|1|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-floating-count > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='VIP' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].group-number'
+ value='1' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].group-number + '|0001'`" />
+ <!-- rdn|data|static|FIXED|4|1|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <switch test='`$eipam-ip-block.plans_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$auto-ip-assignment-input.service-type`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.service-information.service-type' value='NA' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while obtaining ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml new file mode 100644 index 0000000..9417333 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml @@ -0,0 +1,266 @@ +<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='bbs-access-connectivity-network-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call> + <set> + <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' /> + <parameter name='prop.bbs.HsiPackage' value='50M' /> + <parameter name='prop.bbs.HsiType' value='IPoE' /> + </set> + <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> + <for index='idx' start='0' end='`$network-input-parameters.param_length`' > + <block> + <switch test="`$network-input-parameters.param[$idx].name == 'remote_id'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.remote_id' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ONTSN'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ONTSN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'CVLAN'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.CVLAN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'SVLAN'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.SVLAN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="put"/> + <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'> + <switch test='`$token-result.accessSession`'> + <outcome value='Other'> + <set> + <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error executing queryTokenID,vaule is null" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call queryTokenID" /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-access-connectivity-create.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/> + <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 failed to call createAccessConnectivityService" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error createAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block> + <set> + <parameter name='prop.bbs.serviceID' value="`$service-result.accessE2Eservice.serviceID`"/> + </set> + </block> + </outcome> + </switch> + </outcome> + </execute> + <block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.random-data"/> + <outcome value='success'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="ctx_memory_result_key" value="prop.random-data-list"/> + <parameter name="original_string" value="`$prop.random-data`"/> + <parameter name="regex" value="-"/> + <outcome value='success'></outcome> + </execute> + </outcome> + </execute> + <set> + <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/> + <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" > + <parameter name= "vnf-id" value = "`$vnf-id`"/> + <parameter name= "vnf-name" value = "`$vnf-name`"/> + <parameter name= "vnf-type" value = "AccessConnectivity"/> + <parameter name= "service-id" value = "`$network-topology-operation-input.service-information.service-id`"/> + <parameter name= "prov-status" value = "ACTIVE"/> + <parameter name= "orchestration-status" value = "Active"/> + <parameter name= "is-closed-loop-disabled" value = "false" /> + <parameter name= "model-invariant-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`"/> + <parameter name= "model-version-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-uuid`"/> + <parameter name= "model-customization-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save generic-vnf" /> + </return> + </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="generic-vnf instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data" + > + <parameter name="metadata.metadatum[0].metaname" value="remote-id" /> + <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.remote_id`" /> + <parameter name="metadata.metadatum[1].metaname" value="controller-service-id" /> + <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.serviceID`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </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="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </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="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + </block> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..75d15b5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml @@ -0,0 +1,171 @@ +<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='bbs-access-connectivity-network-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' />
+ <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' />
+ </set>
+ <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 + '/bbs-token-template.json'`"/>
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call queryTokenID" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$token-result.accessSession`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing queryTokenID,vaule is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for index='idx' start='0' end='`$network-input-parameters.param_length`' >
+ <switch test="`$network-input-parameters.param[$idx].name == 'serviceID'`">
+ <outcome value='true'>
+ <switch test='`$network-input-parameters.param[$idx].value`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.serviceID' value='`$network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="$network-input-parameters.param[$idx].name +' value is null, please check it.'" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/DeactivateOnt?serviceID='+$prop.bbs.serviceID`" />
+ <parameter name="httpMethod" value="get"/>
+ <parameter name="contentType" value="application/x-www-form-urlencoded"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/>
+ <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 failed to call deleteAccessConnectivityService" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error deleteAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='AccessConnectivity'>
+ <set>
+ <parameter name='prop.bbs.accessConnectivityVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.accessConnectivityVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml new file mode 100644 index 0000000..2ba5835 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml @@ -0,0 +1,288 @@ +<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='bbs-access-connectivity-vnf-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call> + <set> + <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' /> + <parameter name='prop.bbs.HsiPackage' value='50M' /> + <parameter name='prop.bbs.HsiType' value='IPoE' /> + </set> + <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> + <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' > + <block> + <switch test="`$vnf-input-parameters.param[$idx].name == 'remote_id'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.remote_id' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$vnf-input-parameters.param[$idx].name == 'ONTSN'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ONTSN' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$vnf-input-parameters.param[$idx].name == 'CVLAN'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.CVLAN' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$vnf-input-parameters.param[$idx].name == 'SVLAN'`"> + <outcome value='true'> + <switch test='`$vnf-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.SVLAN' value='`$vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="put"/> + <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"/> + <!--<parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>--> + <outcome value='success'> + <switch test='`$token-result.accessSession`'> + <outcome value='Other'> + <set> + <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error executing queryTokenID,vaule is null" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call queryTokenID" /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-access-connectivity-create.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/> + <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="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" />--> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call createAccessConnectivityService" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error createAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block> + <set> + <parameter name='prop.bbs.serviceID' value="`$service-result.accessE2Eservice.serviceID`"/> + </set> + </block> + </outcome> + </switch> + </outcome> + </execute> + <block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.random-data"/> + <outcome value='success'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="ctx_memory_result_key" value="prop.random-data-list"/> + <parameter name="original_string" value="`$prop.random-data`"/> + <parameter name="regex" value="-"/> + <outcome value='success'></outcome> + </execute> + </outcome> + </execute> + <set> + <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/> + <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/> + <!--<set>--> + <!--<parameter name='vnf-id' value="123456789"/>--> + <!--<parameter name='vnf-name' value="vnf_name"/>--> + </set> + <record plugin='org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder'> + <parameter name='logger' value='message-log'/> + <parameter name='field1' value='`$vnf-id`'/> + <parameter name='field2' value='`$vnf-name`'/> + <!--<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">--> + <!-- <parameter name="file" value="/root/logx.txt" />--> + <!-- <parameter name="field1" value="deleteAccessConnectivityService success!" />--> + <!-- <parameter name="field2" value='`$topology.networks.network[0].network-types`' />--> + </record> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" > + <parameter name= "vnf-id" value = "`$vnf-id`"/> + <parameter name= "vnf-name" value = "`$vnf-name`"/> + <parameter name= "vnf-type" value = "AccessConnectivity"/> + <parameter name= "service-id" value = "`$vnf-topology-operation-input.service-information.service-id`"/> + <parameter name= "prov-status" value = "ACTIVE"/> + <parameter name= "orchestration-status" value = "Active"/> + <parameter name= "is-closed-loop-disabled" value = "false" /> + <parameter name= "model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/> + <parameter name= "model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/> + <parameter name= "model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save generic-vnf" /> + </return> + </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="generic-vnf instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata" + key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data" + > + <parameter name="metadata.metadatum[0].metaname" value="remote-id" /> + <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.remote_id`" /> + <parameter name="metadata.metadatum[1].metaname" value="controller-service-id" /> + <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.serviceID`" /> + <parameter name="metadata.metadatum[2].metaname" value="cvlan" /> + <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.CVLAN`" /> + <parameter name="metadata.metadatum[3].metaname" value="svlan" /> + <parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.SVLAN`" /> + <parameter name="metadata.metadatum[4].metaname" value="expected-ont-id" /> + <parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.ONTSN`" /> + <!--<parameter name="metadata.metadatum[5].metaname" value="rgw-mac-address" />--> + <!--<parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.mac`" />--> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </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="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" + key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </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="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + </block> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..3b98365 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml @@ -0,0 +1,225 @@ +<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='bbs-access-connectivity-vnf-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' />
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ </set>
+ <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 + '/bbs-token-template.json'`"/>
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call queryTokenID" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$token-result.accessSession`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing queryTokenID,vaule is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'serviceID'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.serviceID' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="$vnf-input-parameters.param[$idx].name +' value is null, please check it.'" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/DeactivateOnt?serviceID='+$prop.bbs.serviceID`" />
+ <parameter name="httpMethod" value="get"/>
+ <parameter name="contentType" value="application/x-www-form-urlencoded"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/>
+ <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 failed to call deleteAccessConnectivityService" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error deleteAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='AccessConnectivity'>
+ <set>
+ <parameter name='prop.bbs.accessConnectivityVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for silentFailure='true' index='rix' start='0' end="`$aai.service-instance.metadata.metadatum_length`" >
+ <switch test='`$aai.service-instance.metadata.metadatum[$rix].metaname`'>
+ <outcome value='remote-id'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='controller-service-id'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='cvlan'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='svlan'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='expected-ont-id'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.accessConnectivityVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-change-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-change-huawei.xml new file mode 100644 index 0000000..37bb23d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-change-huawei.xml @@ -0,0 +1,42 @@ +<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='bbs-internet-profile-network-topology-operation-change-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync' ></call> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ChangeInternetProfileInstance'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call ChangeInternetProfileInstance" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error ChangeInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block></block> + </outcome> + </switch> + </outcome> + </execute> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-common-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-common-huawei.xml new file mode 100644 index 0000000..d41dfd5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-common-huawei.xml @@ -0,0 +1,166 @@ +<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='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call> + <set> + <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='http://172.30.0.121:5000' /> + <parameter name='prop.bbs.service_id' value='`$network-topology-operation-input.service-information.service-id`' /> + </set> + <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> + <for index='idx' start='0' end='`$network-input-parameters.param_length`' > + <block> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_remote_id'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.remote_id' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ont_sn'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ont_sn' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_service_type'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.service_type' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_rg_mac_addr'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.mac' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_upstream_speed'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.up_speed' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ip_downstream_speed'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.down_speed' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 's_vlan'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.s_vlan' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'c_vlan'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-input-parameters.param[$idx].name +' value is null, please check it.'`" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.c_vlan' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-create-huawei.xml new file mode 100644 index 0000000..2d88b3f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-create-huawei.xml @@ -0,0 +1,146 @@ +<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='bbs-internet-profile-network-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync' ></call> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" /> + <parameter name="contentType" value="application/json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="service-result"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error failed to call CreateInternetProfileInstance" /> + </return> + </outcome> + <outcome value='success'> + <switch test="`$service-result.errors.error[0].error-message`"> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error CreateInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block></block> + </outcome> + </switch> + </outcome> + </execute> + <block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.random-data"/> + <outcome value='success'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="ctx_memory_result_key" value="prop.random-data-list"/> + <parameter name="original_string" value="`$prop.random-data`"/> + <parameter name="regex" value="-"/> + <outcome value='success'></outcome> + </execute> + </outcome> + </execute> + <set> + <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/> + <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" > + <parameter name= "vnf-id" value = "`$vnf-id`"/> + <parameter name= "vnf-name" value = "`$vnf-name`"/> + <parameter name= "vnf-type" value = "InternetProfile"/> + <parameter name= "service-id" value = "`$network-topology-operation-input.service-information.service-id`"/> + <parameter name= "prov-status" value = "ACTIVE"/> + <parameter name= "orchestration-status" value = "Active"/> + <parameter name= "is-closed-loop-disabled" value = "false" /> + <parameter name= "model-invariant-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`"/> + <parameter name= "model-version-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-uuid`"/> + <parameter name= "model-customization-id" value = "`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save generic-vnf" /> + </return> + </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="generic-vnf instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="metadata.metadatum[0].metaname" value="service-type" /> + <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.service_type`" /> + <parameter name="metadata.metadatum[1].metaname" value="up-speed" /> + <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.up_speed`" /> + <parameter name="metadata.metadatum[2].metaname" value="down-speed" /> + <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.down_speed`" /> + <parameter name="metadata.metadatum[3].metaname" value="cvlan" /> + <parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.c_vlan`" /> + <parameter name="metadata.metadatum[4].metaname" value="svlan" /> + <parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.s_vlan`" /> + <parameter name="metadata.metadatum[5].metaname" value="expected-ont-id" /> + <parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.ont_sn`" /> + <parameter name="metadata.metadatum[6].metaname" value="rgw-mac-address" /> + <parameter name="metadata.metadatum[6].metaval" value="`$prop.bbs.mac`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </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="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" + key="service-instance.service-instance-id = $network-topology-operation-input.service-information.service-id + AND customer.global-customer-id = $network-topology-operation-input.service-information.global-customer-id + AND service-subscription.service-type = $network-topology-operation-input.service-information.subscription-service-type + AND service-instance.service-instance-id = $network-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure calling AAI to save metadatum" /> + </return> + </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="metadatum instance does not exist in AAI" /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + </block> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..ea6dde9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-network-topology-operation-delete-huawei.xml @@ -0,0 +1,84 @@ +<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='bbs-internet-profile-network-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/DeleteInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call DeleteInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error DeleteInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='InternetProfile'>
+ <set>
+ <parameter name='prop.bbs.internetProfileVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.internetProfileVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml new file mode 100644 index 0000000..4aa36b9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml @@ -0,0 +1,44 @@ +<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='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ChangeInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call ChangeInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.status`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error ChangeInternetProfileInstance return: '+$service-result.status`" />
+ </return>
+ </outcome>
+ <outcome value='ok'>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync'></call>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync'></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml new file mode 100644 index 0000000..4f67b46 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml @@ -0,0 +1,76 @@ +<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='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='http://172.30.0.121:5000' />
+ <parameter name='prop.bbs.service_id' value='`$vnf-topology-operation-input.service-information.service-id`' />
+ </set>
+ <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>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <block>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_service_type'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.service_type' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_upstream_speed'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.up_speed' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_downstream_speed'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.down_speed' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml new file mode 100644 index 0000000..fb07393 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml @@ -0,0 +1,150 @@ +<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='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <!--<parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call CreateInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.status`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error CreateInternetProfileInstance return: '+$service-result.status`" />
+ </return>
+ </outcome>
+ <outcome value='ok'>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.random-data"/>
+ <outcome value='success'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="ctx_memory_result_key" value="prop.random-data-list"/>
+ <parameter name="original_string" value="`$prop.random-data`"/>
+ <parameter name="regex" value="-"/>
+ <outcome value='success'></outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/>
+ <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/>
+ <!--<set>-->
+ <!--<parameter name='vnf-id' value="123456789"/>-->
+ <!--<parameter name='vnf-name' value="vnf_name"/>-->
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" >
+ <parameter name= "vnf-id" value = "`$vnf-id`"/>
+ <parameter name= "vnf-name" value = "`$vnf-name`"/>
+ <parameter name= "vnf-type" value = "InternetProfile"/>
+ <parameter name= "service-id" value = "`$vnf-topology-operation-input.service-information.service-id`"/>
+ <parameter name= "prov-status" value = "ACTIVE"/>
+ <parameter name= "orchestration-status" value = "Active"/>
+ <parameter name= "is-closed-loop-disabled" value = "false" />
+ <parameter name= "model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/>
+ <parameter name= "model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/>
+ <parameter name= "model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save generic-vnf" />
+ </return>
+ </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="generic-vnf instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="metadata.metadatum[0].metaname" value="service-type" />
+ <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.service_type`" />
+ <parameter name="metadata.metadatum[1].metaname" value="up-speed" />
+ <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.up_speed`" />
+ <parameter name="metadata.metadatum[2].metaname" value="down-speed" />
+ <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.down_speed`" />
+ <!--<parameter name="metadata.metadatum[3].metaname" value="cvlan" />-->
+ <!--<parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.c_vlan`" />-->
+ <!--<parameter name="metadata.metadatum[4].metaname" value="svlan" />-->
+ <!--<parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.s_vlan`" />-->
+ <!--<parameter name="metadata.metadatum[5].metaname" value="expected-ont-id" />-->
+ <!--<parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.ont_sn`" />-->
+ <!--<parameter name="metadata.metadatum[6].metaname" value="rgw-mac-address" />-->
+ <!--<parameter name="metadata.metadatum[6].metaval" value="`$prop.bbs.mac`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </return>
+ </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="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </return>
+ </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="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml new file mode 100644 index 0000000..cebb55f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml @@ -0,0 +1,143 @@ +<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='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='delete'>
+ <block atomic='true'>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/DeleteInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call DeleteInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.status`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error DeleteInternetProfileInstance return: '+$service-result.status`" />
+ </return>
+ </outcome>
+ <outcome value='ok'>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='InternetProfile'>
+ <set>
+ <parameter name='prop.bbs.internetProfileVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for silentFailure='true' index='rix' start='0' end="`$aai.service-instance.metadata.metadatum_length`" >
+ <switch test='`$aai.service-instance.metadata.metadatum[$rix].metaname`'>
+ <outcome value='service-type'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='up-speed'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ <outcome value='down-speed'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id AND
+ metadatum.metaname = $aai.service-instance.metadata.metadatum[$rix].metaname" ></delete>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.internetProfileVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ </delete>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml new file mode 100644 index 0000000..5e1fbe7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml @@ -0,0 +1,333 @@ +<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='brg-topology-operation-activate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<!--
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+-->
+
+</set><block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs' pfx='tmp.vnfdata' >
+</get-resource><for index='vnfidx' start='0' end='`$tmp.vnfdata.vnfs.vnf-list_length`' >
+
+
+<switch test='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id == $tmp.ar.parent-service-instance-id`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.ar.brg-vnf-id'
+ value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id`' />
+
+
+
+</set></block></outcome></switch></for></block><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $brg-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></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="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></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="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" >
+</get-resource><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+</set><set>
+<parameter name='tmp.ar.consuming-service-instance-id' value='`$brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+</set><call module='GENERIC-RESOURCE-API' rpc='get-tunnelxconn-ar' mode='sync' >
+</call><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-lan-ip`' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip`"/>
+</execute><set>
+<parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip` " />
+<parameter name='tmp.tunnel-dest-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip` " />
+<parameter name='tmp.tunnel-src-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip` " />
+<parameter name='tmp.tunnel-vni' value="`$brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.vni` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.vxlan-tunnel.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up vxlan tunnel" />
+</return></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="Error setting up vxlan tunnel" />
+</return></outcome></execute><set>
+<parameter name='tmp.bridge-domain' value="bridge-domain-10" />
+<parameter name='tmp.split-horizon-group' value="2" /></set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.bridge-domain.templatefile`" />
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up bridge domain" />
+</return></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="Error setting up bridge domain" />
+</return></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+</set><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip`' />
+</set><set>
+<parameter name='tmp.search.consuming-service-instance-id' value='`$brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+ </set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='preload-vnfs' pfx='tmp.preloadvnfdata' >
+<!--
+tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[1].preload-data[0].vnf-topology-information.vnf-parameters[16].vnf-parameter-value = 10.0.101.30
+--><outcome value='success'>
+<block>
+<set>
+<parameter name='tmp.brg-match-vnf-name' value="`'VGW2BRG-'+ $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.brg-wan-mac-address`" />
+
+</set><for index='vnfidx' start='0' end='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list_length`' >
+
+
+
+<block>
+<switch test='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].vnf-name == $tmp.brg-match-vnf-name`'>
+
+
+<outcome value='true'>
+<for index='paramidx' start='0' end='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters_length`' >
+
+
+<switch test="`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == 'vgw_private_ip_1'`" >
+
+
+<outcome value='true'>
+<set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip'
+ value="`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`" />
+
+</set></outcome></switch></for></outcome></switch></block></for></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting GENERIC-RESOURCE-API:services" />
+</return></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="Error getting GENERIC-RESOURCE-API:services" />
+</return></outcome></get-resource><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip`"/>
+</execute><set>
+<parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip` " />
+<parameter name='tmp.tunnel-dest-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip` " />
+<parameter name='tmp.tunnel-src-ip' value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-ip` " />
+<parameter name='tmp.tunnel-vni' value="`$brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.vni` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-api.service-information`"/>
+ <parameter name="outputPath" value="tmp.vnf-api-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.brg-vnf-id`"/>
+
+ <!--
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`"/>
+ -->
+ <!--
+ <parameter name="replacement" value="`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`"/>
+-->
+<!--
+brg-ar.allotted-resource-data.brg-topology.brg-assignments
+--></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-api-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="service-data" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-service-data' value='$service-data.' />
+</set><switch test='`$service-data.service-data_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.service-data.' value='$service-data.service-data[0].' />
+</set><switch test='`$tmp.service-data.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='tmp.service-data.service-information.service-instance-id' value='`$brg-topology-operation-input.service-information.service-instance-id`' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.services`"/>
+ <parameter name="outputPath" value="tmp.services-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-data.service-information.service-instance-id`"/>
+<!-- tmp.service-data.service-information.service-instance-id
+brg-topology-operation-input.allotted-resource-information.parent-service-instance-id
+brg-topology-operation-input.service-information.service-instance-id
+
+--></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.services.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.services-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></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="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-data.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+ <!--
+brg-topology-operation-input.allotted-resource-information.parent-service-instance-id
+
+ brg-topology-operation-input.service-information.service-instance-id
+ -->
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml new file mode 100644 index 0000000..21f0efb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml @@ -0,0 +1,227 @@ +<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='brg-topology-operation-assign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='brg-allotted-resources/brg-allotted-resource/$brg-topology-operation-input.allotted-resource-information.allotted-resource-id/' pfx='mdsal-ar' >
+<outcome value='Other'>
+<block atomic="true">
+<set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set><set>
+<parameter name='brg-ar-identifiers.consuming-service-instance-id' value="`$brg-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='brg-ar-identifiers.parent-service-instance-id' value="`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='brg-ar-identifiers.allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='brg-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.brg-topology.onap-model-information.'
+value="`$brg-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+
+
+</set><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+<outcome value=''>
+<set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+
+
+</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+<outcome value=''>
+<set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+
+
+</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+
+
+</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
+<outcome value='Y'>
+<block atomic="true">
+<switch test='`$ar-model.naming-policy`'>
+<outcome value='oam_network_policy'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='brg-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='brg-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.'
+value="`$brg-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='brg-ar-assignments.vbrg-wan-ip' value='127.0.0.1'/>
+</set><set>
+<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.'
+value="`$brg-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set><break></break></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
+<outcome value='false'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+</set></block></outcome></switch></block></outcome></switch><set>
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $brg-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></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="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+
+<outcome value='success'>
+<block></block></outcome><outcome value='failure'>
+<block></block></outcome><outcome value='not-found'>
+<block></block></outcome></execute></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></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="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></outcome></get-resource></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-create.xml new file mode 100644 index 0000000..54c99cb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-create.xml @@ -0,0 +1,100 @@ +<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='brg-topology-operation-create' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='PendingCreate'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></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="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml new file mode 100644 index 0000000..0fda417 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml @@ -0,0 +1,275 @@ +<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='brg-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/' + $tmp.ar.allotted-resource-id + '/allotted-resource-data/brg-topology/'` " />
+ </set>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-brg-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+ </set>
+ <switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+ <parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+ <parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND service-instance.service-instance-id = $brg-topology-operation-input.service-information.service-instance-id AND allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for brg-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.consuming-service-instance-id' value='`$allotted-resource-data.brg-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-tunnelxconn-ar' mode='sync' ></call>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-lan-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-lan-ip`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vbrg-wan-ip`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.vgmux-lan-ip` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error deleting vxlan tunnel" />
+ </return>
+ </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="Error deleting vxlan tunnel" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+ </set>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip' value='`$tmp.tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='services' pfx='tmp.servicedata' >
+ <outcome value='success'>
+ <for index='serviceidx' start='0' end='`$tmp.servicedata.services.service_length`' >
+ <switch test='`$tmp.servicedata.services.service[$serviceidx].service-instance-id == $tmp.search.consuming-service-instance-id`'>
+ <outcome value='true'>
+ <for index='vnfidx' start='0' end='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf_length`' >
+ <for index='vfmoduleidx' start='0' end='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module_length`' >
+ <for index='paramidx' start='0' end='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module[$vfmoduleidx].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module[$vfmoduleidx].vf-module-data.vf-module-topology.vf-module-parameters.param[$paramidx].name == vgw_private_ip_1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip' value='`$tmp.servicedata.services.service[$serviceidx].service-data.vnfs.vnf[$vnfidx].vnf-data.vf-modules.vf-module[$vfmoduleidx].vf-module-data.vf-module-topology.vf-module-parameters.param[$paramidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting GENERIC-RESOURCE-API:services" />
+ </return>
+ </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="Error getting GENERIC-RESOURCE-API:services" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$brg-ar.allotted-resource-data.brg-topology.brg-assignments.vg-mgmt-ip`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`'vxlanTun' + $brg-ar.allotted-resource-data.brg-topology.brg-assignments.vgmux-bearer-ip` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error setting up vxlan tunnel" />
+ </return>
+ </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="Error setting up vxlan tunnel" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $brg-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml new file mode 100644 index 0000000..40effac --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml @@ -0,0 +1,105 @@ +<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='brg-topology-operation-delete' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><set>
+<parameter name='brg-ar-assignments.' value="" />
+
+
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></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="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml new file mode 100644 index 0000000..0a01dd9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml @@ -0,0 +1,81 @@ +<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='brg-topology-operation-unassign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-brg-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='brg-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
+<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-allotted-resource" />
+</return></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="Error updating md-sal for brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation.xml new file mode 100644 index 0000000..90a9389 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_brg-topology-operation.xml @@ -0,0 +1,26 @@ +<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='brg-topology-operation' mode='sync'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-brg-input' mode='sync' >
+</call><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-assign' mode='sync' >
+</call></block></outcome><outcome value='create'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-create' mode='sync' >
+</call></block></outcome><outcome value='activate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-activate' mode='sync' >
+</call></block></outcome><outcome value='deactivate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-deactivate' mode='sync' >
+</call></block></outcome><outcome value='delete'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-delete' mode='sync' >
+</call></block></outcome><outcome value='unassign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-unassign' mode='sync' >
+</call></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><set>
+<parameter name="ack-final" value="Y"/></set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml new file mode 100644 index 0000000..7376942 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml @@ -0,0 +1,94 @@ +<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='connection-attachment-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-connection-attachment-input' mode='sync' ></call>
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='delete'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml new file mode 100755 index 0000000..06756c6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml @@ -0,0 +1,341 @@ +<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='contrail-route-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + ', expecting Created.'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ </set>
+ </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="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " />
+ </set>
+ <set>
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+ local-only="false"
+ pfx="aai.dest-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="related-link"
+key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
+local-only="true"
+pfx="tmp.AnAI-src">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </return>
+ </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="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="related-link"
+key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+local-only="true"
+pfx="tmp.AnAI-dest">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </return>
+ </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="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy:relationship-list"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`tmp.AnAI-src.related-link`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`tmp.AnAI-dest.related-link`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </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="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml new file mode 100755 index 0000000..444b50d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml @@ -0,0 +1,981 @@ +<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='contrail-route-topology-operation-assign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.contrail-applied-service-instance-id' value='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`' /> + <parameter name='tmp.ar.allotted-resource-type' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network`"/> + <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.vnf`"/> + <parameter name="outputPath" value="tmp.ar-contrailappliedsvc-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.contrail-applied-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.parent-ar-url`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: Existing contrail route allotted resource" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-identifiers.consuming-service-instance-id' value="`$contrail-route-topology-operation-input.service-information.service-instance-id` " /> + <parameter name='ar-identifiers.parent-service-instance-id' value="`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id` " /> + <parameter name='ar-identifiers.allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + </set> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.' +value="`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.`" /> + </set> + <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'> + <outcome value=''> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-invariant-uuid' +value="`$ar-model.invariant-uuid`" /> + </set> + </outcome> + </switch> + <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'> + <outcome value=''> + <set> + <parameter name='sar.allotted-resource-data.contrail-route-topology.onap-model-information.model-uuid' +value="`$ar-model.uuid`" /> + </set> + </outcome> + </switch> + <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-version'> + <outcome value=''> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-version' +value="`$ar-model.version`" /> + </set> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='source-network-found' value='false' /> + </set> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="tmp.ar-name="/> + <parameter name="field3" value="`$tmp.ar-name`"/> + <parameter name="field4" value="service-data-network-id" /> + <parameter name="field5" value="`$service-data.networks.network[$nidx].network-id`" /> + <parameter name="field6" value="contrail-route-input-network-id" /> + <parameter name="field7" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`" /> + <parameter name="field8" value="`$nidx`" /> + </record> + <switch test="`$service-data.networks.network[$nidx].network-id == $contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' /> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + <parameter name='source-network-found' value='true' /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="tenant" + key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND + cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND + tenant.tenant-id = $tmp.ar.tenant-id" + pfx='aai.tenant' local-only='false' > + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' /> + </set> + </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="Tenant not found in AAI" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Tenant not found in AAI" /> + </return> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </block> + </for> + <switch test="`$source-network-found`"> + <outcome value='false'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$ar-model.ecomp-generated-naming`'> + <outcome value='Y'> + <block atomic="true"> + <switch test='`$ar-model.naming-policy`'> + <outcome value='oam_network_policy'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantName"/> + <parameter name="replacement" value="`$tmp.ar.tenant-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$CloudRegionID"/> + <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/> + </execute> + <set> + <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' /> + <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' /> + <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' /> + <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" /> + <parameter name='generate-unique-name-input.index-length' value='2' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="tmp.ar-name="/> + <parameter name="field3" value="`$tmp.ar-name`"/> + <parameter name="field4" value="generate-unique-name-input.prefix" /> + <parameter name="field5" value="`$generate-unique-name-input.prefix`" /> + </record> + <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$generate-unique-name-output.error-message`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='tmp.ar-name' value='`$generate-unique-name-output.generated-name`' /> + </set> + </outcome> + </call> + <set> + <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantName"/> + <parameter name="replacement" value="`$tmp.ar.tenant-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$CloudRegionID"/> + <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/> + </execute> + <set> + <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' /> + <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' /> + <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' /> + <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" /> + <parameter name='generate-unique-name-input.index-length' value='2' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="tmp.ar-name="/> + <parameter name="field3" value="`$tmp.ar-name`"/> + <parameter name="field4" value="generate-unique-name-input.prefix" /> + <parameter name="field5" value="`$generate-unique-name-input.prefix`" /> + </record> + <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$generate-unique-name-output.error-message`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='tmp.ar-name' value='`$generate-unique-name-output.generated-name`' /> + </set> + </outcome> + </call> + <set> + <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + </switch> + </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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" /> + </return> + </outcome> + </switch> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.' +value="`$ar-identifiers.`" /> + </set> + <set> + <parameter name='ar-assignments.source-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.` " /> + <parameter name='ar-assignments.dest-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.` " /> + <parameter name='ar-assignments.contrail-applied-service.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.` " /> + </set> + <set> + <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.fq-name`"/> + <parameter name="outputPath" value="tmp.fq-name"/> + <parameter name="target" value="$defaultDomain"/> + <parameter name="replacement" value="default-domain"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.fq-name`"/> + <parameter name="outputPath" value="tmp.fq-name"/> + <parameter name="target" value="$defaultProject"/> + <parameter name="replacement" value="`$tmp.ar.tenant-name`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.fq-name`"/> + <parameter name="outputPath" value="tmp.fq-name"/> + <parameter name="target" value="$sdncNetworkPolicy"/> + <parameter name="replacement" value="`$tmp.ar-name`"/> + </execute> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id`'> + <outcome value=''> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-parentnetwork-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="parent-net" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$parent-net.networks.network_length`'> + <outcome value='1'> + <set> + <parameter name='ar-assignments.dest-network.network-id' value="`$parent-net.networks.network[0].network-id` " /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: Network id not found. Parent Service should only have one network" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: No existing parent netorks" /> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value='Other'> + <set> + <parameter name='ar-assignments.dest-network.network-id' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id` " /> + </set> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-contrailappliedsvc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="vnf" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$vnf.vnfs.vnf_length`'> + <outcome value='1'> + <set> + <parameter name='ar-assignments.contrail-applied-service.vnf-id' value="`$vnf.vnfs.vnf[0].vnf-id` " /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: vnf id not found. Contrail applied service should only have one vnf" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: No existing contrail applied service vnfs" /> + </return> + </block> + </outcome> + </execute> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`'> + <outcome value=''> + <block atomic="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $ar-assignments.contrail-applied-service.vnf-id" + pfx='aai.vnf' local-only='false' > + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Vnf not found in AAI" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error retrieving vnf from AAI" /> + </return> + </outcome> + </get-resource> + <switch test='`$aai.vnf.vf-modules.vf-module_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="VF Module not found in AAI" /> + </return> + </outcome> + <outcome value='Other'> + <for index='idx' start='0' end='`$aai.vnf.vf-modules.vf-module_length`' > + <switch test='`$aai.vnf.vf-modules.vf-module[$idx].contrail-service-instance-fqdn`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <block> + <set> + <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$aai.vnf.vf-modules.vf-module[$idx].contrail-service-instance-fqdn` " /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn` " /> + </set> + </outcome> + </switch> + <switch test='`$ar-assignments.contrail-applied-service.contrail-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error: No vf-module with contrail-service-instance-fqdn found in AAI" /> + </return> + </outcome> + </switch> + <set> + <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " /> + </set> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' +value="`$ar-assignments.`" /> + </set> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'> + <outcome value=''> + <set> + <parameter name='tmp.cidx' value="`0`" /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" /> + </set> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$cidx`' /> + <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' /> + <parameter name='tmp.found-cidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-cidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <set> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="description" value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`" /> + <parameter name="selflink" value="`$tmp.ar.self-link`" /> + <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" /> + <parameter name="model-version-id" value="`$ar-model.uuid`" /> + <parameter name="operational-status" value="null" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </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="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.network-ar-url`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{network-id}"/> + <parameter name="replacement" value="`$ar-assignments.dest-network.network-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="net-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' /> + </set> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' /> + </set> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' /> + </set> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' /> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='failure'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml new file mode 100755 index 0000000..2f3c907 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml @@ -0,0 +1,380 @@ +<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='contrail-route-topology-operation-create' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' /> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="tenant" + key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND + cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND + tenant.tenant-id = $tmp.ar.tenant-id" + pfx='aai.tenant' local-only='false' > + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' /> + </set> + </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="Tenant not found in AAI" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Tenant not found in AAI" /> + </return> + </outcome> + </get-resource> + </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="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="GENERIC-RESOURCE-API.contrail-route-topology-operation-create"/> + <parameter name='field3' value='network-policy' /> + <parameter name='field4' value='create' /> + <parameter name='field5' value='contrailResp' /> + <parameter name='field6' value='default-domain' /> + <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' /> + <parameter name='field8' value='`$tmp.ar.tenant-name`' /> + <parameter name='field9' value='`$ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`' /> + <parameter name='field10' value='$aai.dest-network.contrail-network-fqdn' /> + <parameter name='field11' value='$aai.src-network.contrail-network-fqdn' /> + <parameter name='field12' value='<>' /> + <parameter name='field13' value='$tmp.ar.cloud-region-id' /> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='create' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' /> + <parameter name='default-project' value='`$tmp.ar.tenant-name`' /> + <!-- dummy for dev <parameter name='default-project' value='default-project' /> --> + <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> + <parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' /> + <parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' /> + <parameter name='direction' value='<>' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <switch test='`$contrailResp.resp-code`'> + <outcome value='0'> + <block></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="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </switch> + <set> + <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='policy-manager-create-policy' mode='sync' > + <outcome value='failure'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='delete' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create Policy in Policy Mgr. Rollback failed to delete policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create policy in PolicyMgr. '+ $error-message + 'Contrail network policy rolled back.'`" /> + </return> + </block> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </call> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy" + key="network-policy.network-policy-id = $ar-assignments.contrail-id" > + <!-- Create l3-network object --> + <parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" /> + <parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </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="Failed to save network policy in AAI" /> + </return> + </outcome> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <set> + <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' value='`$ar-assignments.`' /> + </set> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </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="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml new file mode 100755 index 0000000..5fc21d2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml @@ -0,0 +1,309 @@ +<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='contrail-route-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error activating contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + </set> + </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="Error activating contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id" + local-only="false" + pfx="aai.src-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <set> + <parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " /> + </set> + <set> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from source network" /> + </return> + </outcome> + </execute> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id" + local-only="false" + pfx="aai.dest-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /> + </return> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='remove' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' /> + <parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" /> + </return> + </outcome> + </execute> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy:relationship-list" + key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </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="Failed to save network policy in AAI" /> + </return> + </outcome> + </delete> + <set> + <parameter name='ar-assignments.vlan-tag' value="" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </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="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml new file mode 100755 index 0000000..c57b5f9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml @@ -0,0 +1,258 @@ +<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='contrail-route-topology-operation-delete' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='PendingDelete'> + <block></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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + </set> + <set> + <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" /> + </set> + <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' /> + </set> + </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="Error assigning contrail route. Source network not found" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='delete' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' /> + <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to create policy in Contrail" /> + </return> + </outcome> + </execute> + <call module='GENERIC-RESOURCE-API' rpc='policy-manager-delete-policy' mode='sync' > + <outcome value='failure'> + <block atomic="true"></block> + </outcome> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + </call> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="network-policy" + key="network-policy.network-policy-id = $ar-assignments.contrail-id" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to save network policy in AAI" /> + </return> + </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="Failed to save network policy in AAI" /> + </return> + </outcome> + </delete> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="null" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </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="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml new file mode 100755 index 0000000..e4cbfc2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml @@ -0,0 +1,338 @@ +<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='contrail-route-topology-operation-unassign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/contrail-route-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.parent-ar-url`"/> + <parameter name="outputPath" value="tmp.parent-ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network`"/> + <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='bk-cr-ar' value='$mdsal-ar.' /> + </set> + <set> + <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' /> + </set> + <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Contrail Route not found" /> + </return> + </block> + </outcome> + </execute> + <set> + <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /> + <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /> + <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /> + <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " /> + <parameter name='tmp.dest-network-id' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </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="Error updating md-sal for contrail-route-allotted-resource" /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.network-ar-url`"/> + <parameter name="outputPath" value="tmp.network-ar-url"/> + <parameter name="target" value="{network-id}"/> + <parameter name="replacement" value="`$tmp.dest-network-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="net-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='false' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.found-nidx' value='true' /> + <parameter name='tmp.nidx' value='`$nidx`' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-nidx`'> + <outcome value='true'> + <block atomic="true"> + <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' > + <block atomic="true"> + <set> + <parameter name="tmp.newidx" value="`$snidx - 1`"/> + </set> + <set> + <parameter name="$net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.newidx]" value="$net-ar.network-provided-allotted-resources.network-provided-ar-id[$snidx]" /> + </set> + </block> + </for> + <set> + <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length - 1`' /> + </set> + <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length == 0`'> + <outcome value='true'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="p-network-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"></block> + </outcome> + <outcome value='failure'> + <block atomic="true"></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='not-found'> + <block atomic="true"></block> + </outcome> + <outcome value='failure'> + <block atomic="true"></block> + </outcome> + </execute> + <for silentFailure='true' index='snidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <block atomic="true"> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$sdix].allotted-resource-id == $tmp.ar.allotted-resource-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name="tmp.sdidx" value="`$snidx`"/> + </set> + <break/> + </block> + </outcome> + </switch> + </block> + </for> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'> + <outcome value='1'> + <block atomic="true"> + <set> + <parameter name="service-data.consumed-allotted-resources." value=""/> + </set> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="0"/> + </set> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name="tmp.new_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/> + </set> + <for silentFailure='true' index='snidx' start='`$tmp.sdidx + 1`' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <block atomic="true"> + <set> + <parameter name="tmp.newidx" value="`$snidx - 1`"/> + </set> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.newidx]." value="$service-data.consumed-allotted-resources.consumed-allotted-resource[$snidx]." /> + </set> + </block> + </for> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/> + </set> + <set> + <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.new_length]." value=""/> + </set> + </block> + </outcome> + </switch> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $contrail-route-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml new file mode 100755 index 0000000..3b4b87e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml @@ -0,0 +1,56 @@ +<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='contrail-route-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-contrail-route-input' mode='sync' ></call> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-assign' mode='sync' ></call> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-create' mode='sync' ></call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-activate' mode='sync' ></call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-deactivate' mode='sync' ></call> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-delete' mode='sync' ></call> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-unassign' mode='sync' ></call> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-l3-subnet.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-l3-subnet.xml new file mode 100755 index 0000000..c7e3454 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-l3-subnet.xml @@ -0,0 +1,192 @@ +<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='create-l3-subnet' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-idx' value='0' />
+ </set>
+ <switch test='`$v4.entity-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v4.entity-id"/>
+ <parameter name="field5" value="null"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$network-model.ipv4-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv4dhcp-enabled' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv4dhcp-enabled' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$v4.ip-prefix`" />
+ <parameter name="ipVersion" value="4" />
+ <parameter name="subnet" value="`$v4.mask`" />
+ <parameter name="dhcp-enabled" value="`$tmp.ipv4dhcp-enabled`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate ipv4 addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$v4.entity-id`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$v4.ip-prefix`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$v4.mask`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv4-ip-version`' />
+ </set>
+ <switch test='`$network-model.ipv4-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='subnet-idx' value='`$subnet-idx+1`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$v6.entity-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v6.entity-id"/>
+ <parameter name="field5" value="null"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v6.entity-id"/>
+ <parameter name="field5" value="`$v6.entity-id`"/>
+ </record>
+ <switch test='`$network-model.ipv6-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv6dhcp-enabled' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv6dhcp-enabled' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$v6.ip-prefix`" />
+ <parameter name="ipVersion" value="6" />
+ <parameter name="subnet" value="`$v6.mask`" />
+ <parameter name="dhcp-enabled" value="`$tmp.ipv6dhcp-enabled`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate ipv6 addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$v6.entity-id`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$v6.ip-prefix`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$v6.mask`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv6-ip-version`' />
+ </set>
+ <switch test='`$network-model.ipv6-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='subnet-idx' value='`$subnet-idx+1`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml new file mode 100755 index 0000000..f9866fe --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml @@ -0,0 +1,437 @@ +<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='create-route-target-and-vpn-binding' mode='sync'>
+ <block atomic="true">
+ <switch test='`$rt.aic-zone`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.resource`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.resource-value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-vpn-binding`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$rt.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$rt.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$rt.network-id`"/>
+ </execute>
+ <set>
+ <parameter name="get-data-from-policy-input.policy-instance-name" value="`$get-complex-resource-service-model-output.vpn-binding-policy`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' ></call>
+ <set>
+ <parameter name="vpn-binding.vpn-name" value="`$rt.network-name`" />
+ <parameter name="vpn-binding.asn" value="`$get-data-from-policy-output.asn`" />
+ <parameter name="vpn-binding.route-target-role" value="`$get-data-from-policy-output.route-target-role`" />
+ <parameter name="vpn-binding.aic-zone" value="`$rt.aic-zone`" />
+ <parameter name="vpn-binding.route-target-category" value="local" />
+ <parameter name="vpn-binding.resource" value="`$rt.resource`" />
+ <parameter name="vpn-binding.resource-value" value="`$rt.resource-value`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-vpn-binding-id' mode='sync' ></call>
+ <set>
+ <parameter name='vpn-binding.vpn-binding-id' value='`$tmp.return.generate-vpn-binding-id.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{vpn-binding-id}"/>
+ <parameter name="replacement" value="`$vpn-binding.vpn-binding-id`"/>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $vpn-binding.vpn-binding-id" >
+ <parameter name="vpn-id" value="`$vpn-binding.vpn-binding-id`" />
+ <parameter name="vpn-name" value="`$vpn-binding.vpn-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating vpn-binding in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating vpn-binding in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.allocateRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$msRT.responseCode`'>
+ <outcome value='200'></outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Error: calling allocate resource microservice - responseCode: ' + $msRT.responseCode + ' responseMsg: ' + $msRT.responseMessage + ' allocateRouteTargetStatus: ' + $msRT.allocateRouteTargetStatus `"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: calling allocate resource microservice"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="vpn-binding.global-route-target" value="`$msRT.routeTargetID`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save vpn-binding in md-sal" />
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save vpn-binding in md-sal" />
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-target"
+ key="vpn-binding.vpn-binding-id = $vpn-binding.vpn-binding-id
+ AND route-target.global-route-target = $vpn-binding.global-route-target
+ AND route-target.route-target-role = $vpn-binding.route-target-role" >
+ <!-- Create route-target object -->
+ <parameter name="global-route-target" value="`$vpn-binding.global-route-target`" />
+ <parameter name="route-target-role" value="`$vpn-binding.route-target-role`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save route target in AAI"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save route target in AAI"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml new file mode 100644 index 0000000..411cbb3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml @@ -0,0 +1,482 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<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="dci-connects-network-topology-operation-activate" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <block atomic="true">
+ <block atomic="true">
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_description'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.description" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_networkName'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.local_networks.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.local_networks.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.local_networks" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.local_networks_length`">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="l3-network" key="l3-network.network-name = $tmp.dci-connects.local_networks[$idx] AND depth = '0'" pfx="tmp.aai.l3-network" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.dci-connects.local_networks[$idx]" value="`$tmp.aai.l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_routerId'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.router_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_importRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_irts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_irts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_irts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_irts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_irts[$idx]" value="`$tmp.dci-connects.evpn_irts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_exportRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_erts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_erts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_erts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_erts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_erts[$idx]" value="`$tmp.dci-connects.evpn_erts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_vni'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="dci-network-topology-operation-activate" />
+ <parameter name="field3" value="dci-connects.name" />
+ <parameter name="field4" value="`$prop.dci-connects.name`" />
+ <parameter name="field5" value="dci-connects.id" />
+ <parameter name="field6" value="`$prop.dci-connects.id`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l3-dci-connects'`" />
+ <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="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l2-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l2-dci-connects'`" />
+ <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="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <block atomic="true">
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_description'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.description" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ <outcome value="false">
+ <set>
+ <parameter name="prop.dci-connects.description" value="" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_networkName'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.local_networks.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.local_networks.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.local_networks" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.local_networks_length`">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="l3-network" key="l3-network.network-name = $tmp.dci-connects.local_networks[$idx] AND depth = '0'" pfx="tmp.aai.l3-network" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.dci-connects.local_networks[$idx]" value="`$tmp.aai.l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_routerId'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.router_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_importRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_irts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_irts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_irts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_irts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_irts[$idx]" value="`$tmp.dci-connects.evpn_irts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_exportRT1'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.dci-connects.evpn_erts.original" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$tmp.dci-connects.evpn_erts.original`" />
+ <parameter name="regex" value="," />
+ <parameter name="ctx_memory_result_key" value="tmp.dci-connects.evpn_erts" />
+ <outcome value="success">
+ <for index="idx" start="0" end="`$tmp.dci-connects.evpn_erts_length`">
+ <set>
+ <parameter name="prop.dci-connects.evpn_erts[$idx]" value="`$tmp.dci-connects.evpn_erts[$idx]`" />
+ </set>
+ </for>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_vni'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="dci-network-topology-operation-activate" />
+ <parameter name="field3" value="dci-connects.name" />
+ <parameter name="field4" value="`$prop.dci-connects.name`" />
+ <parameter name="field5" value="dci-connects.id" />
+ <parameter name="field6" value="`$prop.dci-connects.id`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l3-dci-connects'`" />
+ <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="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l2-dci-connects-template.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/v2.0/l2-dci-connects'`" />
+ <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="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.dci.network-id" />
+ </execute>
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="">
+ <set>
+ <parameter name="nidx" value="0" />
+ </set>
+ </outcome>
+ <outcome value="Other">
+ <set>
+ <parameter name="nidx" value="`$service-data.networks.network_length`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value="`$prop.dci.network-id`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.sdnc-request-header." value="`$network-topology-operation-input.sdnc-request-header.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.request-information." value="`$network-topology-operation-input.request-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.service-information." value="`$network-topology-operation-input.service-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information." value="`$network-topology-operation-input.network-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value="`$network-topology-operation-input.network-request-input.`" />
+ <parameter name="service-data.networks.network_length" value="`$nidx+1`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status" value="Created" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action" value="`$network-topology-operation-input.sdnc-request-header.svc-action`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action" value="`$network-topology-operation-input.request-information.request-action`" />
+ </set>
+ <set>
+ <parameter name="networkId" value="`$prop.dci.network-id`" />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.dci.network-id + '/network-data/'` " />
+ </set>
+ </block>
+ </block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $prop.dci.network-id">
+ <parameter name="configuration-id" value="`$prop.dci.network-id`" />
+ <parameter name="configuration-type" value="overlay" />
+ <parameter name="configuration-sub-type" value="VPN-DCI" />
+ <parameter name="orchestration-status" value="Created" />
+ <parameter name="operational-status" value="Created" />
+ <parameter name="model-customization-id" value="`$prop.dci.network-id`" />
+ <parameter name="configuration-selflink" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.dci.network-id + '/network-data/'` " />
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" key="service-instance.service-instance-id = $service-data.service-information.service-instance-id AND customer.global-customer-id = $service-data.networks.network[$nidx].network-data.service-information.global-customer-id AND service-subscription.service-type = $service-data.networks.network[$nidx].network-data.service-information.subscription-service-type" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="configuration" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/configurations/configuration/' + $prop.dci.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="configuration.configuration-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.dci.network-id`" />
+ </save>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml new file mode 100644 index 0000000..d70691b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml @@ -0,0 +1,213 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<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="dci-connects-network-topology-operation-deactivate" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <block atomic="true">
+ <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="dci-network-topology-operation-deactivate" />
+ <parameter name="field3" value="dci-connects.id" />
+ <parameter name="field4" value="`$prop.dci-connects.id`" />
+ <parameter name="field5" value="dci-connects.tunnelType" />
+ <parameter name="field6" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l3-dci-connects/' + $prop.dci-connects.id`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l2-dci-connects/' + $prop.dci-connects.id`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <block atomic="true">
+ <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.vendor" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].vendor`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="dci-network-topology-operation-deactivate" />
+ <parameter name="field3" value="dci-connects.id" />
+ <parameter name="field4" value="`$prop.dci-connects.id`" />
+ <parameter name="field5" value="dci-connects.tunnelType" />
+ <parameter name="field6" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field7" value="dci-connects.tunnelType" />
+ <parameter name="field8" value="`$prop.dci-connects.tunnelType`" />
+ <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" />
+ <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" />
+ </record>
+ <switch test="`$prop.sdncRestApi.thirdpartySdnc.vendor`">
+ <outcome value="SPTN">
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l3-dci-connects/' + $prop.dci-connects.id`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l2-dci-connects/' + $prop.dci-connects.id`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $network-topology-operation-input.network-information.network-id" />
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="1">
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <for silentFailure="true" index="snidx" start="`$tmp.nidx + 1`" end="`$service-data.networks.network_length`">
+ <block atomic="true" />
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value="" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` " />
+ </set>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml new file mode 100755 index 0000000..1e6c8bb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml @@ -0,0 +1,1127 @@ +<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='eipam-allocate-generic-subnet' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.allocate-v4-subnet-flag" value="N" />
+ <parameter name="tmp.allocate-v6-subnet-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="N"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="N"/>
+ <parameter name="tmp.leaf-level" value="N" />
+ </set>
+ <switch test="`$tmp.activate-subnet-flag`">
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.activate-subnet-flag" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.leaf-level" value="Y" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.allocate-version`">
+ <outcome value='ipv4'>
+ <block atomic='true'>
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic='true'>
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml new file mode 100755 index 0000000..8fd6376 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml @@ -0,0 +1,537 @@ +<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='eipam-allocate-network-role-subnet' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="eipam-ip-block.ip-prefix" value='' />
+ <parameter name="eipam-ip-block.mask" value='' />
+ <parameter name="pfx.eipam-pool-row" value='' />
+ <parameter name="tmp.level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ </set>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.allocate-version`">
+ <outcome value='ipv4'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = 1 and key_value = $tmp.level1-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="Level 1 subnet saved to DB."/>
+ </record>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="2"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
+ <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ <switch test="`$eipam-ip-block.subnet-size-override`">
+ <outcome value=''>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level2-key-value`"/>
+ <parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
+ </record>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv4-cidr-mask`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = 2 and parent_pool = $tmp.level1-key-value AND key_value = $tmp.level2-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ </save>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
+ <parameter name="field7" value="`$tmp.level2-key-value`"/>
+ <parameter name="field8" value="Level 2 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = 1 and key_value = $tmp.level1-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="Level 1 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="2"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
+ <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ <switch test="`$eipam-ip-block.subnet-size-override`">
+ <outcome value=''>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level2-key-value`"/>
+ <parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
+ </record>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = 2 and parent_pool = $tmp.level1-key-value AND key_value = $tmp.level2-key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
+ <parameter name="field7" value="`$tmp.level2-key-value`"/>
+ <parameter name="field8" value="Level 2 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml new file mode 100755 index 0000000..1940615 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml @@ -0,0 +1,901 @@ +<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='eipam-create-generic-pool' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="N"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="N"/>
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $v4FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-value`"/>
+ <parameter name="field6" value="Level already exists, SKIP."/>
+ <parameter name="field7" value="`$eipam-ip-block.level`"/>
+ <parameter name="field8" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v4.pre-existing" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.qip-pool`">
+ <outcome value=""></outcome>
+ <outcome value='Other'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $v6FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-value`"/>
+ <parameter name="field6" value="Level already exists, SKIP."/>
+ <parameter name="field7" value="`$eipam-ip-block.level`"/>
+ <parameter name="field8" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v6.pre-existing" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.qip-pool`">
+ <outcome value=""></outcome>
+ <outcome value='Other'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-pool.v4.pre-existing`">
+ <outcome value='N'>
+ <block atomic='true'>
+ <set>
+ <parameter name="key-name" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-name`" />
+ <parameter name="key-value" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-value`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name="parent_pool" value="`$tmp.v4-qip-pool`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="parent_pool" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 2].key-value`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-name`"/>
+ <parameter name="field6" value="`$key-value`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan_length`">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan == $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PlanName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="index_found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$index_found`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $v4FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IPAddress ,
+ prefix_length = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.Mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $tmp.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS .' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS .' />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-pool.v6.pre-existing`">
+ <outcome value='N'>
+ <block atomic='true'>
+ <set>
+ <parameter name="key-name" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-name`" />
+ <parameter name="key-value" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-value`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <set>
+ <parameter name="parent_pool" value="`$tmp.v6-qip-pool`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="parent_pool" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 2].key-value`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$v6FQPN-output.pools[$level].key-name`"/>
+ <parameter name="field6" value="`$v6FQPN-output.pools[$level].key-value`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan_length`">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan == $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PlanName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="index_found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$index_found`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $v6FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IPAddress ,
+ prefix_length = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.Mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $tmp.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS .' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS .' />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml new file mode 100755 index 0000000..49436b4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml @@ -0,0 +1,699 @@ +<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='eipam-create-network-role-pool' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="false"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="false"/>
+ <parameter name="tmp.v4-level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.v4-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ <parameter name="tmp.v6-level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ </set>
+ <switch test="`$tmp.region`">
+ <outcome value="USA">
+ <set>
+ <parameter name="tmp.region" value="US" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = 1 and key_value = $tmp.level1-key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="Level 1 already exists, SKIP."/>
+ <parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v4.pre-existing" value="true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = 1 and key_value = $tmp.level1-key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="Level 1 already exists, SKIP."/>
+ <parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v6.pre-existing" value="true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-Private-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-Private-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v4-level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $tmp.v4-qip-pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ </save>
+ </outcome>
+ <outcome value='2'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v4-level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $tmp.level1-key-value ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ </save>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="field6" value="`$tmp.level1-key-value`"/>
+ <parameter name="field7" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="field8" value="`$tmp.level2-key-value`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v6-level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $tmp.v6-qip-pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='2'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $tmp.v6-level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $tmp.level1-key-value ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="field6" value="`$tmp.level1-key-value`"/>
+ <parameter name="field7" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="field8" value="`$tmp.level2-key-value`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-FQPN.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-FQPN.xml new file mode 100644 index 0000000..b9699d6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-FQPN.xml @@ -0,0 +1,472 @@ +<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-FQPN' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generate-FQPN-input.plan-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="generate-FQPN-input.plan-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.plan-name' value='`$generate-FQPN-input.plan-name`' />
+ </set>
+ <set>
+ <parameter name='generate-FQPN-output.' value='' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="getPlanTopology">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while getting Keyname and Keyvalue for address plan, '+ $eipam-ip-block.planName + ', from EIPAM'`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="eipam-ip-block.getPlanTopologyResponse.TopologyDetails is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-FQPN' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-name`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-name" />
+ </execute>
+ <for index="split-index" start="0" end="`$tmp.split.key-name_length`">
+ <set>
+ <parameter name='tmp.eipam.key-name'
+ value='`$tmp.split.key-name[$split-index]`' />
+ </set>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT key_value_source from ADDRESS_PLAN_POLICIES WHERE key_name = $tmp.eipam.key-name '
+ pfx='db.address-plan-policies'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ADDRESS_PLAN_POLICIES table" />
+ </return>
+ </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="`'No ADDRESS_PLAN_POLICIES entry found for key_name = ' + $eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$key-index].KeyName`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ROUTING_CHARACTERISTIC_MAPPING WHERE network_role = $generate-FQPN-input.network-role '
+ pfx='db.routing-characteristic_mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ROUTING_CHARACTERISTIC_MAPPING table" />
+ </return>
+ </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="`'No ROUTING_CHARACTERISTIC_MAPPING entry found for network_role = ' + $generate-FQPN-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.key-value' value='' />
+ </set>
+ <switch test='`$db.address-plan-policies.key-value-source`'>
+ <outcome value='AddressPlanPolicyDG-Routing_Characteristic'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.key-value' value='-1' />
+ </set>
+ <switch test='`$db.routing-characteristic_mapping_length > 1`'>
+ <outcome value='true'>
+ <block>
+ <for index="routing-index" start="0" end="`$db.routing-characteristic_mapping_length`">
+ <switch test='`$db.routing-characteristic_mapping[$routing-index].vrf-name == $generate-FQPN-input.vrf-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[$routing-index].routing-characteristic`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].routing-characteristic`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.key-value`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No matching ROUTING_CHARACTERISTIC_MAPPING.vrf-name found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Location_Clli8'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.location-clli8`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Vrf_Name'>
+ <switch test='`$generate-FQPN-input.vrf-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].vrf-name`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cloud_region_id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.aic-cloud-region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Complex_region'>
+ <set>
+ <parameter name='tmp.key-value' value='`$aai.complex.region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Name'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-name`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Subnet_Role'>
+ <switch test='`$generate-FQPN-input.subnet-role`' >
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='STATIC' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.subnet-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Role'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-role`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-id`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Collection'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-collection`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Zone'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.zone`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown ADDRESS_PLAN_POLICIES: ' + $db.address-plan-policies.key-value-source`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.final.key-value' value="`$tmp.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.final.key-value'
+ value="`$tmp.final.key-value + ':' + $tmp.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-name`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-name" />
+ </execute>
+ <for index="split-index" start="0" end="`$tmp.split.key-name_length`">
+ <set>
+ <parameter name='tmp.eipam.key-name'
+ value='`$tmp.split.key-name[$split-index]`' />
+ </set>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT key_value_source from ADDRESS_PLAN_POLICIES WHERE key_name = $tmp.eipam.key-name '
+ pfx='db.address-plan-policies'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ADDRESS_PLAN_POLICIES table" />
+ </return>
+ </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="`'No ADDRESS_PLAN_POLICIES entry found for key_name = ' + $eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$key-index].KeyName`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ROUTING_CHARACTERISTIC_MAPPING WHERE network_role = $generate-FQPN-input.network-role '
+ pfx='db.routing-characteristic_mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading ROUTING_CHARACTERISTIC_MAPPING table" />
+ </return>
+ </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="`'No ROUTING_CHARACTERISTIC_MAPPING entry found for network_role = ' + $generate-FQPN-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.key-value' value='' />
+ </set>
+ <switch test='`$db.address-plan-policies.key-value-source`'>
+ <outcome value='AddressPlanPolicyDG-Routing_Characteristic'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.key-value' value='-1' />
+ </set>
+ <switch test='`$db.routing-characteristic_mapping_length > 1`'>
+ <outcome value='true'>
+ <block>
+ <for index="routing-index" start="0" end="`$db.routing-characteristic_mapping_length`">
+ <switch test='`$db.routing-characteristic_mapping[$routing-index].vrf-name == $generate-FQPN-input.vrf-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[$routing-index].routing-characteristic`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].routing-characteristic`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.key-value`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No matching ROUTING_CHARACTERISTIC_MAPPING.vrf-name found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Location_Clli8'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.location-clli8`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Vrf_Name'>
+ <switch test='`$generate-FQPN-input.vrf-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].vrf-name`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cloud_region_id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.aic-cloud-region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Complex_region'>
+ <set>
+ <parameter name='tmp.key-value' value='`$aai.complex.region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Name'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-name`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Subnet_Role'>
+ <switch test='`$generate-FQPN-input.subnet-role`' >
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='STATIC' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.subnet-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Role'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-role`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-id`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Collection'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-collection`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Zone'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.zone`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown ADDRESS_PLAN_POLICIES: ' + $db.address-plan-policies.key-value-source`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.final.key-value' value="`$tmp.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.final.key-value'
+ value="`$tmp.final.key-value + ':' + $tmp.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-allottedresource-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-allottedresource-id.xml new file mode 100644 index 0000000..b6792ad --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-allottedresource-id.xml @@ -0,0 +1,68 @@ +<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-allottedresource-id" mode="sync"> + <block atomic="true"> + <set> + <parameter name="tmp.local-variables.generate-allottedresource-id." value="" /> + <parameter name="tmp.return.generate-allottedresource-id." value="" /> + </set> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-allottedresource-id.id" /> + <outcome value='failure'> + <return status='failure'> + <!-- Used to work around execute node bug --> + <parameter name="execute_failure" value="false" /> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /> + </return> + </outcome> + </execute> + <for atomic="true" index="n" start="0" end="1" > + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $cto-api.service-type AND + service-instance.service-instance-id = $cto-api.port-mirror-configuration-instance-id AND + allotted-resource.id = $tmp.return.generate-allottedresource-id.id" + local-only="false" + pfx="tmp.local-variables.generate-allottedresource-id.ALLOTTEDRESOURCE" > + <outcome value='success'> + <block atomic='true'> + <set> + <parameter name="tmp.local-variables.generate-allottedresource-id.is-unique" value="0" /> + </set> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-allottedresource-id.id" /> + <outcome value='failure'> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-allottedresource-id" value="An error occured while generating a UUID for ALLOTTED-RESOURCE." /> + </return> + </outcome> + </execute> + </block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='failure'> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-allottedresource-id" value="`'An error occured while checking if a generated allotted-resource-id was unique. allotted-resource-id = ' + $tmp.local-variables.generate-allottedresource-id.id`" /> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-allottedresource-id" value="`'An error occured while checking if a generated allotted-resource-id was unique. allotted-resource-id = ' + $tmp.local-variables.generate-allottedresource-id.id`" /> + </return> + </outcome> + </get-resource> + </for> + <set> + <parameter name="tmp.local-variables.generate-allottedresource-id." value="" /> + </set> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml new file mode 100755 index 0000000..928e3a8 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc="generate-host-routes-host-route-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ <parameter name="tmp.return.generate-host-routes-host-route-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-host-routes-host-route-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="s" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.local.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-host-routes-host-route-id.HOST_ROUTE" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-host-routes-host-route-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="An error occured while generating a UUID for HOST_ROUTE." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="`'An error occured while checking if a generated host-routes-host-route-id was unique. host-route-id = ' + $tmp.local-variables.generate-host-routes-host-route-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="`'An error occured while checking if a generated host-routes-host-route-id was unique. host-route-id = ' + $tmp.local-variables.generate-host-routes-host-route-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-l3network-network-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-l3network-network-id.xml new file mode 100755 index 0000000..e44c148 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-l3network-network-id.xml @@ -0,0 +1,65 @@ +<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-l3network-network-id" mode="sync"> + <block atomic="true"> + <set> + <parameter name="tmp.local-variables.generate-l3network-network-id." value="" /> + <parameter name="tmp.return.generate-l3network-network-id." value="" /> + </set> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" /> + <outcome value='failure'> + <return status='failure'> + <!-- Used to work around execute node bug --> + <parameter name="execute_failure" value="false" /> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /> + </return> + </outcome> + </execute> + <for atomic="true" index="n" start="0" end="1" > + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" + local-only="false" + pfx="tmp.local-variables.generate-l3network-network-id.L3NETWORK" > + <outcome value='success'> + <block atomic='true'> + <set> + <parameter name="tmp.local-variables.generate-l3network-network-id.is-unique" value="0" /> + </set> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" /> + <outcome value='failure'> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /> + </return> + </outcome> + </execute> + </block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='failure'> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" /> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" /> + </return> + </outcome> + </get-resource> + </for> + <set> + <parameter name="tmp.local-variables.generate-l3network-network-id." value="" /> + </set> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-panorama-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-panorama-name.xml new file mode 100755 index 0000000..b31a9ff --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-panorama-name.xml @@ -0,0 +1,136 @@ +<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>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml new file mode 100755 index 0000000..14ba7fe --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml @@ -0,0 +1,66 @@ +<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-subnets-subnet-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" />
+ <parameter name="tmp.return.generate-subnets-subnet-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-subnets-subnet-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="s" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.local.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-subnets-subnet-id.SUBNETS" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-subnets-subnet-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-subnets-subnet-id" value="An error occured while generating a UUID for SUBNETS." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-subnets-subnet-id" value="`'An error occured while checking if a generated subnets-subnet-id was unique. subnet-id = ' + $tmp.local-variables.generate-subnets-subnet-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-subnets-subnet-id" value="`'An error occured while checking if a generated subnets-subnet-id was unique. subnet-id = ' + $tmp.local-variables.generate-subnets-subnet-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-unique-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-unique-name.xml new file mode 100755 index 0000000..7393842 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-unique-name.xml @@ -0,0 +1,591 @@ +<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-unique-name' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value='' />
+ <parameter name='generate-unique-name-output.generated-name' value='' />
+ </set>
+ <switch test='`$generate-unique-name-input.supplied-name`'>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $generate-unique-name-input.supplied-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the ' + $generate-unique-name-input.name-table-index + ' table'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
++ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name , null , null, $generate-unique-name-input.service-instance-id )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value="`'The name ' + $generate-unique-name-input.supplied-name + ' has already been used'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-table-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-name not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-table-prefix-column`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-prefix-column not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.prefix`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.list-end' value='100000' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='10' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='100' />
+ </set>
+ </outcome>
+ <outcome value='3'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='1000' />
+ </set>
+ </outcome>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='10000' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from ' + $generate-unique-name-input.index-table-name
++ ' WHERE ' + $generate-unique-name-input.index-table-prefix-column + ' = '
++ '$generate-unique-name-input.prefix'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.prefixdb'>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-exists' value='true' />
+ </set>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.gun.index-number' value='`$tmp.gun.prefixdb.index-number + 1`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-number' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-exists' value='false' />
+ </set>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-number' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.gun.index-number' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Error reading the ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.gun.found-flag' value='false' />
+ </set>
+ <block>
+ <for index='tmp.gun.idx' start='`$tmp.gun.index-number`' end='`$tmp.gun.list-end`' >
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='3'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='4'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '000' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <switch test='`$tmp.gun.noindex-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.index-string' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ <switch test='`$generate-unique-name-output.error-message`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'></return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.gun.found-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
+ </set>
+ <switch test='`$tmp.gun.index-exists`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
++ ' set index_number = ' + $tmp.gun.index-string + ' where '
++ $generate-unique-name-input.index-table-prefix-column
++ ' = $generate-unique-name-input.prefix'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
++ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('
++ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql'
+ value="`'insert into GENERIC_RESOURCE_NAME values ( $generate-unique-name-input.name-table-type , $tmp.gun.generated-name , $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ' , $tmp.gun.transient )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.gun.noindex-flag`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="naming exhausted for input with index-length = 0" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
+ </return>
+ </outcome>
+ </switch>
+ <block>
+ <for index='tmp.gun.idx' start='1' end='`$tmp.gun.index-number`' >
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='3'>
+ <switch test='`$tmp.gun.idx < 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx < 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.namedb.name' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="Error reading the GENERIC_RESOURCE_NAME table" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$generate-unique-name-output.error-message`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'></return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.gun.found-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
+ </set>
+ <switch test='`$tmp.gun.index-exists`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
++ ' set index_number = ' + $tmp.gun.index-string + ' where '
++ $generate-unique-name-input.index-table-prefix-column
++ ' = $generate-unique-name-input.prefix'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
++ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('
++ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql'
+ value="`'insert into GENERIC_RESOURCE_NAME values ( $generate-unique-name-input.name-table-type , $tmp.gun.generated-name , $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ' , $tmp.gun.transient )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='pfx'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml new file mode 100755 index 0000000..1a981fa --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml @@ -0,0 +1,65 @@ +<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-vpn-binding-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id." value="" />
+ <parameter name="tmp.return.generate-vpn-binding-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-vpn-binding-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="An error occured while generating a UUID for VPN-BINDING." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="n" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $tmp.return.generate-vpn-binding-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-vpn-binding-id.VPNBINDING" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-vpn-binding-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="An error occured while generating a UUID for VPN-BINDING." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="`'An error occured while checking if a generated vpn-binding-id was unique. vpn-id = ' + $tmp.local-variables.generate-vpn-binding-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="`'An error occured while checking if a generated vpn-binding-id was unique. vpn-id = ' + $tmp.local-variables.generate-vpn-binding-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml new file mode 100755 index 0000000..3ee1bbc --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml @@ -0,0 +1,108 @@ +<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='generic-configuration-notification-activate' mode='sync'>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='Active' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-action'
+ value='CreateGenericConfigurationInstance' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-rpc-action'
+ value='activate' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml new file mode 100755 index 0000000..5db9776 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml @@ -0,0 +1,485 @@ +<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='generic-configuration-notification-assign' mode='sync'>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$generic-configuration-notification-input.response-code`'>
+ <outcome value='Other'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$generic-configuration-notification-input.response-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block></block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-configurations.provided-configuration_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-provided-configuration' value='false' />
+ </set>
+ <set>
+ <parameter name='pc-index' value='0' />
+ </set>
+ <for silentFailure='true' index='pc-index' start='0' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <switch test='`$service-data.provided-configurations.provided-configuration[$pc-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-provided-configuration' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-provided-configuration`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length'
+ value='`$service-data.provided-configurations.provided-configuration_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-type'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-sub-type'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-sub-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-topology-link'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $generic-configuration-notification-input.service-information.service-instance-id
+ + '/service-data/provided-configurations/provided-configuration/'
+ + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-sub-interface-group`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnfc-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnfc-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vsig-url"/>
+ <parameter name="target" value="{parent-port-role}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.parent-port-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc_length`' >
+ <for silentFailure='true' index='vnic-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic_length`' >
+ <for silentFailure='true' index='si-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].vlan-tags.lower-tag-id
+ == $generic-configuration-notification-input.vnr-parameters.lower-tag-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].sub-interface-status'
+ value='assigned' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-customer-bonding-request' value='false' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-customer-bonding-request' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-customer-bonding-request`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ </set>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vnfsubinterfacegroup.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing vnf-sub-interface-group" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing vnf-sub-interface-group" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-network`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.nign-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-customer-bonding-request' value='false' />
+ </set>
+ <set>
+ <parameter name='cbr-index' value='0' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-customer-bonding-request' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-customer-bonding-request`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ </set>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='mdsal-nign.network[0].network-status' value='assigned' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-network.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing network-instance-group network" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing network-instance-group network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Error updating md-sal for gc-configuration" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Error updating md-sal for gc-configuration" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml new file mode 100755 index 0000000..88fcf35 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml @@ -0,0 +1,108 @@ +<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='generic-configuration-notification-deactivate' mode='sync'>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='PendingDelete' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-action'
+ value='DeleteGenericConfigurationInstance' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-rpc-action'
+ value='deactivate' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml new file mode 100755 index 0000000..a3c5fff --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml @@ -0,0 +1,353 @@ +<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='generic-configuration-notification-unassign' mode='sync'>
+ <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>
+ <for silentFailure='true' index='pc-index' start='0' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <switch test='`$service-data.provided-configurations.provided-configuration[$pc-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='pc2-index' start='`$pc-index + 1`' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$pc2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$prev-index].'
+ value='`$service-data.provided-configurations.provided-configuration[$pc2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length'
+ value='`$service-data.provided-configurations.provided-configuration_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$generic-configuration-notification-input.response-code`'>
+ <outcome value='Other'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$generic-configuration-notification-input.response-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block></block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-sub-interface-group`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnfc-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnfc-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vsig-url"/>
+ <parameter name="target" value="{parent-port-role}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.parent-port-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc_length`' >
+ <for silentFailure='true' index='vnic-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic_length`' >
+ <for silentFailure='true' index='si-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].vlan-tags.lower-tag-id
+ == $generic-configuration-notification-input.vnr-parameters.lower-tag-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].sub-interface-status'
+ value='unassigned' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <for index='cbr-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='cbr2-index' start='`$cbr-index + 1`' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$cbr2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$prev-index].'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$cbr2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vnfsubinterfacegroup.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing vnf-sub-interface-group" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing vnf-sub-interface-group" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-network`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.nign-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-nign.network[0].network-status' value='unassigned' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='cbr2-index' start='`$cbr-index + 1`' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$cbr2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$prev-index].'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$cbr2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-network.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing network-instance-group network" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing network-instance-group network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification.xml new file mode 100755 index 0000000..34bfcec --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-notification.xml @@ -0,0 +1,39 @@ +<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='generic-configuration-notification' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generic-configuration-notification-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-activate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml new file mode 100755 index 0000000..56f0d74 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml @@ -0,0 +1,117 @@ +<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='generic-configuration-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-generic-configuration-input' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <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>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <set>
+ <parameter name='gc.configuration-id'
+ value='`$generic-configuration-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$generic-configuration-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.request-information.'
+ value='`$generic-configuration-topology-operation-input.request-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.service-information.'
+ value='`$generic-configuration-topology-operation-input.service-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.configuration-information.'
+ value='`$generic-configuration-topology-operation-input.configuration-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.gc-request-input.'
+ value='`$generic-configuration-topology-operation-input.gc-request-input.`' />
+ </set>
+ <set>
+ <parameter name='gc.configuration-data.configuration-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='gc.configuration-data.configuration-oper-status.last-rpc-action'
+ value='assign' />
+ <parameter name='gc.configuration-data.configuration-oper-status.last-action'
+ value='CreateGenericConfigurationInstance' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$gc.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='notification-url'
+ value="`$prop.controller.url + '/restconf/operations/GENERIC-RESOURCE-API:generic-configuration-notification'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.bondingservice.server + $prop.bondingservice.uri`"/>
+ <parameter name="outputPath" value="tmp.bs-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.bondingservice.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.bs-url`' />
+ <parameter name='restapiUser' value='`$prop.bondingservice.user`' />
+ <parameter name='restapiPassword' value='`$prop.bondingservice.password`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="bonding-service-response" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.bondingservice.authorization`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Error calling bonding service; ' + $error-message`" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-genconfig.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="`$bonding-service-response.ackFinalIndicator`" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml new file mode 100755 index 0000000..07a0486 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml @@ -0,0 +1,181 @@ +<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='get-complex-resource-service-model' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from COMPLEX_RESOURCE
+ WHERE customization_uuid = $get-complex-resource-service-model-input.customization-uuid'
+ pfx='db.complex-resource'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ATTRIBUTE_VALUE_PAIR
+ WHERE resource_uuid = $db.complex-resource.uuid
+ and resource_type = $db.complex-resource.type'
+ pfx='db.av-pair'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.av-pair_length`' >
+ <block atomic='true'>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_function' `">
+ <outcome value='true'>
+ <set>
+ <parameter name='get-complex-resource-service-model-output.cr-function' value='`$db.sdn-circuit-req[$idx].attribute-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-role" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_type'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-type" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_function'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-function" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_description'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-description" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'subinterface_network_quantity'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subinterface-network-quantity" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL
+ WHERE complex_resource_uuid = $db.complex-resource.uuid'
+ pfx='db.network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No network model found" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No network model found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from RESOURCE_POLICY_TO_TARGET_NODE_MAPPING
+ WHERE target_node_uuid = $db.network-model.uuid
+ AND target_node_customization_uuid = db.network-model.customization-uuid'
+ pfx='db.respoltargetnodemap' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="SELECT * from RESOURCE_POLICY
+ WHERE policy_uuid = $db.respoltargetnodemap.policy_uuid
+ and policy_type = 'ecomp.policies.External' "
+ pfx='db.resource-policy'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.resource-policy_length`' >
+ <block atomic='true'>
+ <switch test="`$db.resource-policy[$idx].property-type == 'Name' and $db.resource-policy[$idx].property-name == 'Network Collection Name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-naming-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'subnetwork assignments' and $db.resource-policy[$idx].property-name == 'subnet'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subnet-assignment-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'network assignments' and $db.resource-policy[$idx].property-name == 'route target'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.vpn-binding-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-data-from-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-data-from-policy.xml new file mode 100755 index 0000000..2c825d6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-data-from-policy.xml @@ -0,0 +1,204 @@ +<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='get-data-from-policy' mode='sync'>
+ <block atomic='true'>
+ <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' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='get-data-from-policy: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$get-data-from-policy-input.policy-instance-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: input.policy-instance-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='get-data-from-policy: input.policy-instance-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$get-data-from-policy-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='get-data-from-policy: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='get-data-from-policy: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='get-data-from-policy: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: jsonStringToCtx SUCCESS: policyName|policy-data|"/>
+ <parameter name='field3' value='`$jsonContextPrefix.policyName`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.policy-data`' />
+ </record>
+ <switch test='`$jsonContextPrefix.content.policy-data_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='policyDataIndex' start='0' end='`$jsonContextPrefix.content.policy-data_length`' >
+ <set>
+ <parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: policyDataIndex|nf-role|rule-1|rule-2:"/>
+ <parameter name='field3' value='`$policyDataIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].nf-role`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].rule-1`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].rule-2`' />
+ </record>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$jsonContextPrefix.content.policy-data.extended-params_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='policyDataExtendedParamsIndex' start='0' end='`$jsonContextPrefix.content.policy-data.extended-params_length`' >
+ <set>
+ <parameter name='output-param-name' value='`$jsonContextPrefix.content.policy-data.extended-params[$policyDataExtendedParamsIndex].param-name`' />
+ <parameter name='output-param-value' value='`$jsonContextPrefix.content.policy-data.extended-params[$policyDataExtendedParamsIndex].param-value`' />
+ </set>
+ <set>
+ <parameter name="`'get-data-from-policy-output.' + $output-param-name`" value="`$output-param-value`" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: policyDataExtendedParamsIndex|output-param-name|output-param-value:"/>
+ <parameter name='field3' value='`$policyDataExtendedParamsIndex`' />
+ <parameter name='field4' value='`$output-param-name`' />
+ <parameter name='field5' value='`$output-param-value`' />
+ </record>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='get-data-from-policy-output.' value='`$jsonContextPrefix.content.policy-data.`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: get-data-from-policy-output.:"/>
+ <parameter name='field3' value='`$get-data-from-policy-output.`' />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <return status='success'></return>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-tunnelxconn-ar.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-tunnelxconn-ar.xml new file mode 100644 index 0000000..be34b3b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-tunnelxconn-ar.xml @@ -0,0 +1,17 @@ +<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='get-tunnelxconn-ar' mode='sync'>
+<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='tunnelxconn-allotted-resources' pfx='tmp.tunnel-ar.data' >
+</get-resource><for index='tunnelidx' start='0' end='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource_length`' >
+
+
+<block>
+<set>
+<parameter name='tmp.printout.consuming-service-instance-id' value='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$tunnelidx].allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+<parameter name='tmp.printout.index' value='`$tunnelidx`' />
+</set><switch test='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$tunnelidx].allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.consuming-service-instance-id == $tmp.ar.consuming-service-instance-id`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.tunnelxconn-ar.' value='`$tmp.tunnel-ar.data.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$tunnelidx].`' />
+</set></block></outcome></switch></block></for></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml new file mode 100644 index 0000000..a844fa5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml @@ -0,0 +1,31 @@ +<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='get-vnf-api-parent-instance' mode='sync'>
+<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs' pfx='tmp.vnfdata' >
+</get-resource><for index='vnfidx' start='0' end='`$tmp.vnfdata.vnfs.vnf-list_length`' >
+
+
+<block>
+<set>
+<parameter name='tmp.debug.tmp.search.parent-service-instance-id' value='`$tmp.search.parent-service-instance-id`' />
+</set><switch test='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id == $tmp.search.parent-service-instance-id`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.debug.service-instance.id1' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id`' />
+<parameter name='tmp.debug.service-instance.id2' value='`$tmp.search.parent-service-instance-id`' />
+<parameter name='tmp.debug.service-instance.id3.vnf-id' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id`' />
+
+
+
+</set><set>
+<parameter name='tmp.old-service-data.vnf-id' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id`' />
+</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs/vnf-list/$tmp.vnfdata.vnfs.vnf-list[$vnfidx].vnf-id/service-data/' pfx='parent-service-instance' >
+
+ <outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" />
+</return></outcome></get-resource><break></break></block></outcome></switch></block></for></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml new file mode 100755 index 0000000..0fb35de --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml @@ -0,0 +1,1912 @@ +<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='getpathsegment-composite-match-pair' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsc.log' />
+ </execute>
+ <for index='left-node-index' start='0' end='`$serv-cust_length - 1`' >
+ <block>
+ <set>
+ <parameter name='right-node-index' value='`$left-node-index + 1`' />
+ </set>
+ <for silentFailure='true' index='left-serv-index' start='0' end='`$serv-cust[$left-node-index].serv-insts_length`' >
+ <block>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length' value='0' />
+ </set>
+ <for silentFailure='true' index='right-serv-index' start='0' end='`$serv-cust[$right-node-index].serv-insts_length`' >
+ <block>
+ <switch test='`$match-type`'>
+ <outcome value='network-name'>
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$right-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='0'>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$right-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ > $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$left-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='0'>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ > $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$left-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ > $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`'>
+ <outcome value=''>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index'
+ value='`$right-vnf-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index'
+ value='`$right-vnf-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsd.log' />
+ </execute>
+ <set>
+ <parameter name='path-index' value='0' />
+ </set>
+ <for silentFailure='true' index='first-serv-index' start='0' end='`$serv-cust[0].serv-insts_length`' >
+ <switch test='`$serv-cust[0].serv-insts[$first-serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='cur-vnf-seq' value='1' />
+ </set>
+ <set>
+ <parameter name='end-to-end-path' value='false' />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-id' value='`$tmp.service-path-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $tmp.service-path-instance-id`' />
+ </set>
+ <switch test='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$cur-vnf-seq + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$cur-vnf-seq + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='cur-vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='next-service-instance-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-service-instance-id`' />
+ <parameter name='prev-network-name' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='next-vnf-instance-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-vnf-instance-id`' />
+ <parameter name='next-vf-module-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-vf-module-id`' />
+ </set>
+ <for index='node-index' start='1' end='`$serv-cust_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='serv-index' start='0' end='`$serv-cust[$node-index].serv-insts_length`' >
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ < $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='0'>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ < $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ < $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ > $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-id' value='' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='next-service-instance-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-service-instance-id`' />
+ <parameter name='prev-network-name' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='next-vnf-instance-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-vnf-instance-id`' />
+ <parameter name='next-vf-module-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$max-vnf-seq + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='path-index' value='`$path-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path_length' value='`$path-index`' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml new file mode 100755 index 0000000..76b8df4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml @@ -0,0 +1,627 @@ +<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='getpathsegment-create-composite-path' mode='sync'>
+ <block>
+ <set>
+ <parameter name='match-type' value='network-name' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from PATH_SEGMENT WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ AND path_name = $db.forwarding-path[$path-index].path-name ORDER BY path_segment_seq'
+ pfx='db.path-segment[]'>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error reading PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No entries in PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='serv-cust_length' value='0' />
+ </set>
+ <for index='path-segment-index' start='0' end='`$db.path-segment_length`' >
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-cust_length].id' value='`$db.path-segment[$path-segment-index].source-association-uuid`' />
+ <parameter name='serv-cust_length' value='`$serv-cust_length + 1`' />
+ </set>
+ <switch test='`$path-segment-index == ( $db.path-segment_length - 1) `'>
+ <outcome value='true'>
+ <set>
+ <parameter name='serv-cust[$serv-cust_length].id' value='`$db.path-segment[$path-segment-index].target-association-uuid`' />
+ <parameter name='serv-cust_length' value='`$serv-cust_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index='serv-index' start='0' end='`$serv-cust_length`' >
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select sm.invariant_uuid
+ from SERVICE_PROXY sp, SERVICE_MODEL sm
+ where sp.source_service_uuid = sm.service_uuid
+ and sp.customization_uuid = $serv-cust[$serv-index].id'
+ pfx='db'>
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`'Failure reading SERVICE_PROXY and SERVICE_MODEL for customization uuid ' + $serv-cust[$serv-index].id`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`'Cannot find entries in SERVICE_PROXY and SERVICE_MODEL for customization uuid ' + $serv-cust[$serv-index].id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='serv-cust[$serv-index].inv-id' value='`$db.invariant-uuid`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </for>
+ <for index='serv-index' start='0' end='`$serv-cust_length`' >
+ <switch test='`$serv-cust[$serv-index].inv-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="aai.service-instances" >
+ <parameter name="start[0]" value="`'nodes/service-instances?model-invariant-id=' + $serv-cust[$serv-index].inv-id`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`'Unable to find runtime service instances for invariant UUID ' + $serv-cust[$serv-index].inv-id`" />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`'System error finding runtime service instances for customization UUID ' + $serv-cust[$serv-index].inv-id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$aai.service-instances.results_length`' >
+ <switch test='`$aai.service-instances.results[$runtime-index].service-instance.orchestration-status`'>
+ <outcome value='Active'>
+ <block>
+ <set>
+ <parameter name='serv-inst.service-instance-id' value='`$aai.service-instances.results[$runtime-index].service-instance.service-instance-id`' />
+ </set>
+ <switch test='`$output-global-customer-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource_and_url'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.si">
+ <parameter name="start[0]" value="`'nodes/service-instance/' + $serv-inst.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.AnAI-data.si.results[0].url`" />
+ <parameter name="regex" value="/"/>
+ <parameter name="limit" value="11" />
+ <parameter name="ctx_memory_result_key" value="split" />
+ </execute>
+ <set>
+ <parameter name='output-global-customer-id' value='`$split[6]`' />
+ <parameter name='output-service-type' value='`$split[9]`' />
+ <parameter name='output-service-role' value='`$tmp.AnAI-data.si.results[0].service-instance.service-role`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <block>
+ <switch test='`$runtime-index`'>
+ <outcome value='0'>
+ <set>
+ <parameter name='service.service-role' value='`$aai.service-instances.results[0].service-instance.service-role`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='mdsal-service.' value='' />
+ <parameter name='serv-inst.api' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$serv-inst.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='success'>
+ <block>
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $serv-inst.service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $serv-inst.service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].forwarding-paths.'
+ value='`$mdsal-service.service[0].service-data.forwarding-paths.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-vnfapi' mode='sync' ></call>
+ <switch test='`$serv-inst.api`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Failure finding service instance ' + $si.service-instance-id + ' in either GENERIC-REOURCE-API or VNF-API'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$serv-inst.vnf-list_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT forwarding_path_service_instance_id from SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING WHERE simple_service_instance_id = $serv-inst.service-instance-id'
+ pfx='db.mapped-service-instance-id'>
+ <outcome value='failure'>
+ <set>
+ <parameter name='data-error' value="System error reading SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING table" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='data-error' value="`'No entry in SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING table for service instance ' + $serv-inst.service-instance-id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$db.mapped-service-instance-id.forwarding-path-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='data-error' value="`'Cannot find service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' in MD-SAL'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].forwarding-paths.'
+ value='`$mdsal-service.service[0].service-data.forwarding-paths.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='serv-inst.' value='' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts_length' value='`$tmp.serv-insts_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-composite-match-pair' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsx.log' />
+ </execute>
+ <switch test='`$service-paths.service-path_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='found-service-path' value='false' />
+ </set>
+ <for index='sp-index' start='0' end='`$service-paths.service-path_length`' >
+ <switch test='`$service-paths.service-path[$sp-index].service_length == $serv-cust_length`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-service-path' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-service-path`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='error-message' value="`'No service paths found for path name '
+ + $db.path-segment[0].path-name`" />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='Service' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.' value='`$service-paths.`' />
+ </set>
+ <switch test='`$output-service-instance-id`'>
+ <outcome value=''>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='output-service-instance-id' value='`$tmp.service-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='output-service-instance-id' value='`$tmp.service-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$output-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <for index='sp-index' start='0' end='`$service-paths.service-path_length`' >
+ <switch test='`$service-paths.service-path[$sp-index].service_length == $serv-cust_length`'>
+ <outcome value='true'>
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[$sp-index].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $output-service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $output-service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='service-index' start='0' end='`$service-paths.service-path[$sp-index].service_length`' >
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml new file mode 100755 index 0000000..71d3c77 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml @@ -0,0 +1,749 @@ +<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='getpathsegment-create-simple-path' mode='sync'>
+ <block>
+ <set>
+ <parameter name='match-type' value='network-name' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from PATH_SEGMENT WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ AND path_name = $db.forwarding-path[$path-index].path-name ORDER BY path_segment_seq'
+ pfx='db.path-segment[]'>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error reading PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No entries in PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='vnf-ids_length' value='0' />
+ </set>
+ <for index='path-segment-index' start='0' end='`$db.path-segment_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-ids[$vnf-ids_length]' value='`$db.path-segment[$path-segment-index].source-association-uuid`' />
+ <parameter name='vnf-ids_length' value='`$vnf-ids_length + 1`' />
+ </set>
+ <switch test='`$path-segment-index == ( $db.path-segment_length - 1) `'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-ids[$vnf-ids_length]' value='`$db.path-segment[$path-segment-index].target-association-uuid`' />
+ <parameter name='vnf-ids_length' value='`$vnf-ids_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="aai.service-instances" >
+ <parameter name="start[0]" value="`'nodes/service-instances?model-invariant-id=' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No run-time service instances in AAI for invariant uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error calling AAI to get run-time service instances for invariant uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='runtime_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$aai.service-instances.results_length`' >
+ <switch test='`$aai.service-instances.results[$runtime-index].service-instance.orchestration-status`'>
+ <outcome value='Active'>
+ <block>
+ <set>
+ <parameter name='runtime-ids[$runtime_length]' value='`$aai.service-instances.results[$runtime-index].service-instance.service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='runtime_length' value='`$runtime_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='serv-insts_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$runtime_length`' >
+ <block>
+ <set>
+ <parameter name='serv-inst.service-instance-id' value='`$runtime-ids[$runtime-index]`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource_and_url'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.si">
+ <parameter name="start[0]" value="`'nodes/service-instance/' + $serv-inst.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.AnAI-data.si.results[0].url`" />
+ <parameter name="regex" value="/"/>
+ <parameter name="limit" value="11" />
+ <parameter name="ctx_memory_result_key" value="split" />
+ </execute>
+ <set>
+ <parameter name='output-global-customer-id' value='`$split[6]`' />
+ <parameter name='output-service-type' value='`$split[9]`' />
+ <parameter name='output-service-role' value='`$tmp.AnAI-data.si.results[0].service-instance.service-role`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='mdsal-service.' value='' />
+ <parameter name='serv-inst.api' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$serv-inst.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='found-path' value='false' />
+ </set>
+ <for silentFailure='true' index='fp-index' start='0' end='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path[$fp-index].forwarding-path-name
+ == $db.path-segment[0].path-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-path' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-path`'>
+ <outcome value='false'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-insts[$serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-insts_length' value='`$serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select forwarding_path_service_instance_id
+ from SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ where simple_service_instance_id = $serv-inst.service-instance-id'
+ pfx='db.sitcim'>
+ <outcome value='not-found'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-vnfapi' mode='sync' ></call>
+ <switch test='`$serv-inst.api`'>
+ <outcome value=''>
+ <set>
+ <parameter name='error-message' value="`'Failure finding service instance ' + $serv-inst.service-instance-id + ' in either GENERIC-REOURCE-API or VNF-API'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='serv-insts[$serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-insts_length' value='`$serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-simple-match-pair' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gps.log' />
+ </execute>
+ <for index='serv-index' start='0' end='`$serv-insts_length`' >
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <switch test='`$serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.service-paths.service-path[0].service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='VNF' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.service-paths.service-path_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $forwarding-path.service-paths.service-path[0].service-path-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-instance-id'
+ value='`$serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-path-sequence-id' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <for index='ps-index' start='1' end='`$serv-insts[$serv-index].path-segments_length`' >
+ <block>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-path-sequence-id'
+ value='`$ps-index + 1`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-path-sequence-id'
+ value='`$ps-index + 2`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length + 1`' />
+ </set>
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <set>
+ <parameter name='tmp.service-instance-id' value='`$serv-insts[$serv-index].service-instance-id`' />
+ </set>
+ </outcome>
+ <outcome value='VNF'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ (simple_service_instance_id, forwarding_path_service_instance_id)
+ VALUES ( $serv-insts[$serv-index].service-instance-id , $tmp.service-instance-id )" ></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $tmp.service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <switch test='`$serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.service-paths.service-path[0].service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='VNF' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.service-paths.service-path_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $forwarding-path.service-paths.service-path[0].service-path-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-instance-id'
+ value='`$serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-path-sequence-id' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <for index='ps-index' start='1' end='`$serv-insts[$serv-index].path-segments_length`' >
+ <block>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-path-sequence-id'
+ value='`$ps-index + 1`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-path-sequence-id'
+ value='`$ps-index + 2`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length + 1`' />
+ </set>
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <set>
+ <parameter name='tmp.service-instance-id' value='`$serv-insts[$serv-index].service-instance-id`' />
+ </set>
+ </outcome>
+ <outcome value='VNF'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ (simple_service_instance_id, forwarding_path_service_instance_id)
+ VALUES ( $serv-insts[$serv-index].service-instance-id , $tmp.service-instance-id )" ></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $tmp.service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </get-resource>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml new file mode 100755 index 0000000..1ae609a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml @@ -0,0 +1,145 @@ +<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='getpathsegment-populate-from-grapi' mode='sync'>
+ <block>
+ <switch test='`$vnf-ids_length`'>
+ <outcome value=''>
+ <block>
+ <for silentFailure='true' index='vnf-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-network-list_length' value='0' />
+ </set>
+ <set>
+ <parameter name='vnf-ids-index' value='`$vnf-index`' />
+ </set>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-id' value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <for silentFailure='true' index='vf-module-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network[$vm-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-name'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-role'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].vf-module-id'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='vnf-network-list_length' value='`$vnf-network-list_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list_length' value='`$vnf-network-list_length`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ <set>
+ <parameter name='serv-inst.api' value='GR' />
+ </set>
+ <set>
+ <parameter name='serv-inst.vnf-list_length'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='mismatch' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-ids-index' start='0' end='`$vnf-ids_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-network-list_length' value='0' />
+ </set>
+ <for silentFailure='true' index='vnf-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-ids[$vnf-ids-index] == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.onap-model-information.model-customization-uuid`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-id' value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <for silentFailure='true' index='vf-module-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network[$vm-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-name'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-role'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].vf-module-id'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='vnf-network-list_length' value='`$vnf-network-list_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list_length' value='`$vnf-network-list_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-list_length == 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='matching-error' value="`'Unable to find VNF with customization UUID of ' + $vnf-ids[vnf-ids-index] + ' for service instance ' + $serv-inst.service-instance-id`" />
+ </set>
+ <set>
+ <parameter name='mismatch' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$mismatch`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='serv-inst.api' value='GR' />
+ </set>
+ <set>
+ <parameter name='serv-inst.vnf-list_length'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml new file mode 100755 index 0000000..e84e426 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml @@ -0,0 +1,569 @@ +<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='getpathsegment-populate-from-vnfapi' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ <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' />
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="Could not read properties file" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$serv-inst.service-instance-id`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: input service-instance-id is not set"/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="serv-inst.service-instance-id is not set" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$match-type`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: input match-type is not set"/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="input match-type is not set" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-ids_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name="path-type" value= "COMPOSITE"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: input vnf-ids_length is blank, this is a COMPOSITE path"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="path-type" value= "SIMPLE"/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: input vnf-ids_length is NOT blank, this is a SIMPLE path"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="vnfListIndex" value= "0"/>
+ </set>
+ <switch test='`$path-type`'>
+ <outcome value='SIMPLE'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: Call AAI custom query vfModule-fromServiceInstance to get vf-module-ids"/>
+ </record>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vf-module-ids">
+ <parameter name="start[0]" value="`'/nodes/service-instances/service-instance?service-instance-id=' + $serv-inst.service-instance-id `" />
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/bgb-customer/service-subscriptions/service-subscription/bgb-service-type/service-instances' `" />-->
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/la-customer/service-subscriptions/service-subscription/la-service-type/service-instances' `" />-->
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/vfModule-fromServiceInstance" />
+ <!--<parameter name="query" value="/query/vnfs-fromServiceInstance" /> -->
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: vfModule-fromServiceInstance" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name='tmp.vf-module-ids_length' value='0' />
+ <parameter name='tmp.vnf-instances_length' value='0' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="No vfModules returned from AAI: vfModule-fromService-instance" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='vfModuleResultIndex' start='0' end='`$tmp.AnAI-data.vf-module-ids.results_length`' >
+ <set>
+ <parameter name="`'tmp.vf-module-ids[' + $vfModuleResultIndex + ']'`" value='`$tmp.AnAI-data.vf-module-ids.results[$vfModuleResultIndex].vf-module.vf-module-id`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-ids_length' value='`$tmp.AnAI-data.vf-module-ids.results_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name="tmp.triplet-list_length" value= "0" />
+ <parameter name="tmp.tripletListIndex" value= "0" />
+ <parameter name="tmp.vnf-instances_length" value= "0" />
+ <parameter name="tmp.vnfInstancesIndex" value= "0" />
+ <parameter name="tmp.mdsal-error-encountered" value= "false"/>
+ </set>
+ <for index='vfModuleIndex' start='0' end='`$tmp.vf-module-ids_length`' >
+ <block>
+ <set>
+ <parameter name="tmp.vnf-url" value="`'/restconf/config/VNF-API:vnfs/vnf-list/' + $tmp.vf-module-ids[$vfModuleIndex]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf-mdsal" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed to read vnf info from MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="tmp.mdsal-error-encountered" value= "true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Cannot find vnf info in MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="tmp.mdsal-error-encountered" value= "true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="`'tmp.vnf-instances[' + $tmp.vnfInstancesIndex + ']'`." value= '`$vnf-mdsal.vnf-list[0].`' />
+ <parameter name="genericVnfIdFound" value= 'false' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: MDSAL vnf-instances vnf-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.vnf-id`' />
+ <parameter name="field4" value='`$tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.generic-vnf-id`' />
+ </record>
+ <for index='tmp.tripletListIndex2' start='0' end='`$tmp.triplet-list_length`' >
+ <switch test='`$tmp.triplet-list[$tmp.tripletListIndex2].generic-vnf-id == $tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.generic-vnf-id`'>
+ <outcome value='false'></outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name="genericVnfIdFound" value= 'true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$genericVnfIdFound`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].generic-vnf-id'`" value= '`$vnf-mdsal.vnf-list[0].service-data.vnf-request-information.generic-vnf-id`' />
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].vf-module-id'`" value= '`$tmp.vf-module-ids[$vfModuleIndex]`' />
+ <parameter name="tmp.triplet-list_length" value= '`$tmp.triplet-list_length + 1`'/>
+ <parameter name="tmp.tripletListIndex" value= '`$tmp.tripletListIndex + 1`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf-id in NOT found in triplet-list, add it"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf-id is already in triplet-list, don't add it"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vnfInstancesIndex" value= '`$tmp.vnfInstancesIndex + 1`'/>
+ <parameter name="tmp.vnf-instances_length" value= '`$tmp.vnf-instances_length + 1`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <switch test='`$tmp.mdsal-error-encountered`'>
+ <outcome value='false'>
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <switch test='`$aai.generic-vnf.model-customization-id`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: model-customization-id is BLANK for vf-module-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: Set model-customization-id for vf-module-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ <parameter name="field5" value='`$aai.generic-vnf.model-customization-id`'/>
+ </record>
+ <set>
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].model-customization-id'`" value= '`$aai.generic-vnf.model-customization-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf not found in AAI for generic-vnf-id: "/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: unable to access AAI for generic-vnf-id: "/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ </switch>
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: PRINT triplet-list | vf-module-id:generic-vnf-id:model-customization-id | "/>
+ <parameter name="field3" value='`$tmp.tripletListIndex`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field5" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ <parameter name="field6" value='`$tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'/>
+ </record>
+ </for>
+ </block>
+ <for index='vnfIdIndex' start='0' end='`$vnf-ids_length`' >
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: vnfIdIndex:id | tripletListIndex:model-customization-id | : "/>
+ <parameter name="field3" value='`$vnfIdIndex`'/>
+ <parameter name="field4" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field5" value='`$tmp.tripletListIndex`'/>
+ <parameter name="field6" value='`$tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'/>
+ </record>
+ <switch test='`$vnf-ids[$vnfIdIndex] == $tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='vnfInstanceIndex' start='0' end='`$tmp.vnf-instances_length`' >
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: vnfIdIndex:id | vnfInstanceIndex:id | : "/>
+ <parameter name="field3" value='`$vnfIdIndex`'/>
+ <parameter name="field4" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field5" value='`$vnfInstanceIndex`'/>
+ <parameter name="field6" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`'/>
+ </record>
+ <switch test='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id == $tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: MATCH for vnf-instances.vnf-id and triplet-list.vf-module-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ </record>
+ <switch test='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length > 0`'>
+ <outcome value='true'>
+ <for index='vnfNetworksIndex' start='0' end='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`' >
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: MATCH for vnf-id and vnf-instances for vnf-id: "/>
+ <parameter name="field3" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field4" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfnetworksIndex].`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-name" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-name`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-role" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-role`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].vf-module-id" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list_length" value= '`$vnfNetworksIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: No vnf-networks found for vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ <set>
+ <parameter name='`tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value="0" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-id" value= "`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`"/>
+ </set>
+ <set>
+ <parameter name="vnfListIndex" value= '`$vnfListIndex + 1`'/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: MATCH for input vnf-id and triplet-list.model-customizaiton-id: "/>
+ <parameter name="field3" value='`$vnf-ids[$vnfIdIndex]`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='COMPOSITE'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: Call AAI custom query vfModule-fromServiceInstance to get vf-module-ids"/>
+ </record>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vf-module-ids">
+ <parameter name="start[0]" value="`'/nodes/service-instances/service-instance?service-instance-id=' + $serv-inst.service-instance-id `" />
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/bgb-customer/service-subscriptions/service-subscription/bgb-service-type/service-instances' `" />-->
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/la-customer/service-subscriptions/service-subscription/la-service-type/service-instances' `" />-->
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/vfModule-fromServiceInstance" />
+ <!--<parameter name="query" value="/query/vnfs-fromServiceInstance" /> -->
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: vfModule-fromServiceInstance" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name='tmp.vf-module-ids_length' value='0' />
+ <parameter name='tmp.vnf-instances_length' value='0' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="No vfModules returned from AAI: vfModule-fromService-instance" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='vfModuleResultIndex' start='0' end='`$tmp.AnAI-data.vf-module-ids.results_length`' >
+ <set>
+ <parameter name="`'tmp.vf-module-ids[' + $vfModuleResultIndex + ']'`" value='`$tmp.AnAI-data.vf-module-ids.results[$vfModuleResultIndex].vf-module.vf-module-id`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-ids_length' value='`$tmp.AnAI-data.vf-module-ids.results_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <for index='vfModuleIndex' start='0' end='`$tmp.vf-module-ids_length`' >
+ <block>
+ <set>
+ <parameter name="tmp.vnf-url" value="`'/restconf/config/VNF-API:vnfs/vnf-list/' + $tmp.vf-module-ids[$vfModuleIndex]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf-mdsal" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to read vnf info from MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot find vnf info in MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="`'tmp.vnf-instances[0]'`." value= '`$vnf-mdsal.vnf-list[0].`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: MDSAL vnf-instances vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length > 0`'>
+ <outcome value='true'>
+ <for index='vnfNetworksIndex' start='0' end='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`' >
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: copy vnf-instance data to output: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfnetworksIndex].`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-name" value= "`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-name`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-role" value= "`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-role`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].vf-module-id" value= "`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list_length" value= '`$vnfNetworksIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: getpathsegment-populate-from-vnfapi: No vnf-networks found for vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ <set>
+ <parameter name='`tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value="0" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-id" value= "`$vnf-mdsal.vnf-list[0].service-data.vnf-request-information.generic-vnf-id`"/>
+ </set>
+ <set>
+ <parameter name="vnfListIndex" value= '`$vnfListIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.service-instance-id" value= "`$serv-inst.service-instance-id`"/>
+ <parameter name="serv-inst.vnf-list_length" value= "`$vnfListIndex`"/>
+ </set>
+ <switch test='`$serv-inst.vnf-list_length > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name="serv-inst.api" value= "VNF"/>
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/getpathsegment-populate-from-vnfapi-output.log' />
+ </execute>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml new file mode 100755 index 0000000..049f22e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml @@ -0,0 +1,125 @@ +<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='getpathsegment-simple-match-pair' mode='sync'>
+ <for index='serv-insts-index' start='0' end='`$serv-insts_length`' >
+ <switch test='`$serv-insts[$serv-insts-index].vnf-list_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
+ + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
+ + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='matched-all-vnfs' value='true' />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments_length' value='0' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list_length - 1`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <set>
+ <parameter name='right-vnf-index' value='`$left-vnf-index + 1`' />
+ </set>
+ <switch test='`$match-type`'>
+ <outcome value='network-name'>
+ <for index='left-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name )
+ and
+ ( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role
+ == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-role )`'>
+ <outcome value='true'>
+ <switch test="`$serv-insts[$serv-insts-index].vnf-list[$vnf-index].vnf-network-list[$vnf-network-index].network-name == 'oam'`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-insts[$serv-insts-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-insts[$serv-insts-index].service-instance-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-insts[$serv-insts-index].service-instance-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-name'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-role'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments_length'
+ value='`$serv-insts[$serv-insts-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$found-match`">
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$found-match`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='matched-all-vnfs' value='false' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$matched-all-vnfs`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='matching-error' value="`'Not able to find matches for all vnfs of service instance ' + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments.' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml new file mode 100755 index 0000000..77d04d7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml @@ -0,0 +1,55 @@ +<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='getpathsegment-topology-operation-create' mode='sync'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from FORWARDING_PATH WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.forwarding-path[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading FORWARDING_PATH table" />
+ </return>
+ </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="`'No paths found for service UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid + ' in FORWARDING_PATH table'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='path-index' start='0' end='`$db.forwarding-path_length`' >
+ <switch test='`$db.forwarding-path[$path-index].path-type`'>
+ <outcome value='VF'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-create-simple-path' mode='sync' ></call>
+ </outcome>
+ <outcome value='Service Proxy'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-create-composite-path' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected path type ' + $db.forwarding-path[$path-index].path-type + ' in FORWARDING_PATH table'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gps.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml new file mode 100755 index 0000000..e6c2c9d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml @@ -0,0 +1,36 @@ +<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='getpathsegment-topology-operation' mode='sync'>
+ <block>
+ <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>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-getpathsegment-input' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.sdnc-request-header.' value='`$getpathsegment-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.request-information.' value='`$getpathsegment-topology-operation-input.request-information.`' />
+ <parameter name='service-data.service-information.' value='`$getpathsegment-topology-operation-input.service-information.`' />
+ <parameter name='service-data.service-request-input.' value='`$getpathsegment-topology-operation-input.service-request-input.`' />
+ </set>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_gw-vfmodule-update.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_gw-vfmodule-update.xml new file mode 100644 index 0000000..f738418 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_gw-vfmodule-update.xml @@ -0,0 +1,142 @@ +<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='gw-vfmodule-update' mode='sync'>
+<block>
+<set>
+<!--
+<parameter name='tmp.brg-macaddress' value='fa:16:3e:8f:ea:68' />
+
+
+<parameter name='tmp.consuming-service-instance-id' value='b3cb7040-f7a5-4beb-ad2f-2a893b7d374b' />
+service-data.service-topology.service-topology-identifier.service-instance-id
+
+-->
+<parameter name='tmp.brg-mac-address-match' value="`'VGW2BRG-' + $tmp.brg-macaddress`"/>
+<parameter name='tmp.consuming-service-instance-id' value='`$service-data.service-topology.service-topology-identifier.service-instance-id`' />
+</set><set>
+<parameter name='tmp.thisIsVGW' value='false' />
+</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API'
+ key='tunnelxconn-allotted-resources/' pfx='tmp.txconns' >
+ <outcome value='success'>
+<for index='txidx' start='0' end='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource_length`' >
+
+
+<block atomic='true'><set>
+<parameter name='tmp.test1' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$txidx].allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
+<!--
+this is null
+<parameter name='tmp.test2' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource-data[$txidx].tunnelxconn-topology[0].allotted-resource-identifiers[0].consuming-service-instance-id`' />
+--></set><switch test='`$tmp.test1 == $tmp.consuming-service-instance-id`'><outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.brg-macaddress'
+ value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address`' />
+
+</set><set>
+<parameter name='tmp.brg-mac-address-match' value="`'VGW2BRG-' + $tmp.brg-macaddress`"/>
+<parameter name='tmp.consuming-service-instance-id' value='`$service-data.service-topology.service-topology-identifier.service-instance-id`' />
+
+<!--
+<parameter name='tmp.brg-macaddress' value='fa:16:3e:8f:ea:68' />
+<parameter name='tmp.brg-mac-address-match' value="`'VGW2BRG-' + $tmp.brg-macaddress`"/>
+-->
+<!--
+<parameter name='tmp.consuming-service-instance-id' value='b3cb7040-f7a5-4beb-ad2f-2a893b7d374b' />
+service-data.service-topology.service-topology-identifier.service-instance-id
+
+-->
+</set><set>
+<parameter name='tmp.vg-vgmux-tunnel-vni'
+ value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$txidx].allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni`' />
+<parameter name='tmp.vg-ip'
+ value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[$txidx].allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+</set><set>
+<parameter name='tmp.thisIsVGW' value='true' />
+</set></block></outcome></switch></block></for></outcome></get-resource><switch test='`$tmp.thisIsVGW`'>
+<outcome value='true'>
+<block>
+<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='preload-vnfs' pfx='tmp.preloadvnfdata' >
+</get-resource><for index='vnfidx' start='0' end='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list_length`' >
+
+
+<block atomic='true'><set>
+<parameter name='tmp.test3' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].vnf-name`' />
+<parameter name='tmp.test4' value='`$tmp.brg-mac-address-match`'/>
+
+
+</set><switch test='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].vnf-name == $tmp.brg-mac-address-match`'>
+
+
+<outcome value='true'>
+<block>
+<set>
+<parameter name='tmp.endLoop1' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters_length`' /></set><for index='preloadIdx' start='0' end='`$tmp.endLoop1`'>
+<!--
+
+ "preload-data": {
+ "vnf-topology-information": {
+ "vnf-parameters": [
+
+ -->
+<block atomic='true'><set>
+<parameter name='tmp.vfmodule.param[$preloadIdx].name' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$preloadIdx].vnf-parameter-name`' />
+<parameter name='tmp.vfmodule.param[$preloadIdx].value' value='`$tmp.preloadvnfdata.preload-vnfs.vnf-preload-list[$vnfidx].preload-data.vnf-topology-information.vnf-parameters[$preloadIdx].vnf-parameter-value`' /></set></block></for><set>
+<parameter name='tmp.vfmodule.param_length' value='`$tmp.endLoop1`' />
+</set><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><set>
+<parameter name='tmp.restapi.service.vnf.vfmodule-resource' value='`$prop.restapi.service.vnf.vfmodule-resource`' />
+</set><set>
+<parameter name='tmp.vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-topology.service-topology-identifier.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ + '/'`"/>
+</set><set>
+<!--
+<parameter name='tmp.service.vnf.vf-module.vg-mux-tunnel-vni' value='`$input.vni`' />
+-->
+<parameter name='tmp.service.vnf.vf-module.vg-mux-tunnel-vni' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[0].allotted-resource-data[0].tunnelxconn-topology[0].tunnelxconn-assignments[0].vni`' />
+<parameter name='tmp.service.vnf.vf-module.vg-lan-ip' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource[0].allotted-resource-data[0].tunnelxconn-topology[0].tunnelxconn-assignments[0].vg-ip`' />
+
+
+
+</set><set>
+<!--
+<parameter name='tmp.service.vnf.vf-module.vg-mux-tunnel-vni' value='`$input.vni`' />
+-->
+<parameter name='tmp.vg-mux-tunnel-vni-match' value='vg_vgmux_tunnel_vni' />
+<parameter name='tmp.vg-lan-ip-match' value='vgw_private_ip_0' />
+
+
+
+
+</set><for index='paramIdx' start='0' end='`$tmp.vfmodule.param_length`' >
+<block>
+<switch test='`$tmp.vfmodule.param[$paramIdx].name == $tmp.vg-mux-tunnel-vni-match`'><outcome value='true'>
+<set>
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.vg-vgmux-tunnel-vni`' />
+
+<!--
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni`' />
+--></set></outcome></switch><switch test='`$tmp.vfmodule.param[$paramIdx].name == $tmp.vg-lan-ip-match`'><outcome value='true'>
+<set>
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.vg-ip`' />
+<!--
+<parameter name='$tmp.vfmodule.param[$paramIdx].value' value='`$tmp.txconns.tunnelxconn-allotted-resources.tunnelxconn-allotted-resource.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip`' />
+--></set></outcome></switch></block></for><set>
+<!--
+<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param.'
+
+ service-data.vnfs.vnf\[0\]. vnf-data.vf-modules.vf-module\[0\] .vf-module-data.vf-module-topology.vf-module-parameters.param.
+ value='$tmp.vfmodule.' />
+-->
+<parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.'
+ value='$tmp.vfmodule.' /></set></block></outcome></switch></block></for></block></outcome><outcome value='Other'>
+<block>
+<return status='failure'>
+<parameter name='error-code' value='500' />
+<parameter name='error-message' value='Did not find vGW Preload' />
+</return></block></outcome></switch></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml new file mode 100644 index 0000000..724faf3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml @@ -0,0 +1,24 @@ +<!--Reserve/release IP-->
+<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='manage-ipaddr-assignment' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql.plugin' value='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' />
+ </set>
+ <switch test='`$tmp.manageIpaddr.action`'>
+ <outcome value='reserve'>
+ <block atomic='true'>
+ <get-resource plugin='`$tmp.sql.plugin`' resource='IPADDR' key="SELECT min(ipv4_addr) ip from IPV4_ADDRESS_POOL where universe = $tmp.manageIpaddr.pool and status='AVAILABLE'" pfx="tmp.manageIpaddr" >
+ <outcome value='success'>
+ <save plugin='`$tmp.sql.plugin`' resource='IPADDR' key="UPDATE IPV4_ADDRESS_POOL set status='RESERVED' where universe='VGW' and ipv4_addr = $tmp.manageIpaddr.ip" force='false'></save>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='release'>
+ <save plugin='`$tmp.sql.plugin`' resource='IPADDR' key="UPDATE IPV4_ADDRESS_POOL set status='AVAILABLE' where universe='VGW' and ipv4_addr = $tmp.manageIpaddr.ip" force='false'></save>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-vni-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-vni-assignment.xml new file mode 100644 index 0000000..169d20b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_manage-vni-assignment.xml @@ -0,0 +1,13 @@ +<!--Reserve/release VNI--><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='manage-vni-assignment' mode='sync'>
+<block atomic='true'><set>
+<parameter name='tmp.sql.plugin' value='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' />
+</set><switch test='`$tmp.manageVni.action`'>
+<outcome value='reserve'>
+<block atomic='true'><get-resource plugin='`$tmp.sql.plugin`' resource='VNI' key="SELECT min(vlan_id) vni from VLAN_ID_POOL where purpose = $tmp.manageVni.pool and status='AVAILABLE'" pfx="tmp.manageVni" >
+<outcome value='success'>
+<save plugin='`$tmp.sql.plugin`' resource='VNI' key="UPDATE VLAN_ID_POOL set status='RESERVED' where purpose='VNI' and vlan_id = $tmp.manageVni.vni" force='false'>
+
+</save></outcome></get-resource></block></outcome><outcome value='release'>
+<save plugin='`$tmp.sql.plugin`' resource='VNI' key="UPDATE VLAN_ID_POOL set status='AVAILABLE' where purpose='VNI' and vlan_id=$tmp.manage-vni.vni" force='false'>
+
+</save></outcome></switch></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-name.xml new file mode 100755 index 0000000..2f6def6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-name.xml @@ -0,0 +1,1116 @@ +<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='naming-policy-generate-name' mode='sync'>
+ <block atomic='true'>
+ <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' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='naming-policy-generate-name: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$naming-policy-generate-name-input.naming-type`'>
+ <outcome value='VM'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VM_NAME_INDEX" />
+ <parameter name='table-type' value="VM_INSTANCE" />
+ <parameter name='table-prefix-column' value="vm_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='VNFC'>
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='505' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VNFC_NAME_INDEX" />
+ <parameter name='table-type' value="VNFC_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnfc_name_prefix" />
+ <parameter name='seq-length' value="0" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <set>
+ <parameter name='table-name' value="VNF_NAME_INDEX" />
+ <parameter name='table-type' value="VNF_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnf_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='NETWORK'>
+ <set>
+ <parameter name='table-name' value="NETWORK_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="NETWORK_INSTANCE" />
+ <parameter name='table-prefix-column' value="network_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='SERVICE'>
+ <set>
+ <parameter name='table-name' value="SERVICE_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="SERVICE_INSTANCE" />
+ <parameter name='table-prefix-column' value="service_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: invalid input.naming-type."/>
+ <parameter name="field3" value='`$naming-policy-generate-name-input.naming-type`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='503' />
+ <parameter name='error-message' value='naming-policy-generate-name: Invalid input.naming-type' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.policy-instance-name`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.policy-instance-name is not set but input.policy is not ASSIGN"/>
+ </record>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.vfc-customization-uuid is not set"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='ASSIGN | DELETE'></outcome>
+ </switch>
+ </block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='ASSIGN'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$naming-policy-generate-name-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='naming-policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-name' value="`$naming-policy-generate-name-input.generic-vnf-name`" />
+ <parameter name='constant-tag' value="`$naming-policy-generate-name-input.constant-tag`" />
+ <parameter name='sequence' value="`$naming-policy-generate-name-input.sequence`" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$naming-policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="naming-policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: jsonStringToCtx SUCCESS: policy-instance-name|naming-models_length|constructed-name:"/>
+ <parameter name='field3' value='`$jsonContextPrefix.content.policy-instance-name`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models_length`' />
+ <parameter name='field5' value='`$constructed-name`' />
+ </record>
+ <for index='modelsIndex' start='0' end='`$jsonContextPrefix.content.naming-models_length`' >
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: modelsIndex|naming-type|naming-recipe:"/>
+ <parameter name='field3' value='`$modelsIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ </record>
+ <set>
+ <parameter name='naming-recipe' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ <parameter name='naming-type' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ </set>
+ <switch test='`$naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-type in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-recipe`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-recipe in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-type == $naming-policy-generate-name-input.naming-type`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='original-name' value='`$naming-recipe`' />
+ </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="10" />
+ <parameter name="ctx_memory_result_key" value="namingRecipeSplits" />
+ </execute>
+ <for index='sectionIndex' start='0' end='`$namingRecipeSplits_length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Split naming-recipe sectionIndex|section value"/>
+ <parameter name="field3" value="`$sectionIndex`" />
+ <parameter name="field4" value="`$namingRecipeSplits[$sectionIndex]`" />
+ </record>
+ <block>
+ <set>
+ <parameter name='section-value' value="`$namingRecipeSplits[$sectionIndex]`" />
+ </set>
+ <for index='propertiesIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $section-value`'>
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: recipe section match: section-value|property-name:"/>
+ <parameter name="field3" value="`$section-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="MD-SAL">
+ <block>
+ <switch test='`$property-name`'>
+ <outcome value="VMNAME">
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: required input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vm-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="VNFNAME">
+ <switch test='`$naming-policy-generate-name-input.vnf-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: required input.vnf-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vnf-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <!--<parameter name="source" value="`$naming-policy-generate-name-input.test-source-endpoint-path`" />-->
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system MD-SAL name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="TOSCA">
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.query-parameter is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.query-parameter is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' method='parameterizedQuery' emitsOutcome='true' >
+ <!--<parameter name='query' value='select nfc_naming_code from VFC_MODEL where customization_uuid = ?' />-->
+ <parameter name='query' value="`$source-endpoint`" />
+ <parameter name='prefix' value='queryPfx' />
+ <parameter name='param1' value="`$naming-policy-generate-name-input.query-parameter`" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='514' />
+ <parameter name='error-message' value='naming-policy-generate-name query-parameter not found in DB table'/>
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='515' />
+ <parameter name='error-message' value='naming-policy-generate-name database access failure'/>
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </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="10" />
+ <parameter name="ctx_memory_result_key" value="sourceEndpointSplits" />
+ </execute>
+ <set>
+ <parameter name="query-parameter-name-underbars" value="`$sourceEndpointSplits[1]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$query-parameter-name-underbars`"/>
+ <parameter name="outputPath" value="tmp.query-parameter-name-dashes"/>
+ <parameter name="target" value="_"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <set>
+ <parameter name="full-query-param-name" value="`'queryPfx.' + $tmp.query-parameter-name-dashes`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$full-query-param-name`" />
+ <parameter name="outputPath" value="resolved-query-parameter" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $resolved-query-parameter`" />
+ <parameter name="new-part" value="`$resolved-query-parameter` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system TOSCA name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="AAI">
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </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="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointRegionKeySplits" />
+ </execute>
+ <set>
+ <parameter name="resource" value="`$aaiSourceEndpointRegionKeySplits[0]`" />
+ <parameter name="keys" value="`$aaiSourceEndpointRegionKeySplits[1]`" />
+ <parameter name='aai-constructed-name' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$keys`" />
+ <parameter name="regex" value="\:"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointKeySplits" />
+ </execute>
+ <for index='keyIndex' start='0' end='`$aaiSourceEndpointKeySplits_length`' >
+ <block>
+ <set>
+ <parameter name='key-value' value="`$aaiSourceEndpointKeySplits[$keyIndex]`" />
+ </set>
+ <for index='propIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $key-value`'>
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: key match: key-value|property-name:"/>
+ <parameter name="field3" value="`$key-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="aai-new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="aai-new-part" value="`$property-value` " />
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$aai-constructed-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiQueryKeySplits" />
+ </execute>
+ <set>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[0]`" value= "`$aaiQueryKeySplits[0]`"/>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[1]`" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[2]`" value="`$aaiQueryKeySplits[2]`" />
+ <!--<parameter name="aaiQueryKeyPart1" value="cloud-region.cloud-owner = 'att-aic' AND " />-->
+ <parameter name="aaiQueryKeyPart1" value="`$aaiSourceEndpointKeySplits[0]`"/>
+ <parameter name="aaiQueryKeyPart2" value=" = '" />
+ <parameter name="aaiQueryKeyPart3" value="`$aaiQueryKeySplits[0]`" />
+ <parameter name="aaiQueryKeyPart4" value="' AND " />
+ <parameter name="aaiQueryKeyPart5" value="`$aaiSourceEndpointKeySplits[1]`"/>
+ <parameter name="aaiQueryKeyPart6" value=" = '" />
+ <parameter name="aaiQueryKeyPart7" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="aaiQueryKeyPart8" value="' AND " />
+ <parameter name="aaiQueryKeyPart9" value="`$aaiSourceEndpointKeySplits[2]`"/>
+ <parameter name="aaiQueryKeyPart10" value=" = '" />
+ <parameter name="aaiQueryKeyPart11" value="`$aaiQueryKeySplits[2]`" />
+ <parameter name="aaiQueryKeyPart12" value="'" />
+ <parameter name="aaiQueryKey" value="`$aaiQueryKeyPart1 + $aaiQueryKeyPart2 + $aaiQueryKeyPart3 + $aaiQueryKeyPart4 + $aaiQueryKeyPart5 + $aaiQueryKeyPart6 + $aaiQueryKeyPart7 + $aaiQueryKeyPart8 + $aaiQueryKeyPart9 + $aaiQueryKeyPart10 + $aaiQueryKeyPart11 + $aaiQueryKeyPart12 `" />
+ <!-- works without single quotes <parameter name="aaiQueryKey" value="`'cloud-region.cloud-owner = att-aic AND ' + $aaiSourceEndpointKeySplits[0] + ' = ' + $aaiQueryKeySplits[0] + ' AND ' + $aaiSourceEndpointKeySplits[1] + ' = ' + $aaiQueryKeySplits[1]`" />-->
+ <!-- key="cloud-region.cloud-owner = '$a' AND cloud-region.cloud-region-id = '$b' AND tenant.tenant-id = '$c' AND vserver.vserver-id = '$d'" -->
+ <!--<parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />-->
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Call AAI query for keys aai-constructed-name|region|aaiQueryKey:"/>
+ <parameter name="field3" value="`$aai-constructed-name`" />
+ <parameter name="field4" value="`$resource`" />
+ <parameter name="field5" value="`$aaiQueryKey`" />
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource='`$resource`'
+ key='`$aaiQueryKey`'
+ pfx="`'aai.' + $resource`" local-only='true' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.tenant-name' value='`$aai.tenant.tenant-name`' />
+ </set>
+ </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="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $tmp.tenant-name`" />
+ <parameter name="new-part" value="`$tmp.tenant-name` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system AAI name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="seq-scope" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.scope`" />
+ <parameter name="seq-start-value" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.start-value` " />
+ <parameter name="seq-length" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.length` " />
+ <parameter name="seq-increment" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.increment` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: SDN-GC SEQUENCE info: scope|start-value|length|increment|constructed-name:"/>
+ <parameter name="field3" value="`$seq-scope`" />
+ <parameter name="field4" value="`$seq-start-value`" />
+ <parameter name="field5" value="`$seq-length`" />
+ <parameter name="field6" value="`$seq-increment`" />
+ <parameter name="field7" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="new-part" value="`$property-value` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: property-value name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: naming-type from returned policy does not match input.naming-type. Do not construct name for: "/>
+ <parameter name="field3" value="`$naming-type`" />
+ </record>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/naming-policy-generate-name.log' />
+ </execute>
+ <return status='success'>
+ <parameter name='naming-policy-generate-name-output.vm-name' value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value="`$naming-policy-generate-name-output.vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml new file mode 100644 index 0000000..23aece7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml @@ -0,0 +1,182 @@ +<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='naming-policy-generate-unique-name' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.action not supplied' />
+ </return>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.context-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="generate-unique-name-input.context-id cannot be null for ASSIGN action" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ <outcome value='VNF_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/generic-vnfs?vnf-name=' />
+ </set>
+ </outcome>
+ <outcome value='VM_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/vservers?vserver-name=' />
+ </set>
+ </outcome>
+ <outcome value='NETWORK_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/l3-networks?network-name=' />
+ </set>
+ </outcome>
+ <outcome value='SERVICE_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/service-instances?service-instance-name=' />
+ </set>
+ </outcome>
+ <outcome value='VNFC_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/vnfcs?vnfc-name=' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.nononap' value='NON-ONAP' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.transient' value='TRANSIENT' />
+ </set>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='true' />
+ </set>
+ <while test='`$tmp.grn.loop.flag`'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Encountered error in naming-policy-generate-unique-name: ' +
+ $generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value='`$generate-unique-name-output.generated-name`'/>
+ <parameter name="outputPath" value="encoded-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.nodes-query">
+ <parameter name="start[0]" value="`$tmp.gname.custom-query-string +
+ $encoded-name`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="update GENERIC_RESOURCE_NAME set context_id = $tmp.gun.nononap
+ WHERE type = $generate-unique-name-input.name-table-type
+ AND context_id = $tmp.gun.transient">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = '
+ + $generate-unique-name-input.name-table-type`"/>
+ </return>
+ </outcome>
+ </update>
+ </outcome>
+ </save>
+ </block>
+ </while>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="update GENERIC_RESOURCE_NAME set context_id = $generate-unique-name-input.context-id
+ WHERE type = $generate-unique-name-input.name-table-type
+ AND name = $generate-unique-name-output.generated-name
+ AND context_id = $tmp.gun.transient">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = '
+ + $generate-unique-name-input.name-table-type`"/>
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <set>
+ <parameter name='rollback-generated-names-input.naming-type' value='`$generate-unique-name-input.name-table-type`' />
+ </set>
+ <set>
+ <parameter name='rollback-generated-names-input.context-id' value='`$generate-unique-name-input.context-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='rollback-generated-names' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Encountered error in rollback-generated-names: ' +
+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='Invalid generate-unique-name-input.action. Valid values are ASSIGN or DELETE' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-activate.xml new file mode 100755 index 0000000..ed5130a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-activate.xml @@ -0,0 +1,206 @@ +<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='network-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id AND
+ depth = 'all'"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="network-id not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no networks found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $aai.l3-network.subnets.subnet[$sidx].subnet-id" >
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - activate failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
+ <parameter name="eipam-ip-block.plans[0].plan-name" value="`$tmp.eipam-subnet-row.plan-name`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'ACTIVE'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $aai.l3-network.network-id" >
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $networkId
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml new file mode 100755 index 0000000..4de5c5f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml @@ -0,0 +1,1405 @@ +<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='network-topology-operation-assign-automated' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='network-data.service-information.ecomp-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='network-data.network-information.ecomp-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VPN_BINDINGS WHERE network_customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid'
+ pfx='vpn-bindings[]'>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='hasVpnBindings' value='true' />
+ </set>
+ <for index='vidx' start='0' end='`$vpn-bindings_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $vpn-bindings[$vidx].binding-uuid"
+ pfx='aai.vpnBinding' local-only='false' >
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'No vpn binding found for network-model.vpn-binding='
+ + $vpn-bindings[$vidx].binding-uuid`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'No vpn binding found for network-model.vpn-binding='
+ + $vpn-bindings[$vidx].binding-uuid`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Network model is_bound_to_vpn=true but no vpn_binding is present"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Unexpected error retrieving vpn binding"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.l3-network.network-id' value="`$tmp.return.generate-l3network-network-id.uuid`" />
+ <parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
+ <parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
+ <parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <switch test='`$network-model.is-provider-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-shared-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-external-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.complex-found' value='false' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
+ depth = '0'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving cloud region from AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.complex-found' value='true' />
+ </set>
+ <set>
+ <parameter name='service-data.network-request-input.aic-clli' value='`$aai.complex.physical-location-id`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$aai.complex.region`'>
+ <outcome value='USA'>
+ <block>
+ <set>
+ <parameter name='aai.complex.region' value='US' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='CALA'>
+ <block>
+ <set>
+ <parameter name='aai.complex.region' value='LA' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='CA'>
+ <block></block>
+ </outcome>
+ <outcome value='US'>
+ <block></block>
+ </outcome>
+ <outcome value='LA'>
+ <block></block>
+ </outcome>
+ <outcome value='EMEA'>
+ <block></block>
+ </outcome>
+ <outcome value='AP'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex.region unknown"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving complex from AA"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$tmp.complex-found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.network-technology`'>
+ <outcome value='Contrail'>
+ <block atomic="true">
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v4-address-plan`'>
+ <outcome value='AIC_ATM_UNPROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_ATM_PROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_AIM_LANDING_NETWORK_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid address plan for VIPR"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v6-address-plan`'>
+ <outcome value='AIC_ATM_UNPROTECTED_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_ATM_PROTECTED_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_AIM_LANDING_NETWORK_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="EIPAM V6 Address plan should be null"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AIC_SR_IOV'>
+ <block atomic="true">
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v4-address-plan`'>
+ <outcome value='AIC_DATA_PLANE_UNPROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_DATA_PLANE_PROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_DATA_PLANE_PRIVATE_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid address plan for SRIOV"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v6-address-plan`'>
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid ipv6 address plan for SRIOV"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid network-technology. Only AIC_SR_IOV and Contrail are supported for network automated flow"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.process-eipam-action' value='assign' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='process-eipam-pools' mode='sync' ></call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Values after process-eipam"/>
+ <parameter name="field5" value="`level1-v4-mask`"/>
+ <parameter name="field6" value="`$tmp.l3-network.level1.v4.mask`"/>
+ <parameter name="field7" value="`level1-v4-ipprefix`"/>
+ <parameter name="field8" value="`$tmp.l3-network.level1.v4.ip-prefix`"/>
+ <parameter name="field9" value="`level1-v4-entity-id`"/>
+ <parameter name="field10" value="`$tmp.l3-network.level1.v4.entity-id`"/>
+ <parameter name="field11" value="`level2-v4-mask`"/>
+ <parameter name="field12" value="`$tmp.l3-network.level2.v4.mask`"/>
+ <parameter name="field13" value="`level2-v4-ipprefix`"/>
+ <parameter name="field14" value="`$tmp.l3-network.level2.v4.ip-prefix`"/>
+ <parameter name="field15" value="`level2-v4-entity-id`"/>
+ <parameter name="field16" value="`$tmp.l3-network.level2.v4.entity-id`"/>
+ </record>
+ <set>
+ <parameter name='v4.entity-id' value='`$tmp.l3-network.level2.v4.entity-id`' />
+ <parameter name='v4.ip-prefix' value='`$tmp.l3-network.level2.v4.ip-prefix`' />
+ <parameter name='v4.mask' value='`$tmp.l3-network.level2.v4.mask`' />
+ <parameter name='v6.entity-id' value='`$tmp.l3-network.level2.v6.entity-id`' />
+ <parameter name='v6.ip-prefix' value='`$tmp.l3-network.level2.v6.ip-prefix`' />
+ <parameter name='v6.mask' value='`$tmp.l3-network.level2.v6.mask`' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-name`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name='tmp.network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name='tmp.network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
+ <parameter name='tmp.network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
+ <parameter name='tmp.network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
+ </set>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$tmp.l3-network.network-type`" />
+ <parameter name="network-role" value="`$tmp.l3-network.network-role`" />
+ <parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
+ <parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
+ <parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
+ <parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$tmp.l3-network.network-type`" />
+ <parameter name="network-role" value="`$tmp.l3-network.network-role`" />
+ <parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
+ <parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
+ <parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
+ <parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$hasVpnBindings`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$vpn-bindings_length`' >
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vpn-bindings[$vidx].binding-uuid`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <!-- create relationship-list -->
+ <parameter name="relationship-list.relationship[0].related-to" value="tenant" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="tenant.tenant-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="cloud-region" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$network-model.network-technology`'>
+ <outcome value='AIC_SR_IOV'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.l3-network.segmentation-id" value="1"/>
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="segmentation-assignment"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND segmentation-assignment.segmentation-id = $tmp.l3-network.segmentation-id" >
+ <!-- Create segmentation-assignment object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="segmentation-id" value="`$tmp.l3-network.segmentation-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value='$x.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml new file mode 100755 index 0000000..b0eb3f6 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml @@ -0,0 +1,875 @@ +<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='network-topology-operation-assign-from-preload' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.ecomp-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.ecomp-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.preload-network`"/>
+ <parameter name="outputPath" value="tmp.pn-url"/>
+ <parameter name="target" value="{network-name}"/>
+ <parameter name="replacement" value="`$tmp.network-instance-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pn-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="preload-data" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error: No preload-network found with network-name =' + $tmp.network-instance-name + ' in md-sal'" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-name = $tmp.network-instance-name"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error searching for l3-network with network-name =' + $tmp.network-instance-name + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
+ <parameter name='tmp.l3-network.network-type' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-type`" />
+ <parameter name="tmp.l3-network.physical-network-name" value="`$preload-data.preload-network-topology-information.physical-network-name`" />
+ <parameter name="tmp.l3-network.is-provider-network" value="`$preload-data.preload-network-topology-information.is-provider-network`" />
+ <parameter name="tmp.l3-network.is-shared-network" value="`$preload-data.preload-network-topology-information.is-shared-network`" />
+ <parameter name="tmp.l3-network.is-external-network" value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name="tmp.l3-network.tenant-id" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="tmp.l3-network.network-role-instance" value="0" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.from-preload" value='true' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.network-type" value='`$tmp.l3-network.network-type`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto.log' />
+ </execute>
+ <switch test="`$preload-data.preload-network-topology-information.subnets_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.subnets_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-enabled`">
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="false" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].addr-from-start`">
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`">
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.local.network-id" value="`$tmp.l3-network.network-id`" />
+ </set>
+ <call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" >
+ <!-- Create subnet object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-name`" />
+ <parameter name="subnet-role" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-role`" />
+ <parameter name="gateway-address" value="`$tmp.gateway-address`" />
+ <parameter name="network-start-address" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ip-version" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-start-address`" />
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-end-address`" />
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" />
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$preload-data.preload-network-topology-information.host-routes_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.host-routes_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="h" start="0" end="`$preload-data.preload-network-topology-information.host-routes_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local.subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-host-routes-host-route-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="host-route"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid" >
+ <!-- Create host-route object -->
+ <parameter name="host-route-id" value="`$tmp.return.generate-host-routes-host-route-id.uuid`" />
+ <parameter name="route-prefix" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].route-prefix`" />
+ <parameter name="next-hop" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].next-hop`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <!-- create relationship-list -->
+ <parameter name="relationship-list.relationship[0].related-to" value="tenant" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="tenant.tenant-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="cloud-region" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.vpn-bindings_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`">
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vpn-binding-id != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $tmp.vpn-binding-id"
+ local-only="false"
+ pfx="tmp.AnAI.vpn-binding">
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.vpn-binding.vpn-id`" >
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where vpn-binding-id = ' + $tmp.vpn-binding-id + '.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where vpn-binding-id = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where vpn-binding-id = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vpn-binding-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn-binding relationship for l3-network in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn-binding relationship for l3-network in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name="tmp.is-bound-to-vpn" value="true" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.network-policy_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <switch test="`$preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn != ''`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-fqdn = $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn"
+ local-only="false"
+ pfx="tmp.AnAI.network-policy">
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.network-policy.network-policy-id`" >
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query newtork-policy from AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn + '. It is likely that the same network-policy-fqdn points to more than one network-policy objects in AnAI.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="network-policy" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.network-policy.network-policy-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving network-policy relationship for l3-network in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving network-policy relationship for l3-network in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.route-table-reference_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn != ''`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-table-reference"
+ key="route-table-reference.route-table-reference-fqdn = $preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn"
+ pfx="tmp.AnAI.route-table-reference">
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.route-table-reference.route-table-reference-id`" >
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query route-table-reference from AnAI where route-table-reference-fqdn = ' + $preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn + '. It is likely that the same route-table-reference-fqdn points to more than one route-table-reference objects in AnAI.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.route-table-reference.route-table-reference-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving route-table-reference relationship for l3-network in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving route-table-reference relationship for l3-network in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.is-bound-to-vpn`">
+ <outcome value="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="is-bound-to-vpn" value="true" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network is-bound-to-vpn in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network is-bound-to-vpn in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.from-preload" value='true' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto2.log' />
+ </execute>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success' ></return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml new file mode 100755 index 0000000..56c9f6a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml @@ -0,0 +1,1097 @@ +<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='network-topology-operation-assign-vlantagging-instancegroup' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.ngidx`">
+ <outcome value=''>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_len`'>
+ <outcome value=''>
+ <set>
+ <parameter name='ngidx' value='0' />
+ <parameter name='ngidx_len' value='1'/>
+ <parameter name="ngnidx" value='0' />
+ <parameter name="nig.preexists" value="false"/>
+ <parameter name="nig.first-network" value="true"/>
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ngidx' value='`$service-data.network-instance-groups.network-instance-group_length`' />
+ <parameter name='ngidx_len' value='`$service-data.network-instance-groups.network-instance-group_length + 1`' />
+ <parameter name="nig.preexists" value="false"/>
+ <parameter name="ngnidx" value='0' />
+ <parameter name="nig.first-network" value="true"/>
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='ngidx' value='`$tmp.ngidx`' />
+ <parameter name='ngidx_len' value='`$service-data.network-instance-groups.network-instance-group_length`' />
+ <parameter name="nig.preexists" value="false"/>
+ </set>
+ <switch test='`$ctx.network-instance-group-data.networks.network_len`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig.first-network" value="true" />
+ <parameter name="ngnidx" value="0" />
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig.first-network" value="true" />
+ <parameter name="ngnidx" value="0" />
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig." value="`$ctx.network-instance-group-data.`" />
+ </set>
+ <set>
+ <parameter name="nig.first-network" value="false" />
+ <parameter name="ngnidx" value="`$ctx.network-instance-group-data.networks.network_length`" />
+ <parameter name="nig.networks.network_len" value="`$ctx.network-instance-group-data.networks.network_length + 1`" />
+ <parameter name="nig." value="`$ctx.network-instance-group-data.`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ <parameter name="tmp.l3-network.network-instance-group-id" value="`$network-topology-operation-input.network-request-input.network-instance-group-id`" />
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ <parameter name='service-data.networks.network[$nidx].network-id' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx]..network-data.service-information.onap-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='service-data.networks.network[$nidx]..network-data.network-information.onap-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
+ <parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
+ <parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <switch test='`$network-model.is-provider-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-shared-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-external-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error searching for l3-network with network-id =' + $tmp.l3-network.network-id + 'from AnAI. Network should be created by MSO'" />
+ </return>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ </get-resource>
+ <set>
+ <parameter name='aaiapi.input.network-instance-group-id' value="`$tmp.l3-network.network-instance-group-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='aai-get-network-instance-group' mode='sync' ></call>
+ <set>
+ <parameter name="get-complex-resource-service-model-input.customization-uuid" value="`$aaiapi.output.collection-customization-uuid`"/>
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-complex-resource-service-model' mode='sync' ></call>
+ <set>
+ <parameter name="nig.network-instance-group-id" value="`$tmp.l3-network.network-instance-group-id`"/>
+ <parameter name="nig.network-instance-group-function" value="`$aaiapi.output.collection-function`"/>
+ <parameter name="nig.service-instance-id" value="`$network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <set>
+ <parameter name='nig.networks.network[$ngnidx].network-id' value="`$tmp.l3-network.network-id`" />
+ </set>
+ <set>
+ <parameter name="get-data-from-policy-input.policy-instance-name" value="`$get-complex-resource-service-model-output.subnet-assignment-policy`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' ></call>
+ <set>
+ <parameter name="nig.subnet-assignment-policy.subnet-use" value="`$get-data-from-policy-output.ip-assignment`" />
+ </set>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$get-complex-resource-service-model-output.network-naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$network-model.customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.l3-network.network-name' value='`$naming-policy-generate-name-output.network-name`' />
+ </set>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-id`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-instance-group-id' value="`$tmp.l3-network.network-instance-group-id`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
+ <parameter name='network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name='network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name='network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
+ <parameter name='network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
+ <parameter name='network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
+ <parameter name='nig.network.network-id' value="`$tmp.l3-network.network-id`" />
+ </set>
+ <set>
+ <parameter name="aaiapi.input.cloud-owner" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="aaiapi.input.cloud-region-id" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='aai-get-aic-zone' mode='sync' ></call>
+ <set>
+ <parameter name='network-topology.region-identifier.aic-clli' value="`$aaiapi.output.aic-clli`" />
+ </set>
+ <set>
+ <parameter name="nig.cloud-zone" value="`$aaiapi.output.cloud-zone`" />
+ <parameter name="rt.aic-zone" value="`$aaiapi.output.cloud-zone`" />
+ <parameter name="rt.resource" value="NetworkID" />
+ <parameter name="rt.resource-value" value="`$tmp.l3-network.network-id`" />
+ <parameter name="rt.network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="rt.service-instance-id" value="`$network-topology-operation-input.service-information.service-instance-id`" />
+ <parameter name="rt.network-instance-group-id" value="`$tmp.l3-network.network-instance-group-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='create-route-target-and-vpn-binding' mode='sync' ></call>
+ <set>
+ <parameter name='nig.vpn-bindings.id' value="`$vpn-binding.vpn-binding-id`" />
+ <parameter name='nig.vpn-bindings.global-route-target' value="`$vpn-binding.global-route-target`" />
+ <parameter name='nig.vpn-bindings.aic-zone' value="`$aaiapi.output.cloud-zone`" />
+ <parameter name='nig.vpn-bindings.route-target-role' value="`$vpn-binding.route-target-role`" />
+ </set>
+ <switch test='`$nig.subnet-assignment-policy.subnet-use`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Subnet use not set"/>
+ </set>
+ <switch test='`$tmp.nig-preexists`'>
+ <outcome value='true'>
+ <block atomic='true'></block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-nig" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unique'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.skip-first-level" value="Y"/>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ <parameter name="generate-FQPN-input.aic-cloud-region" value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology.network-topology-identifier-structure.network-name`" />
+ <parameter name="generate-FQPN-input.network-role" value="`$network-topology.network-topology-identifier-structure.network-role`" />
+ <parameter name="generate-FQPN-input.network-collection" value="`$aaiapi.output.collection-name`" />
+ <parameter name="generate-FQPN-input.network-id" value="`$network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-id" value="`network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology.network-topology-identifier-structure.network-instance-group-id`" />
+ <!-- the following are not set by calling dg
+generate-FQPN-input.subnet-role
+generate-FQPN-input.zone
+generate-FQPN-input.equipment
+-->
+ <!-- network model is already in contect memory -->
+ <!-- aai.cloud-region.cloud-region-id is already in contect memory -->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$network-model.eipam-v4-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v4-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v4.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v4.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v4.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.eipam-v6-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v6-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v6.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v6.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v6.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="msidx" value="`$nig.subnets_length`" />
+ </set>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="nig.subnets[$msidx].start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="nig.subnets[$msidx].subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="nig.subnets[$msidx].subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="nig.subnets[$msidx].gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="nig.subnets[$msidx].cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="nig.subnets[$msidx].ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="nig.subnets[$msidx].dhcp-start-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="nig.subnets[$msidx].dhcp-end-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="nig.subnets[$msidx].dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ </set>
+ <set>
+ <parameter name="msidx" value="`$msidx + 1`" />
+ <parameter name="nig.subnets_length" value="`$nig.subnets_length + 1`" />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='shared'>
+ <block atomic="true">
+ <switch test='`$tmp.first-network`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.skip-first-level" value="Y"/>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ <parameter name="generate-FQPN-input.aic-cloud-region" value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology.network-topology-identifier-structure.network-name`" />
+ <parameter name="generate-FQPN-input.network-role" value="`$network-topology.network-topology-identifier-structure.network-role`" />
+ <parameter name="generate-FQPN-input.network-collection" value="`$aaiapi.output.collection-name`" />
+ <parameter name="generate-FQPN-input.network-id" value="`$network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-id" value="`network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology.network-topology-identifier-structure.network-instance-group-id`" />
+ <!-- the following are not set by calling dg
+generate-FQPN-input.subnet-role
+generate-FQPN-input.zone
+generate-FQPN-input.equipment
+-->
+ <!-- network model is already in contect memory -->
+ <!-- aai.cloud-region.cloud-region-id is already in contect memory -->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$network-model.eipam-v4-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v4-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v4.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v4.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v4.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.eipam-v6-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v6-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v6.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v6.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v6.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="msidx" value="`$nig.subnets_length`" />
+ </set>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="nig.subnets[$msidx].start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="nig.subnets[$msidx].subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="nig.subnets[$msidx].subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="nig.subnets[$msidx].gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="nig.subnets[$msidx].cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="nig.subnets[$msidx].ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="nig.subnets[$msidx].dhcp-start-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="nig.subnets[$msidx].dhcp-end-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="nig.subnets[$msidx].dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ </set>
+ <set>
+ <parameter name="msidx" value="`$msidx + 1`" />
+ <parameter name="nig.subnets_length" value="`$nig.subnets_length + 1`" />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test='`$ngnidx`'>
+ <outcome value=''>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'></switch>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/aai/v$/network/instance-groups/instance-group/'+ $tmp.network-instance-group-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving instance-group relationship for l3-network in AnAI where instance-group-id = ' + $tmp.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving instance-group relationship for l3-network in AnAI where instance-group-id = ' + $tmp.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.network-instance-groups.network-instance-group[$ngidx]." value='`$nig.`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign.xml new file mode 100755 index 0000000..1f6f5d8 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-assign.xml @@ -0,0 +1,103 @@ +<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='network-topology-operation-assign' mode='sync'>
+ <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>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tenant"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
+ tenant.tenant-id = $network-topology-operation-input.network-request-input.tenant"
+ pfx='aai.tenant' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true"></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="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-l3network-network-id' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.return.generate-l3network-network-id.uuid' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.l3-network.network-id' value='`$tmp.return.generate-l3network-network-id.uuid`' />
+ <parameter name='network-topology-operation-input.network-information.network-id' value='`$tmp.return.generate-l3network-network-id.uuid`' />
+ </set>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$network-topology-operation-input.network-request-input.network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$network-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$network-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$network-model.customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.network-instance-name' value='`$naming-policy-generate-name-output.network-name`' />
+ <parameter name='tmp.l3-network.network-name' value='`$naming-policy-generate-name-output.network-name`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-automated' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Network name is required if onap naming is false" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.network-instance-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
+ <parameter name='tmp.l3-network.network-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-from-preload' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-vlantagging-instancegroup' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml new file mode 100755 index 0000000..7d0155a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml @@ -0,0 +1,1172 @@ +<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='network-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: changeassign only allowed for networks with from-preload set to true" />
+ </return>
+ </outcome>
+ </switch>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.preload-network`"/>
+ <parameter name="outputPath" value="tmp.pn-url"/>
+ <parameter name="target" value="{network-name}"/>
+ <parameter name="replacement" value="`$network-topology-operation-input.network-request-information.network-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pn-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="preload-data" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error: No preload-network found with network-name =' + $tmp.network-instance-name + ' in md-sal'" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id
+ AND depth='all'"
+ local-only="false"
+ pfx="tmp.AnAI.l3network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network-id: ' + $network-topology-operation-input.network-request-information.network-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$tmp.AnAI.l3network.network-name == $network-data.network-topology.network-topology-identifier-structure.network-name`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'The input network-name,' + network-topology-operation-input.network-request-information.network-name + ', does not match what is returned from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.network-type == $network-data.network-topology.network-topology-identifier-structure.network-type`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'The input network-type,' + network-topology-operation-input.network-request-information.network-type + ', does not match what is returned from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.network-name == $preload-data.preload-network-topology-information.network-topology-identifier.network-name`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'No preload network found with network-name = ' + $tmp.AnAI.l3network.network-name + ' in SDNC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.network-type == $preload-data.preload-network-topology-information.network-topology-identifier.network-type`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'No preload network found with network-type = ' + $tmp.AnAI.l3network.network-type + ' in SDNC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='x' value='0' />
+ <parameter name='tmp.error-message' value='' />
+ <parameter name='execute_failure' value='false' />
+ <parameter name='tmp.l3networkUpdate' value='0' />
+ </set>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.AnAI.l3network.subnets.subnet_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="k" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.start-address-match' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.subnetUpdate' value='0' />
+ </set>
+ <block atomic='true'>
+ <for index="n" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].network-start-address == $preload-data.preload-network-topology-information.subnets[$n].start-address`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.start-address-match' value='1' />
+ </set>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].cidr-mask == $preload-data.preload-network-topology-information.subnets[$n].cidr-mask`">
+ <outcome value='false'>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`">
+ <outcome value=''>
+ <block>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$n].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$n].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$n].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ </execute>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].gateway-address == $tmp.return.generate.gateway-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ </set>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].gateway-address == $preload-data.preload-network-topology-information.subnets[$n].gateway-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`" />
+ </set>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-enabled`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].addr-from-start`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].ip-assignment-direction == $tmp.addrFromStart.boolean`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-enabled == $tmp.dhcpEnabled.boolean`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-start == $preload-data.preload-network-topology-information.subnets[$n].dhcp-start-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-end == $preload-data.preload-network-topology-information.subnets[$n].dhcp-end-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-name == $preload-data.preload-network-topology-information.subnets[$n].subnet-name`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-role == $preload-data.preload-network-topology-information.subnets[$n].subnet-role`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.subnetUpdate == 1`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id" >
+ <!-- Update l3network.subnet -->
+ <parameter name="gateway-address" value="`$tmp.gateway-address`"/>
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$n].subnet-name`"/>
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$n].cidr-mask`"/>
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-start-address`"/>
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-end-address`"/>
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`"/>
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingUpdate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet attributes in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet attributes in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ <parameter name="tmp.subnetRollback[$x].type" value = "update"/>
+ </set>
+ <set>
+ <parameter name="x" value = "`$x + 1`" />
+ </set>
+ <set>
+ <parameter name="tmp.l3networkUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <switch test="`$tmp.start-address-match == 0`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet status to PendingDelete in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet status to PendingDelete in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ <parameter name="tmp.subnetRollback[$x].orchestration-status" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].orchestration-status`" />
+ <parameter name="tmp.subnetRollback[$x].type" value = "delete" />
+ </set>
+ <set>
+ <parameter name="x" value = "`$x + 1`" />
+ </set>
+ <set>
+ <parameter name="tmp.l3networkUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.start-address-match" value="0" />
+ </set>
+ <block atomic='true'>
+ <for index="j" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].start-address == $tmp.AnAI.l3network.subnets.subnet[$j].network-start-address`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.start-address-match' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.start-address-match == 0`">
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-enabled`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].addr-from-start`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gateway-address' value='`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`' />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`">
+ <outcome value=''>
+ <block>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ </execute>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.local.network-id" value="`$tmp.AnAI.l3network.network-id`" />
+ </set>
+ <call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.AnAI.l3network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="gateway-address" value="`$tmp.gateway-address`" />
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-name`" />
+ <parameter name="network-start-address" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ip-version" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-start-address`" />
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-end-address`" />
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" />
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="tmp.subnetRollback[$x].type" value = "create" />
+ </set>
+ <set>
+ <parameter name="x" value = "`$x + 1`" />
+ </set>
+ <set>
+ <parameter name='tmp.l3networkUpdate' value='1' />
+ </set>
+ <block>
+ <set>
+ <parameter name="tmp.local.subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$j].subnet-id`" />
+ </set>
+ <switch test='`$preload-data.preload-network-topology-information.subnets[$i].host-routes_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.subnets[$i].host-routes_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="h" start="0" end="`$preload-data.preload-network-topology-information.subnets[$i].host-routes_length`">
+ <block atomic='true'>
+ <call module="VNF-API" rpc="generate-host-routes-host-route-id" mode="sync" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="host-route"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.local.subnet-id
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid" >
+ <!-- Create host-route object -->
+ <parameter name="host-route-id" value="`$tmp.return.generate-host-routes-host-route-id.uuid`" />
+ <parameter name="route-prefix" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].route-prefix`" />
+ <parameter name="next-hop" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].next-hop`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND related-to = vpn-binding" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while deleting l3-network vpn-binding relationship from AnAI"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.vpn-bindings_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`">
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target != ''`" >
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.global-route-target = $preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target"
+ pfx="tmp.AnAI.vpn-binding">
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings n AnAI where global-route-target = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings n AnAI where global-route-target = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$tmp.AnAI.vpn-binding.vpn-id`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <switch test="`$tmp.vpn-binding-id != ''`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vpn-binding-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <set>
+ <parameter name="i" value = "`$preload-data.preload-network-topology-information.vpn-bindings_length + 1`" />
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <set>
+ <parameter name="i" value = "`$preload-data.preload-network-topology-information.vpn-bindings_length + 1`" />
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vpn-binding.updated' value='1' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND related-to = network-policy" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while deleting l3-network network-policy relationship from AnAI in preparation to regenerate the network-policy relationship from PRELOAD."/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.network-policy_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <switch test="`$preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn != NULL`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-fqdn = $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn"
+ pfx="tmp.AnAI.network-policy" >
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="network-policy" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.network-policy.network-policy-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.network-policy.updated' value='1' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND related-to = route-table-reference" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while deleting l3-network route-table-reference relationship from AnAI prior to regenerate the route-table-reference relationship from PRELOAD."/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.route-table-reference_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn != NULL`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-table-reference"
+ key="route-table-reference.route-table-reference-fqdn = $preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn"
+ pfx="tmp.AnAI.route-table-reference">
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.route-table-reference.route-table-reference-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.route-table-reference.updated' value='1' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <switch test="`$tmp.l3networkUpdate == 1`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="orchestration-status" value="PendingUpdate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while updating l3-network.orchestration-status in AnAI"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while updating l3-network.orchestration-status in AnAI"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.l3network.status.updated' value='1' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value="true">
+ <block atomic='true'>
+ <set>
+ <parameter name='ROLLBACK_START' value='NETWORK_TOPOLOGY_CHANGEASSIGN' />
+ </set>
+ <for index="z" start="0" end="`$tmp.AnAI.l3network.relationship-list.relationship_length`">
+ <switch test="`$tmp.AnAI.l3network.relationship-list.relationship[$z].related-to`">
+ <outcome value='vpn-binding'>
+ <switch test="`$tmp.vpn-binding.updated == 1`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='network-policy'>
+ <switch test="`$tmp.network-policy.updated == 1`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="network-policy" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='route-table-reference'>
+ <switch test="`$tmp.route-table-reference.updated == 1`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <for index="j" start="0" end="`$x`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.rollback.match" value="0"/>
+ </set>
+ <for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-id == $tmp.subnetRollback[$j].subnet-id`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.subnetRollback[$j].type`">
+ <outcome value='delete'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.subnetRollback[$j].subnet-id" >
+ <parameter name="orchestration-status" value="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ <outcome value='update'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$j].subnet-id" >
+ <parameter name="subnet-name" value="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name`"/>
+ <parameter name="gateway-address" value="`$tmp.AnAI.l3network.subnets.subnet[$i].gateway-address`"/>
+ <parameter name="cidr-mask" value="`$tmp.AnAI.l3network.subnets.subnet[$i].cidr-mask`"/>
+ <parameter name="dhcp-start" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-start`"/>
+ <parameter name="dhcp-end" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-end`"/>
+ <parameter name="dhcp-enabled" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-enabled`"/>
+ <parameter name="orchestration-status" value="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet attributes update in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet attributes update in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.rollback.match" value="1"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.rollback.match == 0`">
+ <outcome value='true'>
+ <switch test="`$tmp.subnetRollback[$j].type`">
+ <outcome value='create'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.subnetRollback[$j].subnet-id" >
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback to delete subnet from AnAI where subnet-id = ' + $tmp.subnetRollback[$j].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback to delete subnet from AnAI where subnet-id = ' + $tmp.subnetRollback[$j].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.l3network.status.updated == 1`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="orchestration-status" value="`$tmp.AnAI.l3network.orchestration-status`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback l3network.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback l3network.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error updating l3-network in AnAI with network-id = ' + $tmp.AnAI.l3network.network-id + ' - ' + $tmp.error-message + ' - ' + $tmp.rollback.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <return status="success">
+ <parameter name="networkId" value="`$network-topology-operation-input.network-request-information.network-id`" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-create.xml new file mode 100644 index 0000000..b3e2b21 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-create.xml @@ -0,0 +1,565 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<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="network-topology-operation-create" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'serviceType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.service-type" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'topology'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.topology" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'technology'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.technology" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.site1_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.site2_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'sna1_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.sna1_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'sna2_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.sna2_name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'pe1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.pe1_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'pe2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.pe2_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_peer_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_peer_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_peer_ip'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_peer_ip" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_svlan'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_svlan" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_svlan'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_svlan" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_protocol'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_protocol" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_protocol'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_protocol" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_route'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_route" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$prop.l3vpn.ac1_route`" />
+ <parameter name="regex" value=" ## " />
+ <parameter name="ctx_memory_result_key" value="route1" />
+ <outcome value="success">
+ <set>
+ <parameter name="prop.l3vpn.sna1-route.ip-prefix" value="`$route1[0]`" />
+ <parameter name="prop.l3vpn.sna1-route.next-hop" value="`$route1[1]`" />
+ </set>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_route'`">
+ <outcome value="true">
+ <block atomic="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_route" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="split">
+ <parameter name="original_string" value="`$prop.l3vpn.ac2_route`" />
+ <parameter name="regex" value=" ## " />
+ <parameter name="ctx_memory_result_key" value="route2" />
+ <outcome value="success">
+ <set>
+ <parameter name="prop.l3vpn.sna2-route.ip-prefix" value="`$route2[0]`" />
+ <parameter name="prop.l3vpn.sna2-route.next-hop" value="`$route2[1]`" />
+ </set>
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac1_protocol_bgp_as'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac1_protocol_bgp_as" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ <parameter name="prop.l3vpn.peer1-ip" value="`$prop.l3vpn.ac1_ip`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'ac2_protocol_bgp_as'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.ac2_protocol_bgp_as" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ <parameter name="prop.l3vpn.peer2-ip" value="`$prop.l3vpn.ac2_ip`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'af_type'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.af_type" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $prop.l3vpn.pe1_id AND depth = '0'" pfx="tmp.aai.pnf" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="tmp.thirdparty-sdnc-id" value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ </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="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.l3vpn.pe1_id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </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 esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.vpn-policy1-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.entry1-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.vrf1-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.vrf2-id" />
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="An error occured while generation vpn policy ID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.l3vpn.network-id" />
+ </execute>
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="">
+ <set>
+ <parameter name="nidx" value="0" />
+ </set>
+ </outcome>
+ <outcome value="Other">
+ <set>
+ <parameter name="nidx" value="`$service-data.networks.network_length`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log" />
+ <parameter name="field1" value="__TIMESTAMP__" />
+ <parameter name="field2" value="network-topology-operation-create" />
+ <parameter name="field3" value="L3VPN-Config" />
+ <parameter name="field4" value="`l3vpn.name`" />
+ <parameter name="field5" value="`$prop.l3vpn.name`" />
+ <parameter name="field6" value="`l3vpn.topology`" />
+ <parameter name="field7" value="`$prop.l3vpn.topology`" />
+ <parameter name="field8" value="`l3vpn.site1_name`" />
+ <parameter name="field9" value="`$prop.l3vpn.site1_name`" />
+ <parameter name="field10" value="`l3vpn.vpn-policy1-id`" />
+ <parameter name="field11" value="`$prop.l3vpn.vpn-policy1-id`" />
+ <parameter name="field12" value="`l3vpn.entry1-id`" />
+ <parameter name="field13" value="`$prop.l3vpn.entry1-id`" />
+ <parameter name="field14" value="`l3vpn.sna1_name`" />
+ <parameter name="field15" value="`$prop.l3vpn.sna1_name`" />
+ <parameter name="field16" value="`l3vpn.pe1_id`" />
+ <parameter name="field17" value="`$prop.l3vpn.pe1_id`" />
+ <parameter name="field18" value="`l3vpn.ac1_id`" />
+ <parameter name="field19" value="`$prop.l3vpn.ac1_id`" />
+ <parameter name="field20" value="`l3vpn.ac1_svlan`" />
+ <parameter name="field21" value="`$prop.l3vpn.ac1_svlan`" />
+ <parameter name="field22" value="`l3vpn.ac1_peer_ip`" />
+ <parameter name="field23" value="`$prop.l3vpn.ac1_peer_ip`" />
+ <parameter name="field24" value="`l3vpn.ac1_ip`" />
+ <parameter name="field25" value="`$prop.l3vpn.ac1_ip`" />
+ <parameter name="field26" value="`l3vpn.ac1_protocol`" />
+ <parameter name="field27" value="`$prop.l3vpn.ac1_protocol`" />
+ <parameter name="field28" value="`l3vpn.sna1-route-ip-prefix`" />
+ <parameter name="field29" value="`$prop.l3vpn.sna1-route-ip-prefix`" />
+ <parameter name="field30" value="`l3vpn.sna1-route-next-hop`" />
+ <parameter name="field31" value="`$prop.l3vpn.sna1-route-next-hop`" />
+ <parameter name="field32" value="`l3vpn.peer1_ip`" />
+ <parameter name="field33" value="`$prop.l3vpn.peer1_ip`" />
+ <parameter name="field34" value="`l3vpn.ac1_protocol_bgp_as`" />
+ <parameter name="field35" value="`$prop.l3vpn.ac1_protocol_bgp_as`" />
+ <parameter name="field36" value="`l3vpn.vrf1-id`" />
+ <parameter name="field37" value="`$prop.l3vpn.vrf1-id`" />
+ <parameter name="field38" value="`l3vpn.site2_name`" />
+ <parameter name="field39" value="`$prop.l3vpn.site2_name`" />
+ <parameter name="field40" value="`l3vpn.vpn-policy2-id`" />
+ <parameter name="field41" value="`$prop.l3vpn.vpn-policy2-id`" />
+ <parameter name="field42" value="`l3vpn.entry2-id`" />
+ <parameter name="field43" value="`$prop.l3vpn.entry2-id`" />
+ <parameter name="field44" value="`l3vpn.sna2_name`" />
+ <parameter name="field45" value="`$prop.l3vpn.sna2_name`" />
+ <parameter name="field46" value="`l3vpn.pe2_id`" />
+ <parameter name="field47" value="`$prop.l3vpn.pe2_id`" />
+ <parameter name="field48" value="`l3vpn.ac2_id`" />
+ <parameter name="field49" value="`$prop.l3vpn.ac2_id`" />
+ <parameter name="field50" value="`l3vpn.ac2_svlan`" />
+ <parameter name="field51" value="`$prop.l3vpn.ac2_svlan`" />
+ <parameter name="field52" value="`l3vpn.ac2_peer_ip`" />
+ <parameter name="field53" value="`$prop.l3vpn.ac2_peer_ip`" />
+ <parameter name="field54" value="`l3vpn.ac2_ip`" />
+ <parameter name="field55" value="`$prop.l3vpn.ac2_ip`" />
+ <parameter name="field56" value="`l3vpn.ac2_protocol`" />
+ <parameter name="field57" value="`$prop.l3vpn.ac2_protocol`" />
+ <parameter name="field58" value="`l3vpn.sna2-route-ip-prefix`" />
+ <parameter name="field59" value="`$prop.l3vpn.sna2-route-ip-prefix`" />
+ <parameter name="field60" value="`l3vpn.sna2-route-next-hop`" />
+ <parameter name="field61" value="`$prop.l3vpn.sna2-route-next-hop`" />
+ <parameter name="field62" value="`l3vpn.peer2_ip`" />
+ <parameter name="field63" value="`$prop.l3vpn.peer2_ip`" />
+ <parameter name="field64" value="`l3vpn.ac2_protocol_bgp_as`" />
+ <parameter name="field65" value="`$prop.l3vpn.ac2_protocol_bgp_as`" />
+ <parameter name="field66" value="`l3vpn.vrf2-id`" />
+ <parameter name="field67" value="`$prop.l3vpn.vrf2-id`" />
+ <parameter name="field68" value="`l3vpn.af_type`" />
+ <parameter name="field69" value="`$prop.l3vpn.af_type`" />
+ </record>
+ <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>
+ <switch test="`$prop.l3vpn.service-type`">
+ <outcome value="l3vpn-ipwan">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/v2/tokens'`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="token-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.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">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/l3smvpntemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services'`" />
+ <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="post" />
+ <parameter name="responsePrefix" value="vpn-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" />
+ <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" />
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3smvrftemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/huawei-ac-net-l3vpn-svc-vfi:vrf-attributes'`" />
+ <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="put" />
+ <parameter name="responsePrefix" value="vrf-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" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block atomic="true" />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vrf rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/l3smsitetemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url +'/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites'`" />
+ <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="post" />
+ <parameter name="responsePrefix" value="site-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" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block atomic="true" />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create site rest api" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value="l3vpn-sptn">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir +'/sptn-l3vpn-template.xml'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/sptn-service-l3vpn:service/snc-l3vpns'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="xml" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unexpected error retrieving vpn binding" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value="`$prop.l3vpn.network-id`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.sdnc-request-header." value="`$network-topology-operation-input.sdnc-request-header.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.request-information." value="`$network-topology-operation-input.request-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.service-information." value="`$network-topology-operation-input.service-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information." value="`$network-topology-operation-input.network-information.`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value="`$network-topology-operation-input.network-request-input.`" />
+ <parameter name="service-data.networks.network_length" value="`$nidx+1`" />
+ </set>
+ <set>
+ <parameter name="pidx" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].name" value="vrf1_id" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].value" value="`$prop.l3vpn.vrf1-id`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx+1].name" value="vrf2_id" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx+1].value" value="`$prop.l3vpn.vrf2-id`d" />
+ <parameter name="service-data.networks.network[$nidx].network_data.network-request-input.network-input-parameters.param_length" value="`$pidx+2`" />
+ </set>
+ <set>
+ <parameter name="networkId" value="`$prop.l3vpn.network-id`" />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.l3vpn.network-id + '/network-data/'` " />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status" value="Created" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action" value="`$network-topology-operation-input.sdnc-request-header.svc-action`" />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action" value="`$network-topology-operation-input.request-information.request-action`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $prop.l3vpn.network-id">
+ <parameter name="configuration-id" value="`$prop.l3vpn.network-id`" />
+ <parameter name="configuration-type" value="underlay" />
+ <parameter name="configuration-sub-type" value="l3vpn" />
+ <parameter name="orchestration-status" value="Created" />
+ <parameter name="operational-status" value="Created" />
+ <parameter name="model-customization-id" value="`$prop.l3vpn.network-id`" />
+ <parameter name="configuration-selflink" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.l3vpn.network-id + '/network-data/'` " />
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list" key="service-instance.service-instance-id = $service-data.service-information.service-instance-id AND customer.global-customer-id = $service-data.networks.network[$nidx].network-data.service-information.global-customer-id AND service-subscription.service-type = $service-data.networks.network[$nidx].network-data.service-information.subscription-service-type" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="configuration" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/configurations/configuration/' + $prop.l3vpn.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="configuration.configuration-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.l3vpn.network-id`" />
+ </save>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml new file mode 100644 index 0000000..54c8a75 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml @@ -0,0 +1,172 @@ +<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='network-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id
+ AND depth='all'"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="network-id not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no networks found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $aai.l3-network.subnets.subnet[$sidx].subnet-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - deactivate failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
+ <parameter name="eipam-ip-block.plans[0].plan-name" value="$tmp.eipam-subnet-row.plan-name"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $aai.l3-network.network-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $networkId
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-delete.xml new file mode 100644 index 0000000..0624045 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-delete.xml @@ -0,0 +1,300 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<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="network-topology-operation-delete" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="0">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <for index="nidx" start="0" end="`$service-data.networks.network_length`">
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value="true">
+ <set>
+ <parameter name="tmp.nidx" value="`$nidx`" />
+ <parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.nidx`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.name" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'serviceType'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.service-type" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'pe1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.pe1_id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site1_name'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.site1_name" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'vrf1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.vrf1-id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'vrf2_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.l3vpn.vrf2-id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $prop.l3vpn.pe1_id AND depth = '0'" pfx="tmp.aai.pnf" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="tmp.thirdparty-sdnc-id" value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ </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 esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].serviceUrl`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </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="Network model is_bound_to_vpn=true but no vpn_binding is present" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unexpected error retrieving vpn binding" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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>
+ <switch test="`$prop.l3vpn.service-type`">
+ <outcome value="l3vpn-ipwan">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/v2/tokens'`" />
+ <parameter name="format" value="json" />
+ <parameter name="httpMethod" value="post" />
+ <parameter name="responsePrefix" value="token-result" />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.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">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/sites/site=' + $prop.l3vpn.site1_name`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="site-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" />
+ <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 Delete Site rest api" />
+ </return>
+ </outcome>
+ <outcome value="success">
+ <block />
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/huawei-ac-net-l3vpn-svc-vfi:vrf-attributes/vrf-attribute=' + $prop.l3vpn.vrf1-id`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="vrf1-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" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete VRF1 rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/huawei-ac-net-l3vpn-svc-vfi:vrf-attributes/vrf-attribute=' + $prop.l3vpn.vrf2-id`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="vrf2-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" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete VRF2 rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/huawei-ac-net-l3vpn-svc:l3vpn-svc-cfg/vpn-services/vpnservice=' + $prop.l3vpn.name`" />
+ <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="delete" />
+ <parameter name="responsePrefix" value="vpn-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" />
+ <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value="success">
+ <block />
+ </outcome>
+ <outcome value="failure">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Delete VPN rest api" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="configuration" key="configuration.configuration-id = $network-topology-operation-input.network-information.network-id" />
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="1">
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <for silentFailure="true" index="snidx" start="`$tmp.nidx + 1`" end="`$service-data.networks.network_length`">
+ <block atomic="true" />
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`" />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value="" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` " />
+ </set>
+ <return status="success">
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml new file mode 100755 index 0000000..0ae9fa7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml @@ -0,0 +1,443 @@ +<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='network-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='success'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting network from AAI" />
+ </return>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $service-data.networks.network[$nidx].network-data.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $service-data.networks.network[$nidx].network-data.service-information.onap-model-information.model-uuid'
+ pfx='network-model'></get-resource>
+ <set>
+ <parameter name="tmp.level1-key-value" value=""/>
+ <parameter name="tmp.level1inuse" value="false" />
+ <parameter name="pidx" value="0" />
+ <parameter name="pidx-len" value="0" />
+ </set>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.network_id = $network-topology-operation-input.network-information.network-id and s.entity_id = k.entity_id ; "
+ pfx='tmp.eipam-subnet-row[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='esidx' start='0' end='`$tmp.eipam-subnet-row_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.eipam-subnet-row[$esidx].level`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.level1-key-value[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].key-value`"/>
+ </set>
+ <set>
+ <parameter name="tmp.plan-name[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].plan-name`"/>
+ </set>
+ <set>
+ <parameter name="pidx" value="`$pidx + 1`"/>
+ </set>
+ <set>
+ <parameter name="pidx-len" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name="eipam-ip-block.entity-id" value='' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateAllSubnets">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnets in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting level 2 plans in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='npidx' start='0' end='`$pidx-len`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.level1-key-value" value="`$tmp.level1-key-value[$npidx]`" />
+ <parameter name="tmp.plan-name" value="`$tmp.plan-name[$npidx]`" />
+ </set>
+ <switch test='`$tmp.level1-key-value`'>
+ <outcome value=''>
+ <block atomic='true'></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <switch test='`$network-model`'>
+ <outcome value=''></outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.plan-name' value='`$network-model.eipam-v4-address-plan`' />
+ </set>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 2
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level2pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.level1inuse" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 1
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level1pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
+ <parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
+ <parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
+ <parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.plan-name' value='`$network-model.eipam-v6-address-plan`' />
+ </set>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 2
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level2pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.level1inuse" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
+ WHERE p.level = 1
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ and p.pool_id = s.pool_id and s.entity_id = k.entity_id
+ and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.level1pool[]'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
+ <parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
+ <parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
+ <parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting network from AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation.xml new file mode 100644 index 0000000..51d6b6a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_network-topology-operation.xml @@ -0,0 +1,571 @@ +<?xml version="1.0" encoding="utf-8"?> + +<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='network-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-network-input' mode='sync' ></call> + <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> + <outcome value='Created'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + <outcome value='PendingDelete'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + <outcome value='PendingCreate'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + <outcome value='Other'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign' mode='sync' ></call> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='ActivateSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='ActivateDCINetworkInstance'> + <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='ActivateSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> + <outcome value=''> + <return status='success'></return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ngidx' value='`$ngidx`' /> + <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> + <outcome value='PendingCreate'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value='changeassign'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-changeassign' mode='sync' ></call> + </block> + </outcome> + <outcome value='deactivate'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeactivateSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='DeActivateDCINetworkInstance'> + <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='DeactivateSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> + <outcome value=''> + <return status='success'></return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ngidx' value='`$ngidx`' /> + <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-deactivate' mode='sync' ></call> + </block> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <switch test='`$service-data.networks.network_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='nidx' start='0' end='`$service-data.networks.network_length`' > + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.nidx' value='`$nidx`' /> + <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='nidx' value='`$tmp.nidx`' /> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> + <outcome value=''> + <return status='success'></return> + </outcome> + <outcome value='Other'> + <block> + <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ngidx' value='`$ngidx`' /> + <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> + <outcome value='PendingCreate'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-unassign' mode='sync' ></call> + </outcome> + <outcome value='PendingDelete'> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-unassign' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Network is not in appropriate state for unassign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='update'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='ChangeInternetProfileInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-change-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-change-nokia' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + </switch> + </outcome> + <outcome value='create'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='CreateSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-create' mode='sync' ></call> + </block> + </outcome> + </execute> + </outcome> + <outcome value='CreateInternetProfileInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-create-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-create-nokia' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + <outcome value='CreateAccessConnectivityInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-create-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-create-nokia' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + </switch> + </outcome> + <outcome value='delete'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSOTNConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-delete' mode='sync' ></call> + </outcome> + <outcome value='DeleteSDWANConnectivityInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-delete' mode='sync' ></call> + </outcome> + <outcome value='other'> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' > + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value='true'> + <call module='GENERIC-RESOURCE-API' rpc='wan-connection-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='false'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-delete' mode='sync' ></call> + </block> + </outcome> + </execute> + </outcome> + <outcome value='DeleteAccessConnectivityInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-delete-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-network-topology-operation-delete-nokia' mode='sync' ></call> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + <outcome value='DeleteInternetProfileInstance'> + <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' > + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'manufacturer'`"> + <outcome value='true'> + <switch test='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`'> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" /> + </return> + </outcome> + <outcome value='HUAWEI'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-delete-huawei' mode='sync' ></call> + </outcome> + <outcome value='NOKIA'> + <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-network-topology-operation-delete-nokia' mode='sync' ></call> + </outcome> + </switch> + </outcome> + </switch> + </for> + </outcome> + </switch> + </outcome> + <outcome value='reoptimize'> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='ReoptimizeSOTNInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-reoptimize' mode='sync' ></call> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml new file mode 100644 index 0000000..a382b02 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml @@ -0,0 +1,84 @@ +<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='pnf-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreatePnfInstance'>
+ <block></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="If svc-action is 'activate' then request-action must be 'CreatePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no PNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$pnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find PNF ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-id = $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="prov-status" value="NVTPROV" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating pnf in AAI" />
+ </return>
+ </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="`'No pnf found in AAI with pnf-id = ' + $service-data.pnfs.pnf[$pnf-index].pnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.' value='$pnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.' value='$pnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.' value='$pnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.' value='$pnf-topology-operation-input.pnf-details.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.' value='$pnf-topology-operation-input.pnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-assign.xml new file mode 100644 index 0000000..f25087e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-assign.xml @@ -0,0 +1,71 @@ +<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='pnf-topology-operation-assign' mode='sync'>
+ <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>
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$pnf-topology-operation-input.pnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreatePnfInstance'>
+ <block></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="If svc-action is 'assign' then request-action must be 'CreatePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </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="`'No model found for VF customization UUID ' + $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for pnf with pnf-id=' + $pnf-topology-operation-input.pnf-details.pnf-id + ' with error: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-pnf-assign.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml new file mode 100644 index 0000000..5cb8438 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml @@ -0,0 +1,84 @@ +<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='pnf-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeletePnfInstance'>
+ <block></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="If svc-action is 'deactivate' then request-action must be 'DeletePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no PNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$pnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find PNF with pnf-id = ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-id = $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating pnf in AAI" />
+ </return>
+ </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="`'No pnf found in AAI with pnf-id = ' + $service-data.pnfs.pnf[$pnf-index].pnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.' value='$pnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.' value='$pnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.' value='$pnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.' value='$pnf-topology-operation-input.pnf-details.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.' value='$pnf-topology-operation-input.pnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-unassign.xml new file mode 100644 index 0000000..48bffb4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation-unassign.xml @@ -0,0 +1,93 @@ +<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='pnf-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeletePnfInstance'>
+ <block></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="If svc-action is 'unassign' then request-action must be 'DeletePnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`' >
+ <outcome value='true'>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$pnf-index`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-unassign' mode='sync' >
+ <outcome value='success'>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.pnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$pnf-index + 1`' end='`$service-data.pnfs.pnf_length`' >
+ <block>
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.pnfs.pnf[$tmpidx]." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.pnfs.pnf[$tmpidx]." value="$service-data.pnfs.pnf[$idx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.pnfs.pnf[$service-data.pnfs.pnf_length - 1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.pnfs.pnf_length" value="`$service-data.pnfs.pnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve pnf resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation.xml new file mode 100644 index 0000000..8ab8729 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_pnf-topology-operation.xml @@ -0,0 +1,38 @@ +<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='pnf-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-pnf-input' mode='sync' ></call>
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='pnf-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$pnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-create-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-create-policy.xml new file mode 100755 index 0000000..c6d45de --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-create-policy.xml @@ -0,0 +1,46 @@ +<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='policy-manager-create-policy' mode='sync'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.createpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/createPolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.pushpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/pushPolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to push policy in Policy Manager' /> + </return> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to create policy in Policy Manager' /> + </return> + </outcome> + </execute> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml new file mode 100755 index 0000000..e5bcb09 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml @@ -0,0 +1,46 @@ +<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='policy-manager-delete-policy' mode='sync'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypdp.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypap.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name='convertResponse' value="false" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to delete policy from Policy Manager (PAP)' /> + </return> + </outcome> + </execute> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to delete policy from Policy Manager (PDP)' /> + </return> + </outcome> + </execute> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-update-notify-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-update-notify-operation.xml new file mode 100755 index 0000000..a0d77fd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_policy-update-notify-operation.xml @@ -0,0 +1,89 @@ +<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='policy-update-notify-operation' mode='sync'> + <block atomic="true"> + <switch test='`$policy-update-notify-operation-input.update-type`'> + <outcome value='Update'> + <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> + <set> + <parameter name='tmp.sql' value="`'insert into POLICY_UPDATE_NOTIFICATION (policy_name,version_id,update_type) values ( ' ++ ' $policy-update-notify-operation-input.policy-name , $policy-update-notify-operation-input.version-id , $policy-update-notify-operation-input.update-type )'`" /> + </set> + <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key="`$tmp.sql`" pfx='pfx'></save> + <set> + <parameter name='tmp.policy-name' value='`$policy-update-notify-operation-input.policy-name`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='POST' /> + <parameter name='responsePrefix' value="policy" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to get policy from Policy Manager' /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' > + <parameter name='source' value="policy.config" /> + <parameter name='outputPath' value="tmp.config-ctx" /> + <parameter name='isEscaped' value='false' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to convert config variable from PolicyManager' /> + </return> + </outcome> + </execute> + <set> + <parameter name='policy-name' value='`$tmp.config-ctx.content.fq_name[2]`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$policy-name`" /> + <parameter name="regex" value="_"/> + <parameter name="limit" value="3" /> + <parameter name="ctx_memory_result_key" value="policy-splits" /> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='network-policy' /> + <parameter name='api-action' value='update' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='cloud-region-id' value='`$policy-splits[1]`' /> + <parameter name='update-network-policy-json' value='`$policy.config`' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Error updating Contrail: ' + $contrailResp.resp-message`" /> + </return> + </outcome> + </execute> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="success" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-get-policy.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-get-policy.xml new file mode 100644 index 0000000..a5e7438 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-get-policy.xml @@ -0,0 +1,113 @@ +<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='port-mirror-get-policy' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.policy-name' value='`$db.cap[0].policy-name`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='POST' /> + <parameter name='responsePrefix' value="policy" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to get policy from Policy Manager' /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' > + <parameter name='source' value="policy.config" /> + <parameter name='outputPath' value="tmp.config-ctx" /> + <parameter name='isEscaped' value='false' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to convert config variable from PolicyManager' /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="toLower"> + <parameter name="source" value="`$tmp.tenant-context`" /> + <parameter name="outputPath" value="tmp.lc-tenant-context" /> + </execute> + <switch test='`$tmp.lc-tenant-context`'> + <outcome value=''> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="prod" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.productionContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="test" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.testContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="dev" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.developmentContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="default" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unexpected tenant-context value of ' + $tmp.tenant-context`" /> + </return> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </switch> + <switch test='`$tmp.dest-p-interface`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find p-interface in policy ' + tmp.policy-name`" /> + </return> + </outcome> + </switch> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml new file mode 100644 index 0000000..7b1ab18 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml @@ -0,0 +1,52 @@ +<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='port-mirror-rollback-capacity-db' mode='sync'> + <block> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select available_capacity + from VNICS_CAPACITY + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id + and vnic_port_name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name' + pfx='db.vnics-capacity'> + <outcome value='success'> + <block> + <set> + <parameter name='tmp.avail-capacity' value='`$db.vnics-capacity.available-capacity + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" +key="update VNICS_CAPACITY + set available_capacity = $tmp.avail-capacity + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id + and vnic_port_name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name +" ></update> + </block> + </outcome> + </get-resource> + </block> + </for> + <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='delete from VNICS_CONFIGURATION_ID + where configuration_id = $tmp.configuration-id + and vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select configuration_id + from VNICS_CONFIGURATION_ID + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' + pfx='db.vnics-confid'> + <outcome value='not-found'> + <block> + <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='delete from VNICS_CAPACITY + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete> + <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='delete from VNICS_CAPACITY_GROUP + where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete> + </block> + </outcome> + </get-resource> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml new file mode 100644 index 0000000..0d95f40 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml @@ -0,0 +1,765 @@ +<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='port-mirror-topology-operation-activate-async' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failed to read port-mirror-configuration from MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Cannot find port-mirror-configuration in MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.' + value='`$port-mirror-topology-operation-input.sdnc-request-header.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <block atomic="true"> + <set> + <parameter name='cto-api.default-domain' value='default-domain' /> + <parameter name='cto-api.default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cto-api.cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cto-api.contrail-route-allotted-resource-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' /> + <parameter name='cto-api.src-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn`' /> + <parameter name='cto-api.collector-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='cto-api.owning-entity' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-activate' mode='sync' > + <outcome value='failure'> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </outcome> + </call> + </block> + </outcome> + </switch> + <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + </outcome> + <outcome value='pprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='vni' value='1000' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='juniper-header' value='false' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + </outcome> + </switch> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="true" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='success'> + <set> + <parameter name='l-interface-set[$src-idx]' value='true' /> + </set> + </outcome> + </update> + </block> + </for> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="configuration" + key="configuration.configuration-id = $tmp.configuration-id" + force="true" pfx="tmp.AnAI-data"> + <parameter name="operational-status" value="in-service-path" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Unable to find configuration object in AAI" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failure updating configuration object in AAI" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + </update> + <set> + <parameter name='pm.configuration-data.configuration-oper-status.order-status' + value='Active' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-action' + value='`$port-mirror-topology-operation-input.request-information.request-action`' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action' + value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <switch test="`$contrail-set[$src-idx] == 'true'`"> + <outcome value='true'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + </execute> + </outcome> + </switch> + <switch test="`$l-interface-set[$src-idx] == 'true'`"> + <outcome value='true'> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + </update> + </outcome> + </switch> + </block> + </for> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </block> + </outcome> + </execute> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="200" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='success'> + <parameter name='error-code' value='200' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml new file mode 100644 index 0000000..d95950e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml @@ -0,0 +1,57 @@ +<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='port-mirror-topology-operation-activate-sync' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.pm.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </execute> + <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Created'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Created'`" /> + </return> + </outcome> + </switch> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='N' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml new file mode 100755 index 0000000..edb5557 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml @@ -0,0 +1,2253 @@ +<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='port-mirror-topology-operation-assign-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='tmp.src-vnf-id' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.vnf-information.vnf-id`' />
+ <parameter name='tmp.dest-vnf-id' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.vnf-information.vnf-id`' />
+ <parameter name='tmp.dest-pnf-name' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.pnf-information.pnf-name`' />
+ <parameter name='tmp.service-instance-id' value='`$port-mirror-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='tmp.configuration-sub-type' value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ </set>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.request-information.'
+ value='`$port-mirror-topology-operation-input.request-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.service-information.'
+ value='`$port-mirror-topology-operation-input.service-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.configuration-information.'
+ value='`$port-mirror-topology-operation-input.configuration-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.port-mirror-configuration-request-input.'
+ value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.`' />
+ </set>
+ <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>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select role,nfc_naming_code,pps_capacity,network_role,policy_name
+ from PORT_MIRROR_CAPABILITY cap, PORT_MIRROR_CONFIGURATION conf, SERVICE_PROXY sp
+ where cap.port_mirror_capability_name=conf.port_mirror_capability_name
+ and cap.port_mirror_service_uuid=conf.port_mirror_service_uuid
+ and cap.service_proxy_name=conf.service_proxy_name
+ and cap.service_proxy_name=sp.service_proxy_name
+ and cap.port_mirror_service_uuid=sp.parent_service_uuid
+ and conf.customization_uuid = $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid
+ and conf.port_mirror_service_uuid = $service-data.service-information.onap-model-information.model-uuid
+ order by role'
+ pfx='db.cap[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION table" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION table" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='cap-idx' start='0' end='`$db.cap_length`' >
+ <switch test='`$db.cap[$cap-idx].role`'>
+ <outcome value='source'>
+ <set>
+ <parameter name='tmp.src-pps' value='`$db.cap[$cap-idx].pps-capacity`' />
+ <parameter name='tmp.src-nfc-naming-code' value='`$db.cap[$cap-idx].nfc-naming-code`' />
+ <parameter name='tmp.src-network-role' value='`$db.cap[$cap-idx].network-role`' />
+ </set>
+ </outcome>
+ <outcome value='collector'>
+ <set>
+ <parameter name='tmp.dest-pps' value='`$db.cap[$cap-idx].pps-capacity`' />
+ <parameter name='tmp.dest-nfc-naming-code' value='`$db.cap[$cap-idx].nfc-naming-code`' />
+ <parameter name='tmp.dest-network-role' value='`$db.cap[$cap-idx].network-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace">
+ <parameter name="source" value="`$tmp.src-nfc-naming-code`" />
+ <parameter name="target" value=" " />
+ <parameter name="replacement" value="%20" />
+ <parameter name="outputPath" value="tmp.encoded-src-nfc-naming-code" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace">
+ <parameter name="source" value="`$tmp.dest-nfc-naming-code`" />
+ <parameter name="target" value=" " />
+ <parameter name="replacement" value="%20" />
+ <parameter name="outputPath" value="tmp.encoded-dest-nfc-naming-code" />
+ </execute>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`'>
+ <outcome value=''>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='0' />
+ <parameter name='tmp.dest-vnfc-idx' value='1' />
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vnfc-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].instance-group-role == $tmp.src-network-role`">
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].nfc-naming-code == $tmp.src-nfc-naming-code`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].configuration-id == $tmp.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Source nfc-naming-code of ' + $tmp.src-nfc-naming-code + ' already exists in vnfc-instance-groups for this configuration-id'`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].instance-group-role == $tmp.dest-network-role`">
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].nfc-naming-code == $tmp.dest-nfc-naming-code`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].configuration-id == $tmp.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Dest nfc-naming-code of ' + $tmp.dest-nfc-naming-code + ' already exists in vnfc-instance-groups for this configuration-id'`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' />
+ <parameter name='tmp.dest-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 1`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group_length' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 2`'/>
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group_length' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 1`'/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $tmp.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: owning-entity-fromService-instance" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No owning entity returned from AAI: owning-entity-fromService-instance" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.owning-entity' value='`$tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id`' />
+ </set>
+ </outcome>
+ </save>
+ <switch test='`$tmp.owning-entity`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve owning-entity from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity' value='`$tmp.owning-entity`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $tmp.src-vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.AnAI-data.vnf.results_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant-id' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-context`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant-context' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-context`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-owner' value='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-region-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-region-id' value='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-region-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$tmp.tenant`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve source tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.tenant-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve source tenant-id from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.cloud-region-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.cloud-owner`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $tmp.dest-vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf, for destination vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf, for destination vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.AnAI-data.dest-vnf.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.dest-tenant' value='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.dest-tenant-id' value='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.dest-tenant`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve destination tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.dest-tenant-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve destination tenant-id from AAI" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner'
+ value='`$tmp.cloud-owner`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id'
+ value='`$tmp.cloud-region-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant'
+ value='`$tmp.tenant`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id'
+ value='`$tmp.tenant-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-tenant'
+ value='`$tmp.dest-tenant`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-tenant-id'
+ value='`$tmp.dest-tenant-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-context'
+ value='`$tmp.tenant-context`' />
+ </set>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-get-policy' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.src-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $tmp.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $tmp.src-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No network information returned from AAI: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $tmp.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $tmp.dest-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No network information returned from AAI: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.src-li">
+ <parameter value="`'/network/generic-vnfs/generic-vnf/' + $tmp.src-vnf-id`" name="start[0]"/>
+ <parameter value="1" name="start_length"/>
+ <parameter value="`'/query/vserver-fromVnf?nfcNamingCode=' + $tmp.encoded-src-nfc-naming-code`" name="query"/>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query vserver-fromVnf for source vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No interface data returned from AAI vserver-fromVnf for source vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-li">
+ <parameter value="`'/network/generic-vnfs/generic-vnf/' + $tmp.dest-vnf-id`" name="start[0]"/>
+ <parameter value="1" name="start_length"/>
+ <parameter value="`'/query/vserver-fromVnf?nfcNamingCode=' + $tmp.encoded-dest-nfc-naming-code`" name="query"/>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query vserver-fromVnf for dest vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No interface data returned from AAI vserver-fromVnf for dest vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].instance-group-role'
+ value='`$tmp.src-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].group-type'
+ value='port-mirror-source'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].instance-group-role'
+ value='`$tmp.dest-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].nfc-naming-code'
+ value='`$tmp.dest-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].group-type'
+ value='port-mirror-dest'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].instance-group-role'
+ value='`$tmp.src-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].group-type'
+ value='port-mirror-source'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.src-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.dest-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.dest-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnf-id'
+ value='`$tmp.dest-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type'
+ value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.src-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-pnf-name'
+ value='`$tmp.dest-pnf-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-p-interface'
+ value='`$tmp.dest-p-interface`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-pnf-port-policy-name'
+ value='`$db.cap[0].policy-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type'
+ value='pprobe' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='src-nw-idx' start='0' end='`$tmp.AnAI-data.src-network.results_length`' >
+ <switch test='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.network-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.src-network-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.src-network-name' value='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.network-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn'
+ value='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.contrail-network-fqdn`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'More than one l3-network returned from AAI for network-role ' + $tmp.src-network-role`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.src-network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot determine source network name from AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <for index='dest-nw-idx' start='0' end='`$tmp.AnAI-data.dest-network.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.network-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.dest-network-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.dest-network-name' value='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.network-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn'
+ value='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.contrail-network-fqdn`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'More than one l3-network returned from AAI for network-role ' + $tmp.dest-network-role`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.dest-network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot determine dest network name from AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-create-vnfcs' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-mapping-vprobe' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='pprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-mapping-pprobe' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No usable source l-interfaces found in AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No usable source l-interfaces found in AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <set>
+ <parameter name='cto-api.parent-service-instance-id' value='`$tmp.service-instance-id`' />
+ <parameter name='cto-api.port-mirror-configuration-instance-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.source-network-role' value='`$tmp.src-network-role`' />
+ <parameter name='cto-api.collector-network-role' value='`$tmp.dest-network-role`' />
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.cloud-owner' value='`$tmp.cloud-owner`' />
+ <parameter name='cto-api.service-type' value='`$port-mirror-topology-operation-input.service-information.subscription-service-type`' />
+ <parameter name='cto-api.owning-entity' value='`$tmp.owning-entity`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-create' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id'
+ value='`$cto-api.contrail-route-allotted-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.configuration-name' value="`'PMC_' + $tmp.tenant + '_' + $tmp.cloud-region-id + '_' + $port-mirror-topology-operation-input.configuration-information.configuration-type + '_' + $tmp.configuration-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.configuration-name' value='`$port-mirror-topology-operation-input.configuration-information.configuration-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$tmp.link-name`" />
+ <parameter name="outputPath" value="tmp.encoded-link-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" >
+ <parameter name="link-name" value="`$tmp.link-name`" />
+ <parameter name="in-maint" value="false" />
+ <parameter name="link-type" value="port-mirror-configuration" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-source-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-port-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link:relationship-list"
+ key="logical-link.link-name = $tmp.link-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[0].relationship-label" value="org.onap.relationships.inventory.Source" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-source-port-name`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[1].relationship-label" value="org.onap.relationships.inventory.Destination" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.dest-tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-dest-port-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-source-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$tmp.dest-p-interface`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-p-interface" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link:relationship-list"
+ key="logical-link.link-name = $tmp.link-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[0].relationship-label" value="org.onap.relationships.inventory.Source" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-source-port-name`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[1].relationship-label" value="org.onap.relationships.inventory.Destination" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/pnfs/pnf/'
+ + $tmp.dest-pnf-name + '/p-interfaces/p-interface/'
+ + $tmp.encoded-dest-p-interface + '/l-interfaces/l-interface/'
+ + $tmp.encoded-dest-port-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration:relationship-list"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="logical-link" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/logical-links/logical-link/' + $tmp.encoded-link-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="configuration-name" value="`$tmp.configuration-name`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="configuration-selflink" value="`'/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/'
+ + $port-mirror-topology-operation-input.configuration-information.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find configuration object in AAI" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failure updating configuration object in AAI" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration:relationship-list"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="allotted-resource" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/' + $service-data.service-information.global-customer-id
+ + '/service-subscriptions/service-subscription/' + $port-mirror-topology-operation-input.service-information.subscription-service-type
+ + '/service-instances/service-instance/' + $tmp.service-instance-id
+ + '/allotted-resources/allotted-resource/' + $cto-api.contrail-route-allotted-instance-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-type`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-sub-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.parent-service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-name'
+ value='`$tmp.configuration-name`' />
+ </set>
+ <switch test='`$service-data.provided-configurations.provided-configuration_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.provided-conf-idx' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.provided-conf-idx' value='`$service-data.provided-configurations.provided-configuration_length`' />
+ <parameter name='service-data.provided-configurations.provided-configuration_length' value='`$tmp.provided-conf-idx + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-sub-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-topology-link'
+ value="`'restconf/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/' + $tmp.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ </set>
+ <set>
+ <parameter name='pm.configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-action'
+ value='`$port-mirror-topology-operation-input.request-information.request-action`' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="200" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml new file mode 100755 index 0000000..2cdd98d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml @@ -0,0 +1,124 @@ +<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='port-mirror-topology-operation-assign-sync' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select role,nfc_naming_code,pps_capacity
+ from PORT_MIRROR_CAPABILITY cap, PORT_MIRROR_CONFIGURATION conf, SERVICE_PROXY sp
+ where cap.port_mirror_capability_name=conf.port_mirror_capability_name
+ and cap.port_mirror_service_uuid=conf.port_mirror_service_uuid
+ and cap.service_proxy_name=conf.service_proxy_name
+ and cap.service_proxy_name=sp.service_proxy_name
+ and cap.port_mirror_service_uuid=sp.parent_service_uuid
+ and conf.customization_uuid = $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid
+ and conf.port_mirror_service_uuid = $service-data.service-information.onap-model-information.model-uuid
+ order by role'
+ pfx='db.cap[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION and PORT_MIRROR_CAPABILITY tables" />
+ </return>
+ </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="`'Unable to find PORT_MIRROR_CONFIGURATION entry for ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <switch test='`$db.cap_length == 2`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'PORT_MIRROR_CONFIGURATION does not contain exactly 2 entries for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[0].role == 'collector'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No collector capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[1].role == 'source'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No source capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <switch test='`$db.cap_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'PORT_MIRROR_CONFIGURATION does not contain exactly 1 entry for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[0].role == 'source'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No source capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.pm.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Port mirror configuration ' + $tmp.pm.configuration-id + ' already exists'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='N' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml new file mode 100644 index 0000000..8b07ec1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml @@ -0,0 +1,88 @@ +<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='port-mirror-topology-operation-async' mode='sync'> + <block atomic="true"> + <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'> + <outcome value='pprobe'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' /> + </set> + </outcome> + <outcome value='PPROBE'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' /> + </set> + </outcome> + <outcome value='vprobe'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' /> + </set> + </outcome> + <outcome value='VPROBE'> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' /> + </set> + </outcome> + <outcome value=''> + <set> + <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' /> + </set> + </outcome> + </switch> + <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-assign-async' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Cannot find assign async DG" /> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-activate-async' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Cannot find activate async DG" /> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-deactivate-async' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Cannot find deactivate async DG" /> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml new file mode 100644 index 0000000..0860c6b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml @@ -0,0 +1,293 @@ +<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='port-mirror-topology-operation-create-vnfcs' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.vnfc-objects-idx' value='0' /> + </set> + <for silentFailure='true' index='src-li-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-key' + value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-name' + value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnf-id' + value='`$tmp.src-vnf-id`' /> + </set> + <set> + <parameter name='tmp.vserver-id' value='0' /> + </set> + <for index='rel-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship_length`' > + <switch test="`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].related-to == 'vserver'`"> + <outcome value='true'> + <for index='reldata-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data_length`' > + <switch test="`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-key == 'vserver.vserver-id'`"> + <outcome value='true'> + <set> + <parameter name='tmp.vserver-id' value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-value`' /> + </set> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <switch test='`$tmp.vserver-id == 0`'> + <outcome value='true'> + <block atomic="true"> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find vserver related to vnfc ' + $tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`" /> + </return> + </block> + </outcome> + </switch> + <for index='src-vs-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-id == $tmp.vserver-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-name' + value='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-id' + value='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-id`' /> + <parameter name='tmp.vs-idx' value='`$src-vs-idx`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.interface-ids_length' value='0' /> + </set> + <for silentFailure='true' index='src-vli-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$src-vli-idx].network-name == $tmp.src-network-name`'> + <outcome value='true'> + <set> + <parameter name='tmp.interface-ids[$tmp.interface-ids_length].interface-id' value='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$src-vli-idx].interface-id`' /> + <parameter name='tmp.interface-ids_length' value='`$tmp.interface-ids_length + 1`' /> + </set> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.vnic-idx' value='0' /> + </set> + <for silentFailure='true' index='src-rs-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-name`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <for index='in-idx' start='0' end='`$tmp.interface-ids_length`' > + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-id == $tmp.interface-ids[$in-idx].interface-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-id' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-id`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-name' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.vnic-capacity' + value='`$tmp.src-pps`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.used-capacity' + value='0' /> + </set> + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv4-address' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' /> + </set> + </outcome> + </switch> + <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv6-address' + value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' /> + </set> + </outcome> + </switch> + <set> + <parameter name='tmp.vnic-idx' value='`$tmp.vnic-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic_length' value='`$tmp.vnic-idx`' /> + </set> + <set> + <parameter name='tmp.vnfc-objects-idx' value='`$tmp.vnfc-objects-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length' value='`$tmp.vnfc-objects-idx`' /> + </set> + <set> + <parameter name='tmp.vnfc-objects-idx' value='0' /> + </set> + <for silentFailure='true' index='dest-li-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-key' + value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-name' + value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnf-id' + value='`$tmp.dest-vnf-id`' /> + </set> + <set> + <parameter name='tmp.vserver-id' value='0' /> + </set> + <for index='rel-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship_length`' > + <switch test="`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].related-to == 'vserver'`"> + <outcome value='true'> + <for index='reldata-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data_length`' > + <switch test="`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-key == 'vserver.vserver-id'`"> + <outcome value='true'> + <set> + <parameter name='tmp.vserver-id' value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-value`' /> + </set> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <switch test='`$tmp.vserver-id == 0`'> + <outcome value='true'> + <block atomic="true"> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find vserver related to vnfc ' + $tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`" /> + </return> + </block> + </outcome> + </switch> + <for index='dest-vs-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-id == $tmp.vserver-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-name' + value='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-id' + value='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-id`' /> + <parameter name='tmp.vs-idx' value='`$dest-vs-idx`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.interface-ids_length' value='0' /> + </set> + <for silentFailure='true' index='dest-vli-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$dest-vli-idx].network-name == $tmp.dest-network-name`'> + <outcome value='true'> + <set> + <parameter name='tmp.interface-ids[$tmp.interface-ids_length].interface-id' value='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$dest-vli-idx].interface-id`' /> + <parameter name='tmp.interface-ids_length' value='`$tmp.interface-ids_length + 1`' /> + </set> + </outcome> + </switch> + </for> + <set> + <parameter name='tmp.vnic-idx' value='0' /> + </set> + <for silentFailure='true' index='dest-rs-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-name`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <for index='in-idx' start='0' end='`$tmp.interface-ids_length`' > + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-id == $tmp.interface-ids[$in-idx].interface-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-id' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-id`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-name' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-name`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.vnic-capacity' + value='`$tmp.dest-pps`' /> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.used-capacity' + value='0' /> + </set> + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv4-address' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' /> + </set> + </outcome> + </switch> + <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv6-address' + value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' /> + </set> + </outcome> + </switch> + <set> + <parameter name='tmp.vnic-idx' value='`$tmp.vnic-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic_length' value='`$tmp.vnic-idx`' /> + </set> + <set> + <parameter name='tmp.vnfc-objects-idx' value='`$tmp.vnfc-objects-idx + 1`' /> + </set> + </block> + </outcome> + </switch> + </for> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length' value='`$tmp.vnfc-objects-idx`' /> + </set> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml new file mode 100644 index 0000000..50c52fb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml @@ -0,0 +1,373 @@ +<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='port-mirror-topology-operation-deactivate-async' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failed to read port-mirror-configuration from MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Cannot find port-mirror-configuration in MD-SAL" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <set> + <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.' + value='`$port-mirror-topology-operation-input.sdnc-request-header.`' /> + </set> + <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='policy-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='success'> + <set> + <parameter name='l-interface-set[$src-idx]' value='true' /> + </set> + </outcome> + </update> + </block> + </for> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <block atomic="true"> + <set> + <parameter name='cto-api.default-domain' value='default-domain' /> + <parameter name='cto-api.default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cto-api.cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cto-api.contrail-route-allotted-resource-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' /> + <parameter name='cto-api.src-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn`' /> + <parameter name='cto-api.collector-contrail-network-fqdn' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='cto-api.rollback-flag' value='false' /> + <parameter name='cto-api.owning-entity' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-deactivate' mode='sync' > + <outcome value='failure'> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </outcome> + </call> + </block> + </outcome> + </switch> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="configuration" + key="configuration.configuration-id = $tmp.configuration-id" + force="true" pfx="tmp.AnAI-data"> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Unable to find configuration object in AAI" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Failure updating configuration object in AAI" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </update> + <set> + <parameter name='pm.configuration-data.configuration-oper-status.order-status' + value='Created' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-action' + value='`$port-mirror-topology-operation-input.request-information.request-action`' /> + <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action' + value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"> + <set> + <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" /> + </set> + <block atomic="true"> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="500" /> + <parameter name="input.response-message" value="`$error-message`" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'$error-message'`" /> + </return> + </block> + </block> + </outcome> + </execute> + <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__"> + <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" /> + <parameter name="input.ack-final-indicator" value="Y" /> + <parameter name="input.response-code" value="200" /> + <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" /> + <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" /> + <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" /> + </configure> + <return status='success'> + <parameter name='error-code' value='200' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml new file mode 100644 index 0000000..4a1fc27 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml @@ -0,0 +1,57 @@ +<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='port-mirror-topology-operation-deactivate-sync' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.pm.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" /> + </return> + </outcome> + </execute> + <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" /> + </return> + </outcome> + </switch> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='N' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml new file mode 100644 index 0000000..0be852c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml @@ -0,0 +1,184 @@ +<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='port-mirror-topology-operation-disable' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" /> + </return> + </outcome> + </switch> + <for index='idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$idx].source-port-id + == $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='src-idx' value='`$idx`' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$src-idx`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find source port ' + $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id + ' in MD-SAL'`" /> + </return> + </outcome> + </switch> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='disable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="false" /> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </update> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml new file mode 100644 index 0000000..b6d8c6d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml @@ -0,0 +1,231 @@ +<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='port-mirror-topology-operation-enable' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </execute> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" /> + </return> + </outcome> + </switch> + <for index='idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$idx].source-port-id + == $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='src-idx' value='`$idx`' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$src-idx`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find source port ' + $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id + ' in MD-SAL'`" /> + </return> + </outcome> + </switch> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' /> + </set> + </outcome> + <outcome value=''> + <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'> + <outcome value='Other'> + <set> + <parameter name='tmp.analyzer.ip-address' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' /> + </set> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + </outcome> + <outcome value='pprobe'> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='port-mirroring' /> + <parameter name='api-action' value='enable' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='display-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-name' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' /> + <parameter name='contrail-virtual-machine-interface-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' /> + <parameter name='default-domain' value='default-domain' /> + <parameter name='default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='traffic-direction' value='both' /> + <parameter name='analyzer-ip-address' + value='`$tmp.analyzer.ip-address`' /> + <parameter name='vni' value='1000' /> + <parameter name='udp-port' value='8099' /> + <parameter name='routing-instance' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' /> + <parameter name='local-preference' value='1' /> + <parameter name='juniper-header' value='false' /> + <parameter name='cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cloud-owner' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' /> + <outcome value='success'> + <set> + <parameter name='contrail-set[$src-idx]' value='true' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + </outcome> + </switch> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interface" + key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id + AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner + AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id + AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id + AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name" + force="true" pfx="tmp.AnAI-data"> + <parameter name="is-port-mirrored" value="true" /> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" /> + </return> + </outcome> + </update> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml new file mode 100644 index 0000000..aaead56 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml @@ -0,0 +1,108 @@ +<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='port-mirror-topology-operation-mapping-pprobe' mode='sync'> + <block atomic="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l-interfaces" + key="pnf.pnf-name = $tmp.dest-pnf-name AND + p-interface.interface-name = $tmp.dest-p-interface AND depth='all'" + pfx='aai.pnf.p-interface' local-only='false' > + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Destination L-Interfaces are not set for the Destination PNF" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error retrieving l-interfaces from AAI" /> + </return> + </outcome> + </get-resource> + <switch test='`$aai.pnf.p-interface.l-interface_length > 0`'> + <outcome value='false'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Destination L-Interface is not set for the Destination PNF" /> + </return> + </outcome> + </switch> + <set> + <parameter name='tmp.found-one' value='false' /> + </set> + <for index='idx' start='0' end='`$aai.pnf.p-interface.l-interface_length`' > + <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'> + <outcome value=''> + <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='tmp.found-one' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <set> + <parameter name='tmp.found-one' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-one`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Destination Port IP Address is not set for the Destination PNF' /> + </return> + </outcome> + </switch> + <set> + <parameter name='map-idx' value='0' /> + </set> + <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' > + <block atomic="true"> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id' + value='`$aai.pnf.p-interface.l-interface[$idx].interface-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name' + value='`$aai.pnf.p-interface.l-interface[$idx].interface-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address' + value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address' + value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' /> + </set> + <set> + <parameter name='map-idx' value='`$map-idx + 1`' /> + </set> + </block> + </for> + </for> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length' + value='`$map-idx`' /> + </set> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml new file mode 100644 index 0000000..5421853 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml @@ -0,0 +1,243 @@ +<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='port-mirror-topology-operation-mapping-vprobe' mode='sync'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select vnics_group_id + from VNICS_CAPACITY_GROUP + where service_instance_id = $tmp.service-instance-id + and nfc_naming_code = $tmp.dest-nfc-naming-code + and vnf_id = $tmp.dest-vnf-id' + pfx='db'> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + <outcome value='not-found'> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="insert into VNICS_CAPACITY_GROUP + (service_instance_id, nfc_naming_code, vnf_id) + VALUES ( $tmp.service-instance-id , $tmp.dest-nfc-naming-code , $tmp.dest-vnf-id )" + pfx='pfx' > + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure to insert record into VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + <outcome value='success'> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select vnics_group_id + from VNICS_CAPACITY_GROUP + where service_instance_id = $tmp.service-instance-id + and nfc_naming_code = $tmp.dest-nfc-naming-code + and vnf_id = $tmp.dest-vnf-id' + pfx='db'> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + </get-resource> + </outcome> + </save> + </outcome> + </get-resource> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' + value='`$db.vnics-group-id`' /> + </set> + <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' > + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select available_capacity, vnic_capacity + from VNICS_CAPACITY + where vnics_group_id = $db.vnics-group-id + and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name' + pfx='db.vnics-capacity'> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" /> + </return> + </outcome> + <outcome value='not-found'> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="insert into VNICS_CAPACITY + (vnics_group_id, vnic_port_name, available_capacity, vnic_capacity) + VALUES ( $db.vnics-group-id , + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name , + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity , + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity + )" + pfx='pfx' > + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure to insert record into VNICS_CAPACITY table" /> + </return> + </outcome> + </save> + </outcome> + <outcome value='success'> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity' + value='`$db.vnics-capacity.available-capacity`' /> + </set> + </outcome> + </get-resource> + </for> + </for> + <set> + <parameter name='map-idx' value='0' /> + </set> + <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' > + <block atomic="true"> + <set> + <parameter name='tmp.found-capacity' value='N' /> + <parameter name='tmp.save-rem-cap' value='0' /> + </set> + <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' > + <block atomic="true"> + <set> + <parameter name='tmp.rem-cap' value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity + - $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' /> + </set> + <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].capacity.vnic-capacity + <= $tmp.rem-cap`'> + <outcome value='true'> + <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv4-address`'> + <outcome value=''> + <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv6-address`'> + <outcome value=''> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <switch test='`$tmp.rem-cap > $tmp.save-rem-cap`'> + <outcome value='true'> + <set> + <parameter name='tmp.found-capacity' value='Y' /> + <parameter name='tmp.save-vnfc-do-idx' value='`$vnfc-do-idx`' /> + <parameter name='tmp.save-vnic-d-idx' value='`$vnic-d-idx`' /> + <parameter name='tmp.save-rem-cap' value='`$tmp.rem-cap`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <switch test='`$tmp.rem-cap > $tmp.save-rem-cap`'> + <outcome value='true'> + <set> + <parameter name='tmp.found-capacity' value='Y' /> + <parameter name='tmp.save-vnfc-do-idx' value='`$vnfc-do-idx`' /> + <parameter name='tmp.save-vnic-d-idx' value='`$vnic-d-idx`' /> + <parameter name='tmp.save-rem-cap' value='`$tmp.rem-cap`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </block> + </for> + </for> + <switch test="`$tmp.found-capacity == 'N'`"> + <outcome value='true'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'No capacity for source interface ' + + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].capacity.used-capacity' + value='`$tmp.src-pps + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].capacity.used-capacity`' /> + </set> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-port-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-port-name`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-vserver-id' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vserver-id`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv4-address`' /> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address' + value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv6-address`' /> + </set> + <set> + <parameter name='map-idx' value='`$map-idx + 1`' /> + </set> + </block> + </for> + </for> + <set> + <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length' + value='`$map-idx`' /> + </set> + <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' > + <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' > + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='select available_capacity + from VNICS_CAPACITY + where vnics_group_id = $db.vnics-group-id + and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name' + pfx='db.vnics-capacity'> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure reading VNICS_CAPACITY table" /> + </return> + </outcome> + </get-resource> + <set> + <parameter name='tmp.original-avail-capacity' value='`$db.vnics-capacity.available-capacity`' /> + <parameter name='tmp.original-used-capacity' value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' /> + <parameter name='tmp.avail-capacity' value='`$db.vnics-capacity.available-capacity - $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" +key="update VNICS_CAPACITY + set available_capacity = $tmp.avail-capacity + where vnics_group_id = $db.vnics-group-id + and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name +" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failure updating VNICS_CAPACITY table" /> + </return> + </outcome> + </update> + </block> + </for> + </for> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="insert into VNICS_CONFIGURATION_ID + (configuration_id, vnics_group_id) + values ( $tmp.configuration-id , $db.vnics-group-id )" + pfx='pfx' ></save> + <return status='success'> + <parameter name='' value='' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml new file mode 100644 index 0000000..673c513 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml @@ -0,0 +1,153 @@ +<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='port-mirror-topology-operation-unassign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' /> + <parameter name='tmp.service-instance-id' value='`$port-mirror-topology-operation-input.service-information.service-instance-id`' /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.pm-configuration`"/> + <parameter name="outputPath" value="tmp.pmc-url"/> + <parameter name="target" value="{configuration-id}"/> + <parameter name="replacement" value="`$tmp.configuration-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="pm-mdsal" /> + <outcome value='success'> + <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" /> + </return> + </outcome> + </execute> + <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Created'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Created'`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' /> + </set> + <set> + <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' /> + </set> + <switch test='`$tmp.configuration-sub-type`'> + <outcome value='vprobe'> + <block atomic="true"> + <set> + <parameter name='cto-api.default-domain' value='default-domain' /> + <parameter name='cto-api.default-project' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' /> + <parameter name='cto-api.cloud-region-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' /> + <parameter name='cto-api.contrail-route-allotted-resource-id' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' /> + <parameter name='cto-api.rollback-flag' value='false' /> + <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' /> + <parameter name='cto-api.owning-entity' + value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + </call> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' > + <outcome value='failure'> + <return status='failure'></return> + </outcome> + </call> + </block> + </outcome> + </switch> + <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' > + <block atomic="true"> + <set> + <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id + + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name + + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" /> + </set> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="logical-link" + key="logical-link.link-name = $tmp.link-name" > + <outcome value='failure'> + <block atomic="true"> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Failed to delete logical-link in AAI: ' + $tmp.link-name`" /> + </return> + </block> + </outcome> + <outcome value='not-found'> + <block atomic="true"></block> + </outcome> + </delete> + </block> + </for> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="configuration" + key="configuration.configuration-id = $tmp.configuration-id" + force="true" pfx="tmp.AnAI-data"> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='not-found'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Unable to find configuration object in AAI" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failure updating configuration object in AAI" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="mdsal-pmc" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="Failed to delete port-mirror-configuration object in MD-SAL" /> + </return> + </outcome> + </execute> + <return status='success'> + <parameter name='error-code' value='200' /> + <parameter name='ack-final' value='Y' /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml new file mode 100755 index 0000000..5a8dad5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml @@ -0,0 +1,237 @@ +<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='port-mirror-topology-operation-validation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-information.subscription-service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'No service exists for service instance ' + $port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="No configuration-id supplied in input" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='PPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='VPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-sub-type must be pprobe or vprobe" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'CreatePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be CreatePortMirrorConfigurationInstance for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-type is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-information.onap-model-information.model-customization-uuid is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="source vnf-id is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="dest vnf-id is required for vprobe assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='pprobe'>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.pnf-information.pnf-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="dest pnf-name is required for pprobe assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for activate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'CreatePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be CreatePortMirrorConfigurationInstance for activate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'DeletePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be DeletePortMirrorConfigurationInstance for unassign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for deactivate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'DeletePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be DeletePortMirrorConfigurationInstance for deactivate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='enable'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'ChangePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be ChangePortMirrorConfigurationInstance for enable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="port-mirror-configuration-request-input.source-port.source-port-id is required for enable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='disable'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'ChangePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be ChangePortMirrorConfigurationInstance for disable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="port-mirror-configuration-request-input.source-port.source-port-id is required for disable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml new file mode 100644 index 0000000..fb3cdb2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml @@ -0,0 +1,90 @@ +<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='port-mirror-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-validation' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-assign-sync' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-activate-sync' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-unassign' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-deactivate-sync' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='enable'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-enable' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + <outcome value='disable'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-disable' mode='sync' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y' /> + </return> + </outcome> + </call> + </block> + </outcome> + </switch> + <set> + <parameter name='service-object-path' value="`'/config/GENERIC-RESOURCE-API:services/service/' + + $port-mirror-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology'`" /> + <parameter name='port-mirror-object-path' value="`'/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/' + + $port-mirror-topology-operation-input.configuration-information.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" /> + </set> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-network-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-network-topology-operation.xml new file mode 100755 index 0000000..2558152 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-network-topology-operation.xml @@ -0,0 +1,34 @@ +<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='preload-network-topology-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='preload-data.' value='' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.'
+ value='`$preload-network-topology-operation-input.preload-network-topology-information.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='preload-data.preload-oper-status.order-status' value='PendingAssignment' />
+ <parameter name='preload-data.preload-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml new file mode 100755 index 0000000..91fd4a7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml @@ -0,0 +1,34 @@ +<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='preload-vf-module-topology-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$preload-data.preload-vf-module-topology-information.vf-module-topology.vf-module-topology-identifier.vf-module-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='preload-data.' value='' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='preload-data.preload-vf-module-topology-information.'
+ value='`$preload-vf-module-topology-operation-input.preload-vf-module-topology-information.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='preload-data.preload-oper-status.order-status' value='PendingAssignment' />
+ <parameter name='preload-data.preload-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-eipam-pools.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-eipam-pools.xml new file mode 100755 index 0000000..0f27169 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-eipam-pools.xml @@ -0,0 +1,935 @@ +<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="process-eipam-pools" mode="sync">
+ <switch test='`$tmp.process-eipam-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name='tmp.location8' value='' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='' />
+ <parameter name='tmp.l3-network.level1.v4.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='' />
+ <parameter name='tmp.l3-network.level1.v6.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v4.entity-id' value='' />
+ <parameter name='tmp.l3-network.level2.v4.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level2.v4.mask' value='' />
+ <parameter name='tmp.l3-network.level2.v4.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v4.subnet.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v6.entity-id' value='' />
+ <parameter name='tmp.l3-network.level2.v6.ip-prefix' value='' />
+ <parameter name='tmp.l3-network.level2.v6.mask' value='' />
+ <parameter name='tmp.l3-network.level2.v6.pool.pre-existing' value='false' />
+ <parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='false' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name="string" value="`$aai.complex.physical-location-id`" />
+ <parameter name="result" value="tmp.location8"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="8" />
+ </execute>
+ <set>
+ <parameter name='tmp.region' value='`$aai.complex.region`' />
+ <parameter name='tmp.cloud-region-id' value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name='tmp.physical-location-id' value="`$aai.complex.physical-location-id`" />
+ <parameter name="tmp.clli" value="`$aai.complex.physical-location-id`" />
+ <parameter name="tmp.zone" value="`$aai.cloud-region.cloud-zone`" />
+ <parameter name="tmp.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="tmp.service-type" value="`$network-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ <parameter name="tmp.level1-key-value" value="`$tmp.location8 + ':' + $aai.cloud-region.cloud-region-id`" />
+ <parameter name="tmp.level2-key-value" value="`$network-model.network-role + ':' + $tmp.l3-network.network-id`" />
+ <parameter name="tmp.ipv4-cidr-mask" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="tmp.ipv6-cidr-mask" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='pidx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv4_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v4' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv6_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v6' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-network-role-pool' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while allocating subnet in EIPAM. Error creating level 1 pool. ' + $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.pool.pre-existing' value='`$eipam-pool.v4.pre-existing`'/>
+ <parameter name='tmp.l3-network.level1.v6.pool.pre-existing' value='`$eipam-pool.v6.pre-existing`'/>
+ </set>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = 1 and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name="eipam-ip-block.level" value='1' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level1 ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = 1 and k.key_value = $tmp.level1-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name="eipam-ip-block.level" value='1' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level1 ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level1.v6.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-network-role-pool' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Error creating level 2 pool, need to attempt rollback"/>
+ </record>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Error creating level 2 pool" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v4.pre-existing' value='`$eipam-pool.v4.pre-existing`'/>
+ <parameter name='tmp.l3-network.level2.v6.pre-existing' value='`$eipam-pool.v6.pre-existing`'/>
+ </set>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level2"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level2"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level2.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level2.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$eipam-ip-block.subnet-size-override-v4`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level2"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level2"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v4.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level2.v4.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v4.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level2.v4.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level2 ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level2.v4.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv4 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level2.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level2.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$eipam-ip-block.subnet-size-override-v6`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-network-role-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix for level1"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask for level1"/>
+ <parameter name="field7" value="`$eipam-ip-block.mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='' />
+ <parameter name='tmp.l3-network.level2.v6.entity-id' value='`$eipam-ip-block.entity-id`' />
+ <parameter name='tmp.l3-network.level2.v6.ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='tmp.l3-network.level2.v6.mask' value='`$eipam-ip-block.mask`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate level2 ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ </record>
+ <switch test="`$tmp.l3-network.level2.v6.pool.pre-existing`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'></outcome>
+ <outcome value='Other'></outcome>
+ </execute>
+ <switch test="`$tmp.l3-network.level1.v4.pool.pre-existing == true or $tmp.l3-network.level1.v4.pool.pre-existing == true`">
+ <outcome value='true'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating subnet in EIPAM. Pre-existing pool, no rollback." />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Rollback complete." />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating level 2 ipv6 subnet in EIPAM. Error rolling back EIPAM level 1 pool." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Invalid option to process-eipam" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Invalid option to process-eipam" />
+ </return>
+ </outcome>
+ </switch>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml new file mode 100755 index 0000000..d713d23 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml @@ -0,0 +1,661 @@ +<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}'>
+ <!--This DG relys on generate-FQPN to determine the key_names & key_values for all levels for the specified plan-name.-->
+ <method rpc="process-generic-eipam-pools" mode="sync">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="false"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="false"/>
+ <!-- <parameter name="tmp.network-id" value="`$tmp.l3-network.network-id`" /> -->
+ <parameter name="tmp.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
+ </set>
+ <switch test='`$tmp.service-type`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.service-type" value="`$service-data.service-information.subscription-service-type`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.network-instance-group-id`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology-operation-input.network-request-input.network-instance-group-id`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.network-name`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology-identifier-structure.network-name`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.zone`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.zone" value="`$aai.cloud-region.cloud-zone`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.network-collection`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.network-collection" value="`$aai-network-collection.collection-name`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.aic-cloud-region`'>
+ <outcome value=''>
+ <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>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.location-clli8`'>
+ <outcome value=''>
+ <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>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.complex-region`'>
+ <outcome value=''>
+ <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>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-cloud-region + ' not found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name' value='`$network-model.eipam-v4-address-plan`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="v4FQPN-output." value="generate-FQPN-output."/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name' value='`$network-model.eipam-v6-address-plan`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="v6FQPN-output." value="generate-FQPN-output."/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='pidx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv4_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v4' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv6_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v6' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index="l-idx" start="1" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length + 1`">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.level" value='`$l-idx`' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-generic-pool' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-generic-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Error creating pool for level"/>
+ <parameter name="field5" value="`$l-idx`"/>
+ </record>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-generic-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="`$l-idx`"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ <parameter name="field12" value="Successful" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value=""></outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = $l-idx and k.key_value = $key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level:" />
+ <parameter name="field5" value="`$l-idx`" />
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level:" />
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ <parameter name="field9" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-generic-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.v4.allocateSubnetResponse.' value='eipam-ip-block.allocateSubnetResponse.' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask"/>
+ <parameter name="field7" value="`$eipam-ip-block.v4.allocateSubnetResponse.Mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ <parameter name="field5" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = $l-idx and k.key_value = $key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level:" />
+ <parameter name="field5" value="`$l-idx`" />
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level:" />
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ <parameter name="field9" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-generic-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.v6.allocateSubnetResponse.' value='eipam-ip-block.allocateSubnetResponse.' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask"/>
+ <parameter name="field7" value="`$eipam-ip-block.v6.allocateSubnetResponse.Mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </for>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml new file mode 100644 index 0000000..64e5765 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml @@ -0,0 +1,199 @@ +<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='query-aai-l3-network-by-network-role' mode='sync'>
+ <block atomic='true'>
+ <switch test='`$query-aai-l3-network-by-network-role-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.aic-cloud-region is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$query-aai-l3-network-by-network-role-input.service-instance-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.service-instance-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$query-aai-l3-network-by-network-role-input.network-role`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.network-role is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.aai.l3-networks.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $query-aai-l3-network-by-network-role-input.network-role"
+ pfx='tmp.aai.l3-networks' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No active l3-network found in AAI with cloud_region_id '
+ + $vnf-topology-operation-input.vnf-request-information.aic-cloud-region + ' and network_role '
+ + $query-aai-l3-network-by-network-role-input.network-role`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving l3-network from AAI with network-role = ' + $query-aai-l3-network-by-network-role-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$tmp.aai.l3-networks.l3-network_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$tmp.aai.l3-networks.l3-network[0].`' />
+ <!--
+<parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$tmp.aai.l3-networks.l3-network[0].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$tmp.aai.l3-networks.l3-network[0].network-name`' />
+-->
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.l3-network-found' value='0' />
+ </set>
+ <set>
+ <parameter name='cloud.matched.l3-networks_length' value='0' />
+ </set>
+ <for index='network-index' start='0' end='`$tmp.aai.l3-networks.l3-network_length`' >
+ <block>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name ='tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length' value = '0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='cloud-region'>
+ <for silentFailure='false' index='rdidx' start='0' end="`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $query-aai-l3-network-by-network-role-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='cloud.matched.l3-networks[$cloud.matched.l3-networks_length].'
+ value='$tmp.aai.l3-networks.l3-network[$network-index].' />
+ </set>
+ <set>
+ <parameter name='cloud.matched.l3-networks_length' value='`$cloud.matched.l3-networks_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <switch test='`$cloud.matched.l3-networks_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network with network-role=' + $query-aai-l3-network-by-network-role-input.network-role + ' and cloud-region=' + $query-aai-l3-network-by-network-role-input.aic-cloud-region + ' found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$cloud.matched.l3-networks[0].`' />
+ <!--
+ <parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$cloud.matched.l3-networks[0].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$cloud.matched.l3-networks[0].network-name`' />
+-->
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <block>
+ <for index='cidx' start='0' end='`$cloud.matched.l3-networks_length`' >
+ <block>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name ='tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length' value = '0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship_length`' >
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='false' index='rdidx' start='0' end="`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $query-aai-l3-network-by-network-role-input.service-instance-id`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$cloud.matched.l3-networks[$cidx].`' />
+ <!--
+<parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$cloud.matched.l3-networks[$cidx].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$cloud.matched.l3-networks[$cidx].network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='tmp.l3-network-found' value='1' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.l3-network-found`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network with network-role=' + $query-aai-l3-network-by-network-role-input.network-role + ' and cloud-region=' + $query-aai-l3-network-by-network-role-input.aic-cloud-region + ' and service-instance-id=' + $query-aai-l3-network-by-network-role-input.service-instance-id + ' found in AAI'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml new file mode 100644 index 0000000..6a4ca1b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml @@ -0,0 +1,46 @@ +<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='rollback-eipam-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_ASSIGNMENTS
+ WHERE info = $vnf-topology-operation-input.vnf-request-information.vnf-id'>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.status'
+ value="`'PENDING_DELETE_' + $vnf-topology-operation-input.vnf-request-information.vnf-id`" />
+ <parameter name='service-data.service-information.service-type'
+ value='NOT_APPLICABLE' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status
+ WHERE info = $vnf-topology-operation-input.vnf-request-information.vnf-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 updating EIPAM_IP_ASSIGNMENTS table on rollback." />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in EIPAM unassign IP address on rollback." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-generated-names.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-generated-names.xml new file mode 100644 index 0000000..41a6468 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_rollback-generated-names.xml @@ -0,0 +1,341 @@ +<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='rollback-generated-names' mode='sync'>
+ <block atomic="true">
+ <switch test='`$rollback-generated-names-input.context-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="rollback-generated-names-input.context-id can not be null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rollback-generated-names-input.naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="rollback-generated-names-input.naming-type can not be null" />
+ </return>
+ </outcome>
+ <outcome value='VM_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VM_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vm_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='VNFC_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VNFC_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnfc_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='CLIENT_KEY'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='EIPAM_CLIENT_KEY_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnf_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='NETWORK_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
+ value='NETWORK_INSTANCE_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='network_instance_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='SERVICE_INSTANCE'>
+ <block>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
+ value='SERVICE_INSTANCE_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='service_instance_name_prefix' />
+ </set>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id AND prefix IS NULL AND name_index IS NULL'></delete>
+ </block>
+ </outcome>
+ <outcome value='VNF_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='vnf_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown rollbck-generated-name-input.naming-type: ' + $rollback-generated-names-input.naming-type`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='db.grn.' value='' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT distinct prefix from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id'
+ pfx='db.grn.distinct-prefix[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table to retrieve distinct prefix"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.grn.distinct-prefix_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for index='prefix-index' start='0' end='`$db.grn.distinct-prefix_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='db.grn.subset.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.grn.prefix' value='`$db.grn.distinct-prefix[$prefix-index].prefix`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id
+ AND prefix = $tmp.rb.grn.prefix order by name_index'
+ pfx='db.grn.subset[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'No entry found in GENERIC_RESOURCE_NAME where context_id = ' + $rollback-generated-names-input.context-id + ' and type = ' + $rollback-generated-names-input.naming-type + ' and prefix = ' + $db.grn.distinct-prefix[$prefix-index].prefix`"/>
+ </return>
+ </outcome>
+ </get-resource>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'SELECT * from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`" pfx='db.grn.index-table'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error reading the '
+ + $rollback-generated-names.index-table-name
+ + ' table with ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'No entries found in '
+ + $rollback-generated-names.index-table-name
+ + ' with '
+ + $rollback-generated-names.name-prefix-column
+ + ' = '
+ + $tmp.rb.grn.prefix `" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ <set>
+ <parameter name='tmp.rb.grn.max-index'
+ value='`$db.grn.subset[$db.grn.subset_length - 1].name-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.delta-index'
+ value='`$db.grn.index-table.index-number - $tmp.rb.grn.max-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.net-index'
+ value='`$db.grn.index-table.index-number - $db.grn.subset_length`' />
+ </set>
+ <switch test="`$tmp.rb.delta-index == 0`">
+ <outcome value='true'>
+ <switch test="`$tmp.rb.net-index == 0`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'DELETE from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ <!--
++ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`" />
+-->
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting '
+ + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + ' AND index_number = ' + $db.index-table.index-number
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'UPDATE ' + $rollback-generated-names.index-table-name
+ + ' set index_number = ' + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ </switch>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id
+ AND prefix = $tmp.rb.grn.prefix'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting GENERIC_RESOURCE_NAME WHERE type = '
+ + $rollback-generated-names-input.naming-type
+ + ' AND context_id = ' + $rollback-generated-names-input.context-id
+ + ' AND prefix = '+ $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </delete>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND prefix = $tmp.rb.grn.prefix order by name_index'
+ pfx='db.grn.prefix[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'DELETE from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ <!--
++ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`" />
+-->
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting '
+ + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + ' AND index_number = ' + $db.index-table.index-number`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.grn.last-max-index'
+ value='`$db.grn.prefix[$db.grn.prefix_length - 1].name-index`' />
+ </set>
+ <switch test="`$tmp.rb.net-index > $tmp.rb.grn.last-max-index`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'UPDATE ' + $rollback-generated-names.index-table-name
+ + ' set index_number = ' + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix`" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml new file mode 100755 index 0000000..f49173a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml @@ -0,0 +1,150 @@ +<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='security-zone-topology-operation-activate' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="in-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </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="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml new file mode 100755 index 0000000..cb8450b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml @@ -0,0 +1,348 @@ +<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='security-zone-topology-operation-assign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.vnf-provided-allottedresource`" /> + <parameter name="outputPath" value="tmp.vnf-p-ar-url" /> + <parameter name="target" value="{service-instance-id}" /> + <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`" /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.vnf-p-ar-url`" /> + <parameter name="outputPath" value="tmp.vnf-p-ar-url" /> + <parameter name="target" value="{vnf-id}"/> + <parameter name="replacement" value="`$tmp.ar.sz-vnf-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + <outcome value='PendingDelete'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" /> + </return> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <set> + <parameter name='sz-ar-identifiers.consuming-service-instance-id' value="`$security-zone-topology-operation-input.service-information.service-instance-id` " /> + <parameter name='sz-ar-identifiers.parent-service-instance-id' value="`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id` " /> + <parameter name='sz-ar-identifiers.allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='sz-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + </set> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.' +value="`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.`" /> + </set> + <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'> + <outcome value=''> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-invariant-uuid' +value="`$ar-model.invariant-uuid`" /> + </set> + </outcome> + </switch> + <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'> + <outcome value=''> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-uuid' +value="`$ar-model.uuid`" /> + </set> + </outcome> + </switch> + <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-version'> + <outcome value=''> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-version' +value="`$ar-model.version`" /> + </set> + </outcome> + </switch> + <switch test='`$ar-model.ecomp-generated-naming`'> + <outcome value='Y'> + <block atomic="true"> + <switch test='`$ar-model.naming-policy`'> + <outcome value='oam_security_zone_name'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantOAMNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/> + </execute> + <set> + <parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + <outcome value='Other'> + <block atomic='true'> + <set> + <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$TenantOAMNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.ar-name`"/> + <parameter name="outputPath" value="tmp.ar-name"/> + <parameter name="target" value="$LandingNetworkRole"/> + <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/> + </execute> + <set> + <parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' /> + </set> + </block> + </outcome> + </switch> + </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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" /> + </return> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.allotted-resource-identifiers.' +value="`$sz-ar-identifiers.`" /> + </set> + <set> + <parameter name='sz-ar-assignments.vlan-tag' value="`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag` " /> + <parameter name='sz-ar-assignments.trusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role` " /> + <parameter name='sz-ar-assignments.untrusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role` " /> + <parameter name='sz-ar-assignments.security-zone-service-instance-id' value="`$tmp.ar.parent-service-instance-id` " /> + </set> + <call module='GENERIC-RESOURCE-API' rpc='generate-panorama-name' mode='sync' ></call> + <set> + <parameter name='sz-ar-assignments.security-zone-name-untrusted' value="`$tmp.untrust-sz` " /> + <parameter name='sz-ar-assignments.security-zone-name-trusted' value="`$tmp.trust-sz` " /> + </set> + <set> + <parameter name='sz-ar.allotted-resource-data.security-zone-topology.security-zone-assignments.' +value="`$sz-ar-assignments.`" /> + </set> + <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'> + <outcome value=''> + <set> + <parameter name='tmp.cidx' value="`0`" /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" /> + </set> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' > + <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`"> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$cidx`' /> + <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' /> + <parameter name='tmp.found-cidx' value='true' /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-cidx`'> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <set> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " /> + <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="description" value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`" /> + <parameter name="selflink" value="`$tmp.ar.self-link`" /> + <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" /> + <parameter name="model-version-id" value="`$ar-model.uuid`" /> + <parameter name="operational-status" value="null" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="parent" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block></block> + </outcome> + <outcome value='not-found'> + <block></block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </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="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml new file mode 100755 index 0000000..a234d0d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml @@ -0,0 +1,127 @@ +<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='security-zone-topology-operation-create' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='PendingCreate'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </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="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml new file mode 100755 index 0000000..14ecf29 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml @@ -0,0 +1,150 @@ +<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='security-zone-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="allotted-resource" + key="customer.global-customer-id = $service-data.service-information.global-customer-id AND + service-subscription.service-type = $service-data.service-information.subscription-service-type AND + service-instance.service-instance-id = $service-data.service-information.service-instance-id AND + allotted-resource.id = $tmp.ar.allotted-resource-id" + pfx='pfx' local-only='false' force='false'> + <parameter name="operational-status" value="out-of-service-path" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </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="AAI failed" /> + </return> + </outcome> + </update> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </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="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml new file mode 100755 index 0000000..acad449 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml @@ -0,0 +1,130 @@ +<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='security-zone-topology-operation-delete' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " /> + <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " /> + <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" /> + <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' > + <parameter name="outputPath" value="tmp.current-time" /> + </execute> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' /> + </set> + <set> + <parameter name='sz-ar-assignments.' value="" /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" /> + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='PUT' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </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="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml new file mode 100755 index 0000000..0f11b39 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml @@ -0,0 +1,105 @@ +<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='security-zone-topology-operation-unassign' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' /> + <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' /> + <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' /> + </set> + <set> + <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/' + + $tmp.ar.allotted-resource-id + + '/allotted-resource-data/security-zone-topology/'` " /> + </set> + <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.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/> + <parameter name="outputPath" value="tmp.ar-url"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='GET' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='bk-sz-ar' value='$mdsal-ar.' /> + </set> + <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'> + <outcome value='1'> + <block atomic='true'> + <set> + <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' /> + </set> + <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'> + <outcome value='Created'> + <block></block> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + <set> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' /> + <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' /> + </set> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <block atomic="true"></block> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' /> + <parameter name='restapiUser' value='`$prop.controller.user`' /> + <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='DELETE' /> + <parameter name="responsePrefix" value="mdsal-ar" /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </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="Error updating md-sal for security-zone-allotted-resource" /> + </return> + </outcome> + </execute> + <set> + <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' /> + <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/> + <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + + $security-zone-topology-operation-input.service-information.service-instance-id + + '/service-data/service-topology/'`"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation.xml new file mode 100755 index 0000000..5cb18ae --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_security-zone-topology-operation.xml @@ -0,0 +1,56 @@ +<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='security-zone-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-security-zone-input' mode='sync' ></call> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-assign' mode='sync' ></call> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-create' mode='sync' ></call> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-activate' mode='sync' ></call> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-deactivate' mode='sync' ></call> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-delete' mode='sync' ></call> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-unassign' mode='sync' ></call> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-pnf-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-pnf-put.xml new file mode 100644 index 0000000..6631d89 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-pnf-put.xml @@ -0,0 +1,156 @@ +<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='self-serve-aai-pnf-put' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <for silentFailure='true' index="aidx" start="0" end="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`">
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].name`'>
+ <outcome value='pnf-name'>
+ <set>
+ <parameter name='ss.param.pnf-name' value ='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.pnf-name-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='pnf-name2'>
+ <set>
+ <parameter name='ss.param.pnf-name2' value ='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.pnf-name2-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='pnf-id'>
+ <set>
+ <parameter name='ss.param.pnf-id' value ='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.pnf-id-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-pnf-put'>
+ <set>
+ <parameter name='ss.param.aai-pnf-put-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv6-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv6-oam-address' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.ipv6-oam-address-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-name = $ss.param.pnf-name "
+ pfx="tmp.aai.pnf" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error to get pnf with pnf-name=' + $ss.param.pnf-name + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'pnf with pnf-name=' + $ss.param.pnf-name + ' not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="ss.selflink"
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' +
+ $service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id +
+ '/service-data/pnfs/pnf/' +
+ $ss.param.pnf-id +
+ '/pnf-data/pnf-topology/'`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-name = $ss.param.pnf-name " >
+ <parameter name="pnf-name2" value="`$ss.param.pnf-name2`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <parameter name="selflink" value="`$ss.selflink`" />
+ <parameter name="ipaddress-v4-oam" value="`$ss.param.ipv4-oam-address`" />
+ <parameter name="ipaddress-v6-oam" value="`$ss.param.ipv6-oam-address`" />
+ <parameter name="model-customization-id"
+ value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.onap-model-information.model-customization-uuid`" />
+ <parameter name="model-invariant-id"
+ value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id"
+ value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.onap-model-information.model-uuid`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update pnf.pnf-name in AnAI with pnf-name=' + $ss.param.pnf-name`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'pnf with pnf-name =' + $ss.param.pnf-name + ' is not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$ss.param.aai-pnf-put-index].value'
+ value='SUCCESS' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-aai-pnf-put.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vf-module-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vf-module-put.xml new file mode 100644 index 0000000..c64485b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vf-module-put.xml @@ -0,0 +1,6600 @@ +<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='self-serve-aai-vf-module-put' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='nidx' value='0' />
+ </set>
+ <for silentFailure='true' index="bidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`" >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="sriov"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="_net_id"/>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.network[$nidx].netid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ <set>
+ <parameter name='nidx' value='`$nidx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`'>
+ <outcome value='vf_module_id'>
+ <set>
+ <parameter name='ss.param.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module-name'>
+ <set>
+ <parameter name='ss.param.vf-module-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-id'>
+ <set>
+ <parameter name='ss.param.volume-group-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-name'>
+ <set>
+ <parameter name='ss.param.volume-group-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='aic-cloud-region'>
+ <set>
+ <parameter name='ss.param.aic-cloud-region' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-name'>
+ <set>
+ <parameter name='ss.param.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='oam-interface-name'>
+ <set>
+ <parameter name='ss.param.oam-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.oam-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='=âlo0-interface-name'>
+ <set>
+ <parameter name='ss.param.lo0-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.lo0-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address-prefix'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address-prefix' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-prefix-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='loopback0_ipv4_address'>
+ <set>
+ <parameter name='ss.param.loopback0-ipv4-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.loopback0-ipv4-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-loopback0-address'>
+ <set>
+ <parameter name='ss.param.ipv4-loopback0-address' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-loopback0-address-index' value='`bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-naming-code'>
+ <set>
+ <parameter name='ss.param.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-naming-code-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='ss.param.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-function-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-customization-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-customization-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-customization-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-invariant-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-invariant-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-invariant-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-version'>
+ <set>
+ <parameter name='ss.param.vnfc-model-version' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-version-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='as-number'>
+ <set>
+ <parameter name='ss.param.as-number' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.as-number-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-id-outer'>
+ <set>
+ <parameter name='ss.param.vlan-id-outer' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vlan-id-outer-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='availability_zone_0'>
+ <set>
+ <parameter name='ss.param.availability-zone-0' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.availability-zone-0-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-vf-module-put'>
+ <block>
+ <set>
+ <parameter name='ss.param.aai-vf-module-put-index' value='`$bidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='generic-vnf'>
+ <set>
+ <parameter name='ss.resource-key.generic-vnf' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module'>
+ <set>
+ <parameter name='ss.resource-key.vf-module' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group'>
+ <set>
+ <parameter name='ss.resource-key.volume-group' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc'>
+ <set>
+ <parameter name='ss.resource-key.vnfc' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='connection-points'>
+ <set>
+ <parameter name='ss.resource-key.connection-points' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l-interface'>
+ <set>
+ <parameter name='ss.resource-key.l-interface' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l3-netework'>
+ <set>
+ <parameter name='ss.resource-key.l3-network' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </for>
+ <set>
+ <parameter name='ss.param.vnf-id' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ </block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id "
+ pfx="tmp.aai.vnf" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error to get generic-vnf with vnf-id=' + $ss.param.vnf-id + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf.vnf-name with vnf-id=' + $ss.param.vnf-id + ' not found in AAI. '`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test="`$ss.param.ipv4-loopback0-address != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.ipv4-loopback0-address`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.ipv4-loopback0-address = ' + $ss.param.ipv4-loopback0-address`"/>
+ <parameter name="field3" value="__SKIP ipv4-loopback0-address update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$ss.param.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.ipv4-loopback0-address in AnAI with ipv4-loopback0-address=' + $ss.param.ipv4-loopback0-address + '; ' + $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.ipv4-loopback0-address-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.ipv4-oam-address != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.ipv4-oam-address`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.ipv4-oam-address = ' + $ss.param.ipv4-oam-address`"/>
+ <parameter name="field3" value="__SKIP ipv4-oam-address update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$ss.param.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.ipv4-oam-address in AnAI with ipv4-oam-address=' + $ss.param.ipv4-oam-address + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI' + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.ipv4-oam-address-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.as-number != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.as-number`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.as-number = ' + $ss.param.as-number`"/>
+ <parameter name="field3" value="__SKIP as-number update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$ss.param.as-number`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.as-number in AnAI with as-number=' + $ss.param.as-number + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.as-number-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.vlan-id-outer != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.vlan-id-outer`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.vlan-id-outer = ' + $ss.param.vlan-id-outer`"/>
+ <parameter name="field3" value="__SKIP vlan-id-outer update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vlan-id-outer" value='`$ss.param.vlan-id-outer`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.vlan-id-outer in AnAI with as-number=' + $ss.param.as-number + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf because vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.vlan-id-outer-updated' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.availability-zone-0 != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.availability-zone-0`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.availability-zone-0 = ' + $ss.param.availability-zone-0`"/>
+ <parameter name="field3" value="__SKIP availability-zone-0 update for generic-vnf in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.availability-zone.related-link'
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/' +
+ $prop.cloud-region.cloud-owner + '/' + $ss.param.aic-cloud-region +
+ '/availability-zones/availability-zone/' +
+ $ss.param.availability-zone-0`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`$ss.availability-zone.related-link`" />
+ <!--
+<parameter name="relationship-list.relationship[0].related-to" value="availability-zone" /><parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" /><parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" /><parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" /><parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$ss.param.aic-cloud-region`" /><parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" /><parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$ss.param.availability-zone-0`" />
+-->
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.vlan-id-outer-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.vlan-id-outer update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.vlan-id-outer update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.vlan-id-outer update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to save availability-zone relationship for generic-vnf in AnAI with availability-zone-name =' + $ss.param.as-number + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.ipv4-loopback0-address-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-loopback0-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-loopback0-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-loopback0-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.ipv4-oam-address-updated`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.ipv4-oam-address update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.ipv4-oam-address update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.ipv4-oam-address update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.as-number-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.as-number update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.as-number update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.as-number update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.vlan-id-outer-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf.vlan-id-outer update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf.vlan-id-outer update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf.vlan-id-outer update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to create availability-zone relationship because generic-vnf with vnf-id =' + $ss.param.vnf-id + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.availability-zone-0-updated' value='true' />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id "
+ pfx="tmp.aai.vfmdoule" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get vf-module in AnAI with vf-module-id = ' + $ss.param.vf-module-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'vf-module not found in AnAI with vf-module-id=' + $ss.param.vf-module-id + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='ss.selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' +
+$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id +
+'/service-data/vnfs/vnf/' +
+$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id +
+'/vnf-data/vf-modules/vf-module/' +
+$ss.param.vf-module-id +
+'/vf-module-data/vf-module-topology/'`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$ss.param.vf-module-name`' />
+ <parameter name="selflink" value='`$ss.selflink`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update vf-module-name with vf-module-id = ' + $ss.param.vf-module-id + ' in AnAI; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update vf-module-name with vf-module-id =' + $ss.param.vf-module-id + ' because vf-module is not found in AAI' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id"
+ pfx="tmp.aai.volume-group" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get volume-group in AnAI with volume-group-id = ' + $ss.param.volume-group-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'volume-group not found in AnAI with volume-group-id=' + $ss.param.volume-group-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$ss.param.volume-group-name`' />
+ <parameter name="volume-group-id" value='`$ss.param.volume-group-id`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to update volume-group with volume-group-id =' + $ss.param.volume-group-id + ' and volume-group-name = ' + $ss.param.volume-group-name + ' in AnAI.' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'volume-group not found in AnAI with volume-group-id=' + $ss.param.volume-group-id + '; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <parameter name="nfc-naming-code" value='`$ss.param.nfc-naming-code`' />
+ <parameter name="nfc-function" value='`$ss.param.nfc-function`' />
+ <parameter name="model-customization-id" value='`$ss.param.vnfc-model-customization-uuid`' />
+ <parameter name="model-invariant-id" value='`$ss.param.vnfc-model-invariant-uuid`' />
+ <parameter name="model-version-id" value='`$ss.param.vnfc-model-version`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vnfc with vnfc-name =' + $ss.param.vnfc-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vnfc with vnfc-name =' + $ss.param.vnfc-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.connection-points`">
+ <outcome value='connection-points'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp"
+ key="cp.cp-instance-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id
+ AND vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <parameter name="cp-instance-id"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create connection-point with cp-instance-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create connection-point with cp-instance-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <parameter name="vlan-tag-id"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid`' />
+ <parameter name="vlan-tag-role"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-tag-description`' />
+ <parameter name="vlan-id-outer"
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-tag-id`' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.cp.related-link'
+ value="`'/aai/v$/network/vnfcs/vnfc/' +
+ $ss.param.vnfc-name +
+ '/cps/cp/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.connection-point-id`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag:relationship-list"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`$ss.cp.related-link`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create cp relationship for vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create cp relationship for vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="interface-name" value='`$ss.param.oam-interface-name`' />
+ <parameter name="interface-role" value='OAM' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.oam-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.oam-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="l3-interface-ipv4-address-list.l3-interface-ipv4-address = $ss.param.ipv4-oam-address
+ AND generic-vnf.vnf-id = $ss.param.vnf-id
+ AND l-interface.interface-name = $ss.param.oam-interface-name" >
+ <parameter name="l3-interface-ipv4-address" value='`$ss.param.ipv4-oam-address`' />
+ <parameter name="l3-interface-ipv4-prefix-length" value='`$ss.param.ipv4-oam-address-prefix`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.ipv4-oam-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.ipv4-oam-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="interface-name" value='`$ss.param.lo0-interface-name`' />
+ <parameter name="interface-role" value='loopback' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="l3-interface-ipv4-address-list.l3-interface-ipv4-address = $ss.param.ipv4-loopback0-address
+ AND generic-vnf.vnf-id = $ss.param.vnf-id
+ AND l-interface.interface-name = $ss.param.lo0-interface-name" >
+ <parameter name="l3-interface-ipv4-address" value='`$ss.param.ipv4-loopback0-address`' />
+ <parameter name="l3-interface-ipv4-prefix-length" value='32' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.loopback0-ipv4-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create l3-interface-ipv4-address-list with l3-interface-ipv4-address = ' + $ss.param.loopback0-ipv4-address + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.l3-network.related-link'
+ value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`$ss.l3-network.related-link`" />
+ <!--
+<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /><parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$ss.network[$n].netid`" />
+-->
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK VNF l3-network relationship"/>
+ </record>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <set>
+ <parameter name='tmp.related-link' value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ <!--
+<parameter name='tmp.related-link' value="`'/aai/' + $prop.aai.version + '/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+-->
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND related-to = l3-network
+ AND relationship.related-link = $tmp.related-link" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete VNF l3-network relationship for generic-vnf.vnfid = ' + $ss.param.vnf-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l3-network relationship with related-path = ' + $tmp.related-path + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of generic-vnf l3-network relationships completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create generic-vnf releationship for l3-network with network-id =' + $ss.network[$n].netid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <block>
+ <block atomic='true'>
+ <block>
+ <block>
+ <block>
+ <switch test="`$ss.resource-key.generic-vnf`">
+ <outcome value='generic-vnf'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="ipv4-loopback0-address" value='`$tmp.aai.vnf.ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$tmp.aai.vnf.ipv4-oam-address`' />
+ <parameter name="as-number" value='`$tmp.aai.vnf.as-number`' />
+ <parameter name="vlan-id-outer" value='`$tmp.aai.vnf.vlan-id-outer`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id=' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vf-module`">
+ <outcome value='vf-module'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vf-module update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND vf-module.vf-module-id = $ss.param.vf-module-id " >
+ <parameter name="vf-module-name" value='`$tmp.aai.vfmdoule.vf-module-name`' />
+ <parameter name="selflink" value='`$tmp.aai.vfmdoule.selflink`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' in AnAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback vf-module update with vf-module-id=' + $ss.param.vf-module-id + ' because vf-module not found in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of vf-module update completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.volume-group`">
+ <outcome value='volume-group'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK volume-group update"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="cloud-region.cloud-owner = $prop.cloud-owner
+ AND cloud-region.cloud-region-id = $ss.param.aic-cloud-region
+ AND cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND volume-group-id = $ss.param.volume-group-id" >
+ <parameter name="volume-group-name" value='`$tmp.aai.volume-group.volume-group-name`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to UPDATE volume-group with volume-group-id=' + $ss.param.volume-group-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' volume-group with volume-group-id = ' + $ss.param.volume-group-id + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of volume_group completed.'`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK VNF l3-network relationship"/>
+ </record>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <set>
+ <parameter name='tmp.related-link' value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ <!--
+<parameter name='tmp.related-link' value="`'/aai/' + $prop.aai.version + '/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+-->
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND related-to = l3-network
+ AND relationship.related-link = $tmp.related-link" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete VNF l3-network relationship for generic-vnf.vnfid = ' + $ss.param.vnf-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l3-network relationship with related-path = ' + $tmp.related-path + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of generic-vnf l3-network relationships completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`' Failed to create generic-vnf releationship for l3-network with network-id =' + $ss.network[$n].netid + ' in AnAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].value'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='nidx' value='0' />
+ </set>
+ <for silentFailure='true' index="bidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`" >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="sriov"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`" />
+ <parameter name="target" value="_net_id"/>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.network[$nidx].netid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ <set>
+ <parameter name='nidx' value='`$nidx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].name`'>
+ <outcome value='vf_module_id'>
+ <set>
+ <parameter name='ss.param.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_name'>
+ <set>
+ <parameter name='ss.param.vf-module-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-id'>
+ <set>
+ <parameter name='ss.param.volume-group-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-name'>
+ <set>
+ <parameter name='ss.param.volume-group-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='aic-cloud-region'>
+ <set>
+ <parameter name='ss.param.aic-cloud-region' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-name'>
+ <set>
+ <parameter name='ss.param.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='oam-interface-name'>
+ <set>
+ <parameter name='ss.param.oam-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.oam-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='=âlo0-interface-name'>
+ <set>
+ <parameter name='ss.param.lo0-interface-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.lo0-interface-name-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-oam-address-prefix'>
+ <set>
+ <parameter name='ss.param.ipv4-oam-address-prefix' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-oam-address-prefix-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='loopback0_ipv4_address'>
+ <set>
+ <parameter name='ss.param.loopback0-ipv4-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.loopback0-ipv4-address-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='ipv4-loopback0-address'>
+ <set>
+ <parameter name='ss.param.ipv4-loopback0-address' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.ipv4-loopback0-address-index' value='`bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-naming-code'>
+ <set>
+ <parameter name='ss.param.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-naming-code-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='ss.param.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.nfc-function-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-customization-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-customization-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-customization-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-invariant-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-invariant-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-invariant-uuid-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-version'>
+ <set>
+ <parameter name='ss.param.vnfc-model-version' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vnfc-model-version-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='as-number'>
+ <set>
+ <parameter name='ss.param.as-number' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.as-number-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-id-outer'>
+ <set>
+ <parameter name='ss.param.vlan-id-outer' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.vlan-id-outer-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='availability_zone_0'>
+ <set>
+ <parameter name='ss.param.availability-zone-0' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].value`' />
+ <parameter name='ss.param.availability-zone-0-index' value='`$bidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-vf-module-put'>
+ <block>
+ <set>
+ <parameter name='ss.param.aai-vf-module-put-index' value='`$bidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='generic-vnf'>
+ <set>
+ <parameter name='ss.resource-key.generic-vnf' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module'>
+ <set>
+ <parameter name='ss.resource-key.vf-module' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group'>
+ <set>
+ <parameter name='ss.resource-key.volume-group' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc'>
+ <set>
+ <parameter name='ss.resource-key.vnfc' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='connection-points'>
+ <set>
+ <parameter name='ss.resource-key.connection-points' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l-interface'>
+ <set>
+ <parameter name='ss.resource-key.l-interface' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='l3-netework'>
+ <set>
+ <parameter name='ss.resource-key.l3-network' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$bidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </for>
+ <set>
+ <parameter name='ss.param.vnf-id' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='tmp.return-failure' value ='true' />
+ </set>
+ <block atomic='true'>
+ <switch test="`$ss.resource-key.vnfc`">
+ <outcome value='vnfc'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vnfc save"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $ss.param.vnfc-name" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vnfc with vnfc-name=' + $ss.param.vnfc-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vnfc with vnfc-name=' + $ss.param.vnfc-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vnfc with vnfc-name=' + $ss.param.vnfc-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK vlan-tag save"/>
+ </record>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of vlan-tag with vlan-tag-id =' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$i].connection-point.vlan-data[$j].vlan-uuid + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </for>
+ </block>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.oam-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.oam-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.oam-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.oam-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.oam-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l-interface`">
+ <outcome value='l-interface'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK l-interface (oam) save"/>
+ </record>
+ <switch test="`$ss.param.lo0-interface-name != ''`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="l-interface.interface-name = $ss.param.lo0-interface-name
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l-interface.interface-name = ' + $ss.param.lo0-interface-name + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of l-interface with interface-name = ' + $ss.param.lo0-interface-name + ' completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.resource-key.l3-network`">
+ <outcome value='l3-netework'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK VNF l3-network relationship"/>
+ </record>
+ <for silentFailure='true' index='n' start='0' end='`$nidx`' >
+ <set>
+ <parameter name='tmp.related-link' value="`'/aai/v$/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+ <!--
+<parameter name='tmp.related-link' value="`'/aai/' + $prop.aai.version + '/network/l3-networks/l3-network/' + $ss.network[$n].netid`" />
+-->
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id
+ AND related-to = l3-network
+ AND relationship.related-link = $tmp.related-link" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to delete VNF l3-network relationship for generic-vnf.vnfid = ' + $ss.param.vnf-id + ' from AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ <switch test='`$tmp.return-failure`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='`$error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' l3-network relationship with related-path = ' + $tmp.related-path + ' not found in AAI. Consider silent success!'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback (delete) of generic-vnf l3-network relationships completed.'`" />
+ </set>
+ </outcome>
+ </delete>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-module-put-index].value'
+ value='SUCCESS' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-aai-vfput.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vnf-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vnf-put.xml new file mode 100644 index 0000000..877c272 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-aai-vnf-put.xml @@ -0,0 +1,434 @@ +<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='self-serve-aai-vnf-put' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <for silentFailure='true' index="aidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].name`'>
+ <outcome value='vnf_name'>
+ <set>
+ <parameter name='ss.param.vnf-name' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.vnf-name-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnf_id'>
+ <set>
+ <parameter name='ss.param.vnf-id' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.vnf-id-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='license-assignment-group-uuid'>
+ <set>
+ <parameter name='ss.param.license-assignment-group-uuid' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.license-assignment-group-uuid-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-assignment-group-uuid'>
+ <set>
+ <parameter name='ss.param.entitlement-assignment-group-uuid' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.entitlement-assignment-group-uuid-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='aai-vnf-put'>
+ <set>
+ <parameter name='ss.param.aai-vnf-put-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='license-key'>
+ <set>
+ <parameter name='ss.param.license-key' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.license-key-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-key'>
+ <set>
+ <parameter name='ss.param.entitlement-key' value ='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$aidx].value`' />
+ <parameter name='ss.param.entitlement-key-index' value='`$aidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id "
+ pfx="tmp.aai.vnf" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error to get generic-vnf with vnf-id=' + $ss.param.vnf-id + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf.vnf-name with vnf-id=' + $ss.param.vnf-id + ' not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="ss.selflink"
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id +
+ '/service-data/vnfs/vnf/' +
+ $ss.param.vnf-id +
+ '/vnf-data/vnf-topology/'`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value="`$ss.param.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="selflink" value="`$ss.selflink`" />
+ <parameter name="model-customization-id"
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid`" />
+ <parameter name="model-invariant-id"
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id"
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-uuid`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.vnf-name in AnAI with vnf-name=' + $ss.param.vnf-name`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf with vnf-id =' + $ss.param.vnf-id + ' is not found in AAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <switch test="`$ss.param.license-assignment-group-uuid != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.license-assignment-group-uuid`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.license-assignment-group-uuid = ' + $ss.param.license-assignment-group-uuid`"/>
+ <parameter name="field3" value="__SKIP saving license object in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="license.group-uuid = $ss.param.license-assignment-group-uuid
+ AND license.resource-uuid = $ss.param.license-key
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="group-uuid" value='`$ss.param.license-assignment-group-uuid`' />
+ <parameter name="resource-uuid" value='`$ss.param.license-key`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to save license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' in AA. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.license-updated' value='true' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$ss.param.entitlement-assignment-group-uuid != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$ss.param.entitlement-assignment-group-uuid`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.entitlement-assignment-group-uuid = ' + $ss.param.entitlement-assignment-group-uuid`"/>
+ <parameter name="field3" value="__SKIP saving entitlement object in AnAI__"/>
+ </record>
+ </outcome>
+ <outcome value='false'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="entitlement"
+ key="entitlement.group-uuid = $ss.param.entitlement-assignment-group-uuid
+ AND entitlement.resource-uuid = $ss.param.entitlement-key
+ AND generic-vnf.vnf-id = $ss.param.vnf-id" >
+ <parameter name="group-uuid" value='`$ss.param.entitlement-assignment-group-uuid`' />
+ <parameter name="resource-uuid" value='`$ss.param.entitlement-key`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <switch test="`$ss.license-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK license"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="license.group-uuid = $ss.param.license-assignment-group-uuid
+ AND license.resource-uuid = $ss.param.license-key" >
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license because license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' NOT FOUND in AAI. SILENT SUCCESS! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of license completed. '`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to save entitlement with group-uuid = ' + $ss.param.entitlement-assignment-group-uuid + ' AND entitlement.resource-uuid = ' + $ss.param.entitlement-key + ' in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <block>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK generic-vnf update"/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param.aai-vf-put-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ss.param.vnf-id " >
+ <parameter name="vnf-name" value='`$tmp.aai.vnf.vnf-anme`' />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update in AnAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback generic-vnf update because generic-vnf with vnf-id = ' + $ss.param.vnf-id + ' is not found in AAI. MANUAL ROLLBACK IS REQUIRED! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of generic-vnf update completed. '`" />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ <switch test="`$ss.license-updated`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK license"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="license.group-uuid = $ss.param.license-assignment-group-uuid
+ AND license.resource-uuid = $ss.param.license-key" >
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' in AAI. MANUAL ROLLBACK IS REQUIRED!'`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Failed to rollback license because license with group-uuid = ' + $ss.param.license-assignment-group-uuid + ' AND license.resource-uuid = ' + $ss.param.license-key + ' NOT FOUND in AAI. SILENT SUCCESS! '`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='error-message' value="`$error-message + ' Rollback of license completed. '`" />
+ </set>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'entitlement with group-uuid = ' + $ss.param.entitlement-assignment-group-uuid + ' AND entitlement.resource-uuid = ' + $ss.param.entitlement-key + ' is not found in AAI. ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.param.aai-vnf-put-index].value'
+ value='SUCCESS' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-aai-vnfput.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml new file mode 100644 index 0000000..d3dce91 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml @@ -0,0 +1,281 @@ +<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='self-serve-capability-param-resolution' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-type`">
+ <outcome value='vnf'>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.s2.s2" value=''/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test="`$tmp.s2.s2 == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='vf-module'>
+ <switch test="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.s2.s2" value=''/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test="`$tmp.s2.s2 == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='pnf'>
+ <switch test="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='i' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <switch test="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for silentFailure='true' index='j' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.s2.s2" value=''/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='cn' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test="`$tmp.s2.s2 == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-capability-param-resolution"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name-changeassign.xml new file mode 100644 index 0000000..a8ef58d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name-changeassign.xml @@ -0,0 +1,50 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-generate-name-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <switch test='`$ss.input.param.index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="ss.input.param.index is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.service-data.param.index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="ss.service-data.param.index is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-generate-name-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='vf-module'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-generate-name-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown capability-type [' + $ss.capability-type + '], valid value are: vnf, pnf, vf-module'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name.xml new file mode 100644 index 0000000..c6b5a9a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-generate-name.xml @@ -0,0 +1,31 @@ +<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='self-serve-generate-name' mode='sync'>
+ <block atomic="true">
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <switch test="`$ss.capability-type`">
+ <outcome value='vnf'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-generate-name' mode='sync' ></call>
+ </outcome>
+ <outcome value='vf-module'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-generate-name' mode='sync' ></call>
+ </outcome>
+ <outcome value='pnf'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-generate-name' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-mac-address-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-mac-address-assign.xml new file mode 100644 index 0000000..60c749a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-mac-address-assign.xml @@ -0,0 +1,625 @@ +<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='self-serve-mS-mac-address-assign' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-name`">
+ <outcome value='Other'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-name is not mS-mac-address-assign or it is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-name is not mS-mac-address-assign or it is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-name is not mS-mac-address-assign or it is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='mS-mac-address-assign'>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-name is mS-mac-address-assign"/>
+ </record>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-action`">
+ <outcome value='Other'></outcome>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-action is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-action is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value='assign'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-action is assign"/>
+ </record>
+ </outcome>
+ <outcome value='unassign'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: ss.capability-action is unassign"/>
+ </record>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: call self-serve-capability-param-resolution DG"/>
+ </record>
+ <set>
+ <!--<parameter name='name' value='value' />-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Failure calling self-serve-capability-param-resolution"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='402' />
+ <parameter name='error-message' value='Failure calling self-serve-capability-param-resolution' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'></outcome>
+ </call>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='ma.elements.element_length' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-parameters-length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <set>
+ <parameter name='vfModuleParamsCapabilityName' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.capability-name`' />
+ <parameter name='tmp.vnfHostName' value='' />
+ <parameter name='tmp.policyInstanceName' value='' />
+ <parameter name='tmp.cloudParamName' value='' />
+ <parameter name='tmp.swName' value='' />
+ <parameter name='tmp.resourceValue' value='' />
+ </set>
+ <switch test="`$ss.capability-name == $vfModuleParamsCapabilityName`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Found ss.capability-name MATCH"/>
+ </record>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.resourceValue' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.cloudParamName' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].name`' />
+ </set>
+ <set>
+ <parameter name='tmp.resource-resolution-data.' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.`' />
+ </set>
+ <switch test="`$tmp.resource-resolution-data.status == 'PENDING'`">
+ <outcome value='false'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='reseouce-resolution-data.status is not PENDING' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.resource-key-length' value='`$tmp.resource-resolution-data.resource-key_length`' />
+ </set>
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: key-index"/>
+ <parameter name="field3" value='`$key-index`'/>
+ </record>
+ <block>
+ <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name`">
+ <outcome value='key'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Found resource-resolution-data.name = vnf-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.vnfHostName' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: resolved vnfHostName: "/>
+ <parameter name="field3" value='`$tmp.vnfHostName`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='policy-instance-name'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Found resource-resolution-data.name = policy-instance-name-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.policyInstanceName' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: resolved policyInstanceName: "/>
+ <parameter name="field3" value='`$tmp.policyInstanceName`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='sw-name'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Found resource-resolution-data.name = sw-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.swName' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: resolved swName: "/>
+ <parameter name="field3" value='`$tmp.swName`'/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.vnfHostName`">
+ <outcome value='null'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: vnfHostName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='vnfHostName is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: vnfHostName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='vnfHostName is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.cloudParamName`">
+ <outcome value='null'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: cloudParamName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='cloudParamName is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: cloudParamName is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='cloudParamName is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.policyInstanceName`">
+ <outcome value='null'>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: policyInstanceName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='policyInstanceName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: policyInstanceName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='policyInstanceName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.swName`">
+ <outcome value='null'>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: swName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='swName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test="`$ss.capability-action` == 'assign'">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: swName is not set and action is assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='swName is not set and action is assign' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ma.elements.element[$ma.elements.element_length].policy-instance-name' value='`$tmp.policyInstanceName`' />
+ <parameter name='ma.elements.element[$ma.elements.element_length].vnf-host-name' value='`$tmp.vnfHostName`' />
+ <parameter name='ma.elements.element[$ma.elements.element_length].cloud-param-name' value='`$tmp.cloudParamName`' />
+ <parameter name='ma.elements.element[$ma.elements.element_length].sw-name' value='`$tmp.swName`' />
+ </set>
+ <switch test="`$tmp.resourceValue`">
+ <outcome value='Other'>
+ <set>
+ <parameter name='ma.elements.element[$ma.elements.element_length].resource-value' value='`$tmp.resourceValue`' />
+ </set>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value=''></outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Adding this vf-module-parameters.param to ma.elements "/>
+ <parameter name="field3" value='`$ma.elements.element_length`'/>
+ <parameter name="field4" value='`$ma.elements.element[$ma.elements.element_length].policy-instance-name`'/>
+ <parameter name="field5" value='`$ma.elements.element[$ma.elements.element_length].vnf-host-name`'/>
+ <parameter name="field6" value='`$ma.elements.element[$ma.elements.element_length].cloud-param-name`'/>
+ <parameter name="field7" value='`$ma.elements.element[$ma.elements.element_length].sw-name`'/>
+ <parameter name="field8" value='`$ma.elements.element[$ma.elements.element_length].resource-value`'/>
+ </record>
+ <set>
+ <parameter name='ma.elements.element_length' value='`$ma.elements.element_length + 1`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$ss.capability-action`'>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='prop.restapi.templateDir' value="/opt/lsc/restapi/templates" />
+ <parameter name='prop.mac-address-microserivice.url' value="http://mtanjv9sdlg51-eth1-0.aic.cip.att.com:8989" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: restapi-call-node Call MAC Address microService assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/mac-address-assign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.mac-address-microserivice.url + '/macaddress/service/assign'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="Authorization=Basic YWRtaW46YWRtaW4=" />
+ <parameter name="responsePrefix" value="tmp.mac-address-resp.prefix" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service assign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service assign' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: assign SUCCESS"/>
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <for index='mac-address-list-index' start='0' end='`$tmp.mac-address-resp.prefix.mac-address-list_length`' >
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: mac-address-list-index|name|value "/>
+ <parameter name="field3" value='`$mac-address-list-index`'/>
+ <parameter name="field4" value='`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].name`'/>
+ <parameter name="field5" value='`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].value`'/>
+ </record>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <switch test="`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].name == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].name`">
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: mac-address-list MATCH with param.value: "/>
+ <parameter name="field3" value="`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].name`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.capability-name' value='INPUT' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" value="`$tmp.mac-address-resp.prefix.mac-address-list[$mac-address-list-index].value`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status`" value='SUCCESS' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.restapi.templateDir' value="/opt/lsc/restapi/templates" />
+ <parameter name='prop.mac-address-microserivice.url' value="http://mtanjv9sdlg51-eth1-0.aic.cip.att.com:8989" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: restapi-call-node Call MAC Address microService unassign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/mac-address-unassign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.mac-address-microserivice.url + '/macaddress/service/unassign'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="Authorization=Basic YWRtaW46YWRtaW4=" />
+ <parameter name="responsePrefix" value="tmp.mac-address-resp.prefix" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service unassign"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='self-serve-mS-mac-address-assign: Error calling MAC Address Micro Service unassign' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: unassign SUCCESS: response: "/>
+ <parameter name='field3' value='`$tmp.mac-address-resp.prefix.status`' />
+ </record>
+ <switch test="`$tmp.mac-address-resp.prefix.status == 'deleted successfully'`">
+ <outcome value='false'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mS-mac-address-assign: Address Micro Service unassign did not return: deleted successfully"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='self-serve-mS-mac-address-assign: Address Micro Service unassign did not return: deleted successfully' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status`" value="DELETED" />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/self-serve-mS-mac-address-assign.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value='SUCCESS' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-vlan-tag-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-vlan-tag-assign.xml new file mode 100644 index 0000000..0b2cde9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-mS-vlan-tag-assign.xml @@ -0,0 +1,744 @@ +<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='self-serve-mS-vlan-tag-assign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Not all assignments are resolved' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='qidx' value='0' />
+ <parameter name='ss.vt.' value='' />
+ </set>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.vt.param[$qidx].index' value='`$pidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='policy-instance-name'>
+ <set>
+ <parameter name='vt.request[$qidx].policy-instance-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='resource-name'>
+ <set>
+ <parameter name='vt.request[$qidx].resource-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='scope-id'>
+ <set>
+ <parameter name='vt.request[$qidx].scope-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-tag-key'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-tag-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-type'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-type' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='resource-value'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ <parameter name='target' value='$' />
+ <outcome value='false'>
+ <set>
+ <parameter name='vt.request[$qidx].resource-value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='vt.request[$qidx].resource-value' value='' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='qidx' value='`$qidx + 1`' />
+ </set>
+ <set>
+ <parameter name='vt.request_length' value='`$qidx`' />
+ </set>
+ <set>
+ <parameter name='ss.vt.param_length' value='`$qidx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$ss.capability-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.assign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to get vlan-tag assisgnment from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to get vlan-tag assisgnment from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Encountered error from mS-vlan-tag-assign with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block atomic='true'>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='ss.param.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.nfc-function-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-naming-code'>
+ <set>
+ <parameter name='ss.param.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.nfc-naming-code-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-customization-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-customization-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vnfc-model-customization-uuid-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-invariant-uuid'>
+ <set>
+ <parameter name='ss.param.vnfc-model-invariant-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vnfc-model-invariant-uuid-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-model-version'>
+ <set>
+ <parameter name='ss.param.vnfc-model-version' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vnfc-model-version-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vm-type'>
+ <set>
+ <parameter name='ss.param.vm-type' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ <parameter name='ss.param.vm-type-index' value='`$pidx`' />
+ </set>
+ </outcome>
+ <outcome value='vnfc-name'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.param.vnfc-name-unresolved-value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$ss.param.vnfc-name-unresolved-value`" />
+ <parameter name="target" value="${"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="ss.param.vnfc-name-unresolved-value"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$ss.param.vnfc-name-unresolved-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="ss.param.vnfc-name-unresolved-value"/>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'ss.param.vnfc-name-unresolved-value = ' + $ss.param.vnfc-name-unresolved-value`"/>
+ </record>
+ <block>
+ <for silentFailure='true' index="x" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$x].name == $ss.param.vnfc-name-unresolved-value`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.param.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$x].value`' />
+ <parameter name='ss.param.vnfc-name-index' value='`$x`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$ss.param.vnfc-name`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK: self-serve-mS-vlan-tag-assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="unassign"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <set>
+ <parameter name="error-message"
+ value="`'Received error from mS with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message + '; vlan-tag MUST BE ROLLBACK MANUALLY!!!'`" />
+ </set>
+ </outcome>
+ <outcome value='200'>
+ <block>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='PENDING' />
+ </set>
+ </for>
+ </for>
+ <set>
+ <parameter name="error-message"
+ value="vlan tags were rolled back from mS successfully." />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to resolve vnfc-name; ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-type' value = '`$ss.param.vm-type`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-invariant-uuid' value = '`$ss.param.vnfc-model-invariant-uuid`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-customization-uuid' value = '`$ss.param.vnfc-model-customization-uuid`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-version' value = '`$ss.param.vnfc-model-version`' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-name' value = '`$ss.param.vnfc-name`' />
+ </set>
+ <set>
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length' value = '1' />
+ <parameter name = 'service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names_length' value = '1' />
+ </set>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="vtidx" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$vtidx].index`' />
+ </set>
+ <switch test='`$vtResp.output[$oidx].resource-name == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].name`'>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name='source' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].value`' />
+ <parameter name='target' value='$' />
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].value'
+ value='`$vtResp.output[$oidx].resource-value`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='vnfc-network-role'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].vnfc-network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-cp-instance-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK: self-serve-mS-vlan-tag-assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="unassign"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <set>
+ <parameter name="error-message"
+ value="`'Received error from mS with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message + '; vlan-tag MUST BE ROLLBACK MANUALLY!!!'`" />
+ </set>
+ </outcome>
+ <outcome value='200'>
+ <block>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='PENDING' />
+ </set>
+ </for>
+ </for>
+ <set>
+ <parameter name="error-message"
+ value="vlan tags were rolled back from mS successfully." />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error in generating cp-instance-id in SDNC; ' + $error-message.generate-cp-instance-id + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <for silentFailure='true' index="sidx" start="0" end="`$vtResp.output[$oidx].stored-elements_length`">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.connection-point-id'
+ value='`$tmp.return.generate-cp-instance-id.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-uuid'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlan-uuid`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-id'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-description'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-role'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].element-vlan-role`' />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].value'
+ value='`$vtResp.output[$oidx].resource-value`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='vnfc-network-role'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].vnfc-network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-cp-instance-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="ROLLBACK: self-serve-mS-vlan-tag-assign"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="unassign"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message"
+ value="Failed to rollback vlan-tag from mS. vlan-tag MUST BE ROLLBACK MANUALLY!!!" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <set>
+ <parameter name="error-message"
+ value="`'Received error from mS with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message + '; vlan-tag MUST BE ROLLBACK MANUALLY!!!'`" />
+ </set>
+ </outcome>
+ <outcome value='200'>
+ <block>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='PENDING' />
+ </set>
+ </for>
+ </for>
+ <set>
+ <parameter name="error-message"
+ value="vlan tags were rolled back from mS successfully." />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error in generating cp-instance-id in SDNC; ' + $error-message.generate-cp-instance-id + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <for silentFailure='true' index="sidx" start="0" end="`$vtResp.output[$oidx].stored-elements_length`">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.connection-point-id'
+ value='`$tmp.return.generate-cp-instance-id.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-uuid'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlan-uuid`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-id'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-tag-description'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].vlantag-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data[$sidx].vlan-role'
+ value='`$vtResp.output[$oidx].stored-elements[$sidx].element-vlan-role`' />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.capability-name'
+ value='INPUT' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data_length'
+ value='`$ss.vt.param_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-networks.vnfc-network-data[$vtidx].connection-point.vlan-data_length'
+ value='`$vtResp.output[$oidx].stored-elements_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <set>
+ <parameter name='qidx' value='0' />
+ <parameter name='ss.vt.' value='' />
+ </set>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ss.vt.param[$qidx].index' value='`$pidx`' />
+ </set>
+ <for silentFailure='true' index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='policy-instance-name'>
+ <set>
+ <parameter name='vt.request[$qidx].policy-instance-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-type'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-type' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-tag-key'>
+ <set>
+ <parameter name='vt.request[$qidx].vlan-tag-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='qidx' value='`$qidx + 1`' />
+ </set>
+ <set>
+ <parameter name='vt.request_length' value='`$qidx`' />
+ </set>
+ <set>
+ <parameter name='ss.vt.param_length' value='`$qidx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-mS-vlan-tag-assign`"/>
+ <parameter name="outputPath" value="tmp.ss-vlan-tag-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$ss.capability-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.mS.vlan.tag.unassign.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.vt.mS.url + $tmp.ss-vlan-tag-url`' />
+ <parameter name='restapiUser' value='`$prop.vt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.vt.mS.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="vtResp" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to unassign vlan-tag from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to unassign vlan-tag from mS" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$vtResp.error-code`'>
+ <outcome value='500'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='FAILED' />
+ </set>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Encountered error while unassigning mS-vlan-tag with error-code = ' + $vtResp.error-code + ' and error-message = ' + $vtResp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <for silentFailure='true' index="oidx" start="0" end="`$vtResp.output_length`">
+ <for silentFailure='true' index="i" start="0" end="`$ss.vt.param_length`">
+ <set>
+ <parameter name='vt-index' value='`$ss.vt.param[$i].index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vt-index].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-mS-vlan-tag-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: mS-vlan-tag-assign"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-netbox-ip-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-netbox-ip-assign.xml new file mode 100644 index 0000000..4cf5cdb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-netbox-ip-assign.xml @@ -0,0 +1,414 @@ +<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='self-serve-netbox-ip-assign' mode='sync'> + <block atomic="true"> + <switch test='`$ss.capability-name`'> + <outcome value=''> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="ss.capability-name is null" /> + </return> + </outcome> + </switch> + <switch test='`$ss.capability-action`'> + <outcome value=''> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="ss.capability-action is null" /> + </return> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' > + <outcome value='failure'> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Not all assignments are resolved' + $error-message`" /> + </return> + </outcome> + </call> + <switch test="`$ss.capability-type == 'vnf'`"> + <outcome value='true'> + <block> + <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' > + <set> + <parameter name='tmp.ss.param.capability-name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' /> + </set> + <set> + <parameter name='tmp.ss.param.name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name`' /> + </set> + <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'> + <outcome value='true'> + <block> + <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'> + <outcome value='service-instance-id'> + <set> + <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='vnf-id'> + <set> + <parameter name='tmp.ss.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='prefix-id'> + <set> + <parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='external_key'> + <set> + <parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + </switch> + </for> + <switch test='`$ss.capability-action`'> + <outcome value='assign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'> + <outcome value='FAILED'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vnf-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='PENDING'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vnf-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </outcome> + <outcome value='unassign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'> + <outcome value='SUCCESS'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from IPAM_IP_ASSIGNEMENT + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id' > + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.status' value="PENDING_DELETE" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-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 updating NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" /> + </return> + </outcome> + </update> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="unassignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' + value='DELETED' /> + </set> + </outcome> + </execute> + </block> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + </for> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="`'SS: pidx: ' + $pidx`"/> + </record> + </block> + </outcome> + </switch> + <switch test="`$ss.capability-type == 'vf-module'`"> + <outcome value='true'> + <block> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <set> + <parameter name='tmp.ss.param.capability-name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' /> + </set> + <set> + <parameter name='tmp.ss.param.name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`' /> + </set> + <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'> + <outcome value='true'> + <block> + <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'> + <outcome value='service-instance-id'> + <set> + <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='vf-module-id'> + <set> + <parameter name='tmp.ss.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='prefix-id'> + <set> + <parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='ip-address-id'> + <set> + <parameter name='tmp.ss.ip-address-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='external_key'> + <set> + <parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + </switch> + </for> + <switch test='`$ss.capability-action`'> + <outcome value='assign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'> + <outcome value='FAILED'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vf-module-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + <outcome value='PENDING'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vf-module-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + <outcome value='success'> + <block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value="`$self_serve_netbox_ip_assignement.ip-address`" /> + <parameter name="regex" value="/"/> + <parameter name="ctx_memory_result_key" value="ip" /> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' + value='`$ip[0]`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </execute> + </block> + </outcome> + </switch> + </outcome> + <outcome value='unassign'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'> + <outcome value='SUCCESS'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from IPAM_IP_ASSIGNEMENT + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id' > + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.status' value="PENDING_DELETE" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-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 updating NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" /> + </return> + </outcome> + </update> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="unassignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`" /> + </return> + </outcome> + <outcome value='success'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='DELETED' /> + </set> + </outcome> + </execute> + </block> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + </for> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="`'SS: pidx: ' + $pidx`"/> + </record> + </block> + </outcome> + </switch> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-assign.xml new file mode 100644 index 0000000..55d851c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-assign.xml @@ -0,0 +1,400 @@ +<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='self-serve-pnf-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-pnf' value='true' />
+ </set>
+ <switch test='`$service-data.pnfs.pnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='pnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='pnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >
+ <switch test='`$pf-topology-operation-input.pnf-details.pnf-id == $service-data.pnfs.pnf[$idx].pnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-pnf' value='false' />
+ </set>
+ <set>
+ <parameter name='pnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-pnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pnf-index' value='`$service-data.pnfs.pnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf_length' value='`$service-data.pnfs.pnf_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-pnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id'
+ value='`$pnf-topology-operation-input.pnf-details.pnf-id`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-type'
+ value='`$pnf-topology-operation-input.pnf-details.pnf-type`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.tenant'
+ value='`$pnf-topology-operation-input.pnf-request-input.tenant`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.aic-cloud-region'
+ value='`$pnf-topology-operation-input.pnf-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-id'
+ value='`$pnf-topology-operation-input.pnf-details.pnf-id`' />
+ </set>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.pnf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-uuid'
+ value='`$db.pnf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-uuid'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-version'
+ value='`$db.pnf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-version'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-name'
+ value='`$db.pnf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-name'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.onap-model-information.model-customization-uuid'
+ value='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.'
+ value='$pnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.'
+ value='$pnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.'
+ value='$pnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.'
+ value='$pnf-topology-operation-input.pnf-details.' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.'
+ value='$pnf-topology-operation-input.pnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='aai-get' />
+ <parameter name='ss.capability.execution-order[1]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[7]' value='eipam-create-pool' />
+ <parameter name='ss.capability.execution-order[8]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[9]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[10]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[11]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[12]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order[13]' value='aai-pnf-put' />
+ <parameter name='ss.capability.execution-order_length' value='14' />
+ </set>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='pnf' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.'
+ value='pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-pnf-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE with pnf-ra-assigment"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pf.pnf-id'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-id`' />
+ <parameter name='pf.pnf-data.sdnc-request-header.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.`' />
+ <parameter name='pf.pnf-data.request-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.`' />
+ <parameter name='pf.pnf-data.service-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.`' />
+ <parameter name='pf.pnf-data.pnf-details.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.`' />
+ <parameter name='pf.pnf-data.pnf-topology.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.`' />
+ <parameter name='pf.pnf-data.pnf-level-oper-status.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-input-parameters.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-input-parameters.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.request-version'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.request-version`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-name'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-name`' />
+ <parameter name='pf.pnf-data.pnf-request-input.tenant'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.tenant`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-cloud-region'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-cloud-region`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-clli'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-pnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-pnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{pnf-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.pnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-pnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-pnf" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pf.pnf-id'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-id`' />
+ <parameter name='pf.pnf-data.sdnc-request-header.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.`' />
+ <parameter name='pf.pnf-data.request-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.`' />
+ <parameter name='pf.pnf-data.service-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.`' />
+ <parameter name='pf.pnf-data.pnf-details.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.`' />
+ <parameter name='pf.pnf-data.pnf-topology.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.`' />
+ <parameter name='pf.pnf-data.pnf-level-oper-status.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-input-parameters.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-input-parameters.`' />
+ <parameter name='pf.pnf-data.pnf-request-input.request-version'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.request-version`' />
+ <parameter name='pf.pnf-data.pnf-request-input.pnf-name'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-name`' />
+ <parameter name='pf.pnf-data.pnf-request-input.tenant'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.tenant`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-cloud-region'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-cloud-region`' />
+ <parameter name='pf.pnf-data.pnf-request-input.aic-clli'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-pnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-pnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{pnf-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.pnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-pnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-pnf" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve pnf assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-pnf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-generate-name.xml new file mode 100644 index 0000000..bded0cb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-generate-name.xml @@ -0,0 +1,233 @@ +<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='self-serve-pnf-generate-name' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.pnf-id + '.log'`" />
+ </set>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
+ <for index='i' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ <parameter name='tmp.gen-name_length' value='1' />
+ </set>
+ <for index='j' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ <parameter name='tmp.gen-name_length' value='0' />
+ </set>
+ <for index='i' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-ra-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-ra-assignment.xml new file mode 100644 index 0000000..cff4d49 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-ra-assignment.xml @@ -0,0 +1,235 @@ +<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='self-serve-pnf-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.pnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="cds" value="execution-service_process."/>
+ <parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.pnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$pnf-topology-operation-input.pnf-details.pnf-type`" />
+ <parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$pnf-topology-operation-input.pnf-details.pnf-id`" />
+ <parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
+ <parameter name="responsePrefix" value="raAssign" />
+ <parameter name="`$cds + 'isNonAppend'`" value="true"/>
+ <parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
+ <parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
+ </set>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param_length`' >
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.sdnc-artifact-name' value='`$pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].name + '":"' + $pnf-topology-operation-input.pnf-request-input.pnf-input-parameters.param[$i].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.sdnc-artifact-name == ''`">
+ <outcome value='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </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="`'No VF_MODEL found where customization_uuid = ' + $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ <parameter name='tmp.sdnc-artifact-name' value='`$db1.vf-model.sdnc-artifact-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $pnf-topology-operation-input.service-information.service-instance-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"pnf-model-customization-uuid":"' + $pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"pnf-id":"' + $pnf-topology-operation-input.pnf-details.pnf-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"aic-cloud-region":"' + $pnf-topology-operation-input.pnf-request-input.aic-cloud-region + '"'`"/>
+ </set>
+ <set>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload7 + '}'`" />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.sdnc-artifact-name`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
+ <parameter name='restapiUser' value='`$prop.cds.user`' />
+ <parameter name='restapiPassword' value='`$prop.cds.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
+ <parameter name="responsePrefix" value="`$responsePrefix`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from BlueprintProcessingClient" />
+ </return>
+ </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="Error from BlueprintProcessingClient" />
+ </return>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER BlueprintProcessingClient"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='cnt' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='RA Resolved'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='SUCCESS'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <for silentFailure='true' index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='num' value='0' />
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for silentFailure='true' index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ </set>
+ <set>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' value='`$highnum + 1`'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: pnf-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-pnf-ra-assignment-' +
+ $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.pnf-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-unassign.xml new file mode 100644 index 0000000..2fc4a3a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-pnf-unassign.xml @@ -0,0 +1,143 @@ +<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='self-serve-pnf-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='pnf' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.pnf-id'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-id`' />
+ <parameter name='vf.pnf-data.sdnc-request-header.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.`' />
+ <parameter name='vf.pnf-data.request-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.`' />
+ <parameter name='vf.pnf-data.service-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.`' />
+ <parameter name='vf.pnf-data.pnf-information.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.`' />
+ <parameter name='vf.pnf-data.pnf-request-input.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.`' />
+ <parameter name='vf.pnf-data.pnf-request-input.pnf-input-parameters.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.pnf-input-parameters.`' />
+ <parameter name='vf.pnf-data.pnf-topology.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.`' />
+ <parameter name='vf.pnf-data.pnf-level-oper-status.'
+ value='`$service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-pnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-pnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-pnf-url"/>
+ <parameter name="target" value="{pnf-id}"/>
+ <parameter name="replacement" value="`$service-data.pnfs.pnf[$pnf-index].pnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.pnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-pnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-pnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve pnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve pnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve pnf assignments for ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ <parameter name="field3" value="`'SS: tmp.param.capability-name: ' + $tmp.param.capability-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-pnf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-mapping-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-mapping-ra-response.xml new file mode 100644 index 0000000..75f5a3f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-mapping-ra-response.xml @@ -0,0 +1,100 @@ +<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='self-serve-process-vfmodule-mapping-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resolution-summary_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resolution-summary_length is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='CONSTANT' value='success'/>
+ </set>
+ <for silentFailure='true' index='vdns-index' start='0' end='`$jsonContextPrefix.resolution-summary_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='param-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$param-index].name == $jsonContextPrefix.resolution-summary[$vdns-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$param-index].value'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ <set>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].name`'/>
+ </set>
+ <switch test="`$jsonContextPrefix.resolution-summary[$vdns-index].status == 'success' and
+ $jsonContextPrefix.resolution-summary[$vdns-index].value == ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`'
+ value='`$CONSTANT`'/>
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].dictionary-source`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].status`'/>
+ </set>
+ <for silentFailure='true' index='kid-index' start='0' end='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$kid-index].name'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].name`'/>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$kid-index].value'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].value`'/>
+ </set>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key_length'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' />
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vfmodule-mapping-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-template-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-template-ra-response.xml new file mode 100644 index 0000000..b2746cf --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vfmodule-template-ra-response.xml @@ -0,0 +1,99 @@ +<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='self-serve-process-vfmodule-template-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resource-accumulator-resolved-data_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resource-accumulator-resolved-data_length is null" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='cnt' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cnt].value`'
+ value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`' value='RA Resolved'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`' value='SUCCESS'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <for silentFailure='true' index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='num' value='0' />
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ </set>
+ <set>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vfmodule-template-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-mapping-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-mapping-ra-response.xml new file mode 100644 index 0000000..551364f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-mapping-ra-response.xml @@ -0,0 +1,100 @@ +<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='self-serve-process-vnf-mapping-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resolution-summary_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resolution-summary is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='CONSTANT' value='success'/>
+ </set>
+ <for silentFailure='true' index='vdns-index' start='0' end='`$jsonContextPrefix.resolution-summary_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='param-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].name == $jsonContextPrefix.resolution-summary[$vdns-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].value`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ <set>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].name`'/>
+ </set>
+ <switch test="`$jsonContextPrefix.resolution-summary[$vdns-index].status == 'success' and
+ $jsonContextPrefix.resolution-summary[$vdns-index].value == ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`'
+ value='`$CONSTANT`'/>
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='kid-index' start='0' end='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$kid-index].name'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].name`'/>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$kid-index].value'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers[$kid-index].value`'/>
+ </set>
+ </for>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].dictionary-source`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].status`'/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length'
+ value='`$jsonContextPrefix.resolution-summary[$vdns-index].key-identifiers_length`' />
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vnf-mapping-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-template-ra-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-template-ra-response.xml new file mode 100644 index 0000000..2e62832 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-process-vnf-template-ra-response.xml @@ -0,0 +1,104 @@ +<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='self-serve-process-vnf-template-ra-response' mode='sync'>
+ <block atomic="true">
+ <switch test='`$jsonContextPrefix.resource-accumulator-resolved-data_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resource-accumulator-resolved-data_length is null" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum > 0`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='cnt' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='RA Resolved'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='SUCCESS'/>
+ </set>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <for silentFailure='true' index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <for silentFailure='true' index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='num' value='0' />
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for silentFailure='true' index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ </set>
+ <set>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length'
+ value='`$highnum`'/>
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-process-vnf-template-ra-response"/>
+ </record>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml new file mode 100644 index 0000000..ebd065a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml @@ -0,0 +1,612 @@ +<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='self-serve-unresolved-composite-data' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-type`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-type is null" />
+ </return>
+ </outcome>
+ <outcome value='vnf'>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.composite'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value`' />
+ </set>
+ <switch test="`$tmp.ss.composite == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="[" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="]" />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="]"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'SS: tmp.ss.composite: ' + $tmp.ss.composite`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite`" />
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="comma-splits" />
+ </execute>
+ <for silentFailure='true' index="comma-splits-index" start="0" end="`$comma-splits_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$comma-splits[$comma-splits-index]`" />
+ <parameter name="outputPath" value="tmp.ss.composite.trim"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='' />
+ <parameter name='tmp.ss.param-suffix' value='' />
+ </set>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite.trim`" />
+ <parameter name="regex" value="\$"/>
+ <parameter name="ctx_memory_result_key" value="dollar-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='`$dollar-splits[0]`' />
+ </set>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-prefix`" />
+ <parameter name="outputPath" value="tmp.ss.param-prefix"/>
+ </execute>
+ <switch test='`$dollar-splits_length == 1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.param-prefix`" />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index="dollar-splits-index" start="1" end="`$dollar-splits_length`">
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'$' + $dollar-splits[$dollar-splits-index]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$dollar-splits[$dollar-splits-index]`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="regex" value="\}"/>
+ <parameter name="ctx_memory_result_key" value="end-curly-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$end-curly-splits[0]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-suffix' value='`$end-curly-splits[1]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-suffix`" />
+ <parameter name="outputPath" value="tmp.ss.param-suffix"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'${' + $tmp.ss.partial.composite-value + '}'`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'SS: tmp.ss.partial.composite-value: ' + $tmp.ss.partial.composite-value`"/>
+ </record>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value="`$tmp.ss.param-prefix + $tmp.ss.partial.resolved-value + $tmp.ss.param-suffix`" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'SS: tmp.ss.partial.resolved-value: ' + $tmp.ss.partial.resolved-value`"/>
+ </record>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.final.composite-resolved-value + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </for>
+ </block>
+ <switch test='`$comma-splits-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + ',' + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value='`$tmp.ss.final.resolved-value + $tmp.ss.final.resolved-value.end`' />
+ </set>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='vf-module'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for silentFailure='true' index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.composite'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ </set>
+ <switch test="`$tmp.ss.composite == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="[" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="]" />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="]"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="outputPath" value="tmp.ss.composite"/>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'SS: tmp.ss.composite: ' + $tmp.ss.composite`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite`" />
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="comma-splits" />
+ </execute>
+ <for silentFailure='true' index="comma-splits-index" start="0" end="`$comma-splits_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$comma-splits[$comma-splits-index]`" />
+ <parameter name="outputPath" value="tmp.ss.composite.trim"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='' />
+ <parameter name='tmp.ss.param-suffix' value='' />
+ </set>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite.trim`" />
+ <parameter name="regex" value="\$"/>
+ <parameter name="ctx_memory_result_key" value="dollar-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-prefix' value='`$dollar-splits[0]`' />
+ </set>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-prefix`" />
+ <parameter name="outputPath" value="tmp.ss.param-prefix"/>
+ </execute>
+ <switch test='`$dollar-splits_length == 1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.param-prefix`" />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index="dollar-splits-index" start="1" end="`$dollar-splits_length`">
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'$' + $dollar-splits[$dollar-splits-index]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$dollar-splits[$dollar-splits-index]`" />
+ <parameter name="target" value="{"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$dollar-splits[$dollar-splits-index]`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='endsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="regex" value="\}"/>
+ <parameter name="ctx_memory_result_key" value="end-curly-splits" />
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.composite-value' value='`$end-curly-splits[0]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.partial.composite-value`" />
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.param-suffix' value='`$end-curly-splits[1]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.param-suffix`" />
+ <parameter name="outputPath" value="tmp.ss.param-suffix"/>
+ </execute>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value' value="`'${' + $tmp.ss.partial.composite-value + '}'`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'SS: tmp.ss.partial.composite-value: ' + $tmp.ss.partial.composite-value`"/>
+ </record>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for silentFailure='true' index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value="`$tmp.ss.param-prefix + $tmp.ss.partial.resolved-value + $tmp.ss.param-suffix`" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="`'SS: tmp.ss.partial.resolved-value: ' + $tmp.ss.partial.resolved-value`"/>
+ </record>
+ <set>
+ <parameter name='tmp.ss.final.composite-resolved-value'
+ value="`$tmp.ss.final.composite-resolved-value + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </for>
+ </block>
+ <switch test='`$comma-splits-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + ',' + $tmp.ss.final.composite-resolved-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value='`$tmp.ss.final.resolved-value + $tmp.ss.final.resolved-value.end`' />
+ </set>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='vf-module'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-composite.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml new file mode 100644 index 0000000..d2bb3a0 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml @@ -0,0 +1,302 @@ +<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='self-serve-vf-module-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-vfmodule' value='true' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-vfmodule' value='false' />
+ </set>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-vfmodule`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-vfmodule`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-name'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-type'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.tenant'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-cloud-region'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.aic-clli`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-version'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-name'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.sdnc-generated-cloud-resources'
+ value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability-type' value='vf-module' />
+ </set>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[1]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[6]' value='eipam-create-pool' />
+ <parameter name='ss.capability.execution-order[7]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[9]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[10]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[11]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order[12]' value='aai-vf-module-put' />
+ <parameter name='ss.capability.execution-order_length' value='13' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.'
+ value='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vfmodule-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE with vfmodule-ra-assignment"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-mdsal-put' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-forking-logic.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-forking-logic.xml new file mode 100644 index 0000000..1c5e077 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-forking-logic.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='self-serve-vf-module-forking-logic' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='false' />
+ <parameter name='tmp.exist.vf_module_label' value='false' />
+ </set>
+ <switch test="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='p' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$p].name`">
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='true' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_label'>
+ <set>
+ <parameter name='tmp.exist.vf_module_label' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.exist.sdnc-model-name == 'true' and $tmp.exist.vf_module_label == 'true'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT sdnc_model_name from VF_MODEL
+ WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid
+ AND sdnc_model_name is not null'
+ pfx='db.vf-model-name'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table to determine self-serve forking criteria" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT vf_module_label from VF_MODULE_MODEL
+ WHERE vf_customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid
+ AND vf_module_label is not null '
+ pfx='db.vf-module-label'>
+ <outcome value='success'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table to determine self-serve forking criteria" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='false' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='false' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml new file mode 100644 index 0000000..e2dc3e3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name-changeassign.xml @@ -0,0 +1,92 @@ +<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='self-serve-vf-module-generate-name-changeassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.external-key.value' value='' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
+ <outcome value='external-key'>
+ <set>
+ <parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.external-key.value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="self-service-vf-module-generate-name-changeassign error : external-key is null for vf-module" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vf-module.changeassign.naming-data-payload" value="`'{"elements":[{' + '"resource-name":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].name + '","resource-value":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + '","external-key":"' + $tmp.external-key.value + '"}]}'`"/>
+ </set>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.vf-module.changeassign.naming-data-payload`' />
+ <parameter name="prifix" value="vf-module.changeassign.nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module" key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id AND vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id " >
+ <parameter name="vf-module-name" value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].value`' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name.xml new file mode 100644 index 0000000..01ec0d4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-generate-name.xml @@ -0,0 +1,233 @@ +<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='self-serve-vf-module-generate-name' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ <parameter name='tmp.gen-name_length' value='1' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ <parameter name='tmp.gen-name_length' value='0' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-mdsal-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-mdsal-put.xml new file mode 100644 index 0000000..76b6087 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-mdsal-put.xml @@ -0,0 +1,75 @@ +<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='self-serve-vf-module-mdsal-put' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vf-module assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vf-module assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml new file mode 100644 index 0000000..68df95e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml @@ -0,0 +1,159 @@ +<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='self-serve-vf-module-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vf-module' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during unassign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during unassign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ <parameter name="field3" value="`'SS: tmp.param.capability-name: ' + $tmp.param.capability-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-changeassign.xml new file mode 100644 index 0000000..543b9f5 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-changeassign.xml @@ -0,0 +1,70 @@ +<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='self-serve-vfmodule-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no param name/value provided in vf-module-request-input" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='i' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.input.param.found.in.service.param' value='false' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].name == $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='ss.input.param.index' value='`$i`' />
+ <parameter name='ss.service-data.param.index' value='`$j`' />
+ <parameter name='ss.input.param.found.in.service.param' value='true' />
+ <parameter name='ss.capability-type' value='vf-module' />
+ <parameter name='ss.capability-action' value='changeassign' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-name-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from self-service-generate-name-changeassign" />
+ </return>
+ </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="Error from self-service-generate-name-changeassign" />
+ </return>
+ </outcome>
+ </call>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$ss.input.param.found.in.service.param`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vf-module-request-input.vf-module-input-parameters.param[].name found in service-data." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml new file mode 100644 index 0000000..9038e67 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml @@ -0,0 +1,204 @@ +<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='self-serve-vfmodule-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="cds" value="execution-service_process."/>
+ <parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-type`" />
+ <parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ <parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
+ <parameter name="responsePrefix" value="raAssign" />
+ <parameter name="`$cds + 'isNonAppend'`" value="true"/>
+ <parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
+ <parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_label'>
+ <set>
+ <parameter name='tmp.vf-module-label' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name + '":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.vf-module-label == ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </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="`'No VF_MODEL found with customization_uuid = ' + $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT vf_module_label from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vf_module_label is not null'
+ pfx='db1.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </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="`'vf_module_label not found in VF_MODULE_MODEL WHERE customization_uuid = ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-label' value='`$db1.vf-module-model.vf-module-label`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $vf-module-topology-operation-input.service-information.service-instance-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"vnf-id":"' + $vf-module-topology-operation-input.vnf-information.vnf-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"vf-module-model-customization-uuid":"' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"vnf-model-customization-uuid":"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload8" value="`$tmp.config-name-value-payload7 + '"vf-module-id":"' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload9" value="`$tmp.config-name-value-payload8 + '"aic-cloud-region":"' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region + '"'`"/>
+ </set>
+ <set>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload9 + '}'`" />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.vf-module-label`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
+ <parameter name='restapiUser' value='`$prop.cds.user`' />
+ <parameter name='restapiPassword' value='`$prop.cds.pwd`' />
+ <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="raAssign" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from ConfigAssignmentNode" />
+ </return>
+ </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="Error from ConfigAssignmentNode" />
+ </return>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER BlueprintProcessingClient"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.resolved-data.' + $tmp.vf-module-label`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vfmodule-mapping-ra-response' mode='sync' ></call>
+ </outcome>
+ <outcome value='failure'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.vf-module-label`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to parse RA respose from mapping or meshed-template" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vfmodule-template-ra-response' mode='sync' ></call>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: vfmodule-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-vfmodule-ra-assignment-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml new file mode 100644 index 0000000..96db3ef --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml @@ -0,0 +1,287 @@ +<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='self-serve-vnf-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-vnf' value='true' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-vnf' value='false' />
+ </set>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-vnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$service-data.vnfs.vnf_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-vnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.'
+ value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.'
+ value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.'
+ value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.'
+ value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.'
+ value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[1]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[6]' value='eipam-create-pool' />
+ <parameter name='ss.capability.execution-order[7]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[9]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[10]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[11]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order[12]' value='aai-vnf-put' />
+ <parameter name='ss.capability.execution-order_length' value='13' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vnf' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='error-message' value="`'Encountered error from ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-mdsal-put' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'EXECUTION DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-mdsal-put' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-changeassign.xml new file mode 100644 index 0000000..16da1bb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-changeassign.xml @@ -0,0 +1,70 @@ +<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='self-serve-vnf-changeassign' mode='sync'>
+ <block atomic='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no param name/value provided in vnf-request-input" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='i' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.input.param.found.in.service.param' value='false' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name == $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`' value='PENDING'/>
+ <parameter name='ss.input.param.index' value='`$i`' />
+ <parameter name='ss.service-data.param.index' value='`$j`' />
+ <parameter name='ss.input.param.found.in.service.param' value='true' />
+ <parameter name='ss.capability-type' value='vnf' />
+ <parameter name='ss.capability-action' value='changeassign' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-name-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from self-service-generate-name-changeassign" />
+ </return>
+ </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="Error from self-service-generate-name-changeassign" />
+ </return>
+ </outcome>
+ </call>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$ss.input.param.found.in.service.param`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-request-input.vnf-input-parameters.param[].name found in service-data." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-forking-logic.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-forking-logic.xml new file mode 100644 index 0000000..3570e5d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-forking-logic.xml @@ -0,0 +1,54 @@ +<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='self-serve-vnf-forking-logic' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='false' />
+ <parameter name='tmp.exist.sdnc-artifact-name' value='false' />
+ </set>
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='p' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$p].name`">
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='true' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-artifact-name' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.exist.sdnc-model-name == 'true' and $tmp.exist.sdnc-artifact-name == 'true'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$db.vf-model.sdnc-model-name != '' and $db.vf-model.sdnc-artifact-name != ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='true' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='ss.self-serve-flag' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name-changeassign.xml new file mode 100644 index 0000000..c8a419a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name-changeassign.xml @@ -0,0 +1,94 @@ +<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='self-serve-vnf-generate-name-changeassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.external-key.value' value='' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
+ <outcome value='external-key'>
+ <set>
+ <parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.external-key.value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="self-service-vnf-generate-name-changeassign error : external-key is null for vnf" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vnf.changeassign.naming-data-payload"
+ value="`'{"elements":[{' + '"resource-name":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].name + '","resource-value":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + '","external-key":"' + $tmp.external-key.value + '"}]}'`"/>
+ </set>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.vnf.changeassign.naming-data-payload`' />
+ <parameter name="prifix" value="vnf.changeassign.nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vnf ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vnf ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id " >
+ <parameter name="vnf-name" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value`' />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update generic-vnf.vnf-name to ' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to update generic-vnf.vnf-name to ' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + ' in AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].value`' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name.xml new file mode 100644 index 0000000..4a87679 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-generate-name.xml @@ -0,0 +1,233 @@ +<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='self-serve-vnf-generate-name' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ <parameter name='tmp.gen-name_length' value='1' />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ <parameter name='tmp.gen-name_length' value='0' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
+ <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
+ <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.httpResponse" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-mdsal-put.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-mdsal-put.xml new file mode 100644 index 0000000..a35b4c1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-mdsal-put.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='self-serve-vnf-mdsal-put' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.request-version`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-name`' />
+ <parameter name='vf.vnf-data.vnf-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.tenant`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-cloud-region`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vnf assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="`'Failed to persist self-serve vnf assignments during assign in MD-SAL. ' + $error-message`" />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml new file mode 100644 index 0000000..420bdf3 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml @@ -0,0 +1,179 @@ +<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='self-serve-vnf-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="cds" value="execution-service_process."/>
+ <parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$vnf-topology-operation-input.vnf-information.vnf-type`" />
+ <parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$vnf-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
+ <parameter name="responsePrefix" value="raAssign" />
+ <parameter name="`$cds + 'isNonAppend'`" value="true"/>
+ <parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
+ <parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='i' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.sdnc-artifact-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name + '":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.sdnc-artifact-name == ''`">
+ <outcome value='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </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="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ <parameter name='tmp.sdnc-artifact-name' value='`$db1.vf-model.sdnc-artifact-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $vnf-topology-operation-input.service-information.service-instance-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"vnf-model-customization-uuid":"' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid + '",'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"vnf-id":"' + $vnf-topology-operation-input.vnf-information.vnf-id + '",'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"aic-cloud-region":"' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + '"'`"/>
+ </set>
+ <set>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload7 + '}'`" />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
+ <parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.sdnc-artifact-name`' />
+ <parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
+ <parameter name='restapiUser' value='`$prop.cds.user`' />
+ <parameter name='restapiPassword' value='`$prop.cds.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
+ <parameter name="responsePrefix" value="raAssign" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from BlueprintProcessingClient" />
+ </return>
+ </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="Error from BlueprintProcessingClient" />
+ </return>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER BlueprintProcessingClient"/>
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.resolved-data.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vnf-mapping-ra-response' mode='sync' ></call>
+ </outcome>
+ <outcome value='failure'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to parse RA respose from mapping or meshed-template" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vnf-template-ra-response' mode='sync' ></call>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: self-serve-vnf-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-vnf-ra-assignment-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml new file mode 100644 index 0000000..b640fbf --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml @@ -0,0 +1,143 @@ +<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='self-serve-vnf-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mS-mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='netbox-ip-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='eipam-ip-assignment' />
+ <parameter name='ss.capability.execution-order[4]' value='mS-vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[6]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[8]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vnf' />
+ </set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <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>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve vnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve vnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve vnf assignments for ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ <parameter name="field3" value="`'SS: tmp.param.capability-name: ' + $tmp.param.capability-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_send-so-response.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_send-so-response.xml new file mode 100644 index 0000000..aee8feb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_send-so-response.xml @@ -0,0 +1,46 @@ +<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='send-so-response' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name="so.response-message" value="`$error-message`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'so-response.xml'`" />
+ <parameter name='restapiUrl' value="`$so.notification-url`" />
+ <parameter name='restapiUser' value='`$prop.so.user`' />
+ <parameter name='restapiPassword' value='`$prop.so.pwd`' />
+ <parameter name='accept' value='text/plain' />
+ <parameter name='format' value='xml' />
+ <parameter name='contentType' value='application/xml' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="soResponse-vnf-assign" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Error sending SO response. ' + $error-message`" />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Error sending SO response. ' + $error-message`" />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-assign.xml new file mode 100755 index 0000000..7983036 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-assign.xml @@ -0,0 +1,185 @@ +<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='service-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateServiceInstance'>
+ <block></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="If svc-action is 'assign' then request-action must be 'CreateServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading SERVICE_MODEL table" />
+ </return>
+ </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="`'No model found for service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.service-instance-name' value='' />
+ </set>
+ <switch test='`$service-topology-operation-input.service-request-input.service-instance-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.service-model.ecomp-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$db.service-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='SERVICE_INSTANCE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='service_instance_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$db.service-model.service-instance-name-prefix + '_'`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='generated-via-policy' value='true' />
+ </set>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.service-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.service-model.service-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unable to generate service name" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value='`$naming-policy-generate-name-output.service-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
+ <parameter name='generate-unique-name-input.supplied-name' value='`$service-topology-operation-input.service-request-input.service-instance-name`' />
+ <parameter name='generate-unique-name-input.service-instance-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value="`$service-topology-operation-input.service-request-input.service-instance-name`" />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <set>
+ <parameter name='service-data.service-topology.service-topology-identifier.service-instance-id'
+ value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='service-data.service-topology.service-topology-identifier.service-type'
+ value='`$service-topology-operation-input.service-information.subscription-service-type`' />
+ <parameter name='service-data.service-topology.service-topology-identifier.service-instance-name'
+ value='`$tmp.service-instance-name`' />
+ <parameter name='service-data.service-topology.service-topology-identifier.global-customer-id'
+ value='`$service-topology-operation-input.service-information.global-customer-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.service-topology.onap-model-information.'
+ value='`$service-topology-operation-input.service-information.onap-model-information.`' />
+ </set>
+ <switch test='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`' >
+ <set>
+ <parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-name'
+ value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].name`' />
+ <parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-value'
+ value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].value`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='assign' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml new file mode 100755 index 0000000..c018b1a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml @@ -0,0 +1,63 @@ +<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='service-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateServiceInstance'>
+ <block></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="If svc-action is 'changeassign' then request-action must be 'CreateServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading SERVICE_MODEL table" />
+ </return>
+ </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="`'No model found for service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.service-topology.onap-model-information.'
+ value='`$service-topology-operation-input.service-information.onap-model-information.`' />
+ </set>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='changeassign' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
+ </set>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml new file mode 100755 index 0000000..89cc3eb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml @@ -0,0 +1,67 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='service-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteServiceInstance'>
+ <block></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="If svc-action is 'deactivate' then request-action must be 'DeleteServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></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="Cannot deactivate this service because there are provided allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $service-data.service-topology.service-topology-identifier.global-customer-id AND
+ service-subscription.service-type = $service-data.service-topology.service-topology-identifier.service-type AND
+ service-instance.service-instance-id = $service-topology-operation-input.service-information.service-instance-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='deactivate' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='DeleteServiceInstance' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-delete.xml new file mode 100755 index 0000000..5270874 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation-delete.xml @@ -0,0 +1,100 @@ +<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='service-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteServiceInstance'>
+ <block></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="If svc-action is 'delete' then request-action must be 'DeleteServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></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="Cannot delete the service because there are networks defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></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="Cannot delete the service because there are VNFs defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></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="Cannot deactivate this service because there are provided allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></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="Cannot deactivate this service because there are consumed allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$service-data.service-topology.onap-model-information.model-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.' value='' />
+ <parameter name='service-status.' value='' />
+ </set>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation.xml new file mode 100755 index 0000000..1cf7718 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_service-topology-operation.xml @@ -0,0 +1,41 @@ +<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='service-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-service-input' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.sdnc-request-header.' value='`$service-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.request-information.' value='`$service-topology-operation-input.request-information.`' />
+ <parameter name='service-data.service-information.' value='`$service-topology-operation-input.service-information.`' />
+ <parameter name='service-data.service-request-input.' value='`$service-topology-operation-input.service-request-input.`' />
+ </set>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='delete'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$service-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml new file mode 100644 index 0000000..4d75a2f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml @@ -0,0 +1,133 @@ +<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='tunnelxconn-topology-operation-activate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.brg-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-tx-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $tunnelxconn-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $tunnelxconn-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+
+
+<!--
+
+<set>
+$tunnelxconn-topology-operation-input.service-information.global-customer-id
+$tunnelxconn-topology-operation-input.service-information.subscription-service-type
+
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+
+ $tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id
+
+--><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></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="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></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="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml new file mode 100644 index 0000000..58f73f8 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml @@ -0,0 +1,272 @@ +<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='tunnelxconn-topology-operation-assign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.search.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='Other'>
+
+<call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' >
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set><set>
+<parameter name='tx-ar-identifiers.consuming-service-instance-id' value="`$tunnelxconn-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='tx-ar-identifiers.parent-service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='tx-ar-identifiers.allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='tx-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.'
+value="`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+
+
+</set><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+
+
+</set></outcome></switch><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+
+
+</set></outcome></switch><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+
+
+</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
+<outcome value='Y'>
+<block atomic="true">
+<switch test='`$ar-model.naming-policy`'>
+<outcome value='oam_network_policy'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.' value="`$tx-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='tmp.vni' value='123' />
+<parameter name='tmp.vgmux-bearer-ip' value='127.0.0.1' />
+<parameter name='tmp.vgmux-lan-ip' value='127.0.0.1' /></set><switch test="`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters_length != ''`">
+<outcome value='true'>
+<for index='curidx' start='0' end='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters_length`' >
+<switch test='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$curidx].vnf-parameter-name`'>
+<outcome value='vgmux_private_ip_0'>
+<set>
+<parameter name='tmp.vgmux-lan-ip' value='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$curidx].vnf-parameter-value`'/>
+
+</set></outcome><outcome value='vgmux_private_ip_2'>
+<set>
+<parameter name='tmp.vgmux-bearer-ip' value='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$curidx].vnf-parameter-value`'/>
+
+</set></outcome></switch></for></outcome></switch><set>
+<parameter name='tmp.manageVni.action' value='reserve' />
+<parameter name='tmp.manageIpaddr.action' value='reserve' />
+<parameter name='tmp.manageVni.pool' value='VNI'/>
+<parameter name='tmp.manageIpaddr.pool' value='VGW'/></set><call module='GENERIC-RESOURCE-API' rpc='manage-vni-assignment' mode='sync' >
+</call><call module='GENERIC-RESOURCE-API' rpc='manage-ipaddr-assignment' mode='sync' >
+</call><set>
+<parameter name='tx-ar-assignments.vni' value='`$tmp.manageVni.vni`'/>
+<parameter name='tx-ar-assignments.vgmux-bearer-ip' value='`$tmp.vgmux-bearer-ip`'/>
+<parameter name='tx-ar-assignments.vgmux-lan-ip' value='`$tmp.vgmux-lan-ip`'/>
+<parameter name='tx-ar-assignments.vg-ip' value='`$tmp.manageIpaddr.ip`'/>
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[0].name' value='VNI'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[0].value' value='`$tmp.manageVni.vni`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[1].name' value='vgmux_private_ip_2'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[1].value' value='`$tmp.vgmux-bearer-ip`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[2].name' value='vgmux_private_ip_0'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[2].value' value='`$tmp.vgmux-lan-ip`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[3].name' value='vgw_private_ip_0'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters.param[3].value' value='`$tmp.manageIpaddr.ip`'/>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-parameters_length' value='4'/>
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.'
+value="`$tx-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
+<outcome value='false'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+</set></block></outcome></switch></block></outcome></switch><set>
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><set>
+<parameter name='service-data.service-information.global-customer-id' value='`$tunnelxconn-topology-operation-input.service-information.global-customer-id`' />
+<parameter name='service-data.service-information.subscription-service-type' value='`$tunnelxconn-topology-operation-input.service-information.subscription-service-type`' />
+<!--
+<parameter name='service-data.service-information.service-instance-id' value='`$tunnelxconn-topology-operation-input.service-information.service-instance-id`' />
+-->
+<parameter name='service-data.service-information.service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`"/></set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" /><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></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="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></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="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" />
+</return></outcome></call></outcome></execute></block></method></service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml new file mode 100644 index 0000000..8071065 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml @@ -0,0 +1,300 @@ +<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='tunnelxconn-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/' + $tmp.ar.allotted-resource-id + '/allotted-resource-data/tunnelxconn-topology/'` " />
+ </set>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-tx-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+ </set>
+ <switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+ <parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+ <parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
+ <set>
+ <parameter name='tmp.tunnel-vgMUX-vG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
+ <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ </set>
+ <set>
+ <parameter name='tmp.search.parent-service-instance-id' value='`$tmp.ar.parent-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' ></call>
+ <for index='paramidx' start='0' end='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters_length`' >
+ <!--
+ <for index='paramidx' start='0' end='`$parent-service-instance.vnf-topology-information.vnf-parameters_length`' >
+ -->
+ <switch test='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ <!--
+ <switch test='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ -->
+ <outcome value='true'>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.service-data.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+ <!--
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+
+ -->
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
+ <parameter name='tmp.tunnel-dest-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
+ <parameter name='tmp.tunnel-src-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip` " />
+ <parameter name='tmp.tunnel-vni' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.vxlan-tunnel.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vBRG-name` " />
+ <parameter name='tmp.tunnel-dest-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ <parameter name='tmp.tunnel-src-ip' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-lan-ip` " />
+ <parameter name='tmp.tunnel-vni' value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vni` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.vxlan-tunnel.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.xconnect.templatefile`" />
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-name`"/>
+ </execute>
+ <set>
+ <parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vBRG-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vpp.xconnect.templatefile`" />
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $tunnelxconn-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml new file mode 100644 index 0000000..dc24e03 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml @@ -0,0 +1,117 @@ +<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='tunnelxconn-topology-operation-deactivate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-tx-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></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="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></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="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml new file mode 100644 index 0000000..d70fb60 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml @@ -0,0 +1,268 @@ +<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='tunnelxconn-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/' + $tmp.ar.allotted-resource-id + '/allotted-resource-data/tunnelxconn-topology/'` " />
+ </set>
+ <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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-tx-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+ </set>
+ <switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+ <parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+ <parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <set>
+ <parameter name='tx-ar-assignments.' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.search.parent-service-instance-id' value='`$tmp.ar.parent-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' ></call>
+ <for index='paramidx' start='0' end='`$parent-service-instance.vnf-topology-information.vnf-parameters_length`' >
+ <switch test='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.honeycomb.url`"/>
+ <parameter name="outputPath" value="tmp.honeycomb.url"/>
+ <parameter name="target" value="{honeycomb-instance-ip}"/>
+ <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip`"/>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
+ <set>
+ <parameter name='tmp.tunnel-vgMUX-vG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
+ <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-vgMUX-vG-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-vgMUX-vBRG-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url + '/v3po:l2' `" />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
+ <parameter name="outputPath" value="tmp.vpp-honeycomb-url"/>
+ <parameter name="target" value="{tunnel-name}"/>
+ <parameter name="replacement" value="`$tmp.tunnel-vgMUX-vG-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$tmp.honeycomb.url + $tmp.vpp-honeycomb-url`' />
+ <parameter name='restapiUser' value='`$prop.honeycomb.user`' />
+ <parameter name='restapiPassword' value='`$prop.honeycomb.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="honeycomb-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </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="Error updating md-sal for tunnelxconn-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $tunnelxconn-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml new file mode 100644 index 0000000..eaab7f2 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml @@ -0,0 +1,80 @@ +<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='tunnelxconn-topology-operation-unassign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><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.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-tx-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='tx-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></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="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml new file mode 100644 index 0000000..277b74d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml @@ -0,0 +1,26 @@ +<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='tunnelxconn-topology-operation' mode='sync'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-tunnelxconn-input' mode='sync' >
+</call><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-assign' mode='sync' >
+</call></block></outcome><outcome value='create'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-create' mode='sync' >
+</call></block></outcome><outcome value='activate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-activate' mode='sync' >
+</call></block></outcome><outcome value='deactivate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-deactivate' mode='sync' >
+</call></block></outcome><outcome value='delete'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-delete' mode='sync' >
+</call></block></outcome><outcome value='unassign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-unassign' mode='sync' >
+</call></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><set>
+<parameter name="ack-final" value="Y"/></set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml new file mode 100644 index 0000000..bf041b1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml @@ -0,0 +1,319 @@ +<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='validate-api-contrail-route-input' mode='sync'> + <block atomic="true"> + <switch test='`$ctotmp.action`'> + <outcome value='create'> + <block atomic="true"> + <switch test='`$cto-api.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.port-mirror-configuration-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.port-mirror-configuration-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.source-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.source-network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.collector-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-owner`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.cloud-owner is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.service-type`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.service-type is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.contrail-route-allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.src-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.collector-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.contrail-route-allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.src-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.collector-contrail-network-fqdn`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.rollback-flag`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.rollback-flag is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$cto-api.default-domain`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.default-project`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.cloud-region-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.contrail-route-allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.rollback-flag`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.rollback-flag is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.configuration-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.configuration-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$cto-api.owning-entity`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml new file mode 100644 index 0000000..73bb52d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml @@ -0,0 +1,118 @@ +<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='validate-bbs-network-input-parameters' mode='sync'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='create'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='CreateAccessConnectivityInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='CreateInternetProfileInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteAccessConnectivityInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='DeleteInternetProfileInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='update'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + <outcome value='ChangeInternetProfileInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-input-parameters.param_length'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error invalid request-action" /> + </return> + </outcome> + </switch> + </outcome> + </switch> + </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="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" /> + </return> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="svc-action is null" /> + </return> + </outcome> + </switch> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml new file mode 100644 index 0000000..7f72fbd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml @@ -0,0 +1,118 @@ +<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='validate-bbs-vnf-input-parameters' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateAccessConnectivityInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='CreateInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteAccessConnectivityInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='DeleteInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ <outcome value='ChangeInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </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="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="svc-action is null" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-brg-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-brg-input.xml new file mode 100644 index 0000000..57b493f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-brg-input.xml @@ -0,0 +1,116 @@ +<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='validate-brg-input' mode='sync'>
+<block atomic="true"><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.service-information.service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-information.onap-model-information.model-customization-uuid is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.vgmux-bearer-ip`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.vni`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.brg-wan-mac-address `'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+
+<outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome></get-resource></block></outcome><outcome value='create'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch></block></outcome></switch><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml new file mode 100644 index 0000000..ec0301a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml @@ -0,0 +1,331 @@ +<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='validate-connection-attachment-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='sotnVpnName'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='clientSignal'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-provider-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-client-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-topology-id'></outcome>
+ <outcome value='access-node-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cVLAN'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='CreateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='sdwanVpnName'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='role'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </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="sdnc-request-header.request-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="sdnc-request-header.request-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='DeleteSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </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="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-contrail-route-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-contrail-route-input.xml new file mode 100755 index 0000000..421335d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-contrail-route-input.xml @@ -0,0 +1,337 @@ +<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='validate-contrail-route-input' mode='sync'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block></block> + </outcome> + <outcome value='DeleteContrailRouteInstance'> + <block></block> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required input" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Invalid request-information.request-action " /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.service-information.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="service-information.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-information.onap-model-information.model-customization-uuid is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-topology-operation-input.contrail-route-request-input.dest-network.network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid' + pfx='ar-model'> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + </get-resource> + </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="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=assign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be CreateNetworkInstance for svc-action=create" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='CreateContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=activate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=deactivate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=delete" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteContrailRouteInstance'> + <block atomic="true"> + <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=unassign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml new file mode 100755 index 0000000..cc1bc1a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml @@ -0,0 +1,108 @@ +<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='validate-generic-configuration-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Service instance ' + $generic-configuration-topology-operation-input.service-information.service-instance-id + ' does not exist'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateGenericConfigurationInstance'>
+ <block></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="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be CreateGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateGenericConfigurationInstance'>
+ <block></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="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be CreateGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteGenericConfigurationInstance'>
+ <block></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="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be DeleteGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='unassign'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteGenericConfigurationInstance'>
+ <block></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="`'If svc-action is ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be DeleteGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </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 svc-action ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml new file mode 100755 index 0000000..3489544 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml @@ -0,0 +1,107 @@ +<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='validate-getpathsegment-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$getpathsegment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateForwardingPathInstance'>
+ <block></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="service-information.subscription-service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading SERVICE_MODEL table" />
+ </return>
+ </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="`'No service model found for service UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE invariant_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading SERVICE_MODEL table" />
+ </return>
+ </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="`'No service model found for invariant UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input-parameters.xml new file mode 100644 index 0000000..0987a77 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input-parameters.xml @@ -0,0 +1,311 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<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="validate-network-input-parameters" mode="sync">
+ <block atomic="true">
+ <switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`">
+ <outcome value="create">
+ <block atomic="true">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="CreateNetworkInstance">
+ <block atomic="true">
+ <for index="i" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <set>
+ <parameter name="tmp.name" value="" />
+ <parameter name="tmp.value" value="" />
+ </set>
+ <set>
+ <parameter name="tmp.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$i].name`" />
+ <parameter name="tmp.value" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$i].value`" />
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value="name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="service-type">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="site1-name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="site2-name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="sna1_name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="sna2_name">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="pe1_id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="pe2_id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1-id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2-id">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1-ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2-ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1_peer_ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2_peer_ip">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac1_svlan">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="ac2_svlan">
+ <switch test="`$tmp.value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </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="request-information.request-action is required to be CreateNetworkInstance for svc-action=create" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value="activate">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="ActivateDCINetworkInstance">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-overlay-network-input-parameters" mode="sync" />
+ </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="request-information.request-action is required to be ActivateNetworkInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="deactivate">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="DeActivateDCINetworkInstance">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="requiredParameters">
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id" />
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be DeactivateNetworkInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="delete">
+ <block atomic="true">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="DeleteNetworkInstance">
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="requiredParameters">
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id" />
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </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="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input.xml new file mode 100644 index 0000000..87cf448 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-network-input.xml @@ -0,0 +1,596 @@ +<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='validate-network-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.validate-network-input"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Network id proveded but no network exists that matches"/>
+ <parameter name="field5" value="`$network-topology-operation-input.network-information.network-id`"/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_length`'>
+ <outcome value=''>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.validate-network-input"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Network instance group id proveded but no network instance group exists that matches"/>
+ <parameter name="field5" value="`$network-topology-operation-input.network-information.network-instance-group-id`"/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' >
+ <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ngidx' value='`$ngidx`' />
+ <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be CreateNetworkInstance for svc-action=assign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='ActivateSOTNConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='ActivateDCINetworkInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No service model found for service UUID ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ and service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ + $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
+ ' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be CreateNetworkInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.from-preload`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.from-preload is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be CreateNetworkInstance for svc-action=changeassign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='DeactivateSOTNConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='DeActivateDCINetworkInstance'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='DeleteNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be DeleteNetworkInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be DeleteNetworkInstance for svc-action=unassign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-overlay-network-input-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-overlay-network-input-parameters.xml new file mode 100644 index 0000000..2e16622 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-overlay-network-input-parameters.xml @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<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="validate-overlay-network-input-parameters" mode="sync">
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block atomic="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.name" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site1_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site2_id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_networkName'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site1_networkName" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_networkName'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site2_networkName" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_routerId'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site1_routerId" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_routerId'`">
+ <outcome value="true">
+ <block>
+ <set>
+ <parameter name="validate.dci-connects.site2_routerId" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_importRT1'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_importRT1" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_importRT1'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site2_importRT1" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_exportRT1'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_exportRT1" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_exportRT2'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_exportRT2" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_vni'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site1_vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site2_vni'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="validate.dci-connects.site2_vni" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`">
+ <outcome value="true">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test="`$validate.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="requiredParameters">
+ <parameter name="`$network-topology-operation-input.network-request-input.network-input-parameters.site1_routerId`" value="" />
+ <parameter name="`$network-topology-operation-input.network-request-input.network-input-parameters.site2_routerId`" value="" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI" />
+ <outcome value="other">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-pnf-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-pnf-input.xml new file mode 100644 index 0000000..3c1ae0d --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-pnf-input.xml @@ -0,0 +1,86 @@ +<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='validate-pnf-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-details.pnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-details.pnf-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$pnf-topology-operation-input.pnf-details.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-details.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pnf-topology-operation-input.pnf-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="pnf-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-security-zone-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-security-zone-input.xml new file mode 100755 index 0000000..0aaa7ba --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-security-zone-input.xml @@ -0,0 +1,328 @@ +<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='validate-security-zone-input' mode='sync'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block></block> + </outcome> + <outcome value='DeleteSecurityZoneInstance'> + <block></block> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required input" /> + </return> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Invalid request-information.request-action " /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.service-information.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="service-information.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-information.onap-model-information.model-customization-uuid is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.vlan-tag is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.trusted-network-role is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="security-zone-operation-input.security-zone-request-input.untrusted-network-role is a required input" /> + </return> + </outcome> + </switch> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid' + pfx='ar-model'> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" /> + </return> + </outcome> + </get-resource> + </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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=assign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='create'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=create" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=activate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=deactivate" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=delete" /> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSecurityZoneInstance'> + <block atomic="true"> + <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" /> + </return> + </outcome> + </switch> + </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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=unassign" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-service-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-service-input.xml new file mode 100755 index 0000000..ca1c3a4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-service-input.xml @@ -0,0 +1,117 @@ +<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='validate-service-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.service-information.subscription-service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.subscription-service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.global-customer-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.global-customer-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml new file mode 100644 index 0000000..58b7467 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml @@ -0,0 +1,106 @@ +<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='validate-tunnelxconn-input' mode='sync'>
+<block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.service-information.service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-information.onap-model-information.model-customization-uuid is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.brg-wan-mac-address`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-topology-operation-input.brg-wan-mac-address is a required input" />
+</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+
+<outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No allotted resource model found for model customization UUID ' + $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome></get-resource></block></outcome><outcome value='create'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch></block></outcome></switch><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vf-module-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vf-module-input.xml new file mode 100644 index 0000000..f21ff99 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vf-module-input.xml @@ -0,0 +1,86 @@ +<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='validate-vf-module-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.vf-module-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vnf-input.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vnf-input.xml new file mode 100644 index 0000000..6de5257 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_validate-vnf-input.xml @@ -0,0 +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='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='validate-vnf-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-generate-heat-parameters.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-generate-heat-parameters.xml new file mode 100755 index 0000000..0324511 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-generate-heat-parameters.xml @@ -0,0 +1,926 @@ +<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='vf-module-generate-heat-parameters' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='const.sub-int' value='subint' />
+ <parameter name='const.subnet-id' value='_subnet_id' />
+ <parameter name='const.v6-subnet-id' value='_v6_subnet_id' />
+ <parameter name='const.port' value='port' />
+ <parameter name='const.sub-int-count' value='_subintcount' />
+ <parameter name='const.vlan-ids' value='_vlan_ids' />
+ <parameter name='const.net-names' value='_net_names' />
+ <parameter name='const.net-ids' value='_net_ids' />
+ <parameter name='const.ip' value='_ip' />
+ <parameter name='const.v6-ip' value='_v6_ip' />
+ <parameter name='const.floating-ip' value='_floating_ip' />
+ <parameter name='const.floating-v6-ip' value='_floating_v6_ip' />
+ <parameter name='const.underscore' value='_' />
+ </set>
+ <set>
+ <parameter name='output-index' value='0' />
+ </set>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-name-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + '_name_'
+ + $vm-name-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`" />
+ </set>
+ <switch test='`$vm-name-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='cdl' value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + '_names'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`'>
+ <outcome value=''>
+ <set>
+ <parameter name='network-key' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='network-key' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v4`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.floating-ip`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v4`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v6`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.floating-v6-ip`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].floating-ips.floating-ip-v6`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].interface-route-prefixes.interface-route-prefix_length > 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='cdl' value='[' />
+ </set>
+ <for index='interface-route-prefix-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].interface-route-prefixes.interface-route-prefix_length`' >
+ <block>
+ <switch test='`$interface-route-prefix-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ','`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='cdl' value="`$cdl
+ + '{\"interface_route_table_routes_route_prefix\":\"'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].interface-route-prefixes.interface-route-prefix[$interface-route-prefix-index]
+ + '\"}'`" />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='cdl' value="`$cdl + ']'`" />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_route_prefixes'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.ip
+ + $const.underscore
+ + $address-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$address-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='cdl' value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_ips'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + $const.v6-ip
+ + $const.underscore
+ + $address-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$address-index > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='cdl' value="`$cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='cdl' value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$address-family-index].network-ips.network-ip[$address-index]`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_v6_ips'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length > 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_vlan_filter'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='public-cdl' value='' />
+ <parameter name='private-cdl' value='' />
+ <parameter name='all-cdl' value='' />
+ </set>
+ <for silentFailure='true' index='related-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.is-private`'>
+ <outcome value='true'>
+ <switch test='`$private-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='private-cdl'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='private-cdl'
+ value="',' + `$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$public-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='public-cdl'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='public-cdl'
+ value="',' + `$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$all-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='all-cdl'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='all-cdl'
+ value="',' + `$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.upper-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$private-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_private_vlans'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$private-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$public-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_public_vlans'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$public-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ + $const.underscore
+ + $network-key
+ + '_guest_vlans'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$all-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='port-index' value='0' />
+ </set>
+ <for silentFailure='true' index='vnfc-port-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_subintcount'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data_length`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v4`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_floating_ip'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v4`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v6`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_floating_v6_ip'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[0].floating-ips.floating-ip-v6`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vlan-cdl' value='' />
+ <parameter name='net-names-cdl' value='' />
+ <parameter name='net-id-cdl' value='' />
+ <parameter name='ipv4-ips-cdl' value='' />
+ <parameter name='ipv6-ips-cdl' value='' />
+ </set>
+ <for silentFailure='true' index='vnic-sub-interface-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block>
+ <switch test='`$vlan-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vlan-cdl' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].vlan-tag-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vlan-cdl' value="`$vlan-cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].vlan-tag-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$net-names-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='net-names-cdl' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='net-names-cdl' value="`$net-names-cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$net-id-cdl`'>
+ <outcome value=''>
+ <set>
+ <parameter name='net-id-cdl' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='net-id-cdl' value="`$net-id-cdl + ',' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='nii-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_ip_'
+ + $ip-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip[$ip-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_v6_ip_'
+ + $ip-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.sub-interface-network-data[$vnic-sub-interface-index].network-information-items.network-information-item[$nii-index].network-ips.network-ip[$ip-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <switch test='`$vlan-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_vlan_ids'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$vlan-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$net-names-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_net_names'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$net-names-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$net-id-cdl`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-type
+ + $const.underscore
+ + $vnfc-network-index
+ + '_subint_'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role
+ + '_port_'
+ + $port-index
+ + '_net_ids'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$net-id-cdl`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='port-index' value='`$port-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='az-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`'availability_zone_'
+ + $az-index`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$az-index]`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block>
+ <set>
+ <parameter name='network-key' value='' />
+ </set>
+ <set>
+ <parameter name='network-role' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ </set>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$network-role ==
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`'>
+ <outcome value=''>
+ <set>
+ <parameter name='network-key' value='`network-role`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='network-key' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag`' />
+ </set>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-key`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$network-key`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + '_net_id'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].neutron-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + '_net_name'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].contrail-network-fqdn`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + '_net_fqdn'`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].contrail-network-fqdn
+`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-ipv4' value='false' />
+ <parameter name='found-ipv6' value='false' />
+ </set>
+ <for silentFailure='true' index='subnet-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].ip-version`'>
+ <outcome value='ipv4'>
+ <switch test='`$found-ipv4`'>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + $const.subnet-id`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='found-ipv4' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='ipv6'>
+ <switch test='`$found-ipv6`'>
+ <outcome value='false'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-parameters.param[$output-index].name'
+ value="`$network-key
+ + $const.v6-subnet-id`" />
+ <parameter name='tmp.vf-module-parameters.param[$output-index].value'
+ value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ <set>
+ <parameter name='found-ipv6' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.preload-parameters.' value='`$tmp.vf-module-topology.vf-module-parameters.`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.' value='`$tmp.vf-module-parameters.`' />
+ </set>
+ <for silentFailure='true' index='preload-index' start='0' end='`$tmp.preload-parameters.param_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='cur-index' start='0' end='`$output-index`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].name
+ == $tmp.preload-parameters.param[$preload-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].value' value='`$tmp.preload-parameters.param[$preload-index].value`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].name'
+ value="`$tmp.preload-parameters.param[$preload-index].name`" />
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].value'
+ value="`$tmp.preload-parameters.param[$preload-index].value`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='input-index' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='cur-index' start='0' end='`$output-index`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].name
+ == $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-parameters.param[$cur-index].value'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].value`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].name'
+ value="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].name`" />
+ <parameter name='tmp.vf-module-topology.vf-module-parameters.param[$output-index].value'
+ value="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$input-index].value`" />
+ </set>
+ <set>
+ <parameter name='output-index' value='`$output-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-parameters.param_length' value='`$output-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ </block>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml new file mode 100755 index 0000000..edbbcca --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml @@ -0,0 +1,188 @@ +<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='vf-module-topology-assign-rollback' mode='sync'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $vf-module-topology-operation-input.vf-module-information.vf-module-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag`'>
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" ></delete>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag`'>
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vf-module:relationship-list"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND related-to = l3-network
+ AND l3-network.network-id = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id" ></delete>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" ></delete>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" ></delete>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <for index='network-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$nig-index].networks.network_length`' >
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].vlan-tag-id'
+ value='' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
+ value='unassigned' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml new file mode 100755 index 0000000..d7f4ddd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml @@ -0,0 +1,196 @@ +<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='vf-module-topology-operation-activate' mode='sync'>
+ <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>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></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="If svc-action is 'activate' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-activate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </return>
+ </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="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </return>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="Active" />
+ <parameter name="prov-status" value="NVTPROV" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc in AAI" />
+ </return>
+ </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="`'No vnfc found in AAI for vnfc name ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ </update>
+ </for>
+ </for>
+ <update resource='SQL' force='true' plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ key='UPDATE EIPAM_IP_ASSIGNMENTS SET status = "ACTIVE" WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-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 updating EIPAM_IP_ASSIGNMENTS table" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleactivate.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-async.xml new file mode 100644 index 0000000..923303a --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-async.xml @@ -0,0 +1,1862 @@ +<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='vf-module-topology-operation-assign-async' mode='sync'>
+ <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>
+ <set>
+ <parameter name="so.ack-final-indicator" value="Y" />
+ <parameter name="so.response-code" value="500" />
+ <parameter name="so.notification-url" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="so.svc-request-id" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="so.service-type" value="`$vf-module-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="so.service-instance-id" value="`$vf-module-topology-operation-input.service-information.service-instance-id`" />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVfModuleInstance'" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vf-module with vf-module-id=' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' with error: ' + $error-message`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'VF module id ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id
+ + ' already exists, and status is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-data.vf-module-level-oper-status.order-status`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-type' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='tmp.vf-module-topology.tenant' value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='tmp.vf-module-topology.aic-cloud-region' value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving cloud region from AAI. Is AAI down?" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'from-preload flag is true but could not find preload information for VF module name ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-preload" />
+ <outcome value='failure'>
+ <block>
+ <switch test='`$mdsal-preload.response-code`'>
+ <outcome value='404'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'from-preload flag is true but could not find preload information for VF module name ' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving preload-information" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='`$idx`' />
+ </set>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'VNFC network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ + ' is not found in VNF network list'
+ `" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <for index='subnet-role-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='af-count' value='0' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <set>
+ <parameter name='af-count' value='`$af-count + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$af-count`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$subnet-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='-1' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have network-start-address populated'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have cidr-mask populated'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='ip-type' value='IPv4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='ip-type' value='IPv6' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="isInSameSubnet">
+ <parameter name="firstIPAddr" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`" />
+ <parameter name="secondIPAddr" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address`" />
+ <parameter name="subnet" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`" />
+ <parameter name="ipType" value="`$ip-type`" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$subnet-id`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Not able to find VNF network subnet that contains address '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address
+ `" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id' value='`$subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodulec.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid
+ and network_role = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-message" value="Error reading VFC_RELATED_NETWORK_ROLE table" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for index='db-related-network-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='related-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network[$related-network-index].network-role
+ == $db.vnf-related-network-role[$db-related-network-index].related-network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='true' />
+ </set>
+ <set>
+ <parameter name='saved-vnf-network-index' value='`$vnf-network-index`' />
+ <parameter name='saved-related-network-index' value='`$related-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-message" value="`'Unable to find related network '
+ + $db.vnf-related-network-role[$db-related-network-index].related-network-role + ' in vnf-networks'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].is-trunked'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].is-trunked`' />
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].segmentation-id`' />
+ </set>
+ <set>
+ <parameter name='rn-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.vlan-interface`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.lower-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.upper-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.is-private`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $vf-module-topology-operation-input.vf-module-information.vf-module-id
+ + '/vf-module-data/vf-module-topology/'`"/>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vf-module-name" value="`$tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="selflink" value="`$vf-module-object-path`" />
+ <parameter name="automated-assignment" value="`$automated-assignment`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </set>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-function' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-function' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag' value='true' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vf-module" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id +
+ '/vf-modules/vf-module/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vnfc relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vnfc relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="cp-instance-id" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id" >
+ <parameter name="cp-instance-id" value="`$cp-instance-id`" />
+ <parameter name="port-id" value="0" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving cp object to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving cp object to AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.connection-point-id'
+ value='`$cp-instance-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.port-id'
+ value='0' />
+ </set>
+ <for silentFailure='true' index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error creating l3-interface-ipv4-address-list object in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating l3-interface-ipv4-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv4-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error creating l3-interface-ipv6-address-list object in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating l3-interface-ipv6-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv6-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating cp relationship to l3-network in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='related-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vlan-tag" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vlan-tags/vlan-tag/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.vlan-interface`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating cp relationship to l3-network and vlan-tag in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network and vlan-tag" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module:relationship-list"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vf-module relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No l3-network found in AAI for network ID '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" >
+ <parameter name="vip-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]`" />
+ <parameter name="vip-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vip-ipv4-address-list in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error saving vip-ipv4-address-list" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" >
+ <parameter name="vip-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]`" />
+ <parameter name="vip-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error saving vip-ipv6-address-list in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error saving vip-ipv6-address-list" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv6-address-list relationships in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv6-address-list relationships" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vlantaggingfailure.log' />
+ </execute>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-generate-heat-parameters' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleheat.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
+ AND vm_name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' >
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </delete>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO VIPR_CONFIGURATION (vnf_id, vnf_name, ecomp_service_instance_id, vm_name, cloud_region_id, cloud_owner) VALUES ( $service-data.vnfs.vnf[$vnf-index].vnf-id , $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name , $service-data.service-information.service-instance-id , $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index] , $tmp.vf-module-topology.aic-cloud-region , $prop.cloud-region.cloud-owner )" >
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.' value='tmp.vf-module-topology.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <set>
+ <parameter name='vf-module-data.'
+ value='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vf-module`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.service-topology.service-topology-identifier.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vf-module.url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'vf-module-assign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.controller.url + $tmp.vf-module.url`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="vf-module-assign" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vf-module" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vf-module" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodule.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml new file mode 100755 index 0000000..fd1ca63 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml @@ -0,0 +1,1302 @@ +<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='vf-module-topology-operation-assign-no-preload' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload' value='false' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-to-vfc-mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm_length'
+ value='`$db.vf-module-to-vfc-mapping_length`' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$db.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_MODEL WHERE customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
+ pfx='db.vfc-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_MODEL table" />
+ </return>
+ </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="`'No entries found in VFC_MODEL table for customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="$db.vfc-model.ecomp-generated-naming == 'Y'">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'ECOMP generated naming is not Y for VFC customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="$db.vfc-model.naming-policy">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'naming_policy is null for VFC customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code'
+ value='`$db.vfc-model.nfc-naming-code`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type-tag'
+ value='`$db.vfc-model.vm-type-tag`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
+ <!-- Context variables used when creating vnfc object in AAI -->
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid'
+ value='`$db.vfc-model.invariant-uuid`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function'
+ value='`$db.vfc-model.nfc-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid'
+ value='`$db.vfc-model.uuid`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length'
+ value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' />
+ </set>
+ <for index='vm-index' start='0' end='`$db.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vfc-model.customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VM name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]'
+ value='`$naming-policy-generate-name-output.vm-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vf-module-customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VNFC name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$naming-policy-generate-name-output.vnfc-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </for>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_TO_NETWORK_ROLE_MAPPING WHERE vfc_customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
+ pfx='db.vfc-to-network-role-mapping[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for index='network-role-index' start='0' end='`$db.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='idx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test='`$service-data.networks.network[$idx].network-data.network-topology.network-topology-identifier-structure.network-role == $db.vfc-to-network-role-mapping[$network-role-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No network found in MD-SAL with network-role ' + $db.vfc-to-network-role-mapping[$network-role-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <!--This isn't a node in MD-SAL, but we need to save this for later when we are doing EIPAM processing-->
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id'
+ value='`$service-data.networks.network[$idx].network-data.network-topology.network-topology-identifier-structure.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role-tag'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].network-role-tag`' />
+ </set>
+ <switch test='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='network-information-index' value='-1' />
+ </set>
+ </outcome>
+ <outcome value='4'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-information-index' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-version'
+ value='ipv4' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].use-dhcp'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-count'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='6'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-information-index' value='`$network-information-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-version'
+ value='ipv6' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].use-dhcp'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-information-items.network-information-item[$network-information-index].ip-count'
+ value='`$db.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$db.vfc-to-network-role-mapping_length`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='auto-ip-assignment-input.aic-cloud-region'
+ value='`$tmp.vf-module-topology.aic-cloud-region`' />
+ <parameter name='auto-ip-assignment-input.vf-module.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='auto-ip-assignment-input.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='auto-ip-assignment-input.service-instance-id'
+ value='`$service-data.service-information.service-instance-id`' />
+ <parameter name='auto-ip-assignment-input.service-type'
+ value='`$service-data.service-information.service-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' />
+ </set>
+ <for index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-type'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type`' />
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' />
+ </set>
+ <for index='vm-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vm-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`' />
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vnfc-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' />
+ </set>
+ <for index='vnfc-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vnfc-names[$vnfc-name-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-name`' />
+ </set>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='auto-ip-assignment-input.vnf-topology.vnf-assignments.'
+ value='tmp.vnf-topology.vnf-assignments.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='auto-ip-assignment' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure in call to auto-ip-assignment: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload.log' />
+ </execute>
+ <for silentFailure='true' index='plan-index' start='0' end='`$eipam-ip-block.plans_length`' >
+ <for silentFailure='true' index='req-index' start='0' end='`$eipam-ip-block.plans[$plan-index].requests_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='ck-split' />
+ <parameter name='original_string' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].client-key`' />
+ <parameter name='regex' value='\|' />
+ </execute>
+ <set>
+ <parameter name='tmp.vm-type' value='`$ck-split[0]`' />
+ <parameter name='tmp.vnfc-name' value='`$ck-split[1]`' />
+ <parameter name='tmp.network-role' value='`$ck-split[2]`' />
+ <parameter name='tmp.subnet-role' value='`$ck-split[3]`' />
+ <parameter name='tmp.address-family' value='`$ck-split[5]`' />
+ <parameter name='tmp.ip-type' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].ip-type`' />
+ <parameter name='tmp.client-key' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].client-key`' />
+ <parameter name='tmp.ip-prefix' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].ip-prefix`' />
+ </set>
+ <switch test='`$tmp.subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.address-family`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.address-family' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.address-family' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-vm-type' value='false' />
+ </set>
+ <for index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ == $tmp.vm-type`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vm-type' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vm-type`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <block>
+ <block>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ></update>
+ </block>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'EIPAM returned vm-type ' + $tmp.vm-type + ' but could not find that under vf-module-assignments'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.ip-type`'>
+ <outcome value='FIXED'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vnfc-name' value='false' />
+ </set>
+ <for silentFailure='true' index='vnfc-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-name
+ == $tmp.vnfc-name`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vnfc-name' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vnfc-name`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <block>
+ <block>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id" ></update>
+ </block>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'EIPAM returned VNFC name ' + $tmp.vnfc-name + ' but could not find that under vf-module-assignments for vm-type ' + $tmp.vm-type`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-role' value='false' />
+ </set>
+ <for index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length'
+ value='`$network-role-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-subnet-role' value='false' />
+ </set>
+ <for index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role
+ == $tmp.subnet-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-subnet-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-subnet-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-role-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length'
+ value='`$subnet-role-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role
+ == $tmp.address-family`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='address-family-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length'
+ value='`$address-family-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='ip-address-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].ip-type'
+ value='FIXED' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length'
+ value='`$ip-address-length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='VIP'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.network-role' value='`$ck-split[1]`' />
+ <parameter name='tmp.subnet-role' value='`$ck-split[2]`' />
+ <parameter name='tmp.address-family' value='`$ck-split[4]`' />
+ </set>
+ <set>
+ <parameter name='tmp.vm-network-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='vm-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index' value='`$vm-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vm-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$tmp.vm-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.address-family`'>
+ <outcome value='4'>
+ <block>
+ <set>
+ <parameter name='tmp.length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length`' />
+ </set>
+ <switch test='`$tmp.length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$tmp.length]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='`$tmp.length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='6'>
+ <block>
+ <set>
+ <parameter name='tmp.length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length`' />
+ </set>
+ <switch test='`$tmp.length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[$tmp.length]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='`$tmp.length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload2.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vm-network-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='vm-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index' value='`$vm-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vm-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$tmp.vm-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vnfc-subnet-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.ip-version'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.nii-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.nii-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[0].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.nii-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[0].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='nii-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$nii-index].ip-version
+ == $tmp.ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nii-index' value='`$nii-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.nii-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nii-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='`$tmp.nii-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.ip-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.ip-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.ip-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='ip-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <block>
+ <set>
+ <parameter name='target-index' value='`$ip-index + $tmp.ip-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip[$target-index]'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-index].vnfc-ip-address`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length'
+ value='`$tmp.ip-index + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].ip-count'
+ value='`$tmp.ip-index + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload3.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml new file mode 100755 index 0000000..879f000 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml @@ -0,0 +1,559 @@ +<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='vf-module-topology-operation-assign-preload' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vf-module-topology.`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_TO_VFC_MAPPING WHERE vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-to-vfc-mapping[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_TO_VFC_MAPPING table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='db-vm-type-index' value='-1' />
+ </set>
+ <for index='tmp-idx' start='0' end='`$db.vf-module-to-vfc-mapping_length`' >
+ <switch test='`$db.vf-module-to-vfc-mapping[$tmp-idx].vm-type
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='db-vm-type-index' value='`$tmp-idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$db-vm-type-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Preload data contains vm-type ' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type + ' but VF_MODULE_TO_VFC_MAPPING table does not have this vm-type'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_MODEL WHERE customization_uuid = $db.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid'
+ pfx='db.vfc-model'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_MODEL table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No entries found in VFC_MODEL table for customization UUID ' + $db.vf-module-to-vfc-mapping[$db-vm-index].vfc_customization_uuid`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code'
+ value='`$db.vfc-model.nfc-naming-code`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function'
+ value='`$db.vfc-model.nfc-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid'
+ value='`$db.vfc-model.invariant-uuid`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid'
+ value='`$db.vfc-model.uuid`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' />
+ </set>
+ <switch test='`$db.vfc-model.naming-policy`'>
+ <outcome value=''>
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-type-index]`' />
+ </set>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vf-module-customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VNFC name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$naming-policy-generate-name-output.vnfc-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-subnet-role'
+ value='NA' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item_length`' />
+ </set>
+ <for silentFailure='true' index='ip-version-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-dhcp'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ip-count'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].ip-count`' />
+ </set>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip_length`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ips[$ip-index].vnfc-ip-address'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip[$ip-index]`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ips[$ip-index].ip-type'
+ value='FIXED' />
+ </set>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preload-x.log' />
+ </execute>
+ <for silentFailure='true' index='vnf-network-index' start='0'
+ end='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-name' value='false' />
+ </set>
+ <for silentFailure='true' index='ex-vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-name' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-name`'>
+ <outcome value='true'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='cur-vnf-network-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-role'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].neutron-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].neutron-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$cur-vnf-network-index + 1`' />
+ </set>
+ <set>
+ <parameter name='cur-subnet-index' value='0' />
+ </set>
+ <switch test="`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[0].sdnc-subnet-id`">
+ <outcome value=''>
+ <block atomic="true">
+ <for index='ex-subnet-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='subnet-index' start='0'
+ end='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-match' value='false' />
+ </set>
+ <for index='ex-subnet-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].ip-version
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='match' value='true' />
+ </set>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='match' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='match' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$match`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-match`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preloadxxx.log' />
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Could not find subnet match for network-name '
+ + $mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].sdnc-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].ip-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].subnet-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`' />
+ </set>
+ <set>
+ <parameter name='cur-subnet-index' value='`$cur-subnet-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data_length'
+ value='`$cur-subnet-index`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='cur-vnf-network-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='cur-vnf-network-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='cur-vnf-network-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-role'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-name'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-id'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].neutron-id'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].neutron-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$cur-vnf-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preload.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network-id for network with network-role ' + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml new file mode 100644 index 0000000..5260147 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml @@ -0,0 +1,1433 @@ +<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='vf-module-topology-operation-assign-sync' mode='sync'>
+ <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>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></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="If svc-action is 'assign' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </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="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vf-module with vf-module-id=' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' with error: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id == $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VF module id ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id
+ + ' already exists, and status is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-data.vf-module-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-topology-identifier.vf-module-type' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='tmp.vf-module-topology.tenant' value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='tmp.vf-module-topology.aic-cloud-region' value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-clli`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-version'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-name'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.onap-model-information.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-preload" />
+ <outcome value='failure'>
+ <block>
+ <switch test='`$mdsal-preload.response-code`'>
+ <outcome value='404'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving preload-information" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='`$idx`' />
+ </set>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNFC network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role
+ + ' is not found in VNF network list'
+ `" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for index='subnet-role-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='af-count' value='0' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <set>
+ <parameter name='af-count' value='`$af-count + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$af-count`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$subnet-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='-1' />
+ </set>
+ <for index='subnet-data-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`'>
+ <outcome value=''>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have network-start-address populated'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`'>
+ <outcome value=''>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have cidr-mask populated'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='ip-type' value='IPv4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='ip-type' value='IPv6' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="isInSameSubnet">
+ <parameter name="firstIPAddr" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`" />
+ <parameter name="secondIPAddr" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address`" />
+ <parameter name="subnet" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`" />
+ <parameter name="ipType" value="`$ip-type`" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$subnet-id`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Not able to find VNF network subnet that contains address '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address
+ `" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id' value='`$subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodulec.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid
+ and network_role = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VFC_RELATED_NETWORK_ROLE table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for index='db-related-network-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='related-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network[$related-network-index].network-role
+ == $db.vnf-related-network-role[$db-related-network-index].related-network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='true' />
+ </set>
+ <set>
+ <parameter name='saved-vnf-network-index' value='`$vnf-network-index`' />
+ <parameter name='saved-related-network-index' value='`$related-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='false'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find related network '
+ + $db.vnf-related-network-role[$db-related-network-index].related-network-role + ' in vnf-networks'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].is-trunked'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].is-trunked`' />
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].segmentation-id`' />
+ </set>
+ <set>
+ <parameter name='rn-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.vlan-interface`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.lower-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.upper-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.is-private`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $vf-module-topology-operation-input.vf-module-information.vf-module-id
+ + '/vf-module-data/vf-module-topology/'`"/>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vf-module-name" value="`$tmp.vf-module-topology.vf-module-topology-identifier.vf-module-name`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="selflink" value="`$vf-module-object-path`" />
+ <parameter name="automated-assignment" value="`$automated-assignment`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-naming-code' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.nfc-function' value='DEFAULT' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.nfc-function' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.nfc-function`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid`" />
+ <parameter name="model-customization-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag' value='true' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vf-module" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id +
+ '/vf-modules/vf-module/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vnfc relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="cp-instance-id" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id" >
+ <parameter name="cp-instance-id" value="`$cp-instance-id`" />
+ <parameter name="port-id" value="0" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating cp object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating cp object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.connection-point-id'
+ value='`$cp-instance-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].connection-point.port-id'
+ value='0' />
+ </set>
+ <for silentFailure='true' index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv4-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv6-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnf-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating cp relationship to l3-network in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='related-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cp:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND cp.cp-instance-id = $cp-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vlan-tag" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vlan-tags/vlan-tag/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$related-network-index].vlan-tags.vlan-interface`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating cp relationship to l3-network and vlan-tag in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating cp relationship to l3-network and vlan-tag" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module:relationship-list"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network found in AAI for network ID '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" >
+ <parameter name="vip-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]`" />
+ <parameter name="vip-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv4-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv4-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" >
+ <parameter name="vip-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]`" />
+ <parameter name="vip-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv6-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv6-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='vnfc-network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="cp" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ + '/cps/cp/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-role-index].connection-point.connection-point-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationship to cp in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationship to cp" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vlantaggingfailure.log' />
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-generate-heat-parameters' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleheat.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
+ AND vm_name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' >
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </delete>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO VIPR_CONFIGURATION (vnf_id, vnf_name, ecomp_service_instance_id, vm_name, cloud_region_id, cloud_owner) VALUES ( $service-data.vnfs.vnf[$vnf-index].vnf-id , $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name , $service-data.service-information.service-instance-id , $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index] , $tmp.vf-module-topology.aic-cloud-region , $prop.cloud-region.cloud-owner )" >
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.' value='tmp.vf-module-topology.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='gw-vfmodule-update' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodule.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml new file mode 100755 index 0000000..f1f9ca1 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml @@ -0,0 +1,27 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vf-module-topology-operation-assign' mode='sync'>
+ <block>
+ <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>
+ <switch test='`length($vf-module-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='$vf-module-topology-operation-input.sdnc-request-header.svc-notification-url) == $prop.so.ignore-url'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-async.xml new file mode 100644 index 0000000..e0527fb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-async.xml @@ -0,0 +1,28 @@ +<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='vf-module-topology-operation-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml new file mode 100755 index 0000000..93eaf71 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml @@ -0,0 +1,158 @@ +<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='vf-module-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></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="If svc-action is 'changeassign' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vfmodule-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error performing changeassign for self-serve vf-module resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </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="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.onap-model-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.onap-model-information.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-rpc-action'
+ value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.last-action'
+ value='`$vf-module-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml new file mode 100755 index 0000000..788f0a9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml @@ -0,0 +1,177 @@ +<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='vf-module-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVfModuleInstance'>
+ <block></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="If svc-action is 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc in AAI" />
+ </return>
+ </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="`'No vnfc found in AAI for vnfc name ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ </update>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-topology.vf-module-assignments.vf-module-status' value='PendingDelete' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id
+ AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vf-module in AAI" />
+ </return>
+ </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="`'No vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ value='$vf-module-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'
+ value='$vf-module-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'
+ value='$vf-module-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'
+ value='$vf-module-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'
+ value='$vf-module-topology-operation-input.vf-module-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'
+ value='PendingDelete' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml new file mode 100755 index 0000000..4586dad --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml @@ -0,0 +1,386 @@ +<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='vf-module-topology-operation-unassign' mode='sync'>
+ <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>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVfModuleInstance'>
+ <block></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="If svc-action is 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vf-module-index`'>
+ <outcome value='-1'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve vf-moldule esources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vf-module-index + 1`' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <block>
+ <set>
+ <parameter name="tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx].' value='' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx]." value="$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx]." />
+ </set>
+ </block>
+ </for>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='lastidx' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length - 1`' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$lastidx]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length" value="`$lastidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-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 updating EIPAM_IP_ASSIGNMENTS table" />
+ </return>
+ </outcome>
+ </update>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='service-data.service-information.service-type' value='`$service-data.service-information.subscription-service-type`' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in EIPAM unassign IP address" />
+ </return>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from VIPR_CONFIGURATION WHERE vnf_id = $service-data.vnfs.vnf[$vnf-index].vnf-id
+ AND ecomp_service_instance_id = $service-data.service-information.service-instance-id
+ AND vm_name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]' >
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.vf-module-topology-operation-assign:REQID"/>
+ <parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to insert VIPR_CONFIGURATION record"/>
+ </record>
+ </outcome>
+ </delete>
+ </block>
+ </for>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function
+ AND instance-group.instance-group-type = 'L3-NETWORK'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='success'>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $aai.instance-group.instance-group[$ig-index].id`" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status WHERE info = $aai.instance-group.instance-group[$ig-index].id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$aai.instance-group.instance-group[$ig-index].id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <for index='network-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$nig-index].networks.network_length`' >
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].vlan-tag-id'
+ value='' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
+ value='unassigned' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-name`'>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.name-table-type' value='VF_MODULE_INSTANCE' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-name-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-topology-identifier.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vnfc-index]`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"></delete>
+ </block>
+ </for>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" ></delete>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" ></delete>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vf-module-index + 1`' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <block>
+ <set>
+ <parameter name="tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx].' value='' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx]." value="$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx]." />
+ </set>
+ </block>
+ </for>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='lastidx' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length - 1`' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$lastidx]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length" value="`$lastidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation.xml new file mode 100644 index 0000000..fa9cbd9 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-operation.xml @@ -0,0 +1,197 @@ +<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='vf-module-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-vf-module-input' mode='sync' ></call>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block>
+ <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>
+ <switch test='`length($vf-module-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-notification-url == $prop.so.ignore-url`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <set>
+ <parameter name='ack-final' value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="request-action"/>
+ <parameter name="field3" value='`$vf-module-topology-operation-input.request-information.request-action`'/>
+ </record>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSDWANVpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-vpn-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-site-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-device-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANLanPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-lanport-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vf-operation-wanport-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSOTNUniInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-uni-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSOTNL2VpnInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vf-operation-l2vpn-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='SdwanBandwidthChange'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-bandwidth-policy-change' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </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="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml new file mode 100755 index 0000000..42c29a7 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml @@ -0,0 +1,313 @@ +<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='vf-module-topology-vlan-tagging-activate' mode='sync'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $vf-module-topology-operation-input.vnf-information.vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf" />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.aai.vnf.results_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.aai.vnf.results[$result-idx].cloud-region.cloud-region-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-region-id' value='`$tmp.aai.vnf.results[$result-idx].cloud-region.cloud-region-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vlan-vnfc-instance-groups.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.`' />
+ </set>
+ <for index='vvig-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <switch test='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='parent-port-role'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vnic-interface-role`' />
+ <parameter name='vnfc-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function`' />
+ <parameter name='network-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`' />
+ </set>
+ <set>
+ <parameter name='vsig-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' >
+ <switch test='`
+ $parent-port-role == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].parent-port-role
+ and $vnfc-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].vnfc-instance-group-function
+ and $network-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].network-instance-group-function
+`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vsig-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vsig-index`'>
+ <outcome value='-1'>
+ <block>
+ <set>
+ <parameter name='vsig-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role'
+ value='`$parent-port-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfc-instance-group-function'
+ value='`$vnfc-instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].network-instance-group-function'
+ value='`$network-instance-group-function`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length'
+ value='`$vsig-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $prop.cloud-region.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get network data for network role '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get network data for network role '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ </return>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-name' value='`$tmp.aai.network.results[0].l3-network.network-name`' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='dest-vnfc-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`' />
+ </set>
+ <for index='src-vnfc-index' start='0'
+ end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnfc-name'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.interfaces">
+ <parameter name="start[0]" value="`'/network/vnfcs/vnfc/' + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/vserver-l-interfaces-fromVnfc?networkName=' + $network-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get interface data for network name '
+ + $network-name
+ + ' and vnfc '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for silentFailure='true' index='idx1' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vserver-id'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vserver-name'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-name`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic_length'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface_length`' />
+ </set>
+ <for silentFailure='true' index='int-index' start='0'
+ end='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface_length`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].vnic-port-id'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].vnic-port-name'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-name`' />
+ </set>
+ <for silentFailure='true' index='idx2' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx2].l-interface.interface-id
+ == $tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-id`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface_length'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='sub-int-index' start='0'
+ end='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].sub-interface-port-id'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].sub-interface-port-name'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-name`' />
+ </set>
+ <for silentFailure='true' index='idx3' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx3].l-interface.interface-id
+ == $tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-id`'>
+ <outcome value='true'>
+ <switch test='`$tmp.aai.interfaces.results[$idx3].l-interface.vlans.vlan[0].vlan-interface`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='idx4' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-interface
+ == $tmp.aai.interfaces.results[$idx3].l-interface.vlans.vlan[0].vlan-interface`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-outer`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].vlan-tags.upper-tag-id'
+ value='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-outer`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-inner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].vlan-tags.lower-tag-id'
+ value='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-inner`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='dest-vnfc-index' value='`$dest-vnfc-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='`$dest-vnfc-index`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml new file mode 100755 index 0000000..f451812 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml @@ -0,0 +1,791 @@ +<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='vf-module-topology-vlan-tagging-assign' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select distinct vmvm.vm_type, rg.group_uuid from VF_MODULE_TO_VFC_MAPPING vmvm, VFC_MODEL vm,
+ RESOURCE_GROUP_TO_TARGET_NODE_MAPPING rgm, RESOURCE_GROUP rg
+ where vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmvm.vfc_customization_uuid = vm.customization_uuid
+ and vmvm.vm_type = vm.vm_type
+ and vm.uuid = rgm.target_node_uuid
+ and rgm.target_type = 'CVFC'
+ and rgm.group_uuid = rg.group_uuid"
+ pfx='db.group-uuids[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error getting group uuids from DB" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index='group-index' start='0' end='`$db.group-uuids_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_name, attribute_value from ATTRIBUTE_VALUE_PAIR
+ where resource_uuid = $db.group-uuids[$group-index].group-uuid
+ and attribute_name in ('vfc_instance_group_function','vfc_parent_port_role','network_collection_function')"
+ pfx='db.parameters[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error getting parameters from ATTRIBUTE_VALUE_PAIR table" />
+ </return>
+ </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="`'Unable to find parameters ATTRIBUTE_VALUE_PAIR table for group ' + $db.group-uuids[$group-index].group-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for index='parameter-index' start='0' end='`$db.parameters_length`' >
+ <switch test='`$db.parameters[$parameter-index].attribute-name`'>
+ <outcome value='vfc_parent_port_role'>
+ <set>
+ <parameter name='db.group-uuids[$group-index].vfc_parent_port_role' value='`$db.parameters[$parameter-index].attribute-value`' />
+ </set>
+ </outcome>
+ <outcome value='vfc_instance_group_function'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`$db.parameters[$parameter-index].attribute-value`" />
+ <parameter name="target" value="get_input=" />
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' is '
+ + $db.parameters[$parameter-index].attribute-value
+ + ' but was expected to start with get_input='`" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated-value' />
+ <parameter name='string' value='`$db.parameters[$parameter-index].attribute-value`' />
+ <parameter name='begin-index' value='10' />
+ </execute>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_value from VF_MODULE_MODEL vmm, VF_MODEL vf, ATTRIBUTE_VALUE_PAIR avp
+ where vmm.customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmm.vf_customization_uuid = vf.customization_uuid
+ and vf.uuid = avp.resource_uuid
+ and vmm.vf_customization_uuid = avp.resource_customization_uuid
+ and avp.attribute_name = $tmp.truncated-value"
+ pfx='db.mapped-value'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error retrieving mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name`" />
+ </return>
+ </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="`'Unable to find mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' value '
+ + $tmp.truncated-value`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='db.group-uuids[$group-index].vfc-instance-group-function' value='`$db.mapped-value.attribute-value`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='network_collection_function'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`$db.parameters[$parameter-index].attribute-value`" />
+ <parameter name="target" value="get_input=" />
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' is '
+ + $db.parameters[$parameter-index].attribute-value
+ + ' but was expected to start with get_input='`" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated-value' />
+ <parameter name='string' value='`$db.parameters[$parameter-index].attribute-value`' />
+ <parameter name='begin-index' value='10' />
+ </execute>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_value from VF_MODULE_MODEL vmm, VF_MODEL vf, ATTRIBUTE_VALUE_PAIR avp
+ where vmm.customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmm.vf_customization_uuid = vf.customization_uuid
+ and vf.uuid = avp.resource_uuid
+ and vmm.vf_customization_uuid = avp.resource_customization_uuid
+ and avp.attribute_name = $tmp.truncated-value"
+ pfx='db.mapped-value'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error retrieving mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name`" />
+ </return>
+ </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="`'Unable to find mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' value '
+ + $tmp.truncated-value`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='db.group-uuids[$group-index].network-collection-function' value='`$db.mapped-value.attribute-value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $db.group-uuids[$group-index].vfc-instance-group-function
+ AND instance-group.instance-group-type = 'VNFC'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error getting AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='found-instance-group' value='false' />
+ </set>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='aai-ig-index' value='`$ig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$found-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vvig-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <break/>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vvig-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id
+ == $aai.instance-group.instance-group[$aai-ig-index].id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Instance group id '
+ + $aai.instance-group.instance-group[$aai-ig-index].id
+ + ' already exists in MD-SAL under vlan-vnfc-instance-groups'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='vvig-index' value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id'
+ value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function'
+ value='`$db.group-uuids[$group-index].vfc-instance-group-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length'
+ value='`$vvig-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='found-vm-type' value='false' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ == $db.group-uuids[$group-index].vm-type`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vm-type' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vm-type`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'TOSCA provided vm-type ' +
+ $db.group-uuids[$group-index].vm-type + ' but that was not found in vf-module-assignments.vms'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' />
+ </set>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group:relationship-list"
+ key="instance-group.id = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/' +
+ $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error creating instance-group relationship to vnfc" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Not-found error relating instance group '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id
+ + ' to vnfc '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].data-created' value='true' />
+ </set>
+ </block>
+ </for>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select property_name from VF_MODULE_TO_VFC_MAPPING vmvm,
+ RESOURCE_POLICY_TO_TARGET_NODE_MAPPING rptnm, RESOURCE_POLICY rp
+ where vmvm.vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vmvm.vm_type = $db.group-uuids[$group-index].vm-type
+ AND vmvm.vfc_customization_uuid = rptnm.target_node_uuid
+ AND rptnm.policy_uuid = rp.policy_uuid
+ AND rp.property_type = 'vlan_tag_policy'
+ AND rp.policy_type = 'ecomp.policies.External'
+ AND rp.property_source = 'Policy Manager'"
+ pfx='db.policy[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure retrieving policy for vm-type ' + $db.group-uuids[$group-index].vm-type`" />
+ </return>
+ </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="`'Unable to find policy for vm-type ' + $db.group-uuids[$group-index].vm-type`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vnic-interface-role'
+ value='`$db.group-uuids[$group-index].vfc_parent_port_role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-assignment-policy-name'
+ value='`$db.policy[0].property-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function'
+ value='`$db.group-uuids[$group-index].network-collection-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group_length'
+ value='1' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select vnrm.* from VF_MODULE_TO_VFC_MAPPING vmvm, VFC_TO_NETWORK_ROLE_MAPPING vnrm
+ where vmvm.vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vmvm.vm_type = $db.group-uuids[$group-index].vm-type
+ AND vmvm.vfc_customization_uuid = vnrm.vfc_customization_uuid
+ AND vnrm.network_role_tag = $db.group-uuids[$group-index].vfc_parent_port_role"
+ pfx='db.vfc-to-network-role[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure reading VFC_TO_NETWORK_ROLE_MAPPING for parent role ' + $db.group-uuids[$group-index].vfc_parent_port_role`" />
+ </return>
+ </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="`'Unable to find rows in VFC_TO_NETWORK_ROLE_MAPPING for parent role ' + $db.group-uuids[$group-index].vfc_parent_port_role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='vnic-index' start='0' end='`$db.vfc-to-network-role_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id'
+ value='`$vnic-index`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.vlan-vnic_length'
+ value='`$db.vfc-to-network-role_length`' />
+ </set>
+ <set>
+ <parameter name='get-data-from-policy-input.policy-instance-name' value='`$db.policy[0].property-name`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$get-data-from-policy-output.precreate-sub-intf-num > 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='assign-vlan-tags' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <for index='vnfc-index' start='1' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnics-groups.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnics-groups.`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='counter' value='0' />
+ </set>
+ <set>
+ <parameter name='seq-no' value='1' />
+ </set>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vnic-group-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='FIXED' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vt-ip.network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <switch test='`$get-data-from-policy-output.ip-assignment`'>
+ <outcome value='shared'>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.ip-version'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`' />
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.sequence-number'
+ value='`$seq-no`' />
+ </set>
+ <set>
+ <parameter name='counter' value='`$counter + 1`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$eipam-ip-block.plans_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='vnic-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='2' />
+ <parameter name='tmp.index' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip[0]'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-version'
+ value='`$tmp.vt-ip.ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-count'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].use-dhcp'
+ value='N' />
+ </set>
+ <switch test='`$tmp.vt-ip.ip-version`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-common-ip-addresses.ip-addresses.ipv4-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-common-ip-addresses.ip-addresses.ipv6-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='seq-no' value='`$seq-no + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value="`'/var/tmp/bgb-eipam.log' + $counter`" />
+ </execute>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='unique'>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <for index='vnic-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <set>
+ <parameter name='tmp.vt-ip.ip-version'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`' />
+ </set>
+ <for index='sub-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id`' />
+ <parameter name='tmp.vt-ip.sequence-number'
+ value='`$seq-no`' />
+ </set>
+ <set>
+ <parameter name='counter' value='`$counter + 1`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$eipam-ip-block.plans_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='2' />
+ <parameter name='tmp.index' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip[0]'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-version'
+ value='`$tmp.vt-ip.ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-count'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].use-dhcp'
+ value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='seq-no' value='`$seq-no + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'From policy: ip-assignment is '
+ + $get-data-from-policy-output.ip-assignment
+ + ' but must be unique or shared'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vm-vnfc-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-vnfc-index].vnfc-name`'>
+ <outcome value='true'>
+ <for index='vnic-group-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block>
+ <set>
+ <parameter name='vnfc-network-index' value='-1' />
+ </set>
+ <for index='vn-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnfc-network-index' value='`$vn-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnfc-network-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnfc-network for network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-network-role.vnfc-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ </set>
+ <for index='vnic-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <block>
+ <set>
+ <parameter name='vnfc-port-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='v-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$v-index].vnfc-port-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnfc-port-index' value='`$v-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnfc-port-index`'>
+ <outcome value='-1'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnfc-port-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vnfc-port-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnfc-port-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length'
+ value='`$vnfc-port-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml new file mode 100755 index 0000000..b39e116 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml @@ -0,0 +1,88 @@ +<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='vf-module-topology-vlan-tagging-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnfc-instance-groups.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.`' />
+ </set>
+ <for index='vvig-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <for index='vnfc-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vnic-group-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='parent-port-role'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`' />
+ <parameter name='network-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='vnfc-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function`' />
+ </set>
+ <for silentFailure='true' index='vsig-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' >
+ <switch test='`
+ $parent-port-role == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role
+ and $vnfc-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfc-instance-group-function
+ and $network-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].network-instance-group-function
+`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Cannot deactivate module because customer bonding request exists' />
+ </return>
+ </outcome>
+ </switch>
+ <for index='vnf-vnfc-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`' >
+ <switch test='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$vnf-vnfc-index].vnfc-name`'>
+ <outcome value='true'>
+ <block>
+ <for index='$idx' start='`$vnf-vnfc-index`'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length - 1`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx].'
+ value='' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx].'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx + 1].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length - 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length].' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml new file mode 100644 index 0000000..9a7a73b --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml @@ -0,0 +1,289 @@ +<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='vf-module-topology-vlan-tagging-ip-addresses' mode='sync'>
+ <block atomic="true">
+ <switch test='`$tmp.vt-ip.type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='type is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.network-instance-group-function`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='network-instance-group-function is required for FIXED ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.ip-version`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='ip-version is required' />
+ </return>
+ </outcome>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='tmp.address-family' value='4' />
+ <parameter name='tmp.sql.address-family' value='%4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='tmp.address-family' value='6' />
+ <parameter name='tmp.sql.address-family' value='%6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.' value='' />
+ </set>
+ <switch test='`$tmp.vt-ip.type`'>
+ <outcome value='FIXED'>
+ <block atomic='true'>
+ <switch test='`$tmp.vt-ip.vnfc-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnfc-name is required for FIXED ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.vf-module-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vf-module-id is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.sequence-number`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='seq-num is required' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.selected-client-key"
+ value="`$tmp.vt-ip.vm-type + '|' +
+ $tmp.vt-ip.vnfc-name + '|' +
+ $tmp.vt-ip.network-instance-group-function + '|' +
+ $tmp.vt-ip.type + '|' +
+ $tmp.address-family + '|' +
+ $tmp.vt-ip.sequence-number`" />
+ <!--
+fixed-ip client-key:
+vm-type + VFCname + network-instance-group-function + "FIXED" + [ip-version(4/6)] + seqNo
+ seqNo required for unique, but not required for shared
+-->
+ </set>
+ <set>
+ <parameter name="tmp.eipam.info" value="`$tmp.vt-ip.vf-module-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='VIP'>
+ <block atomic='true'>
+ <switch test='`$tmp.vt-ip.nf-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='nf-role is required for VIP ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-instance-group-id == '' `">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='network-isntance-group-id is required for VIP' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.eipam.info" value="`$tmp.vt-ip.network-instance-group-id`"/>
+ </set>
+ <set>
+ <parameter name='tmp.selected-client-key'
+ value="`$tmp.vt-ip.nf-role + '|' +
+ $tmp.vt-ip.network-instance-group-function + '|' +
+ $tmp.vt-ip.type + '|' +
+ $tmp.vt-ip.ip-version`" />
+ <!--
+loating-ip client-key:
+nf-role + network-instance-group-function + "VIP" + [ip-version(4/6)]
+-->
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-id == '' and $tmp.vt-ip.network-instance-group-id == '' `">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='either network-id or network-isntance-group-id is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-id != '' `">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT * from EIPAM_IP_SUBNETS WHERE network_id = ' +
+ '$tmp.vt-ip.network-id AND address_family like $tmp.sql.address-family'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-data[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNETS table' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = "`'No EIPAM_IP_SUBNETS entry found with network-id = ' + $tmp.vt-ip.network-id + ' and address_family = ' + $tmp.address-family`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].network-id"
+ value="`$tmp.vt-ip.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$tmp.vt-ip.network-instance-group-id != '' `">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT * from EIPAM_IP_SUBNETS WHERE network_instance_group_id = '+
+ '$tmp.vt-ip.network-instance-group-id AND address_family like $tmp.sql.address-family'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-data[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNETS table' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = "`'No EIPAM_IP_SUBNETS entry found with network-instance-group-id = ' + $tmp.vt-ip.network-instance-group-id + ' and address_family = ' + $tmp.address-family`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].network-instance-group-id"
+ value="`$tmp.vt-ip.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.level4-key-found' value='false' />
+ </set>
+ <for index='didx' start='0' end='`$db.selected-subnet-data_length`' >
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT a.entity_id, a.key_name, a.key_value, a.level from EIPAM_IP_SUBNET_KEYS a where level = (SELECT MAX(level) from EIPAM_IP_SUBNET_KEYS b where b.entity_id = a.entity_id and entity_id = ' + ' $db.selected-subnet-data[$didx].entity-id )'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-keys'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNET_KEYS table to find MAX level by entity_id' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$db.selected-subnet-keys.level == '4' `">
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.level4-key-found' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.selected-entity-id' value='`$db.selected-subnet-keys.entity-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.selected-plan-name' value='`$db.selected-subnet-data[$didx].plan-name`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </for>
+ <switch test="`$tmp.level4-key-found`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='No level 4 KeyName found in EIPAM_IP_SUBNET_KEYS' />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_SUBNET_KEYS
+ where entity_id = $tmp.selected-entity-id order by level'
+ pfx='db.eipam-subnet-keys[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNET_KEYS table by entity_id' />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='key' start='0' end='`$db.eipam-subnet-keys_length`' >
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools[$key].key-name"
+ value="`$db.eipam-subnet-keys[$key].key-name`"/>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools[$key].key-value"
+ value="`$db.eipam-subnet-keys[$key].key-value`"/>
+ </set>
+ </for>
+ <set>
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='`$tmp.selected-plan-name`' />
+ <parameter name='eipam-ip-block.plans[0].address-family' value="`$tmp.vt-ip.ip-version`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value="`$tmp.selected-client-key`" />
+ <parameter name="eipam-ip-block.plans[0].requests[0].info"
+ value="`$tmp.eipam.info`"/>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools_length" value="4"/>
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ <parameter name="eipam-ip-block.plans_length" value="1"/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/vlan-tag-ip.log' />
+ </execute>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'An error occured while obtaining ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-get-resource-request.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-get-resource-request.xml new file mode 100644 index 0000000..d602cc0 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-get-resource-request.xml @@ -0,0 +1,242 @@ +<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='vnf-get-resource-request' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.service-instance-id" value='`$vnf-get-resource-request-input.service-information.service-instance-id`'/>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.service-instance-name" value='`$service-data.service-topology.service-topology-identifier.service-instance-name`'/>
+ </set>
+ <switch test="`$vnf-get-resource-request-input.vnf_length == ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.vnf_length" value='`$service-data.vnfs.vnf_length`'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf_length == ''`">
+ <outcome value='false'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vnf-id`' value="`$service-data.vnfs.vnf[$i].vnf-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vnf-name`' value="`$service-data.vnfs.vnf[$i].vnf-name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`'/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.status`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.capability-name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.capability-name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='k' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key[$k].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key[$k].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].value`"/>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param_length`' value="`service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key_length`' value="`service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`"/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key[$n].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key[$n].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.vnf_counter" value='0'/>
+ </set>
+ <for index='ll' start='0' end='`$vnf-get-resource-request-input.vnf_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.vnf-id" value="`$vnf-get-resource-request-input.vnf[$ll].vnf-id`"/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf_length == ''`">
+ <outcome value='false'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vnf-id == $service-data.vnfs.vnf[$i].vnf-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vnf-id`' value="`$service-data.vnfs.vnf[$i].vnf-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vnf-name`' value="`$service-data.vnfs.vnf[$i].vnf-name`"/>
+ <parameter name="tmp.pnum" value='0'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.status`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.capability-name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.capability-name`"/>
+ <parameter name='tmp.prnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='k' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key[$tmp.prnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key[$tmp.prnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key_length`' value='`$tmp.prnum + 1`' />
+ <parameter name='tmp.prnum' value='`$tmp.prnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param_length`' value='`$tmp.pnum + 1`' />
+ <parameter name='tmp.pnum' value='`$tmp.pnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='ln' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`' >
+ <switch test="`$vnf-get-resource-request-input.vnf[$ll].vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='jj' start='0' end='`$vnf-get-resource-request-input.vnf[$ll].vf-module_length`' >
+ <switch test='`$vnf-get-resource-request-input.vnf[$ll].vf-module[$jj].vf-module-id == $service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`"/>
+ <parameter name="tmp.vfpnum" value='0'/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='tmp.pvnfrnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key_length`' value='`$tmp.pvnfrnum + 1`' />
+ <parameter name='tmp.pvnfrnum' value='`$tmp.pvnfrnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param_length`' value='`$tmp.vfpnum + 1`' />
+ <parameter name='tmp.vfpnum' value='`$tmp.vfpnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`"/>
+ <parameter name="tmp.vfpnum" value='0'/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='tmp.pvnfrnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key_length`' value='`$tmp.pvnfrnum + 1`' />
+ <parameter name='tmp.pvnfrnum' value='`$tmp.pvnfrnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param_length`' value='`$tmp.vfpnum + 1`' />
+ <parameter name='tmp.vfpnum' value='`$tmp.vfpnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-get-resource-request-output.vnf-get-resource-response-information.vnf_length' value='`$tmp.vnf_counter + 1`' />
+ <parameter name='tmp.vnf_counter' value='`$tmp.vnf_counter + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <return status="success">
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml new file mode 100755 index 0000000..6d5aacd --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml @@ -0,0 +1,84 @@ +<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='vnf-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></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="If svc-action is 'activate' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="prov-status" value="NVTPROV" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </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="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-async.xml new file mode 100644 index 0000000..61b4226 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-async.xml @@ -0,0 +1,1536 @@ +<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='vnf-topology-operation-assign-async' mode='sync'>
+ <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>
+ <set>
+ <parameter name="so.ack-final-indicator" value="Y" />
+ <parameter name="so.response-code" value="500" />
+ <parameter name="so.notification-url" value="`$vnf-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="so.svc-request-id" value="`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="so.service-type" value="`$vnf-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="so.service-instance-id" value="`$vnf-topology-operation-input.service-information.service-instance-id`" />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVnfInstance'" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vnf with vnf-id=' + $vnf-topology-operation-input.vnf-information.vnf-id + ' with error: ' + $error-message`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='0' />
+ </set>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Cannot find instance group id ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in AAI'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving instance-group from AAI" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='rel-index' start='0' end='`$aai.instance-group.relationship-list.relationship_length`' >
+ <switch test='`$aai.instance-group.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='collection'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value"
+ pfx='aai.collection' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find AAI relationship from collection '
+ + $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value
+ + ' to service instance'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to get network service instance '
+ + $network-service-instance + ' from MD-SAL'`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Could not find network instance group ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in MD-SAL service instance '
+ + $network-service-instance`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-function'
+ value='`$aai.instance-group.instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-id'
+ value='`$aai.instance-group.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-service-instance-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].service-instance-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-customization-uuid'
+ value='`$aai.collection.collection-customization-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='`$tmp.vnf-network-collection_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length'
+ value='`$tmp.vnf-network-collection_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.vf-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$db.vf-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='vnf_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='VNF_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`'z' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + $db.vf-model.nf-code`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vf-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to generate VNF name" />
+ </set>
+ <block atomic='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$naming-policy-generate-name-output.vnf-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vnf-name' value="`$vnf-topology-operation-input.vnf-information.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name'
+ value='`$tmp.vnf-name`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vnf-topology-operation-input.vnf-request-input.aic-cloud-region AND
+ depth='all'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_TO_NETWORK_ROLE_MAPPING WHERE vf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-network-role-mapping[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VF_TO_NETWORK_ROLE_MAPPING table" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='0' />
+ </set>
+ <for silentFailure='true' index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'>
+ <switch test='`$db.vf-network-role-mapping[$role-index].network-role`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='null'>
+ <block></block>
+ </outcome>
+ <outcome value='NULL'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='aai.l3-network.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $db.vf-network-role-mapping[$role-index].network-role"
+ pfx='aai.l3-network' local-only='false'
+>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error retrieving l3-network from AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='l3-network-id' value='-1' />
+ </set>
+ <block>
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <for index='db-network-index' start='0' end='`$aai.l3-network.l3-network_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].orchestration-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Create'>
+ <block></block>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Delete'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='db-rel-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <set>
+ <parameter name='network-service-instance-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='cloud-region'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value == $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='l3-network-id' value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$l3-network-id`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-role'
+ value='`$db.vf-network-role-mapping[$role-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].neutron-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].neutron-network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].contrail-network-fqdn'
+ value='`$aai.l3-network.l3-network[$db-network-index].contrail-network-fqdn`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='subnet-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' >
+ <block>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].ip-version`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].ip-version'
+ value='`$tmp.ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].neutron-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].sdnc-subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-role'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].network-start-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].network-start-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].gateway-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].gateway-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].cidr-mask'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].cidr-mask`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].dhcp-enabled`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='Y' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='N' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid
+ and network_role = $db.vf-network-role-mapping[$role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading VNF_RELATED_NETWORK_ROLE table" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-topology-identifier-structure`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$network-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.ntis-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$l3-network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ntis-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ntis" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`
+ 'Error retrieving network-topology-identifier-structure for service instance '
+ + $network-service-instance-id
+ + ' and network-id '
+ + $l3-network-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].is-trunked'
+ value='`$mdsal-ntis.network-topology-identifier-structure.is-trunked`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].segmentation-id'
+ value='`$mdsal-ntis.network-topology-identifier-structure.segmentation-id`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $network-service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error getting owning entity from service instance" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find owning entity from service instance" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='rn-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='rel-network-role-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.get-networks">
+ <parameter name="start[0]" value="`'/business/owning-entities/owning-entity/' + $tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/getNetworks?networkRole=' + $db.vnf-related-network-role[$rel-network-role-index].related-network-role
+ + '&cloudRegionId=' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error calling getNetworks custom query in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No l3-network returned from getNetworks custom query for related network role '
+ + $db.vnf-related-network-role[0].related-network-role`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-id'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-role'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-role`' />
+ </set>
+ <for index='rel-index' start='0' end='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='vlan-tag'>
+ <block atomic="true">
+ <set>
+ <parameter name='vlan-tag-id' value='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $vlan-tag-id"
+ pfx='aai.vlan-tag' local-only='false'
+>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error getting vlan-tag object from AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$aai.vlan-tag.vlan-tag-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$aai.vlan-tag.vlan-id-outer`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$aai.vlan-tag.vlan-id-inner`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$aai.vlan-tag.is-private`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='`$network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnfa.log' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$network-index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <switch test='`$aai.cloud-region.availability-zones.availability-zone_length`'>
+ <outcome value=''>
+ <switch test='`$db.vf-model.avail-zone-max-count > 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No availability zones found in AAI for cloud region '
+ + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='aai.cloud-region.availability-zones.availability-zone_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$aai.cloud-region.availability-zones.availability-zone_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$idx]'
+ value='`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.max-count'
+ value='`$db.vf-model.avail-zone-max-count`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length'
+ value='`$aai.cloud-region.availability-zones.availability-zone_length`' />
+ </set>
+ <for index='vnf-nw-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-nw-index].network-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vnf-name" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <!-- <parameter name="operational-status" value="out-of-service-path" /> -->
+ <parameter name="equipment-role" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`" />
+ <parameter name="model-invariant-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="selflink" value="`$vnf-object-path`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating selflink in generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-information.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/instance-groups/instance-group/'
+ + $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating relationship in generic-vnf in AAI" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-assign`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.service-topology.service-topology-identifier.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vnf.url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <set>
+ <parameter name='vnf-data.' value='service-data.vnfs.vnf[$vnf-index].vnf-data.' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + 'vnf-data-assign.json'`" />
+ <parameter name='restapiUrl' value="`$prop.controller.url + $tmp.vnf.url`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="vnf-assign" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vnf-data" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error doing PUT of vnf-data" />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnf.log' />
+ </execute>
+ <set>
+ <parameter name="so.response-code" value="200" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='send-so-response' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml new file mode 100644 index 0000000..2202dac --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml @@ -0,0 +1,1250 @@ +<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='vnf-topology-operation-assign-sync' mode='sync'>
+ <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>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></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="If svc-action is 'assign' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </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="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create self-serve assignment for vnf with vnf-id=' + $vnf-topology-operation-input.vnf-information.vnf-id + ' with error: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='0' />
+ </set>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find instance group id ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving instance-group from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='rel-index' start='0' end='`$aai.instance-group.relationship-list.relationship_length`' >
+ <switch test='`$aai.instance-group.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='collection'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value"
+ pfx='aai.collection' local-only='false' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find collection ' +
+ $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value
+ + ' in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error retrieving collection from AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Could not find network instance group ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-function'
+ value='`$aai.instance-group.instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-id'
+ value='`$aai.instance-group.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-service-instance-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].service-instance-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-customization-uuid'
+ value='`$aai.collection.collection-customization-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='`$tmp.vnf-network-collection_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length'
+ value='`$tmp.vnf-network-collection_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.vf-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$db.vf-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='vnf_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='VNF_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`'z' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + $db.vf-model.nf-code`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vf-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unable to generate VNF name" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$naming-policy-generate-name-output.vnf-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vnf-name' value="`$vnf-topology-operation-input.vnf-information.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name'
+ value='`$tmp.vnf-name`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $vnf-topology-operation-input.vnf-request-input.aic-cloud-region AND
+ depth='all'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Cloud region not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving cloud region from AAI" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='idx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$idx].related-to`'>
+ <outcome value='complex'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='aai-uid-split' />
+ <parameter name='original_string' value='`$aai.cloud-region.relationship-list.relationship[$idx].related-link`' />
+ <parameter name='regex' value='/' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli'
+ value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli`'>
+ <outcome value=''>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find aic-clli in AAI for aic-cloud-region ' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_TO_NETWORK_ROLE_MAPPING WHERE vf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-network-role-mapping[]'>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='0' />
+ </set>
+ <for silentFailure='true' index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'>
+ <switch test='`$db.vf-network-role-mapping[$role-index].network-role`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='null'>
+ <block></block>
+ </outcome>
+ <outcome value='NULL'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='aai.l3-network.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $db.vf-network-role-mapping[$role-index].network-role"
+ pfx='aai.l3-network' local-only='false'
+>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No active l3-network found in AAI with cloud_region_id '
+ + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + ' and network_role '
+ + $db.vf-network-role-mapping[$network-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving l3-network from AAI" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='l3-network-id' value='-1' />
+ </set>
+ <block>
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <for index='db-network-index' start='0' end='`$aai.l3-network.l3-network_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].orchestration-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Create'>
+ <block></block>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Delete'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='db-rel-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <set>
+ <parameter name='network-service-instance-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='cloud-region'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value == $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='l3-network-id' value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$l3-network-id`'>
+ <outcome value='-1'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-role'
+ value='`$db.vf-network-role-mapping[$role-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].neutron-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].neutron-network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].contrail-network-fqdn'
+ value='`$aai.l3-network.l3-network[$db-network-index].contrail-network-fqdn`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='subnet-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' >
+ <block>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].ip-version`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].ip-version'
+ value='`$tmp.ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].neutron-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].sdnc-subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-role'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].network-start-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].network-start-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].gateway-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].gateway-address`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].cidr-mask'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].cidr-mask`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].dhcp-enabled`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='Y' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='N' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid
+ and network_role = $db.vf-network-role-mapping[$role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VNF_RELATED_NETWORK_ROLE table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-topology-identifier-structure`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$network-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.ntis-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$l3-network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ntis-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ntis" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`
+ 'Error retrieving network-topology-identifier-structure for service instance '
+ + $network-service-instance-id
+ + ' and network-id '
+ + $l3-network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].is-trunked'
+ value='`$mdsal-ntis.network-topology-identifier-structure.is-trunked`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].segmentation-id'
+ value='`$mdsal-ntis.network-topology-identifier-structure.segmentation-id`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $network-service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting owning entity from service instance" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unable to find owning entity from service instance" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='rn-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='rel-network-role-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.get-networks">
+ <parameter name="start[0]" value="`'/business/owning-entities/owning-entity/' + $tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/getNetworks?networkRole=' + $db.vnf-related-network-role[$rel-network-role-index].related-network-role
+ + '&cloudRegionId=' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error calling getNetworks custom query in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network returned from getNetworks custom query for related network role '
+ + $db.vnf-related-network-role[0].related-network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-id'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-role'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-role`' />
+ </set>
+ <for index='rel-index' start='0' end='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='vlan-tag'>
+ <block atomic="true">
+ <set>
+ <parameter name='vlan-tag-id' value='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $vlan-tag-id"
+ pfx='aai.vlan-tag' local-only='false'
+>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error getting vlan-tag object from AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$aai.vlan-tag.vlan-tag-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$aai.vlan-tag.vlan-id-outer`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$aai.vlan-tag.vlan-id-inner`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$aai.vlan-tag.is-private`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='`$network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnfa.log' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$network-index`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <switch test='`$aai.cloud-region.availability-zones.availability-zone_length`'>
+ <outcome value=''>
+ <switch test='`$db.vf-model.avail-zone-max-count > 0`'>
+ <outcome value='true'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No availability zones found in AAI for cloud region '
+ + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='aai.cloud-region.availability-zones.availability-zone_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$aai.cloud-region.availability-zones.availability-zone_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$idx]'
+ value='`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.max-count'
+ value='`$db.vf-model.avail-zone-max-count`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length'
+ value='`$aai.cloud-region.availability-zones.availability-zone_length`' />
+ </set>
+ <for index='vnf-nw-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-nw-index].network-id`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="vnf-name" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <!-- <parameter name="operational-status" value="out-of-service-path" /> -->
+ <parameter name="equipment-role" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`" />
+ <parameter name="model-invariant-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="in-maint" value="true" />
+ <parameter name="selflink" value="`$vnf-object-path`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating selflink in generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-information.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/instance-groups/instance-group/'
+ + $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating relationship in generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnf.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml new file mode 100755 index 0000000..9c6089f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml @@ -0,0 +1,27 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='vnf-topology-operation-assign' mode='sync'>
+ <block>
+ <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>
+ <switch test='`length($vnf-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='$vnf-topology-operation-input.sdnc-request-header.svc-notification-url) == $prop.so.ignore-url'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-async.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-async.xml new file mode 100644 index 0000000..64183eb --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-async.xml @@ -0,0 +1,28 @@ +<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='vnf-topology-operation-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-async' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml new file mode 100755 index 0000000..a45713f --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml @@ -0,0 +1,132 @@ +<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='vnf-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <block></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="If svc-action is 'changeassign' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </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="`'No model found for VNF customization UUID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODEL table" />
+ </return>
+ </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="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-changeassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error performing changeassign for self-serve resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml new file mode 100755 index 0000000..7665486 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml @@ -0,0 +1,84 @@ +<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='vnf-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVnfInstance'>
+ <block></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="If svc-action is 'deactivate' then request-action must be 'DeleteVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </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="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml new file mode 100644 index 0000000..32e922e --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml @@ -0,0 +1,174 @@ +<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='vnf-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVnfInstance'>
+ <block></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="If svc-action is 'deactivate' then request-action must be 'DeleteVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`' >
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`">
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <block></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="Cannot delete the VNF because there are VF modules defined" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ pfx='db.vf-model'>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="Error reading VF_MODEL table"/>
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'No model found for VNF customization UUID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`"/>
+ </record>
+ </outcome>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length - 1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="" />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length - 1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation.xml new file mode 100644 index 0000000..9b8f9a0 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_vnf-topology-operation.xml @@ -0,0 +1,253 @@ +<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='vnf-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-vnf-input' mode='sync' ></call>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block>
+ <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>
+ <switch test='`length($vnf-topology-operation-input.sdnc-request-header.svc-notification-url) == 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-notification-url == $prop.so.ignore-url`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign-sync' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='skip-mdsal-update' value='Y' />
+ </set>
+ <set>
+ <parameter name='ack-final' value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-activate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ActivateSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-activate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ActivateSOTNUnderlayInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-underlay-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-deactivate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-deactivate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateAccessConnectivityInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-vnf-topology-operation-create-huawei' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='CreateInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='CreateSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-create' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='CreateSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-create' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='CreateSOTNUnderlayInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-underlay-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteAccessConnectivityInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-vnf-topology-operation-delete-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='DeleteInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='DeleteSiteInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANDeviceInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-device-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANPortInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-vnf-topology-operation-wanport-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANVpnInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-delete' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='DeleteSDWANSiteInstance'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-vpn-site-resource-delete' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='DeleteSOTNUnderlayInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-underlay-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='ChangeInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml new file mode 100644 index 0000000..b11e740 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml @@ -0,0 +1,777 @@ +<?xml version="1.0" encoding="utf-8"?> + +<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="wan-connection-topology-operation-activate" mode="sync"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </outcome> + <outcome value="false"> + <block atomic="true"> + <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> + <set> + <parameter name="tmp.found-network-input" value="false"/> + </set> + <for index="pidx" start="0" end="`$service-data.networks.network_length`"> + <switch test="`$service-data.networks.network[$pidx].network-data.network-information.onap-model-information.model-name == $network-topology-operation-input.network-information.onap-model-information.model-name`"> + <outcome value="true"> + <set> + <parameter name="tmp.pidx" value="`$pidx`"/> + <parameter name="tmp.network." value="`$service-data.networks.network[$pidx].`"/> + <parameter name="tmp.network-input-parameters" value="`$service-data.networks.network[$pidx].network-data.network-request-input.network-input-parameters`"/> + <parameter name="tmp.found-network-input" value="true"/> + </set> + </outcome> + </switch> + </for> + </block> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="sotn"/> + <outcome value="true"> + <block> + <block atomic="true"> + <set> + <parameter name="sotnFcPortListLength" value="0"/> + </set> + <for index="sIdx" start="0" end="`$service-data.networks.network_length`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$service-data.networks.network[$sIdx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="sotn"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$service-data.networks.network[$sIdx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FcPort"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.sotnFcPortList[`$sotnFcPortListLength`]" value="`$sIdx`"/> + </set> + <for index="paramIdx" start="0" end="`$service-data.networks.network[$sIdx].network-data.network-request-input.network-input-parameters.param_length`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$service-data.networks.network[$sIdx].network-data.network-request-input.network-input-parameters.param[$paramIdx].name`"/> + <parameter name="target" value="address"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="sotnFcPortAddress" value="`$service-data.networks.network[$sIdx].network-data.network-request-input.network-input-parameters.param[$paramIdx].value`"/> + </set> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$prop.oss.url + '/oss/inventory?location=' + $sotnFcPortAddress`"/> + <parameter name="format" value="json"/> + <parameter name="customHttpHeaders" value="X-FromAppId=MSO"/> + <parameter name="httpMethod" value="GET"/> + <parameter name="responsePrefix" value="temp.oss.accessTPs"/> + <outcome value="success"> + <switch test="`$temp.oss.accessTPs_length`"> + <outcome value="Other"> + <block atomic="true"> + <switch test="`$temp.accessTPs_length`"> + <outcome value=""> + <set> + <parameter name="tp_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="tp_length" value="`$temp.accessTPs_length`"/> + </set> + </outcome> + </switch> + <for index="idx" start="0" end="`$temp.oss.accessTPs_length`"> + <set> + <parameter name="`temp.accessTPs[$idx + $tp_length].`" value="`$temp.oss.accessTPs[$idx].`"/> + </set> + </for> + <set> + <parameter name="temp.accessTPs_length" value="`$temp.accessTPs_length + $temp.oss.accessTPs_length`"/> + </set> + </block> + </outcome> + </switch> + </outcome> + </execute> + </block> + </outcome> + </execute> + </for> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + <switch test="`$temp.accessTPs_length >= 2`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="prop.connection-attachment.access-topology-id" value="`$temp.accessTPs[0].access-topology-id`"/> + <parameter name="prop.connection-attachment.access-client-id" value="`$temp.accessTPs[0].access-client-id`"/> + <parameter name="prop.connection-attachment.access-provider-id" value="`$temp.accessTPs[0].access-provider-id`"/> + <parameter name="prop.connection-attachment.access-node-id" value="`$temp.accessTPs[0].access-node-id`"/> + <parameter name="prop.connection-attachment.access-ltp-id" value="`$temp.accessTPs[0].access-ltp-id`"/> + <parameter name="prop.remote.connection-attachment.access-topology-id" value="`$temp.accessTPs[1].access-topology-id`"/> + <parameter name="prop.remote.connection-attachment.access-client-id" value="`$temp.accessTPs[1].access-client-id`"/> + <parameter name="prop.remote.connection-attachment.access-provider-id" value="`$temp.accessTPs[1].access-provider-id`"/> + <parameter name="prop.remote.connection-attachment.access-node-id" value="`$temp.accessTPs[1].access-node-id`"/> + <parameter name="prop.remote.connection-attachment.access-ltp-id" value="`$temp.accessTPs[1].access-ltp-id`"/> + </set> + <for index="paidx" start="0" end="`$tmp.network-input-parameters.param_length`"> + <block> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'name'`"> + <outcome value="true"> + <set> + <parameter name="template.name" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'service-type'`"> + <outcome value="true"> + <set> + <parameter name="template.service-type" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'total-size'`"> + <outcome value="true"> + <set> + <parameter name="template.total-size" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'pir'`"> + <outcome value="true"> + <set> + <parameter name="template.pir" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'cbs'`"> + <outcome value="true"> + <set> + <parameter name="template.cbs" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'pbs'`"> + <outcome value="true"> + <set> + <parameter name="template.pbs" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'couplingFlag'`"> + <outcome value="true"> + <set> + <parameter name="template.couplingFlag" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'colorAware'`"> + <outcome value="true"> + <set> + <parameter name="template.colorAware" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'route-objective-function'`"> + <outcome value="true"> + <set> + <parameter name="template.route-objective-function" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network-input-parameters.param[$paidx].name == 'diversity-policy'`"> + <outcome value="true"> + <set> + <parameter name="template.diversity-policy" value="`$tmp.network-input-parameters.param[$paidx].value`"/> + </set> + </outcome> + </switch> + </block> + </for> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.oof-getpath.templatefile`"/> + <parameter name="restapiUrl" value="`$prop.restapi.connection-oof-url`"/> + <parameter name="restapiUser" value="`$prop.oof.user`"/> + <parameter name="restapiPassword" value="`$prop.oof.password`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="oof"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <parameter name="customHttpHeaders" value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`"/> + <outcome value="failure"></outcome> + <outcome value="success"> + <for index="vidx" start="0" end="`$oof.vpns_length`"> + <block atomic="true"> + <set> + <parameter name="oof.vpn." value="`$oof.vpns[$vidx].`"/> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="pnf" key="pnf.pnf-name = $oof.vpn.access-node-id AND depth = '0'" pfx="tmp.aai.pnf" local-only="false"> + <outcome value="success"> + <set> + <parameter name="tmp.thirdparty-sdnc-id" value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`"/> + </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.connection-attachement.access-node-id`"/> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`"/> + </return> + </outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </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 esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`"/> + </return> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`"/> + </return> + </outcome> + </get-resource> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sotn-api-ConnectivityService.json'`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/operations/ZTE-API-ConnectivityService:create-connectivity-service'`"/> + <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="patch"/> + <parameter name="responsePrefix" value="vpn-result"/> + <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/> + <parameter name="trustStorePassword" value="adminadmin"/> + <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/> + <parameter name="keyStorePassword" value="adminadmin"/> + <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"/> + </outcome> + </execute> + </block> + </for> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <block atomic="true"> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartySdncId'`"> + <outcome value="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = `$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value` AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="true"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + </get-resource> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </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="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.prop.thirdpartySdnc-found == 'true' and $tmp.templateFileName-found == 'true' and `$tmp.prop.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + $tmp.restapiUrl`"/> + <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="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </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="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartySdncId'`"> + <outcome value="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = `$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value` AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="true"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + </get-resource> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </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="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.prop.thirdpartySdnc-found == 'true' and $tmp.templateFileName-found == 'true' and `$tmp.prop.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + $tmp.restapiUrl`"/> + <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="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </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="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FcPort"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="sitewan"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartySdncId'`"> + <outcome value="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = `$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value` AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false"> + <outcome value="success"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="true"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`"/> + <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`"/> + </set> + </outcome> + <outcome value="not-found"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="prop.thirdpartySdnc-found" value="false"/> + </set> + </outcome> + </get-resource> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </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="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.prop.thirdpartySdnc-found == 'true' and $tmp.templateFileName-found == 'true' and `$tmp.prop.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + $tmp.restapiUrl`"/> + <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="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </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="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + <outcome value="false"> + <block> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="false"> + <block> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </block> + </outcome> + </execute> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml new file mode 100644 index 0000000..d3b24d4 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml @@ -0,0 +1,297 @@ +<?xml version="1.0" encoding="utf-8"?> + +<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="wan-connection-topology-operation-create" mode="sync"> + <block atomic="true"> + <switch test="`$network-topology-operation-input.network-information.network-id`"> + <outcome value=""> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="network-topology-operation-input.network-information.network-id"/> + <outcome value="failure"> + <return status="failure"> + <parameter name="error-code" value=""/> + <parameter name="error-message" value="An error occured while generation allotted resource ID"/> + </return> + </outcome> + </execute> + </outcome> + <outcome value="Other"></outcome> + </switch> + <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.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + </set> + </outcome> + </switch> + <set> + <parameter name="service-data.networks.network[$nidx].network-id" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-data.networks.network[$nidx].network-data.sdnc-request-header." value="`$network-topology-operation-input.sdnc-request-header.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.request-information." value="`$network-topology-operation-input.request-information.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.service-information." value="`$network-topology-operation-input.service-information.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.network-information." value="`$network-topology-operation-input.network-information.`"/> + <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value="`$network-topology-operation-input.network-request-input.`"/> + <parameter name="service-data.networks.network_length" value="`$nidx+1`"/> + </set> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + <parameter name="isExist" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <block> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + <parameter name="isExist" value="false"/> + </set> + <for index="idx" start="0" end="`$nidx`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="nidx" value="`$idx`"/> + <parameter name="isExist" value="true"/> + </set> + <switch test="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="param_length" value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="input_param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="input_param_length" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <for index="pidx" start="0" end="`$param_length`"> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx+$input_param_length]." value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].`"/> + </set> + </for> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param_length" value="`$input_param_length + $param_length`"/> + </set> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + <parameter name="isExist" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <block> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + <parameter name="isExist" value="false"/> + </set> + <for index="idx" start="0" end="`$nidx`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="nidx" value="`$idx`"/> + <parameter name="isExist" value="true"/> + </set> + <switch test="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="param_length" value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="input_param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="input_param_length" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <for index="pidx" start="0" end="`$param_length`"> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx+$input_param_length]." value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].`"/> + </set> + </for> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param_length" value="`$input_param_length + $param_length`"/> + </set> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FcPort"/> + <outcome value="true"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0"/> + <parameter name="isExist" value="false"/> + </set> + </outcome> + <outcome value="Other"> + <block> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`"/> + <parameter name="isExist" value="false"/> + </set> + <for index="idx" start="0" end="`$nidx`"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome="true"> + <parameter name="source" value="`$service-data.networks.network[$idx].network-data.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="nidx" value="`$idx`"/> + <parameter name="isExist" value="true"/> + </set> + <switch test="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="param_length" value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"> + <outcome value=""> + <set> + <parameter name="input_param_length" value="0"/> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="input_param_length" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`"/> + </set> + </outcome> + </switch> + <for index="pidx" start="0" end="`$param_length`"> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx+$input_param_length]." value="`$service-data.networks.network[$nidx].network-data.network-request-input.network-input-parameters.param[$pidx].`"/> + </set> + </for> + <set> + <parameter name="network-topology-operation-input.network-request-input.network-input-parameters.param_length" value="`$input_param_length + $param_length`"/> + </set> + </block> + </outcome> + </execute> + </outcome> + </execute> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value="false"> + <block></block> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml new file mode 100644 index 0000000..592fb65 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="utf-8"?> + +<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="wan-connection-topology-operation-deactivate" mode="sync"> + <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.core.slipluginutils.SliStringUtils" method="replace"> + <parameter name="source" value="`$prop.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.services-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$network-topology-operation-input.service-information.service-id`"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$prop.controller.url + $tmp.services-url`"/> + <parameter name="restapiUser" value="`$prop.controller.user`"/> + <parameter name="restapiPassword" value="`$prop.controller.pwd`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="GET"/> + <parameter name="responsePrefix" value="mdsal-psd"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Parent service data not available"/> + </return> + </outcome> + </execute> + <set> + <parameter name="tmp.found-network-input" value="false"/> + </set> + <for index="pidx" start="0" end="`$mdsal-psd.service-data.networks.network_length`"> + <switch test="`$mdsal-psd.service-data.networks.network[$pidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.pidx" value="`$pidx`"/> + <parameter name="tmp.network." value="`$mdsal-psd.service-data.networks.network[$pidx].`"/> + <parameter name="tmp.network-input-parameters" value="`$mdsal-psd.service-data.networks.network[$pidx].network-data.network-request-input.network-input-parameters`"/> + <parameter name="tmp.found-network-input" value="true"/> + </set> + </block> + </outcome> + </switch> + </for> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + <parameter name="tmp.actualId-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl-deactivate'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUser'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUser" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUser-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiPassword'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiPassword" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiPassword-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'actualId'`"> + <outcome value="true"> + <set> + <parameter name="tmp.actualId" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.actualId-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc-deactivate'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </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="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiUser-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUser not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiPassword-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiPassword not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.actualId-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Wan Connection actualId not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$tmp.restapiUrl + $tmp.actualId`"/> + <parameter name="restapiUser" value="`$tmp.restapiUser`"/> + <parameter name="restapiPassword" value="`$tmp.restapiPassword`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="delete"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </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="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml new file mode 100644 index 0000000..9c24e52 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> + +<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="wan-connection-topology-operation-delete" mode="sync"> + <block atomic="true"> + <switch test="`$network-topology-operation-input.network-information.network-id`"> + <outcome value=""> + <return status="failure"> + <parameter name="error-code" value=""/> + <parameter name="error-message" value="An error occured while generation allotted resource ID"/> + </return> + </outcome> + <outcome value="Other"></outcome> + </switch> + <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.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <block atomic="true"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder"> + <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="wan-connection-topology-operation-delete"/> + <parameter name="field3" value="`$network-topology-operation-input.network-information.onap-model-information.model-name + ' delete'`"/> + </record> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivity" key="connectivity.connectivity-id = $network-topology-operation-input.network-information.network-id"></delete> + <set> + <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx]." value=""/> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` "/> + </set> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder"> + <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="wan-connection-topology-operation-delete"/> + <parameter name="field3" value="`$network-topology-operation-input.network-information.onap-model-information.model-name + ' delete'`"/> + </record> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivity" key="connectivity.connectivity-id = $network-topology-operation-input.network-information.network-id"></delete> + <set> + <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx]." value=""/> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` "/> + </set> + </block> + </outcome> + <outcome value="false"> + <block></block> + </outcome> + </execute> + </outcome> + </execute> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml new file mode 100755 index 0000000..1654a83 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml @@ -0,0 +1,138 @@ +<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='SUBNET-API' version='${project.version}'> + <method rpc='managed-network-notification' mode='sync'> + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="managed-network-notification"/> + <parameter name="field3" value="`$managed-network-notification-input.request-id`"/> + <parameter name="field4" value="`$managed-network-notification-input.managed-network-status.status.code`"/> + <parameter name="field5" value="`$managed-network-notification-input.managed-network-status.status.description`"/> + <parameter name="field6" value="`$managed-network-notification-input.managed-network-status.final-notification-indicator`"/> + </record> + <switch test="`$managed-network-notification-input.managed-network-status.status.code`"> + <outcome value="Success"> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet"> + <outcome value="success"> + <block> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * FROM VPE_POOL where vpe_name = $eipam-ip-block.ptnii-name ;" + pfx='tmp.vpe-pool-row'></get-resource> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ACTIVE' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ACTIVE" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="ACTIVE" /> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool-row.vpe-id" pfx="vpe-after"> + <parameter name="orchestration-status" value="Activated" /> + <parameter name="prov-status" value="NVTPROV" /> + </update> + <return status="success"></return> + </block> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ACTIVATE_ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="EIPAM_ACTIVATESUBNET_ERROR" /> + </save> + <return status="failure"> + <parameter name="error-code" value="3000" /> + <parameter name="error-message" value="ActivateSubnet failure, need to manually activate in EIPAM" /> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="Other"> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet"> + <outcome value="success"> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool"> + <outcome value="success"> + <block> + <set> + <parameter name="eipam-ip-block.status" value="DELETED" /> + </set> + <return status="failure"> + <parameter name="error-code" value="2000" /> + <parameter name="error-message" value="Failure from NCS and deleted pool/subnet in EIPAM"/> + </return> + </block> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'DEALLOCATED' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" /> + </save> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." /> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'DEALLOCSUBNET_ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" /> + </save> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." /> + </return> + </block> + </outcome> + </execute> + </outcome> + </switch> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_subnet-allocated-notification.xml b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_subnet-allocated-notification.xml new file mode 100755 index 0000000..c1ed57c --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_subnet-allocated-notification.xml @@ -0,0 +1,626 @@ +<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='SUBNET-API' version='${project.version}'> + <method rpc='subnet-allocated-notification' mode='sync'> + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="subnet-allocated-notification"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <!--Need to know which ipv version to get the plan name from the network-model.--> + <switch test="`$eipam-ip-block.ptnii-name`"> + <!--If there's ptnii-name, then it's Gamma service--> + <outcome value='Other'> + <block> + <configure adaptor="com.att.sdnctl.sli.adaptor.ncs.ncsAdaptor" key="SNIIR" activate="true"> + <parameter name="input.request-id" value="`$eipam-ip-block.request-id`" /> + <parameter name="input.source" value="SDNC" /> + <parameter name="input.ptnii-name" value="`$eipam-ip-block.ptnii-name`" /> + <parameter name="input.ip-address" value="`$eipam-ip-block.ip-address`" /> + <parameter name="input.mask" value="`$eipam-ip-block.prefix-length`" /> + <outcome value="success"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'PENDING-ACTIVE' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" /> + </save> + <return status="success"></return> + </block> + </outcome> + <outcome value="Other"> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool"> + <outcome value="success"> + <block> + <set> + <parameter name="eipam-ip-block.status" value="DELETED" /> + </set> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="IpBlockInstall failure and deletePool deleted in EIPAM" /> + </return> + </block> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET + status = 'ERROR', + dealloc_failure = 'deletePool failed in response to NCS_IP_SUBNET_INSTALL_ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="NCS_IP_SUBNET_INSTALL_ERROR" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool.vpe-id" pfx="vpe-after"> + <parameter name="operational-status" value="NCS_IP_SUBNET_INSTALL_ERROR" /> + <parameter name="summary-status" value="`$aai-summary-status-message`" /> + <parameter name="prov-status" value="PREPROV" /> + </update> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="IpBlockInstall failure and deletePool failed in EIPAM, need to manually delete" /> + </return> + </block> + </outcome> + </execute> + </outcome> + </configure> + </block> + </outcome> + <!--If no ptnii-name, check if VIPR or SRIOV--> + <outcome value=''> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' > + <parameter name="source" value="`toUpperCase($eipam-ip-block.plan-name)`" /> + <parameter name="target" value="AIC_" /> + <outcome value='false'> + <return status="failure"> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Unknown Address Plan - not supported!" /> + </return> + </outcome> + <outcome value='true'> + <block atomic='true'> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $eipam-ip-block.plan-name and level = 2 and key_value = $tmp.level2-key-value ;" + pfx='tmp.eipam-pool-row'> + <outcome value='failure'> + <block atomic='true'> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="subnet-allocated-notification"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="Failed to find this record in DB!"/> + </record> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" /> + </return> + </block> + </outcome> + <outcome value="not-found"> + <block atomic='true'> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="subnet-allocated-notification"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="This record is not found in DB!"/> + </record> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" /> + </return> + </block> + </outcome> + </get-resource> + <!--initial subnet should exists--> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value and s.address_family = $tmp.version ; " + pfx='pfx.eipam-initial-subnet'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Initial subnet not found, cannot auto extend." /> + </return> + </outcome> + </get-resource> + <!--check if new subnet already exists, possibly from previous attempt.--> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * from EIPAM_IP_SUBNETS s WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = $eipam-ip-block.entity-id and s.ip_address = $eipam-ip-block.ip-address ; " + pfx='pfx.eipam-subnet-with-same-ip'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." /> + </return> + </outcome> + <outcome value="not-found"></outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id" + local-only="false" + pfx="aai.l3-network"> + <outcome value='not-found'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'Not found in AnAI'" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'from AnAI'" /> + </return> + </outcome> + </get-resource> + <set> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + </set> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="INSERT EIPAM_IP_SUBNETS + SET + entity_id = $eipam-ip-block.entity-id , + service_type = $pfx.eipam-initial-subnet.service-type , + ip_address = $eipam-ip-block.ip-prefix , + prefix_length = $eipam-ip-block.mask , + plan_name = $eipam-ip-block.plan-name , + status = 'PENDING_ACTIVE' , + pool_id = $pfx.eipam-initial-subnet.pool-id , + address_family = $pfx.eipam-initial-subnet.address-family , + network_id = $pfx.eipam-initial-subnet.network-id ; " + force='true' + pfx='pfx.eipam-new-subnet'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNETS failed." /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="INSERT EIPAM_IP_SUBNET_KEYS + SET + entity_id = $eipam-ip-block.entity-id , + key_name = $tmp.level1-key-name , + key_value = $tmp.level1-key-value , + level = 1 ; " + force='true' + pfx='pfx.eipam-subnet-level1'> + <outcome value='success'></outcome> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." /> + </return> + </outcome> + </save> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="INSERT EIPAM_IP_SUBNET_KEYS + SET + entity_id = $eipam-ip-block.entity-id , + key_name = $tmp.level2-key-name , + key_value = $tmp.level2-key-value , + level = 2 ; " + force='true' + pfx='pfx.eipam-subnet-level2'> + <outcome value='success'></outcome> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." /> + </return> + </outcome> + </save> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="Added an entry for subnet-allocated-notification in EIPAM_IP_SUBNETS and EIPAM_IP_SUBNET_KEYS"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" + local-only="false" + pfx="tmp.aai-initial-subnet"> + <outcome value='not-found'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' is Not found in AnAI'" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' from AnAI'" /> + </return> + </outcome> + </get-resource> + <switch test='`$aai.l3-network.subnets.subnet_length`'> + <outcome value=''> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="'No subnets found in AAI for network-id=' + $pfx.eipam-initial-subnet.network-id" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='tmp.l3-network.subnet.subnet-name' value="`$aai.l3-network.network-name + '_S' + $aai.l3-network.subnets.subnet_length`" /> + </set> + </outcome> + </switch> + <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses"> + <parameter name="ipAddress" value="`$eipam-ip-block.ip-prefix`" /> + <parameter name="ipVersion" value="`tmp.version`" /> + <parameter name="subnet" value="`$eipam-ip-block.prefix-length`" /> + <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" /> + <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" /> + <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Failed to generate gateway addresses using IpAddressTools" /> + </return> + </outcome> + </execute> + <switch test='`$tmp.aai-initial-subnet.dhcp-enabled`'> + <outcome value='Y'> + <block atomic="true"> + <set> + <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='true' /> + <parameter name='tmp.l3-network.subnet.dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' /> + <parameter name='tmp.l3-network.subnet.dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' /> + </set> + </block> + </outcome> + <outcome value='N'> + <block atomic="true"> + <set> + <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='false' /> + <parameter name='tmp.l3-network.subnet.dhcp-start' value='' /> + <parameter name='tmp.l3-network.subnet.dhcp-end' value='' /> + </set> + </block> + </outcome> + </switch> + <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" > + <!-- Create l3-network object --> + <parameter name="network-id" value="`$pfx.eipam-initial-subnet.network-id`" /> + <parameter name="subnet-id" value="`$eipam-ip-block.entity-id`" /> + <parameter name="subnet-name" value="`$tmp.l3-network.subnet.subnet-name`" /> + <parameter name="gateway-address" value="`$tmp.return.generate.gateway-address`" /> + <parameter name="network-start-address" value="`$eipam-ip-block.ip-prefix`" /> + <parameter name="cidr-mask" value="`$eipam-ip-block.prefix-length`" /> + <parameter name="ip-version" value="`$tmp.version`" /> + <parameter name="dhcp-start" value="`$tmp.l3-network.subnet.dhcp-start`" /> + <parameter name="dhcp-end" value="`$tmp.l3-network.subnet.dhcp-end`" /> + <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet.dhcp-enabled`" /> + <parameter name="orchestration-status" value="PendingCreate" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Cannot save subnet with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" /> + </return> + </outcome> + <outcome value='not-found'></outcome> + </save> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="Added a subnetin AAI"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='subnet' /> + <parameter name='api-action' value='add' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' /> + <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' /> + <parameter name='ip-prefix-len' value='`$eipam-ip-block.prefix-length`' /> + <parameter name='dns-server-address' value='0.0.0.0' /> + <parameter name='enable-dhcp' value='`$tmp.l3-network.subnet.dhcp-enabled`' /> + <parameter name='default-gateway' value='`$tmp.return.generate.gateway-address`' /> + <parameter name='subnet-name' value='`$tmp.l3-network.subnet.subnet-name`' /> + <parameter name='start' value='`$tmp.l3-network.subnet.dhcp-start`' /> + <parameter name='end' value='`$tmp.l3-network.subnet.dhcp-end`' /> + <outcome value='success'> + <block></block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + </save> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </save> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to create subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </block> + </outcome> + </execute> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="Added a subnet in Contrail"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" > + <parameter name="orchestration-status" value="Created" /> + <outcome value='not-found'></outcome> + <outcome value='failure'> + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="Update status to Created failed in AAI"/> + <parameter name="field3" value="`$eipam-ip-block.request-id`"/> + <parameter name="field4" value="`$eipam-ip-block.entity-id`"/> + <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/> + <parameter name="field6" value="`$eipam-ip-block.ip-address`"/> + <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/> + <parameter name="field8" value="`$eipam-ip-block.status`"/> + <parameter name="field9" value="`$tmp.key-value`"/> + </record> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." /> + </return> + </outcome> + </save> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete> + <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' > + <parameter name='api-name' value='subnet' /> + <parameter name='api-action' value='delete' /> + <parameter name='resp-prefix' value='contrailResp' /> + <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' /> + <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' /> + <outcome value='failure'> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to delete subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" /> + </return> + </outcome> + </execute> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <return status='failure'> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="'Cannot save subnet status to Created with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" /> + </return> + </block> + </outcome> + </update> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'CREATED' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." /> + </return> + </outcome> + </save> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet"> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while activating subnet in EIPAM." /> + </return> + </outcome> + </execute> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ACTIVE' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'> + <outcome value='failure'> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to active in mysql." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occured while updating subnet to active in mysql." /> + </return> + </outcome> + <outcome value='success'></outcome> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $aai.l3-network.network-id + AND subnet.subnet-id = $eipam-ip-block.entity-id" > + <parameter name="orchestration-status" value="Created" /> + <outcome value='failure'> + <return status="failure"> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." /> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." /> + </return> + </outcome> + </update> + <return status="success"> + <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" /> + </return> + </block> + </outcome> + </execute> + </outcome> + </switch> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/ms/generic-resource-api/src/test/resources/svclogic/graph.versions b/ms/generic-resource-api/src/test/resources/svclogic/graph.versions new file mode 100755 index 0000000..ba54f84 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/graph.versions @@ -0,0 +1,284 @@ +GENERIC-RESOURCE-API aai-get-aic-zone ${project.version} sync +GENERIC-RESOURCE-API aai-get-network-instance-group ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API api-contrail-route-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API assign-vlan-tags ${project.version} sync +GENERIC-RESOURCE-API auto-ip-assignment ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API brg-topology-operation ${project.version} sync +GENERIC-RESOURCE-API connection-attachment-topology-operation ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API contrail-route-topology-operation ${project.version} sync +GENERIC-RESOURCE-API create-l3-subnet ${project.version} sync +GENERIC-RESOURCE-API create-route-target-and-vpn-binding ${project.version} sync +GENERIC-RESOURCE-API dci-connects-network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API dci-connects-network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API eipam-allocate-generic-subnet ${project.version} sync +GENERIC-RESOURCE-API eipam-allocate-network-role-subnet ${project.version} sync +GENERIC-RESOURCE-API eipam-create-generic-pool ${project.version} sync +GENERIC-RESOURCE-API eipam-create-network-role-pool ${project.version} sync +GENERIC-RESOURCE-API generate-allottedresource-id ${project.version} sync +GENERIC-RESOURCE-API generate-FQPN ${project.version} sync +GENERIC-RESOURCE-API generate-host-routes-host-route-id ${project.version} sync +GENERIC-RESOURCE-API generate-l3network-network-id ${project.version} sync +GENERIC-RESOURCE-API generate-panorama-name ${project.version} sync +GENERIC-RESOURCE-API generate-cp-instance-id ${project.version} sync +GENERIC-RESOURCE-API vf-module-generate-heat-parameters ${project.version} sync +GENERIC-RESOURCE-API generate-subnets-subnet-id ${project.version} sync +GENERIC-RESOURCE-API generate-unique-name ${project.version} sync +GENERIC-RESOURCE-API generate-vpn-binding-id ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-activate ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-assign ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-deactivate ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification-unassign ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-notification ${project.version} sync +GENERIC-RESOURCE-API generic-configuration-topology-operation ${project.version} sync +GENERIC-RESOURCE-API get-complex-resource-service-model ${project.version} sync +GENERIC-RESOURCE-API get-data-from-policy ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-composite-match-pair ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-create-composite-path ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-create-simple-path ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-populate-from-grapi ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-populate-from-vnfapi ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-simple-match-pair ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API getpathsegment-topology-operation ${project.version} sync +GENERIC-RESOURCE-API get-tunnelxconn-ar ${project.version} sync +GENERIC-RESOURCE-API get-vnf-api-parent-instance ${project.version} sync +GENERIC-RESOURCE-API gw-vfmodule-update ${project.version} sync +GENERIC-RESOURCE-API manage-ipaddr-assignment ${project.version} sync +GENERIC-RESOURCE-API manage-vni-assignment ${project.version} sync +GENERIC-RESOURCE-API naming-policy-generate-name ${project.version} sync +GENERIC-RESOURCE-API naming-policy-generate-unique-name ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign-automated ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign-from-preload ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign-vlantagging-instancegroup ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API network-topology-operation ${project.version} sync +GENERIC-RESOURCE-API policy-manager-create-policy ${project.version} sync +GENERIC-RESOURCE-API policy-manager-delete-policy ${project.version} sync +GENERIC-RESOURCE-API policy-update-notify-operation ${project.version} sync +GENERIC-RESOURCE-API port-mirror-get-policy ${project.version} sync +GENERIC-RESOURCE-API port-mirror-rollback-capacity-db ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-activate-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-activate-sync ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-assign-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-assign-sync ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-create-vnfcs ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-deactivate-async ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-deactivate-sync ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-disable ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-enable ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-mapping-pprobe ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-mapping-vprobe ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation-validation ${project.version} sync +GENERIC-RESOURCE-API port-mirror-topology-operation ${project.version} sync +GENERIC-RESOURCE-API preload-network-topology-operation ${project.version} sync +GENERIC-RESOURCE-API preload-vf-module-topology-operation ${project.version} sync +GENERIC-RESOURCE-API process-eipam-pools ${project.version} sync +GENERIC-RESOURCE-API process-generic-eipam-pools ${project.version} sync +GENERIC-RESOURCE-API query-aai-l3-network-by-network-role ${project.version} sync +GENERIC-RESOURCE-API rollback-eipam-ip-assignment ${project.version} sync +GENERIC-RESOURCE-API rollback-generated-names ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API security-zone-topology-operation ${project.version} sync +GENERIC-RESOURCE-API self-serve-aai-vf-module-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-aai-vnf-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-aai-pnf-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-capability-param-resolution ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-generate-name ${project.version} sync +GENERIC-RESOURCE-API self-serve-generate-name-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-generate-name-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-generate-name-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-mS-mac-address-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-mS-vlan-tag-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-netbox-ip-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-unresolved-composite-data ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-unassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vfmodule-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vfmodule-ra-assignment ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-forking-logic ${project.version} sync +GENERIC-RESOURCE-API self-serve-vf-module-mdsal-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vfmodule-mapping-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vfmodule-template-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-mdsal-put ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-changeassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-ra-assignment ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-unassign ${project.version} sync +GENERIC-RESOURCE-API self-serve-vnf-forking-logic ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vnf-mapping-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-process-vnf-template-ra-response ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-ra-assignment ${project.version} sync +GENERIC-RESOURCE-API self-serve-pnf-unassign ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API service-topology-operation ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API site-vnf-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-attachment-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-get-saved-ar-param ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-network-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API tunnelxconn-topology-operation ${project.version} sync +GENERIC-RESOURCE-API validate-api-contrail-route-input ${project.version} sync +GENERIC-RESOURCE-API validate-brg-input ${project.version} sync +GENERIC-RESOURCE-API validate-connection-attachment-input ${project.version} sync +GENERIC-RESOURCE-API validate-contrail-route-input ${project.version} sync +GENERIC-RESOURCE-API validate-generic-configuration-input ${project.version} sync +GENERIC-RESOURCE-API validate-getpathsegment-input ${project.version} sync +GENERIC-RESOURCE-API validate-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API validate-network-input ${project.version} sync +GENERIC-RESOURCE-API validate-overlay-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API validate-security-zone-input ${project.version} sync +GENERIC-RESOURCE-API validate-service-input ${project.version} sync +GENERIC-RESOURCE-API validate-sotn-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API validate-tunnelxconn-input ${project.version} sync +GENERIC-RESOURCE-API validate-vf-module-input ${project.version} sync +GENERIC-RESOURCE-API validate-vnf-input ${project.version} sync +GENERIC-RESOURCE-API validate-pnf-input ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-assign-rollback ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-no-preload ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-preload ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-async ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-assign-sync ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation-async ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-operation ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-activate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-assign ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-deactivate ${project.version} sync +GENERIC-RESOURCE-API vf-module-topology-vlan-tagging-ip-addresses ${project.version} sync +GENERIC-RESOURCE-API vnf-get-resource-request ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-async ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-assign-async ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-assign-sync ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-changeassign ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API vnf-topology-operation ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-assign ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation-unassign ${project.version} sync +GENERIC-RESOURCE-API pnf-topology-operation ${project.version} sync +SUBNET-API managed-network-notification ${project.version} sync +SUBNET-API subnet-allocated-notification ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-network-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API validate-sdwan-network-input-parameters ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-tenant-auth ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-attachment-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-device-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-saved-ar-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-wan-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-device-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vnf-topology-operation-wanport-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-wanport-vnf-topology-operation-underlay ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-create ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-activate ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-deactivate ${project.version} sync +GENERIC-RESOURCE-API wan-connection-topology-operation-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-device-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-vf-module-device-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-site-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-vf-module-site-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-wanport-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-wan-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-vpn-delete ${project.version} sync +GENERIC-RESOURCE-API validate-sdwan-vf-vpn-input-parameters ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-create ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-activate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-deactivate ${project.version} sync +GENERIC-RESOURCE-API sdwan-vf-operation-lanport-delete ${project.version} sync +GENERIC-RESOURCE-API sdwan-get-vf-module-lanport-param ${project.version} sync +GENERIC-RESOURCE-API sdwan-bandwidth-policy-change ${project.version} sync +GENERIC-RESOURCE-API send-so-response ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-create ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-l2vpn-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-create ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-vf-operation-uni-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-activate ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-create ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-deactivate ${project.version} sync +GENERIC-RESOURCE-API sotn-vnf-topology-operation-underlay-delete ${project.version} sync +GENERIC-RESOURCE-API sotn-get-vf-module-uni-param ${project.version} sync + |