Merge "Remove test for Active on Delete"
[sdnc/oam.git] / platform-logic / vnfapi / src / main / xml / VNF-API_vf-module-topology-assign-vnf-networks.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-vnf-networks' mode='sync'><block atomic="true"><switch test="`$vf-module-preload-data.oper-status.order-status == PendingAssignment`"><outcome value='false'><return status='failure'>
23     <parameter name='error-code' value='400'/>
24     <parameter name='error-message' value='Invalid preload-data order status'/></return></outcome></switch><set>
25     <parameter name="vf-module-service-data." value="vf-module-preload-data." /></set><set>
26     <parameter name="vf-module-service-data." value="vf-module-topology-operation-input." /></set><set>
27     <parameter name="vf-module-service-data.vf-module-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id`"/></set><switch test="`$vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set>
28 <parameter name = "vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value="0" />
29 </set></outcome></switch><for index="j" start="0" end="`$vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><block atomic="true">
30 <set>
31 <parameter name='tmp.usePreload' value='1' />
32 <parameter name='tmp.AnAI.l3network.' value='' />
33 </set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length`"><outcome value=''><set>
34 <parameter name='vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length' value='0' />
35 </set></outcome></switch><block atomic="true">
36 <for index="i" start="0" end="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length`"><switch test="`$vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-role == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-role`"><outcome value='true'>
37 <block atomic="true">
38 <set>
39 <parameter name='tmp.usePreload' value='0' />
40 </set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id == '' or $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id == '0'`"><outcome value='false'><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
41     resource="l3-network"
42         key="l3-network.network-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id"
43     pfx="tmp.AnAI.l3network">
44 <outcome value='failure'>
45 <return status='failure'>
46 <parameter name='error-code' value='500' />
47 <parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id`"  />
48 </return></outcome><outcome value='not-found'>
49 <set>
50 <parameter name='tmp.usePreload' value='1' />
51 </set></outcome></get-resource></outcome><outcome value='true'>
52 <switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name == '' or $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name == '0'`"><outcome value='true'>
53 <set>
54 <parameter name='tmp.usePreload' value='1' />
55 </set></outcome><outcome value='false'><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
56     resource="l3-network"
57         key="l3-network.network-name = $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name"
58     pfx="tmp.AnAI.l3network">
59
60 <outcome value='failure'>
61 <return status='failure'>
62 <parameter name='error-code' value='500' />
63 <parameter name='error-message' value="`'An error occurred whie querying AnAI for l3-network with network-name = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name`"  />
64 </return></outcome><outcome value='not-found'>
65 <set>
66 <parameter name='tmp.usePreload' value='1' />
67 </set></outcome></get-resource></outcome></switch></outcome></switch><switch test="`$tmp.usePreload == 0`"><outcome value='true'>
68 <block>
69 <switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''>
70 <set>
71     <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-role`"><outcome value='true'>
72 <block>
73 <set>
74 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" />
75 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" />
76 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" />
77 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" />
78 </set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-id != ''`"><outcome value='true'>
79 <set>
80 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-id`" /></set></outcome><outcome value='false'>
81 <switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-name != ''`"><outcome value='true'>
82 <switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
83 <for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-name`"><outcome value='true'>
84 <set>
85 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-id != ''`"><outcome value='true'>
86 <set>
87 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-id`" /></set></outcome><outcome value='false'>
88 <switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-name != ''`"><outcome value='true'>
89 <switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
90 <for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-name`"><outcome value='true'>
91 <set>
92 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></outcome></switch></for><switch test="`$tmp.usePreload == 1`"><outcome value='true'><block atomic="true">
93 <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
94     resource="l3-network"
95         key="l3-network.network-name = $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name"
96     pfx="tmp.AnAI.l3network">
97 <outcome value='not-found'>
98 <return status='failure'>
99 <parameter name='error-code' value='500' />
100 <parameter name='error-message' value="`'PRELOAD network-name = ' + $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' not found in AnAI'`"  />
101 </return></outcome><outcome value='failure'>
102 <return status='failure'>
103 <parameter name='error-code' value='500' />
104 <parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-name = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$j].network-name`"  />
105 </return></outcome><outcome value='success'>
106 <switch test="`$tmp.AnAI.l3network.network-id == ''`"><outcome value='true'><return status='failure'>
107 <parameter name='error-code' value='500' />
108 <parameter name='error-message' value="`'An error occurred while querying l3-network with network-name = ' + $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' , it is likely that there are more than one l3-newtork object with the same network-name in AnAI.'`"  />
109 </return></outcome></switch></outcome></get-resource><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''>
110 <set>
111     <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-role`"><outcome value='true'>
112 <block><set>
113 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" />
114 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" />
115 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" />
116 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" />
117
118 </set><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id == ''`"><outcome value='true'>
119 <switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-name != ''`"><outcome value='true'>
120 <switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
121 <for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-name`"><outcome value='true'>
122 <set>
123 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id == ''`"><outcome value='true'>
124 <switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name != ''`"><outcome value='true'>
125 <switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
126 <for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name`"><outcome value='true'>
127 <set>
128 <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></block></for><return status='success'>
129     <parameter name="error-code" value="200" /></return></block></method></service-logic>