summaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml
diff options
context:
space:
mode:
authorCheung, Pat (kc1472) <kc1472@att.com>2019-02-28 16:14:59 +0000
committerCheung, Pat (kc1472) <kc1472@att.com>2019-02-28 16:14:59 +0000
commit648e7e06e153fb793928e8f6cd6a73751963a47c (patch)
tree9da749cf9e115b9a2bc750f2e2024e1edc0dbf61 /platform-logic/generic-resource-api/src/main/xml
parent8dbbd82465ea1b409dfcd164ef79401f4b3b24ca (diff)
DG bugfix
fix vnf and vf-module unassign to clear MD-SAL Change-Id: If4b9797fa3f206f299bc37fcfb1d68d7bd59241f Issue-ID: SDNC-676 Signed-off-by: Cheung, Pat (kc1472) <kc1472@att.com> Former-commit-id: f491b4ef34c30f811e6a082c27fa1cb8c210acf3
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml212
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml186
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml513
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml227
4 files changed, 596 insertions, 542 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml
index 28735a9b..68df95e3 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml
@@ -4,12 +4,12 @@
<method rpc='self-serve-vf-module-unassign' mode='sync'>
<block atomic='true'>
<set>
- <parameter name='ss.capability.execution-order[0]' value='mac-address-assign' />
- <parameter name='ss.capability.execution-order[1]' value='mS-mac-address-assign' />
- <parameter name='ss.capability.execution-order[2]' value='eipam-ip-assign' />
- <parameter name='ss.capability.execution-order[3]' value='netbox-ip-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[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' />
@@ -18,6 +18,14 @@
<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]`' />
@@ -37,138 +45,112 @@ ss.capability.execution-order
</set>
<switch test='`$ss.capability-name == $tmp.param.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[$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'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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'
+ <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'
+ <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'
+ <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'
+ <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'
+ <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>
- </call>
- </outcome>
- <outcome value='DELETED'>
- <block></block>
- </outcome>
- <outcome value='Other'>
- <block atomic='true'>
+ </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>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value="`'Failed to unassign self-serve vf-module assignments because the status for ' + $ss.capability-name + ' is ' + $service-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`"/>
- </return>
- </block>
- </outcome>
- </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
</outcome>
</switch>
</for>
</for>
- <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`' >
- <set>
- <parameter name="tmpidx" value="`$idx - 1`"/>
- <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>
- </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>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
<parameter name='filename' value='/var/tmp/ss-vf-unassign.log' />
</execute>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml
index dd5bc409..d69f4758 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml
@@ -4,12 +4,12 @@
<method rpc='self-serve-vnf-unassign' mode='sync'>
<block atomic='true'>
<set>
- <parameter name='ss.capability.execution-order[0]' value='mac-address-assign' />
- <parameter name='ss.capability.execution-order[1]' value='mS-mac-address-assign' />
- <parameter name='ss.capability.execution-order[2]' value='eipam-ip-assign' />
- <parameter name='ss.capability.execution-order[3]' value='netbox-ip-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[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' />
@@ -18,6 +18,14 @@
<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]`' />
@@ -37,118 +45,96 @@ ss.capability.execution-order[]
</set>
<switch test='`$ss.capability-name == $tmp.param.capability-name`'>
<outcome value='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'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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>
- </call>
- </outcome>
- <outcome value='DELETED'>
- <block></block>
- </outcome>
- <outcome value='Other'>
- <block atomic='true'>
+ </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>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value="`'Failed to unassign self-serve vnf assignments because the status for ' + $ss.capability-name + ' is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
- </return>
- </block>
- </outcome>
- </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
</outcome>
</switch>
</for>
</for>
- <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`' >
- <set>
- <parameter name="$tmpidx" value="`$idx - 1`"/>
- <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
- </set>
- </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>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
<parameter name='filename' value='/var/tmp/ss-vnf-assign.log' />
</execute>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml
index 28669172..4586dad8 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml
@@ -34,10 +34,9 @@
</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 status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
</return>
</outcome>
<outcome value='Other'>
@@ -57,292 +56,328 @@
</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 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>
- <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>
+ <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='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 status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
</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-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'>
- <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'>
+ <outcome value='Other'>
<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>
+ <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>
- </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`' >
+ <outcome value='false'>
<block atomic="true">
- <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ <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 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>
- </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"
+ <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
+ <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
+ <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'>
+ <outcome value='true'>
<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"
+ <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
+ <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'
+ <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'
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
value='unassigned' />
- </set>
+ </set>
+ </for>
+ </outcome>
+ </switch>
</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>
+ </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></block>
+ </outcome>
+ <outcome value=''>
+ <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='`$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' />
+ <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-name' mode='sync' ></call>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-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'>
+ <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>
- <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"
+ <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"
+ </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"
+ </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>
- <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`' >
- <set>
- <parameter name="tmpidx" value="`$idx - 1`"/>
- <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>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </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>
+ <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>
- <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>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml
index 725e64f4..32e922e2 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml
@@ -17,106 +17,157 @@
</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 status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
</return>
</outcome>
- </switch>
- <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 VFs 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'></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>
+ <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">
- <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
- <set>
- <parameter name="$tmpidx" value="`$idx - 1`"/>
- <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
- </set>
- </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>
+ <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>
- <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'>
- <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>