diff options
author | Agarwal, Ruchira(ra1926) <ra1926@att.com> | 2018-09-13 00:03:53 +0000 |
---|---|---|
committer | Agarwal, Ruchira(ra1926) <ra1926@att.com> | 2018-09-13 00:03:53 +0000 |
commit | 3ff5037bd42b416bf1a904d4288f2212de73d795 (patch) | |
tree | 62e9bb79917ac3c34ba3771d17b9566bb8bd01ee /platform-logic/lcm/src/main/xml | |
parent | e83869ac2ab813b27036d8c8dca068c903da82c2 (diff) |
update LCM DGs
allow many playbooks-various criteria for same LCM Action
Change-Id: Ie29b884d05d52635a532e1d5beb10e6db7d7287e
Issue-ID: SDNC-424
Signed-off-by: Agarwal, Ruchira(ra1926) <ra1926@att.com>
Former-commit-id: 134e3f8c3430e33eea0e4490e147a99559555bb1
Diffstat (limited to 'platform-logic/lcm/src/main/xml')
9 files changed, 379 insertions, 85 deletions
diff --git a/platform-logic/lcm/src/main/xml/LCM_distribute-traffic.xml b/platform-logic/lcm/src/main/xml/LCM_distribute-traffic.xml index d83d149d..9b550d32 100755 --- a/platform-logic/lcm/src/main/xml/LCM_distribute-traffic.xml +++ b/platform-logic/lcm/src/main/xml/LCM_distribute-traffic.xml @@ -10,26 +10,75 @@ <set>
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
- <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='quote' value="'" />
</set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='distribute-traffic-input.payload' />
+ <parameter name='outputPath' value='payloadJson' />
+ <parameter name='isEscaped' value='true' />
+ </execute>
+ <switch test='`$payloadJson.pnf-flag`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
+ <parameter name='playbookname' value='`$prop.lcm.pnf.distribute-traffic.playbookname`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $payloadJson.nf-naming-code + '.distribute-traffic.playbookname'`" />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $distribute-traffic-input.action-identifiers.vnf-id"
local-only="false"
pfx='aai.generic-vnf'>
- <outcome value='success'>
+ <outcome value='success'>
+ <block>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $aai.generic-vnf.nf-naming-code + '.distribute-traffic.playbookname'`" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $aai.generic-vnf.ipv4-oam-address + $quote + ']'`"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
<set>
- <parameter name='quote' value="'" />
- <parameter name='nodelist' value="`'[' + $quote + $aai.ipv4-oam-address + $quote + ']'`"/>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='playbookname' value='`$prop.lcm.distribute-traffic.playbookname`'/>
</set>
</outcome>
- <outcome value='Other'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log"/>
- <parameter name="field1" value='VNF not found in AAI. Nodelist retrieved from config'/>
- </record>
+ </switch>
+ <switch test='`$nodelist`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
+ </outcome>
+ <outcome value="['']">
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
</outcome>
- </get-resource>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value='`$playbookname`'/>
+ <parameter name="field2" value='`$nodelist`'/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter' method='reqExec' >
<parameter name='AgentUrl' value='`$prop.ansible.agenturl`'/>
<parameter name='User' value='`$prop.ansible.user`'/>
@@ -40,7 +89,7 @@ <parameter name='Timeout' value='`$prop.ansible.timeout`'/>
<parameter name='Version' value='`$prop.ansible.version`'/>
<parameter name='Id' value='`$distribute-traffic-input.common-header.request-id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.distribute-traffic.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='not-found'>
<block>
<set>
@@ -219,7 +268,7 @@ <parameter name='User' value='`$prop.ansible.user`'/>
<parameter name='Password' value='`$prop.ansible.password`'/>
<parameter name='Id' value='`$org.onap.appc.adapter.ansible.Id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.distribute-traffic.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
<set>
diff --git a/platform-logic/lcm/src/main/xml/LCM_quiesce-traffic.xml b/platform-logic/lcm/src/main/xml/LCM_quiesce-traffic.xml index 95038993..36eec1dd 100644 --- a/platform-logic/lcm/src/main/xml/LCM_quiesce-traffic.xml +++ b/platform-logic/lcm/src/main/xml/LCM_quiesce-traffic.xml @@ -10,26 +10,75 @@ <set>
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
- <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='quote' value="'" />
</set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='quiesce-traffic-input.payload' />
+ <parameter name='outputPath' value='payloadJson' />
+ <parameter name='isEscaped' value='true' />
+ </execute>
+ <switch test='`$payloadJson.pnf-flag`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
+ <parameter name='playbookname' value='`$prop.lcm.pnf.quiesce-traffic.playbookname`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $payloadJson.nf-naming-code + '.quiesce-traffic.playbookname'`" />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $quiesce-traffic-input.action-identifiers.vnf-id"
local-only="false"
pfx='aai.generic-vnf'>
- <outcome value='success'>
+ <outcome value='success'>
+ <block>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $aai.generic-vnf.nf-naming-code + '.quiesce-traffic.playbookname'`" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $aai.generic-vnf.ipv4-oam-address + $quote + ']'`"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
<set>
- <parameter name='quote' value="'" />
- <parameter name='nodelist' value="`'[' + $quote + $aai.ipv4-oam-address + $quote + ']'`"/>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='playbookname' value='`$prop.lcm.quiesce-traffic.playbookname`'/>
</set>
</outcome>
- <outcome value='Other'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log"/>
- <parameter name="field1" value='VNF not found in AAI. Nodelist retrieved from config'/>
- </record>
+ </switch>
+ <switch test='`$nodelist`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
+ </outcome>
+ <outcome value="['']">
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
</outcome>
- </get-resource>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value='`$playbookname`'/>
+ <parameter name="field2" value='`$nodelist`'/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter' method='reqExec' >
<parameter name='AgentUrl' value='`$prop.ansible.agenturl`'/>
<parameter name='User' value='`$prop.ansible.user`'/>
@@ -40,7 +89,7 @@ <parameter name='Timeout' value='`$prop.ansible.timeout`'/>
<parameter name='Version' value='`$prop.ansible.version`'/>
<parameter name='Id' value='`$quiesce-traffic-input.common-header.request-id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.quiesce-traffic.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='not-found'>
<block>
<set>
@@ -219,7 +268,7 @@ <parameter name='User' value='`$prop.ansible.user`'/>
<parameter name='Password' value='`$prop.ansible.password`'/>
<parameter name='Id' value='`$org.onap.appc.adapter.ansible.Id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.quiesce-traffic.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
<set>
diff --git a/platform-logic/lcm/src/main/xml/LCM_resume-traffic.xml b/platform-logic/lcm/src/main/xml/LCM_resume-traffic.xml index 54d35bde..9d2795b6 100644 --- a/platform-logic/lcm/src/main/xml/LCM_resume-traffic.xml +++ b/platform-logic/lcm/src/main/xml/LCM_resume-traffic.xml @@ -10,26 +10,75 @@ <set>
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
- <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='quote' value="'" />
</set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='resume-traffic-input.payload' />
+ <parameter name='outputPath' value='payloadJson' />
+ <parameter name='isEscaped' value='true' />
+ </execute>
+ <switch test='`$payloadJson.pnf-flag`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
+ <parameter name='playbookname' value='`$prop.lcm.pnf.resume-traffic.playbookname`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $payloadJson.nf-naming-code + '.resume-traffic.playbookname'`" />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $resume-traffic-input.action-identifiers.vnf-id"
local-only="false"
pfx='aai.generic-vnf'>
- <outcome value='success'>
+ <outcome value='success'>
+ <block>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $aai.generic-vnf.nf-naming-code + '.resume-traffic.playbookname'`" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $aai.generic-vnf.ipv4-oam-address + $quote + ']'`"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
<set>
- <parameter name='quote' value="'" />
- <parameter name='nodelist' value="`'[' + $quote + $aai.ipv4-oam-address + $quote + ']'`"/>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='playbookname' value='`$prop.lcm.resume-traffic.playbookname`'/>
</set>
</outcome>
- <outcome value='Other'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log"/>
- <parameter name="field1" value='VNF not found in AAI. Nodelist retrieved from config'/>
- </record>
+ </switch>
+ <switch test='`$nodelist`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
+ </outcome>
+ <outcome value="['']">
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
</outcome>
- </get-resource>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value='`$playbookname`'/>
+ <parameter name="field2" value='`$nodelist`'/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter' method='reqExec' >
<parameter name='AgentUrl' value='`$prop.ansible.agenturl`'/>
<parameter name='User' value='`$prop.ansible.user`'/>
@@ -40,7 +89,7 @@ <parameter name='Timeout' value='`$prop.ansible.timeout`'/>
<parameter name='Version' value='`$prop.ansible.version`'/>
<parameter name='Id' value='`$resume-traffic-input.common-header.request-id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.resume-traffic.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='not-found'>
<block>
<set>
@@ -219,7 +268,7 @@ <parameter name='User' value='`$prop.ansible.user`'/>
<parameter name='Password' value='`$prop.ansible.password`'/>
<parameter name='Id' value='`$org.onap.appc.adapter.ansible.Id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.resume-traffic.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
<set>
diff --git a/platform-logic/lcm/src/main/xml/LCM_snapshot.xml b/platform-logic/lcm/src/main/xml/LCM_snapshot.xml index 4284f404..73d0885a 100644 --- a/platform-logic/lcm/src/main/xml/LCM_snapshot.xml +++ b/platform-logic/lcm/src/main/xml/LCM_snapshot.xml @@ -50,4 +50,4 @@ </return>
</block>
</method>
-</service-logic>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/lcm/src/main/xml/LCM_unlock.xml b/platform-logic/lcm/src/main/xml/LCM_unlock.xml index 37c36a07..f524af4e 100644 --- a/platform-logic/lcm/src/main/xml/LCM_unlock.xml +++ b/platform-logic/lcm/src/main/xml/LCM_unlock.xml @@ -26,7 +26,7 @@ <parameter name='lcm-dmaap.flags.force' value='`$unlock-input.common-header.flags.force`'/>
<parameter name='lcm-dmaap.flags.ttl' value='`$unlock-input.common-header.flags.ttl`'/>
<parameter name='lcm-dmaap.status.code' value='400' />
- <parameter name='lcm-dmaap.status.message' value='SDNC UnLock Mock returns success'/>
+ <parameter name='lcm-dmaap.status.message' value='SDNC Unlock Mock returns success'/>
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.lcm.dmaap.publish.templatefile`" />
@@ -46,8 +46,8 @@ </execute>
<return status='success'>
<parameter name='status.code' value='400' />
- <parameter name='status.message' value='SDNC UnLock Mock returns success'/>
+ <parameter name='status.message' value='SDNC Unlock Mock returns success'/>
</return>
</block>
</method>
-</service-logic>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/lcm/src/main/xml/LCM_upgrade-backup.xml b/platform-logic/lcm/src/main/xml/LCM_upgrade-backup.xml index 4b9ef5cd..39eb3414 100644 --- a/platform-logic/lcm/src/main/xml/LCM_upgrade-backup.xml +++ b/platform-logic/lcm/src/main/xml/LCM_upgrade-backup.xml @@ -26,7 +26,7 @@ <parameter name='lcm-dmaap.flags.force' value='`$upgrade-backup-input.common-header.flags.force`'/>
<parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-backup-input.common-header.flags.ttl`'/>
<parameter name='lcm-dmaap.status.code' value='400' />
- <parameter name='lcm-dmaap.status.message' value='SDNC Lock Mock returns success'/>
+ <parameter name='lcm-dmaap.status.message' value='SDNC Upgrade-backup Mock returns success'/>
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.lcm.dmaap.publish.templatefile`" />
@@ -46,8 +46,8 @@ </execute>
<return status='success'>
<parameter name='status.code' value='400' />
- <parameter name='status.message' value='SDNC Lock Mock returns success'/>
+ <parameter name='status.message' value='SDNC Upgrade-backup Mock returns success'/>
</return>
</block>
</method>
-</service-logic>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/lcm/src/main/xml/LCM_upgrade-post-check.xml b/platform-logic/lcm/src/main/xml/LCM_upgrade-post-check.xml index 50301a72..3338f1c2 100644 --- a/platform-logic/lcm/src/main/xml/LCM_upgrade-post-check.xml +++ b/platform-logic/lcm/src/main/xml/LCM_upgrade-post-check.xml @@ -10,26 +10,75 @@ <set>
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
- <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='quote' value="'" />
</set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='upgrade-post-check-input.payload' />
+ <parameter name='outputPath' value='payloadJson' />
+ <parameter name='isEscaped' value='true' />
+ </execute>
+ <switch test='`$payloadJson.pnf-flag`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
+ <parameter name='playbookname' value='`$prop.lcm.pnf.upgrade-post-check.playbookname`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $payloadJson.nf-naming-code + '.upgrade-post-check.playbookname'`" />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $upgrade-post-check-input.action-identifiers.vnf-id"
local-only="false"
pfx='aai.generic-vnf'>
- <outcome value='success'>
+ <outcome value='success'>
+ <block>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $aai.generic-vnf.nf-naming-code + '.upgrade-post-check.playbookname'`" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $aai.generic-vnf.ipv4-oam-address + $quote + ']'`"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
<set>
- <parameter name='quote' value="'" />
- <parameter name='nodelist' value="`'[' + $quote + $aai.ipv4-oam-address + $quote + ']'`"/>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='playbookname' value='`$prop.lcm.upgrade-post-check.playbookname`'/>
</set>
</outcome>
- <outcome value='Other'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log"/>
- <parameter name="field1" value='VNF not found in AAI. Nodelist retrieved from config'/>
- </record>
+ </switch>
+ <switch test='`$nodelist`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
+ </outcome>
+ <outcome value="['']">
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
</outcome>
- </get-resource>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value='`$playbookname`'/>
+ <parameter name="field2" value='`$nodelist`'/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter' method='reqExec' >
<parameter name='AgentUrl' value='`$prop.ansible.agenturl`'/>
<parameter name='User' value='`$prop.ansible.user`'/>
@@ -40,7 +89,7 @@ <parameter name='Timeout' value='`$prop.ansible.timeout`'/>
<parameter name='Version' value='`$prop.ansible.version`'/>
<parameter name='Id' value='`$upgrade-post-check-input.common-header.request-id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.upgrade-post-check.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='not-found'>
<block>
<set>
@@ -219,7 +268,7 @@ <parameter name='User' value='`$prop.ansible.user`'/>
<parameter name='Password' value='`$prop.ansible.password`'/>
<parameter name='Id' value='`$org.onap.appc.adapter.ansible.Id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.upgrade-post-check.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
<set>
diff --git a/platform-logic/lcm/src/main/xml/LCM_upgrade-pre-check.xml b/platform-logic/lcm/src/main/xml/LCM_upgrade-pre-check.xml index c0947ca7..1bf68e52 100644 --- a/platform-logic/lcm/src/main/xml/LCM_upgrade-pre-check.xml +++ b/platform-logic/lcm/src/main/xml/LCM_upgrade-pre-check.xml @@ -10,26 +10,75 @@ <set>
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
- <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='quote' value="'" />
</set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='upgrade-pre-check-input.payload' />
+ <parameter name='outputPath' value='payloadJson' />
+ <parameter name='isEscaped' value='true' />
+ </execute>
+ <switch test='`$payloadJson.pnf-flag`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
+ <parameter name='playbookname' value='`$prop.lcm.pnf.upgrade-pre-check.playbookname`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $payloadJson.nf-naming-code + '.upgrade-pre-check.playbookname'`" />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $upgrade-pre-check-input.action-identifiers.vnf-id"
local-only="false"
pfx='aai.generic-vnf'>
- <outcome value='success'>
+ <outcome value='success'>
+ <block>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $aai.generic-vnf.nf-naming-code + '.upgrade-pre-check.playbookname'`" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $aai.generic-vnf.ipv4-oam-address + $quote + ']'`"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
<set>
- <parameter name='quote' value="'" />
- <parameter name='nodelist' value="`'[' + $quote + $aai.ipv4-oam-address + $quote + ']'`"/>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='playbookname' value='`$prop.lcm.upgrade-pre-check.playbookname`'/>
</set>
</outcome>
- <outcome value='Other'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log"/>
- <parameter name="field1" value='VNF not found in AAI. Nodelist retrieved from config'/>
- </record>
+ </switch>
+ <switch test='`$nodelist`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
+ </outcome>
+ <outcome value="['']">
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
</outcome>
- </get-resource>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value='`$playbookname`'/>
+ <parameter name="field2" value='`$nodelist`'/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter' method='reqExec' >
<parameter name='AgentUrl' value='`$prop.ansible.agenturl`'/>
<parameter name='User' value='`$prop.ansible.user`'/>
@@ -40,7 +89,7 @@ <parameter name='Timeout' value='`$prop.ansible.timeout`'/>
<parameter name='Version' value='`$prop.ansible.version`'/>
<parameter name='Id' value='`$upgrade-pre-check-input.common-header.request-id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.upgrade-pre-check.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='not-found'>
<block>
<set>
@@ -219,7 +268,7 @@ <parameter name='User' value='`$prop.ansible.user`'/>
<parameter name='Password' value='`$prop.ansible.password`'/>
<parameter name='Id' value='`$org.onap.appc.adapter.ansible.Id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.upgrade-pre-check.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
<set>
diff --git a/platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml b/platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml index 252b438d..1a72c47e 100644 --- a/platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml +++ b/platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml @@ -10,26 +10,75 @@ <set>
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
- <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='quote' value="'" />
</set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='upgrade-software-input.payload' />
+ <parameter name='outputPath' value='payloadJson' />
+ <parameter name='isEscaped' value='true' />
+ </execute>
+ <switch test='`$payloadJson.pnf-flag`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
+ <parameter name='playbookname' value='`$prop.lcm.pnf.upgrade-software.playbookname`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $payloadJson.nf-naming-code + '.upgrade-software.playbookname'`" />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $upgrade-software-input.action-identifiers.vnf-id"
local-only="false"
pfx='aai.generic-vnf'>
- <outcome value='success'>
+ <outcome value='success'>
+ <block>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='outputPath' value='playbookname' />
+ <parameter name='source' value="`'prop.lcm.' + $aai.generic-vnf.nf-naming-code + '.upgrade-software.playbookname'`" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='nodelist' value="`'[' + $quote + $aai.generic-vnf.ipv4-oam-address + $quote + ']'`"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$playbookname`'>
+ <outcome value=''>
<set>
- <parameter name='quote' value="'" />
- <parameter name='nodelist' value="`'[' + $quote + $aai.ipv4-oam-address + $quote + ']'`"/>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ <parameter name='playbookname' value='`$prop.lcm.upgrade-software.playbookname`'/>
</set>
</outcome>
- <outcome value='Other'>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
- <parameter name="logger" value="message-log"/>
- <parameter name="field1" value='VNF not found in AAI. Nodelist retrieved from config'/>
- </record>
+ </switch>
+ <switch test='`$nodelist`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
+ </outcome>
+ <outcome value="['']">
+ <set>
+ <parameter name='nodelist' value="`$prop.ansible.nodelist`"/>
+ </set>
</outcome>
- </get-resource>
+ </switch>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value='`$playbookname`'/>
+ <parameter name="field2" value='`$nodelist`'/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter' method='reqExec' >
<parameter name='AgentUrl' value='`$prop.ansible.agenturl`'/>
<parameter name='User' value='`$prop.ansible.user`'/>
@@ -40,7 +89,7 @@ <parameter name='Timeout' value='`$prop.ansible.timeout`'/>
<parameter name='Version' value='`$prop.ansible.version`'/>
<parameter name='Id' value='`$upgrade-software-input.common-header.request-id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.upgrade-software.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='not-found'>
<block>
<set>
@@ -219,7 +268,7 @@ <parameter name='User' value='`$prop.ansible.user`'/>
<parameter name='Password' value='`$prop.ansible.password`'/>
<parameter name='Id' value='`$org.onap.appc.adapter.ansible.Id`'/>
- <parameter name='PlaybookName' value='`$prop.lcm.upgrade-software.playbookname`'/>
+ <parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
<set>
|