aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml
blob: b987c54025450b8b22231993fa5677c9bf06252d (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<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='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='network-topology-operation-unassign' mode='sync'>
<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
  key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $service-data.networks.network[$nidx].network-data.network-information.onap-model-information.model-customization-uuid
  and service_uuid = $service-data.networks.network[$nidx].network-data.service-information.onap-model-information.model-uuid'
  pfx='network-model'>

</get-resource><set>
	<parameter name="tmp.level1-key-value" value=""/>
	<parameter name="tmp.level1inuse" value="false" />
	<parameter name="pidx" value="0" />
	<parameter name="pidx-len" value="0" />
	
</set><get-resource
        plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.network_id = $network-topology-operation-input.network-information.network-id and s.entity_id = k.entity_id ; "
        pfx='tmp.eipam-subnet-row[]'>

<outcome value='failure'>
<return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
	</return></outcome><outcome value='success'>
<block atomic='true'><for silentFailure='true' index='esidx' start='0' end='`$tmp.eipam-subnet-row_length`' >
<block atomic="true"><switch test='`$tmp.eipam-subnet-row[$esidx].level`'>
<outcome value='1'>
<block atomic="true"><set>
	<parameter name="tmp.level1-key-value[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].key-value`"/>

	
</set><set>
	<parameter name="tmp.plan-name[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].plan-name`"/>

	
</set><set>
	<parameter name="pidx" value="`$pidx + 1`"/>

	
</set><set>
	<parameter name="pidx-len" value="`$pidx`"/>

	
</set></block></outcome><outcome value='Other'>
<block atomic="true"></block></outcome></switch></block></for></block></outcome><outcome value="not-found"><block atomic='true'></block></outcome></get-resource><set>
	<parameter name="eipam-ip-block.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
	<parameter name="eipam-ip-block.level" value='2' />
	<parameter name="eipam-ip-block.entity-id" value='' /></set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateAllSubnets">
<outcome value='failure'><return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deallocating subnets in EIPAM." />
	</return></outcome></execute><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
<outcome value='failure'><return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deleting level 2 plans in EIPAM." />
	</return></outcome></execute><for silentFailure='true' index='npidx' start='0' end='`$pidx-len`' >
<block atomic="true"><set>
	<parameter name="tmp.level1-key-value" value="`$tmp.level1-key-value[$npidx]`" />
	<parameter name="tmp.plan-name" value="`$tmp.plan-name[$npidx]`" />
	
</set><switch test='`$tmp.level1-key-value`'>
<outcome value=''>
<block atomic='true'></block></outcome><outcome value='Other'>
<block atomic='true'><switch test='`$network-model`'>
<outcome value=''></outcome><outcome value='Other'>
<block atomic='true'><switch test="`$network-model.use-ipv4`"><outcome value='Y'><block atomic="true"><set>
<parameter name='tmp.plan-name' value='`$network-model.eipam-v4-address-plan`' />

</set><get-resource
        plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k 
        WHERE p.level = 2 
        and p.plan_name = $tmp.plan-name
        and k.level = 1 
        and p.pool_id = s.pool_id and s.entity_id = k.entity_id 
        and k.key_value = $tmp.level1-key-value  ; "
        pfx='tmp.level2pool[]'>



<outcome value='failure'>
<return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
	</return></outcome><outcome value='success'>
<block atomic='true'><set>
	<parameter name="tmp.level1inuse" value="true" />
	
</set></block></outcome><outcome value="not-found"><block atomic='true'><get-resource
        plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k 
        WHERE p.level = 1 
        and p.plan_name = $tmp.plan-name
        and k.level = 1 
        and p.pool_id = s.pool_id and s.entity_id = k.entity_id 
        and k.key_value = $tmp.level1-key-value  ; "
        pfx='tmp.level1pool[]'>

<outcome value='failure'>
<return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
	</return></outcome><outcome value='success'>
<block atomic='true'><for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
<block atomic='true'><set>
<parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
<parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
<parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
<parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
<parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
<parameter name="eipam-ip-block.level" value='1' />

</set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
<outcome value='failure'><return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
	</return></outcome></execute><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
<outcome value='failure'><return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
	</return></outcome></execute></block></for></block></outcome><outcome value="not-found"><block atomic='true'></block></outcome></get-resource></block></outcome></get-resource></block></outcome></switch><switch test="`$network-model.use-ipv6`"><outcome value='Y'><block atomic="true"><set>
<parameter name='tmp.plan-name' value='`$network-model.eipam-v6-address-plan`' />

</set><get-resource
        plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k 
        WHERE p.level = 2 
        and p.plan_name = $tmp.plan-name
        and k.level = 1 
        and p.pool_id = s.pool_id and s.entity_id = k.entity_id 
        and k.key_value = $tmp.level1-key-value  ; "
        pfx='tmp.level2pool[]'>



<outcome value='failure'>
<return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
	</return></outcome><outcome value='success'>
<block atomic='true'><set>
	<parameter name="tmp.level1inuse" value="true" />
	
</set></block></outcome><outcome value="not-found"><block atomic='true'><get-resource
        plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k 
        WHERE p.level = 1 
        and p.plan_name = $tmp.plan-name
        and k.level = 1 
        and p.pool_id = s.pool_id and s.entity_id = k.entity_id 
        and k.key_value = $tmp.level1-key-value  ; "
        pfx='tmp.level1pool[]'>

<outcome value='failure'>
<return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
	</return></outcome><outcome value='success'>
<block atomic='true'><for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
<block atomic='true'><set>
<parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
<parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
<parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
<parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
<parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
<parameter name="eipam-ip-block.level" value='1' />

</set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
<outcome value='failure'><return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
	</return></outcome></execute><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
<outcome value='failure'><return status="failure">
	<parameter name="tmp.eipam-error" value="true" />
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
	</return></outcome></execute></block></for></block></outcome><outcome value="not-found"><block atomic='true'></block></outcome></get-resource></block></outcome></get-resource></block></outcome></switch></block></outcome></switch></block></outcome></switch></block></for><switch test='`$service-data.networks.network_length`'>
<outcome value='1'>
<block atomic="true"><set>
	<parameter name="service-data.networks." value=""/>

</set><set>
	<parameter name="service-data.networks.network_length" value="0"/>

	
</set></block></outcome><outcome value='Other'>
<block atomic="true"><set>
	<parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
	
	
</set><for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
<block atomic="true"><set>
	<parameter name="tmp.newidx" value="`$snidx - 1`"/>
	
	
</set><set>
	<parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
	
</set></block></for><set>
	<parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>

	
</set><set>
	<parameter name="service-data.networks.network[$tmp.new_length]." value=""/>

</set></block></outcome></switch><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
	resource="l3-network" 
	key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"><outcome value='failure'>
<return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while deleting network from AAI" />
	</return></outcome></delete><return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
<parameter name="error-message" value="`$error-message`" />
</return></block></method></service-logic>