Merge "Remove test for Active on Delete"
[sdnc/oam.git] / platform-logic / vnfapi / src / main / xml / VNF-API_vf-module-topology-assign.xml
1 <!--
2   ============LICENSE_START=======================================================
3   openECOMP : SDN-C
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property. All rights
6                                                 reserved.
7   ================================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11        http://www.apache.org/licenses/LICENSE-2.0
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17   ============LICENSE_END=========================================================
18   -->
19
20 <service-logic xmlns="http://www.onap.org/sdnc/svclogic"
21     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22     xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-assign' mode='sync'>
23 <block atomic="true"><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
24     resource="vf-module"
25         key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id
26             and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id"
27         pfx="tmp.AnAI.vfmodule" ><outcome value='failure'>
28 <return status='failure'>
29     <parameter name='error-code' value='500'/>
30     <parameter name='error-message' value="`'An error occurred while querying vf-module from AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'>
31 <return status='failure'>
32     <parameter name='error-code' value='500'/>
33     <parameter name='error-message' value="`'vf-module not found in AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome></get-resource><call module='VNF-API' rpc='vf-module-topology-assign-vnf-networks' mode='sync' ></call><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set>
34 <parameter name='vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length' value='0' />
35 </set></outcome></switch><for index="i" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
36     resource="vf-module:relationship-list"
37         key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id
38             and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" >
39     <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
40     <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" />
41     <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'>
42 <block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
43     resource="vf-module:relationship-list"
44         key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id
45             AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id
46             AND related-to = l3-network" ></delete><return status='failure'>
47     <parameter name='error-code' value='500'/>
48     <parameter name='error-message' value="`'An error occurred while saving vf-module l3-network relationship in AnAI with network-id = ' + $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$i].network-id`"/></return></block></outcome></save></for><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
49     resource="vf-module"
50         key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id
51             and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" >
52 <parameter name="orchestration-status" value="pending-create" /><outcome value='failure'>
53 <block atomic="true">
54 <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
55     resource="vf-module:relationship-list"
56         key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id
57             AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id
58             AND related-to = l3-network" ></delete><return status='failure'>
59     <parameter name='error-code' value='500'/>
60     <parameter name='error-message' value="An error occurred while updating vf-module orchestration-status in AnAI"/></return></block></outcome></update><set>
61     <parameter name="vf-module-service-data.oper-status.order-status" value="PendingCreate"/></set><set>
62 <parameter name="ack-final" value="Y"/></set><return status='success'>
63     <parameter name="error-code" value="200" /></return></block></method></service-logic>