summaryrefslogtreecommitdiffstats
path: root/platform-logic/lcm/src/main/xml
diff options
context:
space:
mode:
authorEnbo Wang <wangenbo@huawei.com>2019-05-10 10:04:18 +0000
committerEnbo Wang <wangenbo@huawei.com>2019-05-10 10:04:18 +0000
commit83ff8436156f3f976eff2633b0c54b9426d11a25 (patch)
tree356caabf8ea3829ac9acd0a71ebf9feb316fb69e /platform-logic/lcm/src/main/xml
parent89a89ebe94c58324eb3e441ba23128057e7fd6d5 (diff)
Fix missing payload for DGs and Playbooks of SW upgrade
Change-Id: I89a118ef1e05c76800d6c2fa640dc3dcf2d78fca Issue-ID: SDNC-733 Signed-off-by: Enbo Wang <wangenbo@huawei.com> Former-commit-id: 4ca9a8ea6cebfad2e3f423b90df187bcbc51a67b
Diffstat (limited to 'platform-logic/lcm/src/main/xml')
-rw-r--r--platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml216
1 files changed, 174 insertions, 42 deletions
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 e4f818f7..af0ee715 100644
--- a/platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml
+++ b/platform-logic/lcm/src/main/xml/LCM_upgrade-software.xml
@@ -11,6 +11,7 @@
<parameter name='status.code' value='200' />
<parameter name='status.message' value='unexpected return from DG' />
<parameter name='quote' value="'" />
+ <parameter name='outputPayloadField' value='.Output' />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
<parameter name='source' value='upgrade-software-input.payload' />
@@ -22,6 +23,7 @@
<set>
<parameter name='nodelist' value="`'[' + $quote + $payloadJson.ipaddress-v4-oam + $quote + ']'`"/>
<parameter name='playbookname' value='`$prop.lcm.pnf.upgrade-software.playbookname`'/>
+ <parameter name='outputPayloadField' value="`'.' + $payloadJson.ipaddress-v4-oam + '.Output'`"/>
</set>
</outcome>
<outcome value='Other'>
@@ -270,23 +272,56 @@
<parameter name='PlaybookName' value='`$playbookname`'/>
<outcome value='failure'>
<block>
- <set>
- <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
- <parameter name='lcm-dmaap.correlation-id' value="`$upgrade-software-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
- <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
- <parameter name='lcm-dmaap.rpc-name' value='upgrade-software'/>
- <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
- <parameter name='lcm-dmaap.timestamp' value='`$upgrade-software-input.common-header.timestamp`'/>
- <parameter name='lcm-dmaap.api-ver' value='`$upgrade-software-input.common-header.api-ver`'/>
- <parameter name='lcm-dmaap.originator-id' value='`$upgrade-software-input.common-header.originator-id`'/>
- <parameter name='lcm-dmaap.request-id' value='`$upgrade-software-input.common-header.request-id`'/>
- <parameter name='lcm-dmaap.sub-request-id' value='`$upgrade-software-input.common-header.sub-request-id`'/>
- <parameter name='lcm-dmaap.flags.mode' value='`$upgrade-software-input.common-header.flags.mode`'/>
- <parameter name='lcm-dmaap.flags.force' value='`$upgrade-software-input.common-header.flags.force`'/>
- <parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-software-input.common-header.flags.ttl`'/>
- <parameter name='lcm-dmaap.status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
- <parameter name='lcm-dmaap.status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
- </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='org.onap.appc.adapter.ansible.results' />
+ <parameter name='outputPath' value='resultsJson' />
+ <parameter name='isEscaped' value='false' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='source' value="`'resultsJson' + $outputPayloadField`" />
+ <parameter name='outputPath' value='outputPayload' />
+ </execute>
+ <switch test='`$outputPayload`'>
+ <outcome value=''>
+ <set>
+ <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
+ <parameter name='lcm-dmaap.correlation-id' value="`$upgrade-software-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
+ <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
+ <parameter name='lcm-dmaap.rpc-name' value='upgrade-software'/>
+ <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
+ <parameter name='lcm-dmaap.timestamp' value='`$upgrade-software-input.common-header.timestamp`'/>
+ <parameter name='lcm-dmaap.api-ver' value='`$upgrade-software-input.common-header.api-ver`'/>
+ <parameter name='lcm-dmaap.originator-id' value='`$upgrade-software-input.common-header.originator-id`'/>
+ <parameter name='lcm-dmaap.request-id' value='`$upgrade-software-input.common-header.request-id`'/>
+ <parameter name='lcm-dmaap.sub-request-id' value='`$upgrade-software-input.common-header.sub-request-id`'/>
+ <parameter name='lcm-dmaap.flags.mode' value='`$upgrade-software-input.common-header.flags.mode`'/>
+ <parameter name='lcm-dmaap.flags.force' value='`$upgrade-software-input.common-header.flags.force`'/>
+ <parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-software-input.common-header.flags.ttl`'/>
+ <parameter name='lcm-dmaap.status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='lcm-dmaap.status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
+ <parameter name='lcm-dmaap.correlation-id' value="`$upgrade-software-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
+ <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
+ <parameter name='lcm-dmaap.rpc-name' value='upgrade-software'/>
+ <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
+ <parameter name='lcm-dmaap.timestamp' value='`$upgrade-software-input.common-header.timestamp`'/>
+ <parameter name='lcm-dmaap.api-ver' value='`$upgrade-software-input.common-header.api-ver`'/>
+ <parameter name='lcm-dmaap.originator-id' value='`$upgrade-software-input.common-header.originator-id`'/>
+ <parameter name='lcm-dmaap.request-id' value='`$upgrade-software-input.common-header.request-id`'/>
+ <parameter name='lcm-dmaap.sub-request-id' value='`$upgrade-software-input.common-header.sub-request-id`'/>
+ <parameter name='lcm-dmaap.flags.mode' value='`$upgrade-software-input.common-header.flags.mode`'/>
+ <parameter name='lcm-dmaap.flags.force' value='`$upgrade-software-input.common-header.flags.force`'/>
+ <parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-software-input.common-header.flags.ttl`'/>
+ <parameter name='lcm-dmaap.status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='lcm-dmaap.status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ <parameter name='lcm-dmaap.payload' value='`$outputPayload`'/>
+ </set>
+ </outcome>
+ </switch>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.lcm.dmaap.publish.templatefile`" />
<parameter name='restapiUrl' value='`$prop.lcm.dmaap.url`' />
@@ -303,31 +338,96 @@
</record>
</outcome>
</execute>
- <return status='failure'>
- <parameter name='status.code' value='401' />
- <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`' />
- </return>
+ <switch test='`$outputPayload`'>
+ <outcome value=''>
+ <switch test="`$org.onap.appc.adapter.ansible.result.code`">
+ <outcome value='400'>
+ <return status='success'>
+ <parameter name='status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='status.code' value='401' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <switch test="`$org.onap.appc.adapter.ansible.result.code`">
+ <outcome value='400'>
+ <return status='success'>
+ <parameter name='status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ <parameter name='payload' value='`$outputPayload`'/>
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='status.code' value='401' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`' />
+ <parameter name='payload' value='`$outputPayload`'/>
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
</block>
</outcome>
<outcome value='success'>
<block>
- <set>
- <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
- <parameter name='lcm-dmaap.correlation-id' value="`$upgrade-software-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
- <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
- <parameter name='lcm-dmaap.rpc-name' value='upgrade-software'/>
- <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
- <parameter name='lcm-dmaap.timestamp' value='`$upgrade-software-input.common-header.timestamp`'/>
- <parameter name='lcm-dmaap.api-ver' value='`$upgrade-software-input.common-header.api-ver`'/>
- <parameter name='lcm-dmaap.originator-id' value='`$upgrade-software-input.common-header.originator-id`'/>
- <parameter name='lcm-dmaap.request-id' value='`$upgrade-software-input.common-header.request-id`'/>
- <parameter name='lcm-dmaap.sub-request-id' value='`$upgrade-software-input.common-header.sub-request-id`'/>
- <parameter name='lcm-dmaap.flags.mode' value='`$upgrade-software-input.common-header.flags.mode`'/>
- <parameter name='lcm-dmaap.flags.force' value='`$upgrade-software-input.common-header.flags.force`'/>
- <parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-software-input.common-header.flags.ttl`'/>
- <parameter name='lcm-dmaap.status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
- <parameter name='lcm-dmaap.status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
- </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
+ <parameter name='source' value='org.onap.appc.adapter.ansible.results' />
+ <parameter name='outputPath' value='resultsJson' />
+ <parameter name='isEscaped' value='false' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue'>
+ <parameter name='source' value="`'resultsJson' + $outputPayloadField`" />
+ <parameter name='outputPath' value='outputPayload' />
+ </execute>
+ <switch test='`$outputPayload`'>
+ <outcome value=''>
+ <set>
+ <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
+ <parameter name='lcm-dmaap.correlation-id' value="`$upgrade-software-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
+ <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
+ <parameter name='lcm-dmaap.rpc-name' value='upgrade-software'/>
+ <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
+ <parameter name='lcm-dmaap.timestamp' value='`$upgrade-software-input.common-header.timestamp`'/>
+ <parameter name='lcm-dmaap.api-ver' value='`$upgrade-software-input.common-header.api-ver`'/>
+ <parameter name='lcm-dmaap.originator-id' value='`$upgrade-software-input.common-header.originator-id`'/>
+ <parameter name='lcm-dmaap.request-id' value='`$upgrade-software-input.common-header.request-id`'/>
+ <parameter name='lcm-dmaap.sub-request-id' value='`$upgrade-software-input.common-header.sub-request-id`'/>
+ <parameter name='lcm-dmaap.flags.mode' value='`$upgrade-software-input.common-header.flags.mode`'/>
+ <parameter name='lcm-dmaap.flags.force' value='`$upgrade-software-input.common-header.flags.force`'/>
+ <parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-software-input.common-header.flags.ttl`'/>
+ <parameter name='lcm-dmaap.status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='lcm-dmaap.status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
+ <parameter name='lcm-dmaap.correlation-id' value="`$upgrade-software-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
+ <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
+ <parameter name='lcm-dmaap.rpc-name' value='upgrade-software'/>
+ <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
+ <parameter name='lcm-dmaap.timestamp' value='`$upgrade-software-input.common-header.timestamp`'/>
+ <parameter name='lcm-dmaap.api-ver' value='`$upgrade-software-input.common-header.api-ver`'/>
+ <parameter name='lcm-dmaap.originator-id' value='`$upgrade-software-input.common-header.originator-id`'/>
+ <parameter name='lcm-dmaap.request-id' value='`$upgrade-software-input.common-header.request-id`'/>
+ <parameter name='lcm-dmaap.sub-request-id' value='`$upgrade-software-input.common-header.sub-request-id`'/>
+ <parameter name='lcm-dmaap.flags.mode' value='`$upgrade-software-input.common-header.flags.mode`'/>
+ <parameter name='lcm-dmaap.flags.force' value='`$upgrade-software-input.common-header.flags.force`'/>
+ <parameter name='lcm-dmaap.flags.ttl' value='`$upgrade-software-input.common-header.flags.ttl`'/>
+ <parameter name='lcm-dmaap.status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='lcm-dmaap.status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ <parameter name='lcm-dmaap.payload' value='`$outputPayload`'/>
+ </set>
+ </outcome>
+ </switch>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.lcm.dmaap.publish.templatefile`" />
<parameter name='restapiUrl' value='`$prop.lcm.dmaap.url`' />
@@ -344,10 +444,42 @@
</record>
</outcome>
</execute>
- <return status='success'>
- <parameter name='status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
- <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
- </return>
+ <switch test='`$outputPayload`'>
+ <outcome value=''>
+ <switch test="`$org.onap.appc.adapter.ansible.result.code`">
+ <outcome value='400'>
+ <return status='success'>
+ <parameter name='status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='status.code' value='401' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <switch test="`$org.onap.appc.adapter.ansible.result.code`">
+ <outcome value='400'>
+ <return status='success'>
+ <parameter name='status.code' value='`$org.onap.appc.adapter.ansible.result.code`' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`'/>
+ <parameter name='payload' value='`$outputPayload`'/>
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='status.code' value='401' />
+ <parameter name='status.message' value='`$org.onap.appc.adapter.ansible.message`' />
+ <parameter name='payload' value='`$outputPayload`'/>
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
</block>
</outcome>
</execute>