1 <service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='VNF-API' version='${project.version}'><method rpc='vnf-topology-assign' mode='sync'>
\r
2 <block atomic="true"><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-id == $service-data.vnf-id`"><outcome value='true'>
\r
3 <return status='failure'>
\r
4 <parameter name='error-code' value='500'/>
\r
5 <parameter name='error-message' value='vnf-id is already present in config-tree'/></return></outcome></switch><get-resource plugin="com.att.sdnctl.sli.aai.AAIService"
\r
6 resource="vf-module"
\r
7 key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id
\r
8 and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id"
\r
10 pfx="tmp.AnAI.vfmodule" ><outcome value='failure'>
\r
11 <return status='failure'>
\r
12 <parameter name='error-code' value='500'/>
\r
13 <parameter name='error-message' value="`'Encountered error while querying vf-module from AnAI with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome><outcome value='not-found'>
\r
14 <return status='failure'>
\r
15 <parameter name='error-code' value='500'/>
\r
16 <parameter name='error-message' value="`'vf-module not found in AnAI with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome></get-resource><call module='VNF-API' rpc='vnf-topology-assign-vfmodule' mode='sync' ></call><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set>
\r
17 <parameter name='service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value='0' />
\r
18 </set></outcome></switch><for index="i" start="0" end="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="com.att.sdnctl.sli.aai.AAIService"
\r
19 resource="vf-module:relationship-list"
\r
20 key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id
\r
21 and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id"
\r
25 <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
\r
26 <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" />
\r
27 <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'>
\r
28 <block atomic='true'><delete plugin="com.att.sdnctl.sli.aai.AAIService"
\r
29 resource="vf-module:relationship-list"
\r
30 key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id
\r
31 AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id
\r
32 AND related-to = l3-network"
\r
34 local-only="false"></delete><return status='failure'>
\r
35 <parameter name='error-code' value='500'/>
\r
36 <parameter name='error-message' value="`'Encountered error while saving vf-module l3-network relationship in AnAI with network-id = ' + $service-data.vnf-topology-information.vnf-assignments.vnf-networks[$i].network-id`"/></return></block></outcome></save></for><update plugin="com.att.sdnctl.sli.aai.AAIService"
\r
37 resource="vf-module"
\r
38 key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id
\r
39 and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id"
\r
40 local-only="false" >
\r
41 <parameter name="orchestration-status" value="pending-create" /><outcome value='failure'>
\r
42 <block atomic="true">
\r
43 <delete plugin="com.att.sdnctl.sli.aai.AAIService"
\r
44 resource="vf-module:relationship-list"
\r
45 key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id
\r
46 AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id
\r
47 AND related-to = l3-network"
\r
49 local-only="false"></delete><return status='failure'>
\r
50 <parameter name='error-code' value='500'/>
\r
51 <parameter name='error-message' value="Encountered error while updating vf-module orchestration-status in AnAI"/></return></block></outcome></update><set>
\r
52 <parameter name="service-data.oper-status.order-status" value="PendingCreate"/></set><set>
\r
53 <parameter name="ack-final" value="Y"/></set><return status='success'>
\r
54 <parameter name="error-code" value="200" /></return></block></method></service-logic>