diff options
author | 2018-07-26 18:10:42 +0000 | |
---|---|---|
committer | 2018-07-26 18:10:42 +0000 | |
commit | 5a41e5c15bdbfba0e84e89e13bb06d9930988e77 (patch) | |
tree | 72fa804d3fc3f1e286e3c8e1209309e97a3ff528 /platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml | |
parent | 3b79de733187d2c1c9bccf626958a43bb06dbf2e (diff) |
Generic resource API DG catch up
Generic resource API DG catch up with several new capabilities
Change-Id: I6ba4a1716693a2fb0ba5314f60038277a50249a3
Issue-ID: SDNC-403
Signed-off-by: Brandon, Bruce (bb2697) <bb2697@att.com>
Former-commit-id: dd97cf829ce1c0b3bbb0e98e93a2e6619d945beb
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml')
-rwxr-xr-x | platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml | 1116 |
1 files changed, 1116 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml new file mode 100755 index 00000000..2f6def60 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml @@ -0,0 +1,1116 @@ +<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
+ <method rpc='naming-policy-generate-name' mode='sync'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='naming-policy-generate-name: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$naming-policy-generate-name-input.naming-type`'>
+ <outcome value='VM'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VM_NAME_INDEX" />
+ <parameter name='table-type' value="VM_INSTANCE" />
+ <parameter name='table-prefix-column' value="vm_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='VNFC'>
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='505' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VNFC_NAME_INDEX" />
+ <parameter name='table-type' value="VNFC_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnfc_name_prefix" />
+ <parameter name='seq-length' value="0" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <set>
+ <parameter name='table-name' value="VNF_NAME_INDEX" />
+ <parameter name='table-type' value="VNF_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnf_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='NETWORK'>
+ <set>
+ <parameter name='table-name' value="NETWORK_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="NETWORK_INSTANCE" />
+ <parameter name='table-prefix-column' value="network_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='SERVICE'>
+ <set>
+ <parameter name='table-name' value="SERVICE_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="SERVICE_INSTANCE" />
+ <parameter name='table-prefix-column' value="service_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: invalid input.naming-type."/>
+ <parameter name="field3" value='`$naming-policy-generate-name-input.naming-type`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='503' />
+ <parameter name='error-message' value='naming-policy-generate-name: Invalid input.naming-type' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.policy-instance-name`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.policy-instance-name is not set but input.policy is not ASSIGN"/>
+ </record>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.vfc-customization-uuid is not set"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='ASSIGN | DELETE'></outcome>
+ </switch>
+ </block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='ASSIGN'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$naming-policy-generate-name-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='naming-policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-name' value="`$naming-policy-generate-name-input.generic-vnf-name`" />
+ <parameter name='constant-tag' value="`$naming-policy-generate-name-input.constant-tag`" />
+ <parameter name='sequence' value="`$naming-policy-generate-name-input.sequence`" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$naming-policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="naming-policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: jsonStringToCtx SUCCESS: policy-instance-name|naming-models_length|constructed-name:"/>
+ <parameter name='field3' value='`$jsonContextPrefix.content.policy-instance-name`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models_length`' />
+ <parameter name='field5' value='`$constructed-name`' />
+ </record>
+ <for index='modelsIndex' start='0' end='`$jsonContextPrefix.content.naming-models_length`' >
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: modelsIndex|naming-type|naming-recipe:"/>
+ <parameter name='field3' value='`$modelsIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ </record>
+ <set>
+ <parameter name='naming-recipe' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ <parameter name='naming-type' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ </set>
+ <switch test='`$naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-type in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-recipe`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-recipe in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-type == $naming-policy-generate-name-input.naming-type`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='original-name' value='`$naming-recipe`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="namingRecipeSplits" />
+ </execute>
+ <for index='sectionIndex' start='0' end='`$namingRecipeSplits_length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Split naming-recipe sectionIndex|section value"/>
+ <parameter name="field3" value="`$sectionIndex`" />
+ <parameter name="field4" value="`$namingRecipeSplits[$sectionIndex]`" />
+ </record>
+ <block>
+ <set>
+ <parameter name='section-value' value="`$namingRecipeSplits[$sectionIndex]`" />
+ </set>
+ <for index='propertiesIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $section-value`'>
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: recipe section match: section-value|property-name:"/>
+ <parameter name="field3" value="`$section-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="MD-SAL">
+ <block>
+ <switch test='`$property-name`'>
+ <outcome value="VMNAME">
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: required input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vm-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="VNFNAME">
+ <switch test='`$naming-policy-generate-name-input.vnf-name`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: required input.vnf-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vnf-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <!--<parameter name="source" value="`$naming-policy-generate-name-input.test-source-endpoint-path`" />-->
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system MD-SAL name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="TOSCA">
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: input.query-parameter is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.query-parameter is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' method='parameterizedQuery' emitsOutcome='true' >
+ <!--<parameter name='query' value='select nfc_naming_code from VFC_MODEL where customization_uuid = ?' />-->
+ <parameter name='query' value="`$source-endpoint`" />
+ <parameter name='prefix' value='queryPfx' />
+ <parameter name='param1' value="`$naming-policy-generate-name-input.query-parameter`" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='514' />
+ <parameter name='error-message' value='naming-policy-generate-name query-parameter not found in DB table'/>
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='515' />
+ <parameter name='error-message' value='naming-policy-generate-name database access failure'/>
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value=" "/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="sourceEndpointSplits" />
+ </execute>
+ <set>
+ <parameter name="query-parameter-name-underbars" value="`$sourceEndpointSplits[1]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$query-parameter-name-underbars`"/>
+ <parameter name="outputPath" value="tmp.query-parameter-name-dashes"/>
+ <parameter name="target" value="_"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <set>
+ <parameter name="full-query-param-name" value="`'queryPfx.' + $tmp.query-parameter-name-dashes`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$full-query-param-name`" />
+ <parameter name="outputPath" value="resolved-query-parameter" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $resolved-query-parameter`" />
+ <parameter name="new-part" value="`$resolved-query-parameter` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system TOSCA name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="AAI">
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointRegionKeySplits" />
+ </execute>
+ <set>
+ <parameter name="resource" value="`$aaiSourceEndpointRegionKeySplits[0]`" />
+ <parameter name="keys" value="`$aaiSourceEndpointRegionKeySplits[1]`" />
+ <parameter name='aai-constructed-name' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$keys`" />
+ <parameter name="regex" value="\:"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointKeySplits" />
+ </execute>
+ <for index='keyIndex' start='0' end='`$aaiSourceEndpointKeySplits_length`' >
+ <block>
+ <set>
+ <parameter name='key-value' value="`$aaiSourceEndpointKeySplits[$keyIndex]`" />
+ </set>
+ <for index='propIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $key-value`'>
+ <outcome value='true'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: key match: key-value|property-name:"/>
+ <parameter name="field3" value="`$key-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="aai-new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="aai-new-part" value="`$property-value` " />
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$aai-constructed-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiQueryKeySplits" />
+ </execute>
+ <set>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[0]`" value= "`$aaiQueryKeySplits[0]`"/>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[1]`" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[2]`" value="`$aaiQueryKeySplits[2]`" />
+ <!--<parameter name="aaiQueryKeyPart1" value="cloud-region.cloud-owner = 'att-aic' AND " />-->
+ <parameter name="aaiQueryKeyPart1" value="`$aaiSourceEndpointKeySplits[0]`"/>
+ <parameter name="aaiQueryKeyPart2" value=" = '" />
+ <parameter name="aaiQueryKeyPart3" value="`$aaiQueryKeySplits[0]`" />
+ <parameter name="aaiQueryKeyPart4" value="' AND " />
+ <parameter name="aaiQueryKeyPart5" value="`$aaiSourceEndpointKeySplits[1]`"/>
+ <parameter name="aaiQueryKeyPart6" value=" = '" />
+ <parameter name="aaiQueryKeyPart7" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="aaiQueryKeyPart8" value="' AND " />
+ <parameter name="aaiQueryKeyPart9" value="`$aaiSourceEndpointKeySplits[2]`"/>
+ <parameter name="aaiQueryKeyPart10" value=" = '" />
+ <parameter name="aaiQueryKeyPart11" value="`$aaiQueryKeySplits[2]`" />
+ <parameter name="aaiQueryKeyPart12" value="'" />
+ <parameter name="aaiQueryKey" value="`$aaiQueryKeyPart1 + $aaiQueryKeyPart2 + $aaiQueryKeyPart3 + $aaiQueryKeyPart4 + $aaiQueryKeyPart5 + $aaiQueryKeyPart6 + $aaiQueryKeyPart7 + $aaiQueryKeyPart8 + $aaiQueryKeyPart9 + $aaiQueryKeyPart10 + $aaiQueryKeyPart11 + $aaiQueryKeyPart12 `" />
+ <!-- works without single quotes <parameter name="aaiQueryKey" value="`'cloud-region.cloud-owner = att-aic AND ' + $aaiSourceEndpointKeySplits[0] + ' = ' + $aaiQueryKeySplits[0] + ' AND ' + $aaiSourceEndpointKeySplits[1] + ' = ' + $aaiQueryKeySplits[1]`" />-->
+ <!-- key="cloud-region.cloud-owner = '$a' AND cloud-region.cloud-region-id = '$b' AND tenant.tenant-id = '$c' AND vserver.vserver-id = '$d'" -->
+ <!--<parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />-->
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Call AAI query for keys aai-constructed-name|region|aaiQueryKey:"/>
+ <parameter name="field3" value="`$aai-constructed-name`" />
+ <parameter name="field4" value="`$resource`" />
+ <parameter name="field5" value="`$aaiQueryKey`" />
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource='`$resource`'
+ key='`$aaiQueryKey`'
+ pfx="`'aai.' + $resource`" local-only='true' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.tenant-name' value='`$aai.tenant.tenant-name`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $tmp.tenant-name`" />
+ <parameter name="new-part" value="`$tmp.tenant-name` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: source-system AAI name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="seq-scope" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.scope`" />
+ <parameter name="seq-start-value" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.start-value` " />
+ <parameter name="seq-length" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.length` " />
+ <parameter name="seq-increment" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.increment` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: SDN-GC SEQUENCE info: scope|start-value|length|increment|constructed-name:"/>
+ <parameter name="field3" value="`$seq-scope`" />
+ <parameter name="field4" value="`$seq-start-value`" />
+ <parameter name="field5" value="`$seq-length`" />
+ <parameter name="field6" value="`$seq-increment`" />
+ <parameter name="field7" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="new-part" value="`$property-value` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: property-value name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: naming-type from returned policy does not match input.naming-type. Do not construct name for: "/>
+ <parameter name="field3" value="`$naming-type`" />
+ </record>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/naming-policy-generate-name.log' />
+ </execute>
+ <return status='success'>
+ <parameter name='naming-policy-generate-name-output.vm-name' value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value="`$naming-policy-generate-name-output.vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file |