diff options
author | Cheung, Pat <kc1472@att.com> | 2018-09-13 15:49:17 +0000 |
---|---|---|
committer | Dan Timoney <dt5972@att.com> | 2018-09-13 17:51:40 +0000 |
commit | 384c95d22e3f9a1546af27847bb954ec0c4650a2 (patch) | |
tree | b096239ac495a9ea0b226fc42d7fd288367ba434 /platform-logic/generic-resource-api/src/main/xml | |
parent | 1eaad00a71b1ca82e7dce54e4d81d81c747243b4 (diff) |
CallNodeExecutor patch
Merging an old change that prevents a nullpointerexception when calledgraph is null
Change-Id: I38580a9f2044e20cc322ad8a8170a06ce69ffd0f
Issue-ID: CCSDK-185
Signed-off-by: Cheung, Pat <kc1472@att.com>
Former-commit-id: 03d97536c815e9f48bd2771383c61fcdb9c68b7c
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
8 files changed, 0 insertions, 2742 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml deleted file mode 100644 index 0ca7cde5..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml +++ /dev/null @@ -1,171 +0,0 @@ -<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-vfmodule-put' mode='sync'>
- <block atomic='true'>
- <switch test='`$vnf-index`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='vnf-index is required' />
- </return>
- </outcome>
- <outcome value='Other'>
- <block>
- <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
- <outcome value='vnf-id'>
- <block>
- <set>
- <parameter name='vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
- </set>
- </block>
- </outcome>
- <outcome value='ipv4-loopback0-address'>
- <block>
- <set>
- <parameter name='ipv4-loopback0-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
- </set>
- </block>
- </outcome>
- <outcome value='as-number'>
- <block>
- <set>
- <parameter name='as-number' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
- </set>
- </block>
- </outcome>
- <outcome value='vlan-id-outer'>
- <block>
- <set>
- <parameter name='vlan-id-outer' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <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`" >
- <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-parameters.param[$j].name`'>
- <outcome value='vf-module-id'>
- <set>
- <parameter name='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[$j].value`' />
- </set>
- </outcome>
- <outcome value='vf-module-name'>
- <set>
- <parameter name='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[$j].value`' />
- </set>
- </outcome>
- <outcome value='volume-group-id'>
- <set>
- <parameter name='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[$j].value`' />
- </set>
- </outcome>
- <outcome value='volume-group-name'>
- <set>
- <parameter name='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[$j].value`' />
- </set>
- </outcome>
- <outcome value='cloud-region'>
- <set>
- <parameter name='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[$j].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- <block>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="generic-vnf"
- key="generic-vnf.vnf-id = $vnf-id "
- pfx="tmp.AnAI-data.vnf" >
- <parameter name="ipv4-loopback0-address" value='`$ipv4-loopback0-address`' />
- <parameter name="ipv4-oam-address" value='`$ipv4-oam-address`' />
- <parameter name="as-number" value='`$as-number`' />
- <parameter name="vlan-id-outer" value='`$vlan-id-outer`' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error for PUT in AAI for generic-vnf." />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error for PUT in AAI for generic-vnf." />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='success'>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="vf-module"
- key="vf-module.vf-module-id = $vf-module-id "
- pfx="tmp.AnAI-data.vfmodule" >
- <parameter name="vf-module-name" value='`$vf-module-name`' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error for PUT in AAI for vf-module" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error for PUT in AAI for vf-module" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='success'>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="volume-group"
- key="volume-group-id = $volume-group-id and
- cloud-region.cloud-owner = $prop.cloud-region.cloud-owner and
- cloud-region.cloud-region-id = $cloud-region "
- pfx="tmp.AnAI-data.vnf" >
- <parameter name="volume-group-name" value='`$volume-group-name`' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error Saving in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error Saving in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='success'>
- <return status='success'></return>
- </outcome>
- </update>
- </outcome>
- </update>
- </outcome>
- </update>
- </block>
- </block>
- </method>
-</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml deleted file mode 100644 index c26b6664..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml +++ /dev/null @@ -1,653 +0,0 @@ -<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-alts-assignment' mode='sync'>
- <block>
- <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
- <switch test='`$ss.capability-name`'>
- <outcome value='alts-license-assign'>
- <switch test='`$ss.capability-action`'>
- <outcome value='assign'>
- <block atomic='true'>
- <switch test='`$vnf-index`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='vnf-index is required' />
- </return>
- </outcome>
- <outcome value='Other'>
- <block>
- <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
- <outcome value='alts-license-assign'>
- <block>
- <set>
- <parameter name='license-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <block>
- <set>
- <parameter name='entitlement-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
- <outcome value='license-key'>
- <block>
- <set>
- <parameter name='license-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- <outcome value='entitlement-key'>
- <block>
- <set>
- <parameter name='entitlement-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <switch test='`$ss.capability-name`'>
- <outcome value='alts-license-assign'>
- <set>
- <parameter name='param-index' value='`$license-param-index`' />
- </set>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <set>
- <parameter name='param-index' value='`$entitlement-param-index`' />
- </set>
- </outcome>
- </switch>
- <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
- <outcome value='vnf-id'>
- <set>
- <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='vnf_name'>
- <set>
- <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='license-assignment-group-uuid'>
- <set>
- <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='entitlement-assignment-group-uuid'>
- <set>
- <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="acquireLicense" >
- <parameter name="error-prefix" value="alts.error" />
- <parameter name="prefix" value="alts.resp" />
- <parameter name="assignment-group" value="`$alts.license-assignment-group-uuid`" />
- <parameter name="hostname" value="`$alts.vnf-name`" />
- <parameter name="vnf-id" value="`$alts.vnf-id`" />
- <outcome value='success'>
- <block>
- <set>
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$license-key-index].value' value='`$alts.resp.license-key`' />
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='SUCCESS' />
- </set>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="license"
- key="generic-vnf.vnf-id = $alts.vnf-id
- AND license.group-uuid = $alts.license-assignment-group-uuid
- AND license.resource-uuid = $alts.resp.license-key"
- pfx="tmp.AnAI.license" >
- <parameter name="group-uuid" value='`$alts.license-assignment-group-uuid`' />
- <parameter name="resource-uuid" value='`$alts.resp.license-key`' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error Saving in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error Saving in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- </save>
- </block>
- </outcome>
- <outcome value="failure">
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
- </set>
- </block>
- </outcome>
- <outcome value="not-found">
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
- </set>
- </block>
- </outcome>
- <outcome value="unsupported-method">
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
- </set>
- </block>
- </outcome>
- </execute>
- </block>
- </outcome>
- <outcome value='unassign'>
- <block atomic='true'>
- <switch test='`$vnf-index`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='vnf-index is required' />
- </return>
- </outcome>
- <outcome value='Other'>
- <block>
- <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
- <outcome value='alts-license-assign'>
- <block>
- <set>
- <parameter name='license-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <block>
- <set>
- <parameter name='entitlement-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
- <outcome value='license-key'>
- <block>
- <set>
- <parameter name='license-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- <outcome value='entitlement-key'>
- <block>
- <set>
- <parameter name='entitlement-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <switch test='`$ss.capability-name`'>
- <outcome value='alts-license-assign'>
- <set>
- <parameter name='param-index' value='`$license-param-index`' />
- </set>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <set>
- <parameter name='param-index' value='`$entitlement-param-index`' />
- </set>
- </outcome>
- </switch>
- <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
- <outcome value='vnf-id'>
- <set>
- <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='vnf_name'>
- <set>
- <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='license-assignment-group-uuid'>
- <set>
- <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='entitlement-assignment-group-uuid'>
- <set>
- <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="releaseLicense" >
- <parameter name="asset-uuid" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$license-key-index].value`" />
- <parameter name="error-prefix" value="alts.error" />
- <parameter name="prefix" value="alts.resp" />
- <parameter name="assignment-group" value="`$alts.license-assignment-group-uuid`" />
- <parameter name="hostname" value="`$alts.vnf-name`" />
- <parameter name="vnf-id" value="`$alts.vnf-id`" />
- <outcome value='success'>
- <block>
- <set>
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='DELETED' />
- </set>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
-resource="license"
-key="generic-vnf.vnf-id = $alts.vnf-id "
-force="true"
-local-only="false"
-pfx="tmp.AnAI-data.vnf" >
- <parameter name="group-uuid" value='' />
- <parameter name="resource-uuid" value='' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error updating in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error updating in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- </update>
- </block>
- </outcome>
- <outcome value="failure">
- <block>
- <return status='failure'>
- <parameter name='error-code' value='`$alts.error.error-code`' />
- <parameter name='error-message' value='`$alts.error.error-message`' />
- </return>
- </block>
- </outcome>
- <outcome value="not-found">
- <block>
- <return status='failure'>
- <parameter name='error-code' value='`$alts.error.error-code`' />
- <parameter name='error-message' value='`$alts.error.error-message`' />
- </return>
- </block>
- </outcome>
- <outcome value="unsupported-method">
- <block>
- <return status='failure'>
- <parameter name='error-code' value='`$alts.error.error-code`' />
- <parameter name='error-message' value='`$alts.error.error-message`' />
- </return>
- </block>
- </outcome>
- </execute>
- </block>
- </outcome>
- </switch>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <switch test='`$ss.capability-action`'>
- <outcome value='assign'>
- <block atomic='true'>
- <switch test='`$vnf-index`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='vnf-index is required' />
- </return>
- </outcome>
- <outcome value='Other'>
- <block>
- <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
- <outcome value='alts-license-assign'>
- <block>
- <set>
- <parameter name='license-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <block>
- <set>
- <parameter name='entitlement-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
- <outcome value='license-key'>
- <block>
- <set>
- <parameter name='license-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- <outcome value='entitlement-key'>
- <block>
- <set>
- <parameter name='entitlement-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <switch test='`$ss.capability-name`'>
- <outcome value='alts-license-assign'>
- <set>
- <parameter name='param-index' value='`$license-param-index`' />
- </set>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <set>
- <parameter name='param-index' value='`$entitlement-param-index`' />
- </set>
- </outcome>
- </switch>
- <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
- <outcome value='vnf-id'>
- <set>
- <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='vnf_name'>
- <set>
- <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='license-assignment-group-uuid'>
- <set>
- <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='entitlement-assignment-group-uuid'>
- <set>
- <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="acquireEntitlement" >
- <parameter name="error-prefix" value="alts.error" />
- <parameter name="prefix" value="alts.resp" />
- <parameter name="assignment-group" value="`$alts.entitlement-assignment-group-uuid`" />
- <parameter name="hostname" value="`$alts.vnf-name`" />
- <parameter name="vnf-id" value="`$alts.vnf-id`" />
- <outcome value='success'>
- <block>
- <set>
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$entitlement-key-index].value' value='`$alts.resp.license-key`' />
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='SUCCESS' />
- </set>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="entitlement"
- key="generic-vnf.vnf-id = $alts.vnf-id
- AND entitlement.group-uuid = $alts.entitlement-assignment-group-uuid
- AND entitlement.resource-uuid = $alts.resp.license-key "
- pfx="tmp.AnAI.entitlement" >
- <parameter name="group-uuid" value='`$alts.entitlement-assignment-group-uuid`' />
- <parameter name="resource-uuid" value='`$alts.resp.license-key`' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error Saving in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error Saving in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- </save>
- </block>
- </outcome>
- <outcome value="failure">
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
- </set>
- </block>
- </outcome>
- <outcome value="not-found">
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
- </set>
- </block>
- </outcome>
- <outcome value="unsupported-method">
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
- </set>
- </block>
- </outcome>
- </execute>
- </block>
- </outcome>
- <outcome value='unassign'>
- <block atomic='true'>
- <switch test='`$vnf-index`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='vnf-index is required' />
- </return>
- </outcome>
- <outcome value='Other'>
- <block>
- <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
- <outcome value='alts-license-assign'>
- <block>
- <set>
- <parameter name='license-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <block>
- <set>
- <parameter name='entitlement-param-index' value='`$i`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
- <outcome value='license-key'>
- <block>
- <set>
- <parameter name='license-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- <outcome value='entitlement-key'>
- <block>
- <set>
- <parameter name='entitlement-key-index' value='`$k`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <switch test='`$ss.capability-name`'>
- <outcome value='alts-license-assign'>
- <set>
- <parameter name='param-index' value='`$license-param-index`' />
- </set>
- </outcome>
- <outcome value='alts-entitlement-assign'>
- <set>
- <parameter name='param-index' value='`$entitlement-param-index`' />
- </set>
- </outcome>
- </switch>
- <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
- <block>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
- <outcome value='vnf-id'>
- <set>
- <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='vnf_name'>
- <set>
- <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='license-assignment-group-uuid'>
- <set>
- <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- <outcome value='entitlement-assignment-group-uuid'>
- <set>
- <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="releaseEntitlement" >
- <parameter name="asset-uuid" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$entitlement-key-index].value`" />
- <parameter name="error-prefix" value="alts.error" />
- <parameter name="prefix" value="alts.resp" />
- <parameter name="assignment-group" value="`$alts.entitlement-assignment-group-uuid`" />
- <parameter name="hostname" value="`$alts.vnf-name`" />
- <parameter name="vnf-id" value="`$alts.vnf-id`" />
- <outcome value='success'>
- <block>
- <set>
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='DELETED' />
- </set>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
-resource="license"
-key="generic-vnf.vnf-id = $alts.vnf-id "
-force="true"
-local-only="false"
-pfx="tmp.AnAI-data.vnf" >
- <parameter name="group-uuid" value='' />
- <parameter name="resource-uuid" value='' />
- <outcome value='failure'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error updating in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- <outcome value='not-found'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log" />
- <parameter name="level" value="error" />
- <parameter name="field1" value="Error updating in AAI" />
- <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
- <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
- </record>
- </outcome>
- </update>
- </block>
- </outcome>
- <outcome value="failure">
- <block>
- <return status='failure'>
- <parameter name='error-code' value='`$alts.error.error-code`' />
- <parameter name='error-message' value='`$alts.error.error-message`' />
- </return>
- </block>
- </outcome>
- <outcome value="not-found">
- <block>
- <return status='failure'>
- <parameter name='error-code' value='`$alts.error.error-code`' />
- <parameter name='error-message' value='`$alts.error.error-message`' />
- </return>
- </block>
- </outcome>
- <outcome value="unsupported-method">
- <block>
- <return status='failure'>
- <parameter name='error-code' value='`$alts.error.error-code`' />
- <parameter name='error-message' value='`$alts.error.error-message`' />
- </return>
- </block>
- </outcome>
- </execute>
- </block>
- </outcome>
- </switch>
- </outcome>
- </switch>
- </block>
- </method>
-</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml deleted file mode 100755 index 800ded3f..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml +++ /dev/null @@ -1,486 +0,0 @@ -<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-create-vpe-pool' mode='sync'>
- <block atomic='true'>
- <switch test="`$ss.capability-name`">
- <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-create-vpe-pool: ss.capability-name 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'></outcome>
- <outcome value='create-vpe-pool'>
- <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-create-vpe-pool: ss.capability-name is create-vpe-pool"/>
- </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-create-vpe-pool: 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-create-vpe-pool: 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-create-vpe-pool: 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-create-vpe-pool: call self-service-capability-param-resolution DG"/>
- </record>
- <set>
- <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
- </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-create-vpe-pool: Failure calling self-service-capability-param-resolution"/>
- </record>
- <return status='failure'>
- <parameter name='error-code' value='402' />
- <parameter name='error-message' value='Failure calling self-service-capability-param-resolution' />
- </return>
- </block>
- </outcome>
- <outcome value='success'></outcome>
- </call>
- </block>
- <block atomic='true'>
- <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-create-vpe-pool: 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`' />
- </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-create-vpe-pool: Found ss.capability-name MATCH"/>
- </record>
- <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>
- <break/>
- </block>
- </outcome>
- <outcome value='false'></outcome>
- </switch>
- </block>
- </for>
- </block>
- <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-create-vpe-pool: 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 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-create-vpe-pool: key-index"/>
- <parameter name="field3" value='`$key-index`'/>
- </record>
- <block>
- <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name == 'vpe_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-create-vpe-pool: Found resource-resolution-data.name = vpe_name"/>
- </record>
- <set>
- <parameter name='tmp.vpe_name' 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-mac-address-assign: resolved vpe_name: "/>
- <parameter name="field3" value='`$tmp.vpe_name`'/>
- </record>
- <break/>
- </block>
- </outcome>
- <outcome value='false'></outcome>
- </switch>
- </block>
- </for>
- <switch test="`$tmp.vpe_name`">
- <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-mac-address-assign: hostname 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='vpe_name is not valid' />
- </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-mac-address-assign: hostname 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='vpe_name is not valid' />
- </return>
- </block>
- </outcome>
- </switch>
- </block>
- <block atomic='true'>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="select * FROM VPE_POOL WHERE vpe_name= $tmp.vpe_name" pfx='tmp.vpe_pool_data'>
- <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-mac-address-assign: Unable to access VPE_POOL"/>
- </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='405' />
- <parameter name='error-message' value='Unable to access VPE_POOL' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <switch test="`$tmp.vpe_pool_data.vpe-name`">
- <outcome value=''>
- <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-mac-address-assign: data not found in VPE_POOL for vpe_name: "/>
- <parameter name="field3" value='`$tmp.vpe_name`'/>
- </record>
- </outcome>
- <outcome value='null'>
- <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-mac-address-assign: data not found in VPE_POOL for vpe_name: "/>
- <parameter name="field3" value='`$tmp.vpe_name`'/>
- </record>
- </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="self-serve-mac-address-assign: data already found in VPE_POOL for vpe_name: "/>
- <parameter name="field3" value='`$tmp.vpe_name`'/>
- </record>
- <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-mac-address-assign: Unable to create vpe-pool, data already exists in VPE_POOL for vpe_name"/>
- </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='405' />
- <parameter name='error-message' value='Unable to create vpe-pool, data already exists in VPE_POOL for vpe_name' />
- </return>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- <switch test='`$ss.capability-action`'>
- <outcome value='ASSIGN'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.resource-key-length' value='`$tmp.resource-resolution-data.resource-key_length`' />
- <!-- String to build VPE_POOL table SQL insert statement -->
- <parameter name='tmp.resource-insert-columns' value='' />
- <parameter name='tmp.resource-insert-values' value='' />
- <!-- These are the resources to insert into VPE_POOL -->
- <parameter name='tmp.resource-names-length' value='19' />
- <parameter name='tmp.resource-names[0]' value='vpe_name' />
- <parameter name='tmp.resource-names[1]' value='ipv4_oam_address' />
- <parameter name='tmp.resource-names[2]' value='loopback0' />
- <parameter name='tmp.resource-names[3]' value='provisioning_status' />
- <parameter name='tmp.resource-names[4]' value='aic_site_id' />
- <parameter name='tmp.resource-names[5]' value='avaiablity_zone' />
- <parameter name='tmp.resource-names[6]' value='vlan_id_outer' />
- <parameter name='tmp.resource-names[7]' value='vendor' />
- <parameter name='tmp.resource-names[8]' value='physical_intf_name' />
- <parameter name='tmp.resource-names[9]' value='phyiscal_intf_speed' />
- <parameter name='tmp.resource-names[10]' value='phyiscal_intf_units' />
- <parameter name='tmp.resource-names[11]' value='vpe_uuid' />
- <parameter name='tmp.resource-names[12]' value='vpe_id' />
- <parameter name='tmp.resource-names[13]' value='image_filename' />
- <parameter name='tmp.resource-names[14]' value='as_number' />
- <parameter name='tmp.resource-names[15]' value='loopback5000' />
- <parameter name='tmp.resource-names[16]' value='loopback10' />
- <parameter name='tmp.resource-names[17]' value='aic_version' />
- <parameter name='tmp.resource-names[18]' value='vpe_capacity' />
- </set>
- <for index='names-index' start='0' end='`$tmp.resource-names-length`' >
- <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-create-vpe-pool: key-index, resource-key.name, resource-names"/>
- <parameter name="field3" value='`$key-index`'/>
- <parameter name="field4" value='`$tmp.resource-resolution-data.resource-key[$key-index].name`'/>
- <parameter name="field5" value='`$tmp.resource-names[$names-index]`'/>
- </record>
- <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name == $tmp.resource-names[$names-index]`">
- <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-create-vpe-pool: resource-name MATCH: "/>
- <parameter name="field3" value='`$tmp.resource-names[$names-index]`'/>
- <parameter name="field4" value='`$tmp.resource-resolution-data.resource-key[$key-index].value`'/>
- </record>
- <switch test="`$tmp.insert-columns`">
- <outcome value=''>
- <set>
- <parameter name='tmp.insert-columns' value="`$tmp.resource-resolution-data.resource-key[$key-index].name`" />
- <parameter name='tmp.insert-values' value="$tmp.resource-resolution-data.resource-key[$key-index].value`" />
- </set>
- </outcome>
- <outcome value='Other'>
- <set>
- <parameter name='tmp.insert-columns' value="`$tmp.insert-columns + ', ' + $tmp.resource-resolution-data.resource-key[$key-index].name`" />
- <parameter name='tmp.insert-values' value="`$tmp.insert-values + ', ' + $tmp.resource-resolution-data.resource-key[$key-index].value`" />
- </set>
- </outcome>
- </switch>
- <set>
- <parameter name="`'tmp.forInsert.' + $tmp.resource-resolution-data.resource-key[$key-index].name`" value="`$tmp.resource-resolution-data.resource-key[$key-index].value`" />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </for>
- </for>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
-resource="SQL"
-key="INSERT INTO VPE_POOL ( vpe_name, ipv4_oam_address, loopback0_ipv4_address, provisioning_status, aic_site_id, availability_zone, vlan_id_outer, vendor, physical_intf_name, physical_intf_speed, physical_intf_units, vpe_uuid, vpe_id, image_filename, as_number, loopback5000, loopback10, aic_version, vpe_capacity )
-VALUES ( $tmp.forInsert.vpe_name , $tmp.forInsert.ipv4_oam_address , $tmp.forInsert.loopback0_ipv4_address , $tmp.forInsert.provisioning_status , $tmp.forInsert.aic_site_id , $tmp.forInsert.availability_zone , $tmp.forInsert.vlan_id_outer , $tmp.forInsert.vendor , $tmp.forInsert.physical_intf_name , $tmp.forInsert.physical_intf_speed , $tmp.forInsert.physical_intf_units , $tmp.forInsert.vpe_uuid , $tmp.forInsert.vpe_id , $tmp.forInsert.image_filename , $tmp.forInsert.as_number , $tmp.forInsert.loopback5000 , $tmp.forInsert.loopback10 , $tmp.forInsert.aic_version , $tmp.forInsert.vpe_capacity )"
-force='true' pfx='save_val'>
- <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-mac-address-assign: Unable to create VPE Pool in VPE_POOL"/>
- </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='406' />
- <parameter name='error-message' value='Unable to create VPE Pool in VPE_POOL' />
- </return>
- </block>
- </outcome>
- </save>
- </block>
- </outcome>
- <outcome value='UNASSIGN'>
- <block atomic="true">
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="select * FROM VPE_POOL WHERE vpe_name= $tmp.vpe_name" pfx='tmp.pool'>
- <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-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <switch test="`$tmp.pool.vpe-name`">
- <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-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
- </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-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
- </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-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
- </return>
- </block>
- </outcome>
- <outcome value='Other'>
- <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key='DELETE from VPE_POOL WHERE vpe_name = $tmp.vpe_name'>
- <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-mac-address-assign: Failure deleting from VPE_POOL on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='Failure deleting from VPE_POOL on UNASSIGN operation' />
- </return>
- </block>
- </outcome>
- <outcome value='success'>
- <block>
- <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_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-parameters-index].resource-resolution-data.status`" value="DELETED" />
- </set>
- </for>
- </block>
- </outcome>
- </delete>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
- <parameter name='filename' value='/var/tmp/self-serve-create-vpe-pool.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/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml deleted file mode 100644 index 15648b48..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml +++ /dev/null @@ -1,157 +0,0 @@ -<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-eipam-create-pool' mode='sync'>
- <block atomic="true">
- <set>
- <parameter name='vnf-index' value='0' />
- <parameter name='vf-module-index' value='0' />
- <parameter name='ss.capability-name' value='self-serve-eipam-create-pool' />
- <parameter name='ss.capability-action' value='assign' />
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources'
- value='true' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param_length' value = '1' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].name' value = 'ipv4-wan-address-pool' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].value' value = '${ipv4-wan-address-pool}' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.capability-name' value = 'eipam-create-pool' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].name' value = 'group-flag' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].value' value = 'Y' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].name' value = 'plan-name' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].value' value = 'GMIS_V4_VPE_WAN' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[2].name' value = 'service-instance-id' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[2].value' value = '12345' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[3].name' value = 'region' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[3].value' value = 'mtn6' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[4].name' value = 'address-family' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[4].value' value = 'ipv4' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[5].name' value = 'equipment' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[5].value' value = 'VPE' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[6].name' value = 'mask' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[6].value' value = '32' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[7].name' value = 'allocateSubnetFlag' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[7].value' value = 'N' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[8].name' value = 'service-instance-id' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[8].value' value = '111222' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key_length' value = '9' />
- <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.status' value = 'PENDING' />
- </set>
- <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='Other'>
- <return status="failure">
- <parameter name="ack-final" value="Y" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="`'Invalid capability-action: '+ ss.capability-action + 'only assign is supported'`" />
- </return>
- </outcome>
- <outcome value='assign'>
- <block atomic="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>
- <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
- <outcome value='true'>
- <break/>
- </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>
- <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='group-flag'>
- <set>
- <parameter name='tmp.ss.group-flag' 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='allocateSubnetFlag'>
- <set>
- <parameter name='tmp.ss.allocateSubnetFlag' 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='plan-name'>
- <set>
- <parameter name='tmp.ss.plan-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='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='address-family'>
- <set>
- <parameter name='tmp.ss.address-family' 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='mask'>
- <set>
- <parameter name='tmp.ss.mask' 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>
- </block>
- <set>
- <parameter name='aai.cloud-region.cloud-region-id'
- 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`' />
- </set>
- <set>
- <parameter name='tmp.skip-first-level' value='Y' />
- <parameter name='tmp.allocate-subnet-flag' value='`$tmp.ss.allocateSubnetFlag`' />
- <parameter name='eipam-ip-block.group-flag' value='`$tmp.ss.group-flag`' />
- </set>
- <switch test='`$tmp.ss.address-family`'>
- <outcome value='ipv4'>
- <set>
- <parameter name='network-model.eipam-v4-address-plan' value='tmp.ss.plan-name' />
- <parameter name='network-model.use-ipv4' value='Y' />
- <parameter name='network-model.ipv4-ip-version' value='tmp.ss.address-family' />
- <parameter name='network-model.ipv4-cidr-mask' value='tmp.ss.mask' />
- </set>
- </outcome>
- <outcome value='ipv6'>
- <set>
- <parameter name='network-model.eipam-v6-address-plan' value='tmp.ss.plan-name' />
- <parameter name='network-model.use-ipv6' value='Y' />
- <parameter name='network-model.ipv6-ip-version' value='tmp.ss.address-family' />
- <parameter name='network-model.ipv6-cidr-mask' value='tmp.ss.mask' />
- </set>
- </outcome>
- </switch>
- <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>
- </block>
- </outcome>
- </switch>
- </block>
- </method>
-</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml deleted file mode 100644 index 7b813073..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml +++ /dev/null @@ -1,269 +0,0 @@ -<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-eipam-ip-assignment' 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-service-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>
- <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>
- <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
- <outcome value='true'>
- <break/>
- </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>
- <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='group-flag'>
- <set>
- <parameter name='tmp.ss.group-flag' 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='plan-name'>
- <set>
- <parameter name='tmp.ss.plan-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='address-family'>
- <set>
- <parameter name='tmp.ss.address-family' 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='client-key'>
- <set>
- <parameter name='tmp.ss.client-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>
- </block>
- <call module='GENERIC-RESOURCE-API' rpc='self-serve-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="`'Not all assignments are resolved' + $error-message`" />
- </return>
- </outcome>
- </call>
- <set>
- <parameter name='eipam-ip-block.plans[0].requests[0].'
- value='self-serve-generate-FQPN-output.' />
- </set>
- <set>
- <parameter name='eipam-ip-block.group-flag'
- value='`$tmp.ss.group-flag`' />
- <parameter name='eipam-ip-block.plans[0].plan-name'
- value='`$tmp.ss.plan-name`' />
- <parameter name='eipam-ip-block.plans[0].address-family'
- value="`$tmp.ss.address-family`" />
- <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
- value="`$tmp.ss.client-key`" />
- </set>
- <set>
- <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
- </set>
- <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
- <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="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>
- <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`">
- <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='vmxvre_oam_ip_0'>
- <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[$pidx].value'
- value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
- </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>
- <outcome value='vmxvre_oam_ip_prefix_0'>
- <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[$pidx].value'
- value='`$eipam-ip-block.plans[0].requests[0].ip-prefix-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-parameters.param[$pidx].resource-resolution-data.status'
- value='SUCCESS' />
- </set>
- </block>
- </outcome>
- <outcome value='vmxvre_oam_gateway'>
- <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[$pidx].value'
- value='`$eipam-ip-block.plans[0].requests[0].ReservedAssignments[0].ReservedAssignment[3].ReservedKeyIPAddress`' />
- </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>
- </switch>
- </for>
- </block>
- </outcome>
- <outcome value='unassign'>
- <block atomic="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>
- <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
- <outcome value='true'>
- <break/>
- </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>
- <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='group-flag'>
- <set>
- <parameter name='tmp.ss.group-flag' 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='plan-name'>
- <set>
- <parameter name='tmp.ss.plan-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='address-family'>
- <set>
- <parameter name='tmp.ss.address-family' 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='client-key'>
- <set>
- <parameter name='tmp.ss.client-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>
- </block>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from EIPAM_IP_ASSIGNMENTS
- WHERE service_instance_id = $tmp.ss.service-instance-id
- AND client_key = $tmp.ss.client-key'>
- <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 EIPAM_IP_ASSIGNMENTS set status = $tmp.status
- WHERE service_instance_id = $tmp.ss.service-instance-id
- AND client_key = $tmp.ss.client-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 updating EIPAM_IP_ASSIGNMENTS table to unassign ip with client_key=' + $tmp.ss.client-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" />
- </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 EIPAMPlugin.unassignIPAddress with client-key='+ $tmp.ss.client-key`" />
- </return>
- </outcome>
- </execute>
- </block>
- </outcome>
- </get-resource>
- <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`">
- <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='vmxvre_oam_ip_0'>
- <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>
- <outcome value='vmxvre_oam_ip_prefix_0'>
- <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>
- <outcome value='vmxvre_oam_gateway'>
- <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>
- </switch>
- </for>
- </block>
- </outcome>
- </switch>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
- <parameter name='filename' value='/var/tmp/ss.eipam.log' />
- </execute>
- </block>
- </method>
-</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml deleted file mode 100644 index 1c4903ee..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml +++ /dev/null @@ -1,129 +0,0 @@ -<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-FQPN' mode='sync'>
- <block atomic="true">
- <set>
- <parameter name='eipam-ip-block.plan-name' value='`$tmp.ss.plan-name`' />
- </set>
- <set>
- <parameter name='self-serve-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>
- <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.getPlanTopologyResponse.key-name'
- value='`$eipam-ip-block.getPlanTopologyResponse.topologyDetails[$resp-index].keyName`' />
- </set>
- <set>
- <parameter name='tmp.getPlanTopologyResponse.key-value-format'
- value='`$eipam-ip-block.getPlanTopologyResponse.topologyDetails[$resp-index].keyValueFormat`' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-value-format`" />
- <parameter name="regex" value=":" />
- <parameter name="ctx_memory_result_key" value="tmp.split.key-value-format" />
- </execute>
- <set>
- <parameter name='tmp.final.key-value' value="" />
- </set>
- <for index="split-index" start="0" end="`$tmp.split.key-value-format_length`">
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.split.key-value-format[$split-index]`" />
- <parameter name="target" value="${"/>
- <parameter name="replacement" value=""/>
- <parameter name="outputPath" value="tmp.split-value"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.split-value`" />
- <parameter name="target" value="}"/>
- <parameter name="replacement" value=""/>
- <parameter name="outputPath" value="tmp.ss.split-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: tmp.ss.split-value: ' + $tmp.ss.split-value`"/>
- </record>
- <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>
- <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
- <outcome value='true'>
- <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[$ss.param-index].resource-resolution-data.resource-key_length`">
- <set>
- <parameter name='tmp.ss.resource-key.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].name`' />
- </set>
- <switch test='`$tmp.ss.split-value == $tmp.ss.resource-key.name`'>
- <outcome value='true'>
- <set>
- <parameter name='tmp.ss.partial.key-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>
- </switch>
- </for>
- </outcome>
- </switch>
- </for>
- <switch test='`$split-index == 0`'>
- <outcome value='true'>
- <set>
- <parameter name='tmp.ss.final.key-value' value="`$tmp.ss.partial.key-value`" />
- </set>
- </outcome>
- <outcome value='false'>
- <set>
- <parameter name='tmp.ss.final.key-value'
- value="`$tmp.ss.final.key-value + ':' + $tmp.ss.partial.key-value`" />
- </set>
- </outcome>
- </switch>
- </for>
- <set>
- <parameter name='self-serve-generate-FQPN-output.pools[$pool-index].key-name'
- value='`$tmp.getPlanTopologyResponse.key-name`' />
- <parameter name='self-serve-generate-FQPN-output.pools[$pool-index].key-value'
- value='`$tmp.ss.final.key-value`' />
- </set>
- </for>
- <set>
- <parameter name='self-serve-generate-FQPN-output.pools_length'
- value='`$eipam-ip-block.getPlanTopologyResponse.topologyDetails_length`' />
- </set>
- </block>
- </method>
-</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml deleted file mode 100755 index 0d56b233..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml +++ /dev/null @@ -1,615 +0,0 @@ -<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-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-mac-address-assign: ss.capability-name 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-mac-address-assign: ss.capability-name 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-mac-address-assign: ss.capability-name 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='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-mac-address-assign: ss.capability-name is 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-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-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-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-mac-address-assign: call self-service-capability-param-resolution DG"/>
- </record>
- <set>
- <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
- </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-mac-address-assign: Failure calling self-service-capability-param-resolution"/>
- </record>
- <return status='failure'>
- <parameter name='error-code' value='402' />
- <parameter name='error-message' value='Failure calling self-service-capability-param-resolution' />
- </return>
- </block>
- </outcome>
- <outcome value='success'></outcome>
- </call>
- </block>
- <block atomic='true'>
- <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-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`' />
- </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-mac-address-assign: Found ss.capability-name MATCH"/>
- </record>
- <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>
- <break/>
- </block>
- </outcome>
- <outcome value='false'></outcome>
- </switch>
- </block>
- </for>
- </block>
- <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-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 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-mac-address-assign: key-index"/>
- <parameter name="field3" value='`$key-index`'/>
- </record>
- <block>
- <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name == 'vnf-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-mac-address-assign: Found resource-resolution-data.name = vnf-name"/>
- </record>
- <set>
- <parameter name='tmp.hostname' 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-mac-address-assign: resolved hostname: "/>
- <parameter name="field3" value='`$tmp.hostname`'/>
- </record>
- </block>
- </outcome>
- <outcome value='false'></outcome>
- </switch>
- </block>
- </for>
- <switch test="`$tmp.hostname`">
- <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-mac-address-assign: hostname 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='hostname 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-mac-address-assign: hostname 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='hostname is not set' />
- </return>
- </block>
- </outcome>
- </switch>
- </block>
- <switch test='`$ss.capability-action`'>
- <outcome value='ASSIGN'>
- <block atomic="true">
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="select * FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING WHERE HOSTNAME= $tmp.hostname" pfx='tmp.map'>
- <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-mac-address-assign: Unable to access VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING"/>
- </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='405' />
- <parameter name='error-message' value='Unable to access VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <switch test="`$tmp.map.hostname`">
- <outcome value='failure'>
- <block>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="SELECT MIN(pool.id) as pool_id, pool.mac_address FROM VPE_MAC_ADDRESS_POOL pool WHERE NOT EXISTS(SELECT ID FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map where pool.ID = map.ID)" pfx='tmp.availid'>
- <!--
-tmp.availid.mac_address is the mac_address we need to have finally.
--->
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
-resource="SQL"
-key="INSERT INTO VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( id , hostname , assigned_user, assigned_date ) VALUES ( $tmp.availid.pool-id , $tmp.hostname , 'SDNC' , NOW())"
-force='true' pfx='save_val'>
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </save>
- <set>
- <parameter name="tmp.mac-address.mac-address" value="`$tmp.availid.mac-address`" />
- </set>
- </block>
- </outcome>
- <outcome value=''>
- <block>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="SELECT MIN(pool.id) as pool_id, pool.mac_address FROM VPE_MAC_ADDRESS_POOL pool WHERE NOT EXISTS(SELECT ID FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map where pool.ID = map.ID)" pfx='tmp.availid'>
- <!--
-tmp.availid.mac_address is the mac_address we need to have finally.
--->
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
-resource="SQL"
-key="INSERT INTO VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( id , hostname , assigned_user, assigned_date ) VALUES ( $tmp.availid.pool-id , $tmp.hostname , 'SDNC' , NOW())"
-force='true' pfx='save_val'>
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </save>
- <set>
- <parameter name="tmp.mac-address.mac-address" value="`$tmp.availid.mac-address`" />
- </set>
- </block>
- </outcome>
- <outcome value='null'>
- <block>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="SELECT MIN(pool.id) as pool_id, pool.mac_address FROM VPE_MAC_ADDRESS_POOL pool WHERE NOT EXISTS(SELECT ID FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map where pool.ID = map.ID)" pfx='tmp.availid'>
- <!--
-tmp.availid.mac_address is the mac_address we need to have finally.
--->
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
-resource="SQL"
-key="INSERT INTO VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( id , hostname , assigned_user, assigned_date ) VALUES ( $tmp.availid.pool-id , $tmp.hostname , 'SDNC' , NOW())"
-force='true' pfx='save_val'>
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </save>
- <set>
- <parameter name="tmp.mac-address.mac-address" value="`$tmp.availid.mac-address`" />
- </set>
- </block>
- </outcome>
- <outcome value='Other'>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="SELECT pool.mac_address FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map, VPE_MAC_ADDRESS_POOL pool WHERE pool.ID = map.ID AND map.HOSTNAME = $tmp.hostname" pfx="tmp.mac-address">
- <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-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='406' />
- <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
- </return>
- </block>
- </outcome>
- </get-resource>
- </outcome>
- </switch>
- <switch test="`$tmp.mac-address.mac-address`">
- <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-mac-address-assign: tmp.mac_address 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='405' />
- <parameter name='error-message' value='tmp.mac_address 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-mac-address-assign: tmp.mac_address 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='405' />
- <parameter name='error-message' value='tmp.mac_address not set' />
- </return>
- </block>
- </outcome>
- <outcome value='Other'>
- <block>
- <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-mac-address-assign: vf-module-param-index"/>
- <parameter name="field3" value='`$vf-module-param-index`'/>
- </record>
- <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-parameters.param[$vf-module-param-index].name`">
- <outcome value='vmxvpfe_sriov41_0_port_mac'>
- <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.mac-address`" />
- </set>
- </outcome>
- <outcome value='vmxvpfe_sriov41_1_port_mac'>
- <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.mac-address`" />
- </set>
- </outcome>
- <outcome value='vmxvpfe_sriov41_3_port_mac'>
- <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.mac-address`" />
- </set>
- </outcome>
- <outcome value='vmxvpfe_sriov41_4_port_mac'>
- <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.mac-address`" />
- </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[$vf-module-parameters-index].resource-resolution-data.status`" value='SUCCESS' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='UNASSIGN'>
- <block atomic="true">
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key="select * FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING WHERE HOSTNAME= $tmp.hostname" pfx='tmp.map'>
- <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-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
- </return>
- </block>
- </outcome>
- </get-resource>
- <switch test="`$tmp.map.hostname`">
- <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-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
- </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-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
- </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-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
- </return>
- </block>
- </outcome>
- <outcome value='Other'>
- <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key='DELETE from VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING WHERE hostname = $tmp.hostname'>
- <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-mac-address-assign: Failure deleting from VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
- </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='405' />
- <parameter name='error-message' value='Failure deleting from VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
- </return>
- </block>
- </outcome>
- <outcome value='success'>
- <block>
- <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_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-parameters-index].resource-resolution-data.status`" value="DELETED" />
- </set>
- </for>
- </block>
- </outcome>
- </delete>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
- <parameter name='filename' value='/var/tmp/self-serv-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/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml deleted file mode 100755 index db5066db..00000000 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml +++ /dev/null @@ -1,262 +0,0 @@ -<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-vlan-tag-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' /> - <outcome value='success'> - <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"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: read properties file." /> - </record> - </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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: failed to read properties file." /> - <parameter name="field4" value="generic-resource-api-dg.properties"/> - </record> - <return status='failure'> - <parameter name='error-code' value='500' /> - <parameter name='error-message' value='self-serve-vlan-tag-assign: could not read generic-resource-api properties' /> - </return> - </block> - </outcome> - </execute> - <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call> - <for index='capIdx' 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.param[$capIdx].resource-resolution-data.capability-name == $ss.capability-name`"> - <outcome value='true'> - <switch test="`$ss.capability-action`"> - <outcome value='assign'> - <block atomic='true'> - <set> - <parameter name='sscap.res-target-type' value='`$prop.restapi.ss.capreserve.targettype`' /> - </set> - <for index='rkIdx' 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[$capIdx].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[$capIdx].resource-resolution-data.resource-key[$rkIdx].name`"> - <outcome value='vlan-recipe'> - <set> - <parameter name='sscap.res-service-model' 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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </outcome> - <outcome value='vnf-name'> - <set> - <parameter name='sscap.res-entity-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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </outcome> - <outcome value='nf-role'> - <set> - <parameter name='sscap.res-entity-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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </outcome> - <outcome value='aic-site-id'> - <set> - <parameter name='sscap.res-target-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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </outcome> - <outcome value='vlan-tag-type'> - <set> - <parameter name='sscap.res-endpoint-position' 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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: reserve params"/> - <parameter name="field4" value='`$sscap.res-service-model`'/> - <parameter name="field5" value='`$sscap.res-entity-type`'/> - <parameter name="field6" value='`$sscap.res-entity-id`'/> - <parameter name="field7" value='`$sscap.res-target-type.`' /> - <parameter name="field8" value='`$sscap.res-target-id`'/> - <parameter name="field9" value='`$sscap.res.endpoint-position`' /> - </record> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.capreserve.templatefile`" /> - <parameter name='restapiUser' value='`$prop.controller.user`' /> - <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> - <parameter name='format' value='json' /> - <parameter name='httpMethod' value='post' /> - <parameter name='responsePrefix' value='tmp.sscapres-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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: restapi reserve execution failed"/> - </record> - <set> - <parameter name='sscap.reserve.response-code' value='500' /> - <parameter name='sscap.reserve.response-message' value='Self Serve Capacity Api restapi reserve execution failed' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' /> - </set> - <return status='failure'> - <parameter name='error-code' value='500' /> - <parameter name='error-message' value='self-serve-vlan-tag-assign: reserve failed' /> - </return> - </block> - </outcome> - <outcome value='success'> - <switch test="`$tmp.sscapres-response.response-code`"> - <outcome value='200'> - <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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: reserve successful"/> - <parameter name="field4" value='`$tmp.sscapres-response.response-code`'/> - <parameter name="field5" value='`$tmp.sscapres-response.response-message`'/> - <parameter name="field6" value='`$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].allocated`' /> - <parameter name="field7" value='`$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].end-point-position`' /> - </record> - <set> - <parameter name='pmIdx' value='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length' /> - </set> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='SUCCESS' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pmIdx].value' value='$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].allocated' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pmIdx].name' value='$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].end-point-position' /> - </set> - </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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: reserve failed"/> - <parameter name="field4" value='`$tmp.sscapres-response.response-code`'/> - <parameter name="field5" value='`$tmp.sscapres-response.response-message`'/> - </record> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' /> - </set> - </block> - </outcome> - </switch> - </outcome> - </execute> - </block> - </outcome> - <outcome value='unassign'> - <block atomic='true'> - <for index='rkIdx' 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[$capIdx].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[$capIdx].resource-resolution-data.resource-key[$rkIdx].name`"> - <outcome value='vnf-name'> - <set> - <parameter name='sscap.rel-entity-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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </outcome> - <outcome value='nf-role'> - <set> - <parameter name='sscap.rel-entity-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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </outcome> - <outcome value='vlan-tag-type'> - <set> - <parameter name='sscap.rel-endpoint-position' 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[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' /> - </set> - </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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: release params"/> - <parameter name="field4" value='`$sscap.res-entity-type`'/> - <parameter name="field5" value='`$sscap.res-entity-id`'/> - <parameter name="field6" value='`$sscap.res.endpoint-position`' /> - </record> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.caprelease.templatefile`" /> - <parameter name='restapiUrl' value='`$prop.controller.url`' /> - <parameter name='restapiUser' value='`$prop.controller.user`' /> - <parameter name='restapiPassword' value='`$prop.controller.pwd`' /> - <parameter name='format' value='json' /> - <parameter name='httpMethod' value='post' /> - <parameter name='responsePrefix' value='tmp.sscaprel-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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: restapi release execution failed"/> - </record> - <set> - <parameter name='sscap.release.response-code' value='500' /> - <parameter name='sscap.release.response-message' value='Self Serve Capacity Api restapi release execution failed' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' /> - </set> - <return status='failure'> - <parameter name='error-code' value='500' /> - <parameter name='error-message' value='self-serve-vlan-tag-assign: release failed' /> - </return> - </block> - </outcome> - <outcome value='success'> - <switch test="`$tmp.sscaprel-response.response-code`"> - <outcome value='200'> - <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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: release successful"/> - <parameter name="field4" value='`$tmp.sscaprel-response.response-code`'/> - <parameter name="field5" value='`$tmp.sscaprel-response.response-message`'/> - </record> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='DELETED' /> - </set> - </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="GENERIC-RESOURCE-API"/> - <parameter name="field3" value="self-serve-vlan-tag-assign: release failed"/> - <parameter name="field4" value='`$tmp.sscaprel-response.response-code`'/> - <parameter name="field5" value='`$tmp.sscaprel-response.response-message`'/> - </record> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' /> - </set> - <return status='failure'> - <parameter name='error-code' value='500' /> - <parameter name='error-message' value='self-serve-vlan-tag-assign: release failed' /> - </return> - </block> - </outcome> - </switch> - </outcome> - </execute> - </block> - </outcome> - </switch> - </outcome> - </switch> - </for> - <return status='success'> - <parameter name="error-code" value="200" /> - <parameter name="error-message" value="`$error-message`" /> - </return> - </block> - </method> -</service-logic> |