Chore: Add gerrit maven verify GHA workflow
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / xml / GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml
1 <service-logic
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='GENERIC-RESOURCE-API' version='${project.version}'>
4     <method rpc='port-mirror-topology-operation-mapping-pprobe' mode='sync'>
5         <block atomic="true">
6             <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
7                 resource="l-interfaces" 
8                 key="pnf.pnf-name = $tmp.dest-pnf-name AND 
9                      p-interface.interface-name = $tmp.dest-p-interface AND depth='all'"
10         pfx='aai.pnf.p-interface' local-only='false' >
11                 <outcome value='not-found'>
12                     <return status='failure'>
13                         <parameter name='ack-final' value='Y'/>
14                         <parameter name="error-code" value="500" />
15                         <parameter name="error-message" value="Destination L-Interfaces are not set for the Destination PNF" />
16                     </return>
17                 </outcome>
18                 <outcome value='failure'>
19                     <return status='failure'>
20                         <parameter name='ack-final' value='Y'/>
21                         <parameter name="error-code" value="500" />
22                         <parameter name="error-message" value="Error retrieving l-interfaces from AAI" />
23                     </return>
24                 </outcome>
25             </get-resource>
26             <switch test='`$aai.pnf.p-interface.l-interface_length &gt; 0`'>
27                 <outcome value='false'>
28                     <return status='failure'>
29                         <parameter name='ack-final' value='Y'/>
30                         <parameter name="error-code" value="500" />
31                         <parameter name="error-message" value="Destination L-Interface is not set for the Destination PNF" />
32                     </return>
33                 </outcome>
34             </switch>
35             <set>
36                 <parameter name='tmp.found-one' value='false' />
37             </set>
38             <for index='idx' start='0' end='`$aai.pnf.p-interface.l-interface_length`' >
39                 <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'>
40                     <outcome value=''>
41                         <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'>
42                             <outcome value=''>
43                                 <block></block>
44                             </outcome>
45                             <outcome value='Other'>
46                                 <block atomic="true">
47                                     <set>
48                                         <parameter name='tmp.found-one' value='true' />
49                                     </set>
50                                     <break/>
51                                 </block>
52                             </outcome>
53                         </switch>
54                     </outcome>
55                     <outcome value='Other'>
56                         <block atomic="true">
57                             <set>
58                                 <parameter name='tmp.found-one' value='true' />
59                             </set>
60                             <break/>
61                         </block>
62                     </outcome>
63                 </switch>
64             </for>
65             <switch test='`$tmp.found-one`'>
66                 <outcome value='false'>
67                     <return status='failure'>
68                         <parameter name='error-code' value='500' />
69                         <parameter name='error-message' value='Destination Port IP Address is not set for the Destination PNF' />
70                     </return>
71                 </outcome>
72             </switch>
73             <set>
74                 <parameter name='map-idx' value='0' />
75             </set>
76             <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' >
77                 <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' >
78                     <block atomic="true">
79                         <set>
80                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id'
81   value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' />
82                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name'
83   value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' />
84                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id'
85   value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' />
86                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id'
87   value='`$aai.pnf.p-interface.l-interface[$idx].interface-id`' />
88                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name'
89   value='`$aai.pnf.p-interface.l-interface[$idx].interface-name`' />
90                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address'
91   value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' />
92                             <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address'
93   value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' />
94                         </set>
95                         <set>
96                             <parameter name='map-idx' value='`$map-idx + 1`' />
97                         </set>
98                     </block>
99                 </for>
100             </for>
101             <set>
102                 <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length'
103   value='`$map-idx`' />
104             </set>
105             <return status='success'></return>
106         </block>
107     </method>
108 </service-logic>