2 xmlns='http://www.onap.org/sdnc/svclogic'
3 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='SUBNET-API' version='${project.version}'>
4 <method rpc='subnet-allocated-notification' mode='sync'>
6 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
7 <parameter name="logger" value="message-log"/>
8 <parameter name="field1" value="__TIMESTAMP__"/>
9 <parameter name="field2" value="subnet-allocated-notification"/>
10 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
11 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
12 <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
13 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
14 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
15 <parameter name="field8" value="`$eipam-ip-block.status`"/>
16 <parameter name="field9" value="`$tmp.key-value`"/>
18 <!--Need to know which ipv version to get the plan name from the network-model.-->
19 <switch test="`$eipam-ip-block.ptnii-name`">
20 <!--If there's ptnii-name, then it's Gamma service-->
21 <outcome value='Other'>
23 <configure adaptor="com.att.sdnctl.sli.adaptor.ncs.ncsAdaptor" key="SNIIR" activate="true">
24 <parameter name="input.request-id" value="`$eipam-ip-block.request-id`" />
25 <parameter name="input.source" value="SDNC" />
26 <parameter name="input.ptnii-name" value="`$eipam-ip-block.ptnii-name`" />
27 <parameter name="input.ip-address" value="`$eipam-ip-block.ip-address`" />
28 <parameter name="input.mask" value="`$eipam-ip-block.prefix-length`" />
29 <outcome value="success">
32 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
34 key="UPDATE EIPAM_IP_SUBNETS
35 SET status = 'PENDING-ACTIVE'
36 WHERE entity_id = $eipam-ip-block.entity-id ; "
38 pfx='pfx.eipam-subnet-row'></save>
40 <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" />
42 <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
43 <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" />
45 <return status="success"></return>
48 <outcome value="Other">
49 <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
50 <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool">
51 <outcome value="success">
54 <parameter name="eipam-ip-block.status" value="DELETED" />
56 <return status="failure">
57 <parameter name="error-code" value="1000" />
58 <parameter name="error-message" value="IpBlockInstall failure and deletePool deleted in EIPAM" />
62 <outcome value="Other">
65 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
67 key="UPDATE EIPAM_IP_SUBNETS
70 dealloc_failure = 'deletePool failed in response to NCS_IP_SUBNET_INSTALL_ERROR'
71 WHERE entity_id = $eipam-ip-block.entity-id ; "
73 pfx='pfx.eipam-subnet-row'></save>
75 <parameter name="eipam-ip-block.status" value="NCS_IP_SUBNET_INSTALL_ERROR" />
77 <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool.vpe-id" pfx="vpe-after">
78 <parameter name="operational-status" value="NCS_IP_SUBNET_INSTALL_ERROR" />
79 <parameter name="summary-status" value="`$aai-summary-status-message`" />
80 <parameter name="prov-status" value="PREPROV" />
82 <return status="failure">
83 <parameter name="error-code" value="1000" />
84 <parameter name="error-message" value="IpBlockInstall failure and deletePool failed in EIPAM, need to manually delete" />
93 <!--If no ptnii-name, check if VIPR or SRIOV-->
95 <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
96 <parameter name="source" value="`toUpperCase($eipam-ip-block.plan-name)`" />
97 <parameter name="target" value="AIC_" />
98 <outcome value='false'>
99 <return status="failure">
100 <parameter name="error-code" value="500" />
101 <parameter name="error-message" value="Unknown Address Plan - not supported!" />
104 <outcome value='true'>
105 <block atomic='true'>
107 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
109 key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $eipam-ip-block.plan-name and level = 2 and key_value = $tmp.level2-key-value ;"
110 pfx='tmp.eipam-pool-row'>
111 <outcome value='failure'>
112 <block atomic='true'>
113 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
114 <parameter name="logger" value="message-log"/>
115 <parameter name="field1" value="__TIMESTAMP__"/>
116 <parameter name="field2" value="subnet-allocated-notification"/>
117 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
118 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
119 <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
120 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
121 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
122 <parameter name="field8" value="`$eipam-ip-block.status`"/>
123 <parameter name="field9" value="Failed to find this record in DB!"/>
125 <return status="failure">
126 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
127 <parameter name="error-code" value="500" />
128 <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" />
132 <outcome value="not-found">
133 <block atomic='true'>
134 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
135 <parameter name="logger" value="message-log"/>
136 <parameter name="field1" value="__TIMESTAMP__"/>
137 <parameter name="field2" value="subnet-allocated-notification"/>
138 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
139 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
140 <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
141 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
142 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
143 <parameter name="field8" value="`$eipam-ip-block.status`"/>
144 <parameter name="field9" value="This record is not found in DB!"/>
146 <return status="failure">
147 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
148 <parameter name="error-code" value="500" />
149 <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" />
154 <!--initial subnet should exists-->
156 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
158 key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value and s.address_family = $tmp.version ; "
159 pfx='pfx.eipam-initial-subnet'>
160 <outcome value='failure'>
161 <return status="failure">
162 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
163 <parameter name="error-code" value="500"/>
164 <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
167 <outcome value="not-found">
168 <return status="failure">
169 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
170 <parameter name="error-code" value="500"/>
171 <parameter name="error-message" value="Initial subnet not found, cannot auto extend." />
175 <!--check if new subnet already exists, possibly from previous attempt.-->
177 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
179 key="SELECT * from EIPAM_IP_SUBNETS s WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = $eipam-ip-block.entity-id and s.ip_address = $eipam-ip-block.ip-address ; "
180 pfx='pfx.eipam-subnet-with-same-ip'>
181 <outcome value='failure'>
182 <return status="failure">
183 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
184 <parameter name="error-code" value="500"/>
185 <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
188 <outcome value="not-found"></outcome>
190 <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
191 resource="l3-network"
192 key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id"
194 pfx="aai.l3-network">
195 <outcome value='not-found'>
196 <return status='failure'>
197 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
198 <parameter name="error-code" value="404" />
199 <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'Not found in AnAI'" />
202 <outcome value='failure'>
203 <return status='failure'>
204 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
205 <parameter name="error-code" value="500" />
206 <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'from AnAI'" />
211 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
214 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
216 key="INSERT EIPAM_IP_SUBNETS
218 entity_id = $eipam-ip-block.entity-id ,
219 service_type = $pfx.eipam-initial-subnet.service-type ,
220 ip_address = $eipam-ip-block.ip-prefix ,
221 prefix_length = $eipam-ip-block.mask ,
222 plan_name = $eipam-ip-block.plan-name ,
223 status = 'PENDING_ACTIVE' ,
224 pool_id = $pfx.eipam-initial-subnet.pool-id ,
225 address_family = $pfx.eipam-initial-subnet.address-family ,
226 network_id = $pfx.eipam-initial-subnet.network-id ; "
228 pfx='pfx.eipam-new-subnet'>
229 <outcome value='failure'>
230 <return status="failure">
231 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
232 <parameter name="error-code" value="500"/>
233 <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNETS failed." />
236 <outcome value='success'></outcome>
239 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
241 key="INSERT EIPAM_IP_SUBNET_KEYS
243 entity_id = $eipam-ip-block.entity-id ,
244 key_name = $tmp.level1-key-name ,
245 key_value = $tmp.level1-key-value ,
248 pfx='pfx.eipam-subnet-level1'>
249 <outcome value='success'></outcome>
250 <outcome value='failure'>
251 <return status="failure">
252 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
253 <parameter name="error-code" value="500"/>
254 <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." />
259 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
261 key="INSERT EIPAM_IP_SUBNET_KEYS
263 entity_id = $eipam-ip-block.entity-id ,
264 key_name = $tmp.level2-key-name ,
265 key_value = $tmp.level2-key-value ,
268 pfx='pfx.eipam-subnet-level2'>
269 <outcome value='success'></outcome>
270 <outcome value='failure'>
271 <return status="failure">
272 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
273 <parameter name="error-code" value="500"/>
274 <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." />
278 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
279 <parameter name="logger" value="message-log"/>
280 <parameter name="field1" value="__TIMESTAMP__"/>
281 <parameter name="field2" value="Added an entry for subnet-allocated-notification in EIPAM_IP_SUBNETS and EIPAM_IP_SUBNET_KEYS"/>
282 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
283 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
284 <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
285 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
286 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
287 <parameter name="field8" value="`$eipam-ip-block.status`"/>
288 <parameter name="field9" value="`$tmp.key-value`"/>
290 <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
292 key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
293 AND subnet.subnet-id = $eipam-ip-block.entity-id"
295 pfx="tmp.aai-initial-subnet">
296 <outcome value='not-found'>
297 <return status='failure'>
298 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
299 <parameter name="error-code" value="404" />
300 <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' is Not found in AnAI'" />
303 <outcome value='failure'>
304 <return status='failure'>
305 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
306 <parameter name="error-code" value="500" />
307 <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' from AnAI'" />
311 <switch test='`$aai.l3-network.subnets.subnet_length`'>
313 <return status='failure'>
314 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
315 <parameter name="error-code" value="404" />
316 <parameter name="error-message" value="'No subnets found in AAI for network-id=' + $pfx.eipam-initial-subnet.network-id" />
319 <outcome value='Other'>
321 <parameter name='tmp.l3-network.subnet.subnet-name' value="`$aai.l3-network.network-name + '_S' + $aai.l3-network.subnets.subnet_length`" />
325 <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
326 <parameter name="ipAddress" value="`$eipam-ip-block.ip-prefix`" />
327 <parameter name="ipVersion" value="`tmp.version`" />
328 <parameter name="subnet" value="`$eipam-ip-block.prefix-length`" />
329 <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
330 <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
331 <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
332 <outcome value='failure'>
333 <return status='failure'>
334 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
335 <parameter name='ack-final' value='Y'/>
336 <parameter name="error-code" value="500" />
337 <parameter name="error-message" value="Failed to generate gateway addresses using IpAddressTools" />
341 <switch test='`$tmp.aai-initial-subnet.dhcp-enabled`'>
343 <block atomic="true">
345 <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='true' />
346 <parameter name='tmp.l3-network.subnet.dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
347 <parameter name='tmp.l3-network.subnet.dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
352 <block atomic="true">
354 <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='false' />
355 <parameter name='tmp.l3-network.subnet.dhcp-start' value='' />
356 <parameter name='tmp.l3-network.subnet.dhcp-end' value='' />
361 <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
363 key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
364 AND subnet.subnet-id = $eipam-ip-block.entity-id" >
365 <!-- Create l3-network object -->
366 <parameter name="network-id" value="`$pfx.eipam-initial-subnet.network-id`" />
367 <parameter name="subnet-id" value="`$eipam-ip-block.entity-id`" />
368 <parameter name="subnet-name" value="`$tmp.l3-network.subnet.subnet-name`" />
369 <parameter name="gateway-address" value="`$tmp.return.generate.gateway-address`" />
370 <parameter name="network-start-address" value="`$eipam-ip-block.ip-prefix`" />
371 <parameter name="cidr-mask" value="`$eipam-ip-block.prefix-length`" />
372 <parameter name="ip-version" value="`$tmp.version`" />
373 <parameter name="dhcp-start" value="`$tmp.l3-network.subnet.dhcp-start`" />
374 <parameter name="dhcp-end" value="`$tmp.l3-network.subnet.dhcp-end`" />
375 <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet.dhcp-enabled`" />
376 <parameter name="orchestration-status" value="PendingCreate" />
377 <outcome value='failure'>
378 <return status='failure'>
379 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
380 <parameter name="error-code" value="500" />
381 <parameter name="error-message" value="'Cannot save subnet with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" />
384 <outcome value='not-found'></outcome>
386 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
387 <parameter name="logger" value="message-log"/>
388 <parameter name="field1" value="__TIMESTAMP__"/>
389 <parameter name="field2" value="Added a subnetin AAI"/>
390 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
391 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
392 <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
393 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
394 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
395 <parameter name="field8" value="`$eipam-ip-block.status`"/>
396 <parameter name="field9" value="`$tmp.key-value`"/>
398 <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
399 <parameter name='api-name' value='subnet' />
400 <parameter name='api-action' value='add' />
401 <parameter name='resp-prefix' value='contrailResp' />
402 <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' />
403 <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
404 <parameter name='ip-prefix-len' value='`$eipam-ip-block.prefix-length`' />
405 <parameter name='dns-server-address' value='0.0.0.0' />
406 <parameter name='enable-dhcp' value='`$tmp.l3-network.subnet.dhcp-enabled`' />
407 <parameter name='default-gateway' value='`$tmp.return.generate.gateway-address`' />
408 <parameter name='subnet-name' value='`$tmp.l3-network.subnet.subnet-name`' />
409 <parameter name='start' value='`$tmp.l3-network.subnet.dhcp-start`' />
410 <parameter name='end' value='`$tmp.l3-network.subnet.dhcp-end`' />
411 <outcome value='success'>
414 <outcome value='failure'>
417 <parameter name="eipam-ip-block.status" value="ERROR" />
420 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
422 key="UPDATE EIPAM_IP_SUBNETS
424 WHERE entity_id = $eipam-ip-block.entity-id ; "
426 pfx='pfx.eipam-subnet-row'>
427 <outcome value='failure'>
428 <return status="failure">
429 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
430 <parameter name="error-code" value="500"/>
431 <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
434 <outcome value="not-found">
435 <return status="failure">
436 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
437 <parameter name="error-code" value="500"/>
438 <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
442 <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
444 key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
445 AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete>
446 <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
447 <parameter name="eipam-ip-block.status" value="ERROR" />
449 <return status='failure'>
450 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
451 <parameter name="error-code" value="500" />
452 <parameter name="error-message" value="`'Failed to create subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
457 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
458 <parameter name="logger" value="message-log"/>
459 <parameter name="field1" value="__TIMESTAMP__"/>
460 <parameter name="field2" value="Added a subnet in Contrail"/>
461 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
462 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
463 <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
464 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
465 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
466 <parameter name="field8" value="`$eipam-ip-block.status`"/>
467 <parameter name="field9" value="`$tmp.key-value`"/>
469 <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
471 key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
472 AND subnet.subnet-id = $eipam-ip-block.entity-id" >
473 <parameter name="orchestration-status" value="Created" />
474 <outcome value='not-found'></outcome>
475 <outcome value='failure'>
477 <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
478 <parameter name="logger" value="message-log"/>
479 <parameter name="field1" value="__TIMESTAMP__"/>
480 <parameter name="field2" value="Update status to Created failed in AAI"/>
481 <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
482 <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
483 <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
484 <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
485 <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
486 <parameter name="field8" value="`$eipam-ip-block.status`"/>
487 <parameter name="field9" value="`$tmp.key-value`"/>
490 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
492 key="UPDATE EIPAM_IP_SUBNETS
494 WHERE entity_id = $eipam-ip-block.entity-id ; "
496 pfx='pfx.eipam-subnet-row'>
497 <outcome value='failure'>
498 <return status="failure">
499 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
500 <parameter name="error-code" value="500"/>
501 <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
504 <outcome value="not-found">
505 <return status="failure">
506 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
507 <parameter name="error-code" value="500"/>
508 <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
512 <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
514 key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
515 AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete>
516 <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
517 <parameter name='api-name' value='subnet' />
518 <parameter name='api-action' value='delete' />
519 <parameter name='resp-prefix' value='contrailResp' />
520 <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' />
521 <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
522 <outcome value='failure'>
523 <return status='failure'>
524 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
525 <parameter name="error-code" value="500" />
526 <parameter name="error-message" value="`'Failed to delete subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
531 <parameter name="eipam-ip-block.status" value="ERROR" />
533 <return status='failure'>
534 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
535 <parameter name="error-code" value="500" />
536 <parameter name="error-message" value="'Cannot save subnet status to Created with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" />
542 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
544 key="UPDATE EIPAM_IP_SUBNETS
545 SET status = 'CREATED'
546 WHERE entity_id = $eipam-ip-block.entity-id ; "
548 pfx='pfx.eipam-subnet-row'>
549 <outcome value='failure'>
550 <return status="failure">
551 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
552 <parameter name="error-code" value="500"/>
553 <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." />
556 <outcome value="not-found">
557 <return status="failure">
558 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
559 <parameter name="error-code" value="500"/>
560 <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." />
564 <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
565 <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
566 <outcome value='failure'>
567 <return status="failure">
568 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
569 <parameter name="error-code" value="500"/>
570 <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
575 plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
577 key="UPDATE EIPAM_IP_SUBNETS
578 SET status = 'ACTIVE'
579 WHERE entity_id = $eipam-ip-block.entity-id ; "
581 pfx='pfx.eipam-subnet-row'>
582 <outcome value='failure'>
583 <return status="failure">
584 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
585 <parameter name="error-code" value="500"/>
586 <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
589 <outcome value="not-found">
590 <return status="failure">
591 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
592 <parameter name="error-code" value="500"/>
593 <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
596 <outcome value='success'></outcome>
598 <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
600 key="l3-network.network-id = $aai.l3-network.network-id
601 AND subnet.subnet-id = $eipam-ip-block.entity-id" >
602 <parameter name="orchestration-status" value="Created" />
603 <outcome value='failure'>
604 <return status="failure">
605 <parameter name="error-code" value="500"/>
606 <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
609 <outcome value="not-found">
610 <return status="failure">
611 <parameter name="error-code" value="500"/>
612 <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
616 <return status="success">
617 <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />