diff options
author | Dan Timoney <dtimoney@att.com> | 2018-11-02 20:51:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-02 20:51:35 +0000 |
commit | 20f59d1ca896f3e39bd16db9adc972caad520b41 (patch) | |
tree | 4c1e746a9550a8acee95db35b74a38dd080d29c5 /platform-logic/generic-resource-api/src/main/xml | |
parent | 929d24bc7c9034afa8185c02d2f6504c85b5340f (diff) | |
parent | 95fe03ff454e1da13732a8528c1976796cb51ce6 (diff) |
Merge "self-serve DG bugfixes" into casablanca
Former-commit-id: 80f61a087ba5cdf1f99b963d93fe3e8f197e99a3
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
4 files changed, 577 insertions, 693 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml index 294ce772..94225a15 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml @@ -6,613 +6,430 @@ <set>
<parameter name='tmp.naming-data-payload' value='{"elements":[' />
</set>
- <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
- </execute>
- <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from capability-param-resolution" />
- </return>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from capability-param-resolution" />
- </return>
- </outcome>
- </call>
- <switch test="`$ss.capability-type == 'vnf'`">
- <outcome value='true'>
- <block>
- <switch test="`$ss.capability-action == 'unassign'`">
- <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <switch test="`$ss.capability-type`">
+ <outcome value='vnf'>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.UnAssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
<for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
<outcome value='true'>
<block atomic='true'>
<set>
<parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
- <parameter name='tmp.gen-name_length' value='1' />
</set>
<for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
- <outcome value='true'>
- <set>
- <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
- <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
- <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
- <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
- </set>
- </outcome>
- </switch>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ </set>
</for>
<set>
<parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
</set>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',}' />
- <parameter name='replacement' value='}' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',]' />
- <parameter name='replacement' value=']' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
- <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
- <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="nameGenResponse" />
- <outcome value='failure'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
- </set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
- </return>
- </block>
- </outcome>
- <outcome value='not-found'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
- </set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
- </return>
- </block>
- </outcome>
- </execute>
- <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
- <parameter name="source" value="nameGenResponse.httpResponse" />
- <parameter name="outputPath" value="jsonContextPrefix" />
- <parameter name="isEscaped" value="false" />
- </execute>
- <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
- <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
- <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`" />
- <parameter name="target" value="$"/>
- <outcome value='true'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
- <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' />
- <parameter name='regex' value='\$\{' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='s2' />
- <parameter name='original_string' value='`$resource-resolution-split[1]`' />
- <parameter name='regex' value='\}' />
- </execute>
- <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
- <outcome value='true'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
- </set>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.status`' value='DELETED' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </execute>
- </for>
- </for>
</block>
</outcome>
</switch>
</for>
- </outcome>
- </switch>
- <switch test="`$ss.capability-action == 'assign'`">
- <outcome value='true'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.naming-data-payload' value='{"elements":[' />
- <parameter name='tmp.gen-name_length' value='0' />
- </set>
- <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
- <outcome value='true'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
- </set>
- <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
<set>
- <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
- <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name`"/>
- <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
- <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
</set>
- </for>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
- <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
- </set>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test="`$tmp.naming-data-payload == ''`">
- <outcome value='false'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',}' />
- <parameter name='replacement' value='}' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',]' />
- <parameter name='replacement' value=']' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
- <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
- <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='POST' />
- <parameter name="responsePrefix" value="nameGenResponse" />
- <outcome value='failure'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
- </set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Assign" />
- </return>
- </block>
- </outcome>
- <outcome value='not-found'>
- <block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
<set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
</set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Assign" />
- </return>
- </block>
- </outcome>
- </execute>
- <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
- <parameter name="source" value="nameGenResponse.httpResponse" />
- <parameter name="outputPath" value="jsonContextPrefix" />
- <parameter name="isEscaped" value="false" />
- </execute>
- <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
- <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
- <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`" />
- <parameter name="target" value="$"/>
- <outcome value='true'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
- <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' />
- <parameter name='regex' value='\$\{' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='s2' />
- <parameter name='original_string' value='`$resource-resolution-split[1]`' />
- <parameter name='regex' value='\}' />
- </execute>
- <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
- <outcome value='true'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
- </set>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </execute>
- </for>
- </for>
- <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
- <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`" />
- <parameter name="target" value="$"/>
- <outcome value='false'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.capability-name`' value='INPUT' />
- </set>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].resource-resolution-data.status`' value='SUCCESS' />
- </set>
- </block>
</outcome>
- </execute>
+ </switch>
</for>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
</outcome>
- </switch>
- <switch test="`$ss.capability-type == 'vf-module'`">
- <outcome value='true'>
- <block>
- <switch test="`$ss.capability-action == 'unassign'`">
- <outcome value='true'>
+ <outcome value='vf-module'>
+ <switch test="`$ss.capability-action`">
+ <outcome value='unassign'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.UnAssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <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[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.UnAssignNameNode"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{"elements":[' />
+ </set>
<for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
<outcome value='true'>
<block atomic='true'>
<set>
<parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
- <parameter name='tmp.gen-name_length' value='1' />
</set>
<for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
- <outcome value='true'>
- <set>
- <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
- <parameter name="`tmp.gen-name[0].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`"/>
- <parameter name="`tmp.gen-name[0].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
- <parameter name="`tmp.gen-name[0].element_length`" value='`$j + 1`' />
- </set>
- </outcome>
- </switch>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
+ </set>
</for>
<set>
<parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
</set>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',}' />
- <parameter name='replacement' value='}' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',]' />
- <parameter name='replacement' value=']' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
- <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
- <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="nameGenResponse" />
- <outcome value='failure'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
- </set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
- </return>
- </block>
- </outcome>
- <outcome value='not-found'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
- </set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
- </return>
- </block>
- </outcome>
- </execute>
- <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
- <parameter name="source" value="nameGenResponse.httpResponse" />
- <parameter name="outputPath" value="jsonContextPrefix" />
- <parameter name="isEscaped" value="false" />
- </execute>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='DELETED' />
- </set>
- <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
- <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
- <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`" />
- <parameter name="target" value="$"/>
- <outcome value='true'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
- <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' />
- <parameter name='regex' value='\$\{' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='s2' />
- <parameter name='original_string' value='`$resource-resolution-split[1]`' />
- <parameter name='regex' value='\}' />
- </execute>
- <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
- </set>
- </outcome>
- </switch>
- </block>
- </outcome>
- </execute>
- </for>
- </for>
</block>
</outcome>
</switch>
</for>
- </outcome>
- </switch>
- <switch test="`$ss.capability-action == 'assign'`">
- <outcome value='true'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.naming-data-payload' value='{"elements":[' />
- <parameter name='tmp.gen-name_length' value='0' />
- </set>
- <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
- <outcome value='true'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
- </set>
- <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$tmp.naming-data-payload == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE namegeneration.node.AssignNameNode"/>
+ </record>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
<set>
- <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '":' + '"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '",'`"/>
- <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].name`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`"/>
- <parameter name="`tmp.gen-name[$tmp.gen-name_length].element[$j].value`" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
- <parameter name="`tmp.gen-name[$tmp.gen-name_length].element_length`" value='`$j + 1`' />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
</set>
- </for>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
- <parameter name='tmp.gen-name_length' value='`$tmp.gen-name_length + 1`' />
- </set>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test="`$tmp.naming-data-payload == ''`">
- <outcome value='false'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',}' />
- <parameter name='replacement' value='}' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
- <parameter name='outputPath' value='tmp.naming-data-payload' />
- <parameter name='source' value='`$tmp.naming-data-payload`' />
- <parameter name='target' value=',]' />
- <parameter name='replacement' value=']' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.naming.gen-name.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.naming.gen-name.url + $prop.restapi.naming.gen-name.service`' />
- <parameter name='restapiUser' value='`$prop.naming.gen-name.user`' />
- <parameter name='restapiPassword' value='`$prop.naming.gen-name.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='POST' />
- <parameter name="responsePrefix" value="nameGenResponse" />
- <outcome value='failure'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
- </set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Assign" />
- </return>
- </block>
- </outcome>
- <outcome value='not-found'>
- <block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER namegeneration.node.AssignNameNode"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-gen-name-' +
+ $ss.capability-type + '-' + $ss.capability-action + '-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].name == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
<set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].resource-resolution-data.status`' value='SUCCESS' />
</set>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error from NameGenerationNode Assign" />
- </return>
- </block>
- </outcome>
- </execute>
- <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
- <parameter name="source" value="nameGenResponse.httpResponse" />
- <parameter name="outputPath" value="jsonContextPrefix" />
- <parameter name="isEscaped" value="false" />
- </execute>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='SUCCESS' />
- </set>
- <for index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].name == 'vnfc-name'`">
- <outcome value='true'>
- <for silentFailure='true' index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key_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[$cn].resource-resolution-data.resource-key[$j].name == 'vm-type'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-type`' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].name == 'model-invariant-uuid'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-invariant-uuid`' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].name == 'model-customization-uuid'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-customization-uuid`' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].name == 'model-uuid'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-uuid`' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].name == 'model-version'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-version`' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[j].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].name == 'model-name'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].onap-model-information.model-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[$cn].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].name == 'vnfc-name'`">
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[0].vm-names.vnfc-names[0].vnfc-name`' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].resource-resolution-data.resource-key[$j].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
</outcome>
</switch>
</for>
- <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
- <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
- <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`" />
- <parameter name="target" value="$"/>
- <outcome value='true'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
- <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' />
- <parameter name='regex' value='\$\{' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
- <parameter name='ctx_memory_result_key' value='s2' />
- <parameter name='original_string' value='`$resource-resolution-split[1]`' />
- <parameter name='regex' value='\}' />
- </execute>
- <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
- <outcome value='true'>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
- </set>
- </outcome>
- </switch>
- </block>
- </outcome>
- </execute>
- </for>
- </for>
- <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
- <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`" />
- <parameter name="target" value="$"/>
- <outcome value='false'>
- <block>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].resource-resolution-data.capability-name`' value='INPUT' />
- </set>
- <set>
- <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].resource-resolution-data.status`' value='SUCCESS' />
- </set>
- </block>
- </outcome>
- </execute>
- </for>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
</outcome>
</switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
</block>
</method>
</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml index 5b15d653..de88ad7d 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml @@ -189,6 +189,14 @@ <parameter name='ss.capability.execution-order[12]' value='aai-vf-module-put' />
<parameter name='ss.capability.execution-order_length' value='13' />
</set>
+ <switch test='`$prop.controller.user`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ </outcome>
+ </switch>
<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
<outcome value=''>
<block atomic='true'>
@@ -204,6 +212,10 @@ </return>
</outcome>
</call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE with vfmodule-ra-assignment"/>
+ </record>
</block>
</outcome>
</switch>
@@ -226,166 +238,181 @@ ss.capability.execution-order </set>
<switch test='`$ss.capability-name == $tmp.param.capability-name`'>
<outcome value='true'>
- <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
- <outcome value='PENDING'>
- <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
- <outcome value='failure'>
- <block atomic='true'>
- <set>
- <parameter name='vf.vf-module-id'
+ <block atomic='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
- <parameter name='vf.vf-module-data.sdnc-request-header.'
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
- <parameter name='vf.vf-module-data.request-information.'
+ <parameter name='vf.vf-module-data.request-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
- <parameter name='vf.vf-module-data.service-information.'
+ <parameter name='vf.vf-module-data.service-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
- <parameter name='vf.vf-module-data.vnf-information.'
+ <parameter name='vf.vf-module-data.vnf-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
- <parameter name='vf.vf-module-data.vf-module-information.'
+ <parameter name='vf.vf-module-data.vf-module-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
- <parameter name='vf.vf-module-data.vf-module-topology.'
+ <parameter name='vf.vf-module-data.vf-module-topology.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
- <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
- <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
- <parameter name="target" value="{service-instance-id}"/>
- <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
- <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
- <parameter name="target" value="{vnf-id}"/>
- <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
- <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
- <parameter name="target" value="{vf-module-id}"/>
- <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
- <outcome value='failure'>
- <set>
- <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
- </set>
- </outcome>
- <outcome value='not-found'>
- <set>
- <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
- </set>
- </outcome>
- </execute>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
- </return>
- </block>
- </outcome>
- </call>
- </outcome>
- <outcome value='FAILED'>
- <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
- <outcome value='failure'>
- <block atomic='true'>
- <set>
- <parameter name='vf.vf-module-id'
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
- <parameter name='vf.vf-module-data.sdnc-request-header.'
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
- <parameter name='vf.vf-module-data.request-information.'
+ <parameter name='vf.vf-module-data.request-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
- <parameter name='vf.vf-module-data.service-information.'
+ <parameter name='vf.vf-module-data.service-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
- <parameter name='vf.vf-module-data.vnf-information.'
+ <parameter name='vf.vf-module-data.vnf-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
- <parameter name='vf.vf-module-data.vf-module-information.'
+ <parameter name='vf.vf-module-data.vf-module-information.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
- <parameter name='vf.vf-module-data.vf-module-topology.'
+ <parameter name='vf.vf-module-data.vf-module-topology.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
- <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
- <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
- <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
- <parameter name="target" value="{service-instance-id}"/>
- <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
- <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
- <parameter name="target" value="{vnf-id}"/>
- <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
- <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
- <parameter name="target" value="{vf-module-id}"/>
- <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
- <outcome value='failure'>
- <set>
- <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
- </set>
- </outcome>
- <outcome value='not-found'>
- <set>
- <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
- </set>
- </outcome>
- </execute>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
- </return>
- </block>
- </outcome>
- </call>
- </outcome>
- </switch>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'DONE: ' + $ss.capability-dg`"/>
+ </record>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
</outcome>
</switch>
</for>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml index 8a91cdec..c1bbe225 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml @@ -121,7 +121,11 @@ <parameter name="tmp.config-name-value-payload9" value="`$tmp.config-name-value-payload8 + '"aic-cloud-region":"' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region + '"'`"/>
<parameter name="tmp.config-name-value-payload91" value="`'{' + $tmp.config-name-value-payload9 + '}'`" />
</set>
- <execute plugin='org.onap.ccsdk.features.assignment.service.ConfigAssignmentNode' method='process'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE ConfigAssignmentNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.config.assignment.service.ConfigAssignmentNode' method='process'>
<parameter name="request-id" value='`$request-id`' />
<parameter name="resource-id" value='`$resource-id`' />
<parameter name="resource-type" value='`$resource-type`' />
@@ -146,6 +150,10 @@ </return>
</outcome>
</execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER ConfigAssignmentNode"/>
+ </record>
<execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
<parameter name="source" value="`'sriovAssign.mashed-data.' + $tmp.vf-module-label`" />
<parameter name="outputPath" value="jsonContextPrefix" />
@@ -227,6 +235,18 @@ </for>
</for>
</for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: vfmodule-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-vfmodule-ra-assignment-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
</block>
</method>
</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml index 5d3ec7eb..54549b69 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml @@ -96,7 +96,11 @@ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"aic-cloud-region":"' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + '"'`"/>
<parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload7 + '}'`" />
</set>
- <execute plugin='org.onap.ccsdk.features.assignment.service.ConfigAssignmentNode' method='process'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="BEFORE ConfigAssignmentNode"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.config.assignment.service.ConfigAssignmentNode' method='process'>
<parameter name="request-id" value='`$request-id`' />
<parameter name="resource-id" value='`$resource-id`' />
<parameter name="resource-type" value='`$resource-type`' />
@@ -121,6 +125,10 @@ </return>
</outcome>
</execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="AFTER ConfigAssignmentNode"/>
+ </record>
<execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
<parameter name="source" value="`'sriovAssign.mashed-data.' + $tmp.sdnc-artifact-name`" />
<parameter name="outputPath" value="jsonContextPrefix" />
@@ -202,6 +210,18 @@ </for>
</for>
</for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="DONE: vnf-ra-assignment"/>
+ </record>
+ <set>
+ <parameter name='pathname'
+ value="`'/var/tmp/ss-vnf-ra-assignment-' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id + '.log'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='`$pathname`' />
+ </execute>
</block>
</method>
</service-logic>
\ No newline at end of file |