summaryrefslogtreecommitdiffstats
path: root/platform-logic/vnfapi/src/main/xml/VNF-API_vf-module-topology-assign-vnf-networks.xml
blob: ec0af29035e751f1752c1fe23536e18be1dd1b06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!--
  ============LICENSE_START=======================================================
  openECOMP : SDN-C
  ================================================================================
  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=========================================================
  -->

<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='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'>
    <parameter name='error-code' value='400'/>
    <parameter name='error-message' value='Invalid preload-data order status'/></return></outcome></switch><set>
    <parameter name="vf-module-service-data." value="vf-module-preload-data." /></set><set>
    <parameter name="vf-module-service-data." value="vf-module-topology-operation-input." /></set><set>
    <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>
<parameter name = "vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value="0" />
</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">
<set>
<parameter name='tmp.usePreload' value='1' />
<parameter name='tmp.AnAI.l3network.' value='' />
</set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length`"><outcome value=''><set>
<parameter name='vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length' value='0' />
</set></outcome></switch><block atomic="true">
<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'>
<block atomic="true">
<set>
<parameter name='tmp.usePreload' value='0' />
</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"
    resource="l3-network"
        key="l3-network.network-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id"
    pfx="tmp.AnAI.l3network">
<outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
<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`"  />
</return></outcome><outcome value='not-found'>
<set>
<parameter name='tmp.usePreload' value='1' />
</set></outcome></get-resource></outcome><outcome value='true'>
<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'>
<set>
<parameter name='tmp.usePreload' value='1' />
</set></outcome><outcome value='false'><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
    resource="l3-network"
        key="l3-network.network-name = $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name"
    pfx="tmp.AnAI.l3network">

<outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
<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`"  />
</return></outcome><outcome value='not-found'>
<set>
<parameter name='tmp.usePreload' value='1' />
</set></outcome></get-resource></outcome></switch></outcome></switch><switch test="`$tmp.usePreload == 0`"><outcome value='true'>
<block>
<switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''>
<set>
    <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'>
<block>
<set>
<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" />
<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" />
<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" />
<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`" />
</set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-id != ''`"><outcome value='true'>
<set>
<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'>
<switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-name != ''`"><outcome value='true'>
<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
<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'>
<set>
<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'>
<set>
<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'>
<switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-name != ''`"><outcome value='true'>
<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
<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'>
<set>
<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">
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
    resource="l3-network"
        key="l3-network.network-name = $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name"
    pfx="tmp.AnAI.l3network">
<outcome value='not-found'>
<return status='failure'>
<parameter name='error-code' value='500' />
<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'`"  />
</return></outcome><outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
<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`"  />
</return></outcome><outcome value='success'>
<switch test="`$tmp.AnAI.l3network.network-id == ''`"><outcome value='true'><return status='failure'>
<parameter name='error-code' value='500' />
<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.'`"  />
</return></outcome></switch></outcome></get-resource><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''>
<set>
    <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'>
<block><set>
<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" />
<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" />
<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" />
<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`" />

</set><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id == ''`"><outcome value='true'>
<switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-name != ''`"><outcome value='true'>
<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
<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'>
<set>
<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'>
<switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name != ''`"><outcome value='true'>
<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'>
<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'>
<set>
<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'>
    <parameter name="error-code" value="200" /></return></block></method></service-logic>