diff options
5 files changed, 311 insertions, 146 deletions
diff --git a/installation/appc/pom.xml b/installation/appc/pom.xml index 8b8dd9f..82c3d14 100644 --- a/installation/appc/pom.xml +++ b/installation/appc/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START========================================== ONAP : APPC =================================================================== -Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. +Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -116,6 +116,7 @@ limitations under the License. <include>*.sh</include> <include>*.cfg</include> <include>*.xml</include> + <include>*.json</include> </includes> <filtering>false</filtering> </resource> @@ -362,6 +363,7 @@ limitations under the License. <include>*.sh</include> <include>*.cfg</include> <include>*.xml</include> + <include>*.json</include> </includes> <filtering>false</filtering> </resource> diff --git a/installation/appc/src/main/resources/aai-named-query.json b/installation/appc/src/main/resources/aai-named-query.json new file mode 100755 index 0000000..6ccb5de --- /dev/null +++ b/installation/appc/src/main/resources/aai-named-query.json @@ -0,0 +1,14 @@ +{ + "query-parameters": { + "named-query": { + "named-query-uuid": ${tmp.named-query-uuid} + } + }, + "instance-filters":{ + "instance-filter":[ { + "generic-vnf": { + "vnf-id": ${tmp.named-query-vnf-id} + } + } ] + } +} diff --git a/installation/appc/src/main/scripts/installFeatures.sh b/installation/appc/src/main/scripts/installFeatures.sh index 9ad6898..4138fdc 100644 --- a/installation/appc/src/main/scripts/installFeatures.sh +++ b/installation/appc/src/main/scripts/installFeatures.sh @@ -175,3 +175,8 @@ do sleep 7s echo "Sleep Finished" done + +#Copy json template file for use by the generic restart DG aai fix +mkdir -p /opt/onap/appc/restapi/templates +cp /opt/onap/appc/data/aai-named-query.json /opt/onap/appc/restapi/templates/aai-named-query.json + diff --git a/platform-logic/appc/src/main/xml/APPC_method_Generic_Restart_3.0.0.xml b/platform-logic/appc/src/main/xml/APPC_method_Generic_Restart_3.0.0.xml deleted file mode 100644 index 20df079..0000000 --- a/platform-logic/appc/src/main/xml/APPC_method_Generic_Restart_3.0.0.xml +++ /dev/null @@ -1,145 +0,0 @@ -<!-- - ============LICENSE_START======================================================= - APPC - ================================================================================ - Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ============LICENSE_END========================================================= - ECOMP is a trademark and service mark of AT&T Intellectual Property. ---> -<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='APPC' version='3.0.0'><method rpc='Generic_Restart' mode='sync'> -<execute plugin='org.onap.appc.dg.common.JsonDgUtil' method='flatAndAddToContext' > -<parameter name="payload" value="`$input.payload`" /><outcome value='failure'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Failure in flattening payload Json" /><outcome value='success'> -</outcome></execute><return status='failure'> -<parameter name="output.status.message" value="Failure in flattening payload Json" /></return></block></outcome><outcome value='not-found'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Failure in loading Json flattening plugin" /><outcome value='success'> -</outcome></execute><return status='failure'> -<parameter name="output.status.message" value="Failure in loading Json flattening plugin" /></return></block></outcome><outcome value='success'> -<switch test='$input.action-identifiers.vnf-id'> -<outcome value=''><return status="failure"> - <parameter name="error-message" value="input.action-identifiers.vnf-id is null" /> -</return></outcome><outcome value='Other'> -<block atomic='true'> -<set> -<parameter name='namedQueryData.instance-filters.instance-filter[0].generic-vnf.vnf-id' value='`$input.action-identifiers.vnf-id`' /> -<parameter name='namedQueryData.instance-filters.instance-filter_length' value='`1`' /></set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="named-query" key="named-query-uuid = '037eb932-edac-48f5-9782-c19c0aa5a031' AND prefix = 'namedQueryData' " local-only="false" pfx="vnfInfo" > -<outcome value='failure'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Exception in running AAI Named Query" /> - -<outcome value='success'> -</outcome></execute><return status='failure'> -</return></block></outcome></get-resource><switch test='`$vnfInfo.inventory-response-item[0].generic-vnf.vnf-id`'> -<outcome value=''><block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Failure in retrieving VNF Hierachy" /><outcome value='success'> -</outcome></execute><return status='failure'> -<parameter name="output.status.message" value="Failure in retrieving VNF Hierachy" /></return></block></outcome></switch><switch test='`$vnfInfo.inventory-response-item[0].generic-vnf.vnf-id == $input.action-identifiers.vnf-id`'> -<outcome value='false'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Failure matching vnf-id to VNF Hierachy" /><outcome value='success'> -</outcome></execute><return status='failure'> -<parameter name="output.status.message" value="Failure in loading Json flattening plugin" /></return></block></outcome><outcome value='true'> -<block atomic='true'><for index='vserverIndex' start='0' end='`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item_length`' > -<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink'> -<outcome value=''><block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Failure in retrieving vserver-selflink from VNF Hierachy" /><outcome value='success'> -</outcome></execute><return status='failure'> -<parameter name="output.status.message" value="Failure in retrieving vserver-selflink from VNF Hierachy" /></return></block></outcome><outcome value='Other'> -<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url'> -<outcome value=''><block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="Failure in retrieving identity-url from VNF Hierachy" /><outcome value='success'> -</outcome></execute><return status='failure'> -<parameter name="output.status.message" value="Failure in retrieving identity-url from VNF Hierachy" /></return></block></outcome><outcome value='Other'> -<switch test='`$vm-id`'> -<outcome value='Other'> -<switch test='`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink == $vm-id`'> -<outcome value='true'> -<execute plugin='org.onap.appc.adapter.iaas.ProviderAdapter' method='restartServer'> -<parameter name="org.onap.appc.provider.name" value="OpenStack"/> -<parameter name="org.onap.appc.instance.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`" /> -<parameter name="org.onap.appc.identity.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`" /> - -<outcome value='failure'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Failure in restart for:' + $VNF.VM[$i].URL`" /><outcome value='success'> -</outcome></execute><return status='failure'> -</return></block></outcome><outcome value='success'> -<switch test='`$RESTART_STATUS`'> -<outcome value='ERROR'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`" /><outcome value='success'> -</outcome></execute><return status='failure'> -</return></block></outcome><outcome value='CONTEXT_NOT_FOUND'> -<block atomic='true'><return status='failure'> -</return><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Stop : Context not found:' + $VNF.VM[$i].URL`" /><outcome value='success'> -</outcome></execute></block></outcome><outcome value='SUCCESS'> -<execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' > -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Restart event executed successfully for ' + $VNF.VM[$i].URL`" /> -<outcome value='failure'> -</outcome><outcome value='success'> -</outcome></execute></outcome></switch></outcome></execute></outcome></switch></outcome><outcome value=''><execute plugin='org.onap.appc.adapter.iaas.ProviderAdapter' method='restartServer'> -<parameter name="org.onap.appc.provider.name" value="OpenStack"/> -<parameter name="org.onap.appc.instance.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`" /> -<parameter name="org.onap.appc.identity.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`" /> - -<outcome value='failure'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Failure in restart for:' + $VNF.VM[$i].URL`" /><outcome value='success'> -</outcome></execute><return status='failure'> -</return></block></outcome><outcome value='success'> -<switch test='`$RESTART_STATUS`'> -<outcome value='ERROR'> -<block atomic='true'><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`" /><outcome value='success'> -</outcome></execute><return status='failure'> -</return></block></outcome><outcome value='CONTEXT_NOT_FOUND'> -<block atomic='true'><return status='failure'> -</return><execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' > -<parameter name="apiVer" value="1.01"/> -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Stop : Context not found:' + $VNF.VM[$i].URL`" /><outcome value='success'> -</outcome></execute></block></outcome><outcome value='SUCCESS'> -<execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' > -<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" /> -<parameter name="output.status.message" value="`'Restart event executed successfully for ' + $VNF.VM[$i].URL`" /> -<outcome value='failure'> -</outcome><outcome value='success'> -</outcome></execute></outcome></switch></outcome></execute></outcome></switch></outcome></switch></outcome></switch></for><return status='success'> -</return></block></outcome></switch></block></outcome></switch></outcome></execute></method></service-logic> diff --git a/platform-logic/appc/src/main/xml/vcpe-workaround-with-properties_APPC_method_Generic_Restart_3.0.0.xml b/platform-logic/appc/src/main/xml/vcpe-workaround-with-properties_APPC_method_Generic_Restart_3.0.0.xml new file mode 100755 index 0000000..46a0011 --- /dev/null +++ b/platform-logic/appc/src/main/xml/vcpe-workaround-with-properties_APPC_method_Generic_Restart_3.0.0.xml @@ -0,0 +1,289 @@ +<!--
+ ============LICENSE_START=======================================================
+ APPC
+ ================================================================================
+ Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+-->
+<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='APPC' version='3.0.0'>
+ <method rpc='Generic_Restart' mode='sync'>
+
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%APPC_CONFIG_DIR%/aaiclient.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='Other'>
+ <return status='failure'>
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <execute plugin='org.onap.appc.dg.common.JsonDgUtil' method='flatAndAddToContext' >
+ <parameter name="payload" value="`$input.payload`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Failure in flattening payload Json" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="output.status.message" value="Failure in flattening payload Json" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Failure in loading Json flattening plugin" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="output.status.message" value="Failure in loading Json flattening plugin" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='$input.action-identifiers.vnf-id'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="error-message" value="input.action-identifiers.vnf-id is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='namedQueryData.instance-filters.instance-filter[0].generic-vnf.vnf-id' value='`$input.action-identifiers.vnf-id`' />
+ <parameter name='namedQueryData.instance-filters.instance-filter_length' value='`1`' />
+ </set>
+ <set>
+ <parameter name='tmp.named-query-uuid' value='037eb932-edac-48f5-9782-c19c0aa5a031' />
+ <parameter name='tmp.named-query-vnf-id' value='`$input.action-identifiers.vnf-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value='/opt/onap/appc/restapi/templates/aai-named-query.json' />
+ <parameter name='restapiUrl' value='https://aai.onap:8443/aai/search/named-query' />
+ <parameter name='restapiUser' value='AAI' />
+ <parameter name='restapiPassword' value='AAI' />
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='responsePrefix' value='vnfInfo' />
+ <parameter name='dumpHeaders' value='true' />
+ <parameter name='customHttpHeaders' value='X-FromAppId=AAI-Temp-Tool,X-TransactionId=AAI-Temp-Tool' />
+ <!-- <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" /><parameter name='restapiUser' value='`$prop.controller.user`' /><parameter name='restapiPassword' value='`$prop.controller.pwd`' /><parameter name='customHttpHeaders' value='X-FromAppId=AAI-Temp-Tool,X-TransactionId=AAI-Temp-Tool' />
+ -->
+ <outcome value='failure'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Exception in running AAI Named Query" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$vnfInfo.inventory-response-item[0].generic-vnf.vnf-id`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Failure in retrieving VNF Hierachy" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="output.status.message" value="Failure in retrieving VNF Hierachy" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$vnfInfo.inventory-response-item[0].generic-vnf.vnf-id == $input.action-identifiers.vnf-id`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Failure matching vnf-id to VNF Hierachy" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="output.status.message" value="Failure in loading Json flattening plugin" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='vserverIndex' start='0' end='`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item_length`' >
+ <switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Failure in retrieving vserver-selflink from VNF Hierachy" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="output.status.message" value="Failure in retrieving vserver-selflink from VNF Hierachy" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="Failure in retrieving identity-url from VNF Hierachy" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="output.status.message" value="Failure in retrieving identity-url from VNF Hierachy" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$vm-id`'>
+ <outcome value='Other'>
+ <switch test='`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink == $vm-id`'>
+ <outcome value='true'>
+ <execute plugin='org.onap.appc.adapter.iaas.ProviderAdapter' method='restartServer'>
+ <parameter name="org.onap.appc.provider.name" value="OpenStack"/>
+ <parameter name="org.onap.appc.instance.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`" />
+ <parameter name="org.onap.appc.identity.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Failure in restart for:' + $VNF.VM[$i].URL`" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$RESTART_STATUS`'>
+ <outcome value='ERROR'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='CONTEXT_NOT_FOUND'>
+ <block atomic='true'>
+ <return status='failure'></return>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Stop : Context not found:' + $VNF.VM[$i].URL`" />
+ <outcome value='success'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='SUCCESS'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' >
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Restart event executed successfully for ' + $VNF.VM[$i].URL`" />
+ <outcome value='failure'></outcome>
+ <outcome value='success'></outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <execute plugin='org.onap.appc.adapter.iaas.ProviderAdapter' method='restartServer'>
+ <parameter name="org.onap.appc.provider.name" value="OpenStack"/>
+ <parameter name="org.onap.appc.instance.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`" />
+ <parameter name="org.onap.appc.identity.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Failure in restart for:' + $VNF.VM[$i].URL`" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$RESTART_STATUS`'>
+ <outcome value='ERROR'>
+ <block atomic='true'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`" />
+ <outcome value='success'></outcome>
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='CONTEXT_NOT_FOUND'>
+ <block atomic='true'>
+ <return status='failure'></return>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='report' >
+ <parameter name="apiVer" value="1.01"/>
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Stop : Context not found:' + $VNF.VM[$i].URL`" />
+ <outcome value='success'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='SUCCESS'>
+ <execute plugin='org.onap.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' >
+ <parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+ <parameter name="output.status.message" value="`'Restart event executed successfully for ' + $VNF.VM[$i].URL`" />
+ <outcome value='failure'></outcome>
+ <outcome value='success'></outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ </method>
+</service-logic>
|