summaryrefslogtreecommitdiffstats
path: root/ms/generic-resource-api/src/test/resources/svclogic/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml
blob: aaead5638c033d5bb7c37ed3a1187e918f5b068e (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
<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='port-mirror-topology-operation-mapping-pprobe' mode='sync'>
        <block atomic="true">
            <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
		resource="l-interfaces" 
		key="pnf.pnf-name = $tmp.dest-pnf-name AND 
		     p-interface.interface-name = $tmp.dest-p-interface AND depth='all'"
        pfx='aai.pnf.p-interface' local-only='false' >
                <outcome value='not-found'>
                    <return status='failure'>
                        <parameter name='ack-final' value='Y'/>
                        <parameter name="error-code" value="500" />
                        <parameter name="error-message" value="Destination L-Interfaces are not set for the Destination PNF" />
                    </return>
                </outcome>
                <outcome value='failure'>
                    <return status='failure'>
                        <parameter name='ack-final' value='Y'/>
                        <parameter name="error-code" value="500" />
                        <parameter name="error-message" value="Error retrieving l-interfaces from AAI" />
                    </return>
                </outcome>
            </get-resource>
            <switch test='`$aai.pnf.p-interface.l-interface_length &gt; 0`'>
                <outcome value='false'>
                    <return status='failure'>
                        <parameter name='ack-final' value='Y'/>
                        <parameter name="error-code" value="500" />
                        <parameter name="error-message" value="Destination L-Interface is not set for the Destination PNF" />
                    </return>
                </outcome>
            </switch>
            <set>
                <parameter name='tmp.found-one' value='false' />
            </set>
            <for index='idx' start='0' end='`$aai.pnf.p-interface.l-interface_length`' >
                <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'>
                    <outcome value=''>
                        <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'>
                            <outcome value=''>
                                <block></block>
                            </outcome>
                            <outcome value='Other'>
                                <block atomic="true">
                                    <set>
                                        <parameter name='tmp.found-one' value='true' />
                                    </set>
                                    <break/>
                                </block>
                            </outcome>
                        </switch>
                    </outcome>
                    <outcome value='Other'>
                        <block atomic="true">
                            <set>
                                <parameter name='tmp.found-one' value='true' />
                            </set>
                            <break/>
                        </block>
                    </outcome>
                </switch>
            </for>
            <switch test='`$tmp.found-one`'>
                <outcome value='false'>
                    <return status='failure'>
                        <parameter name='error-code' value='500' />
                        <parameter name='error-message' value='Destination Port IP Address is not set for the Destination PNF' />
                    </return>
                </outcome>
            </switch>
            <set>
                <parameter name='map-idx' value='0' />
            </set>
            <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`' >
                <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`' >
                    <block atomic="true">
                        <set>
                            <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'
  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`' />
                            <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'
  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`' />
                            <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'
  value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' />
                            <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'
  value='`$aai.pnf.p-interface.l-interface[$idx].interface-id`' />
                            <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'
  value='`$aai.pnf.p-interface.l-interface[$idx].interface-name`' />
                            <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'
  value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' />
                            <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'
  value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' />
                        </set>
                        <set>
                            <parameter name='map-idx' value='`$map-idx + 1`' />
                        </set>
                    </block>
                </for>
            </for>
            <set>
                <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length'
  value='`$map-idx`' />
            </set>
            <return status='success'></return>
        </block>
    </method>
</service-logic>