aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/appc/src/main/xml/vcpe-workaround-with-properties_APPC_method_Generic_Restart_3.0.0.xml
diff options
context:
space:
mode:
Diffstat (limited to 'platform-logic/appc/src/main/xml/vcpe-workaround-with-properties_APPC_method_Generic_Restart_3.0.0.xml')
-rwxr-xr-xplatform-logic/appc/src/main/xml/vcpe-workaround-with-properties_APPC_method_Generic_Restart_3.0.0.xml289
1 files changed, 289 insertions, 0 deletions
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>