aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml
blob: 049f22e7bbf2b72b1626e4110383accb9a9438dd (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
<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='getpathsegment-simple-match-pair' mode='sync'>
        <for index='serv-insts-index' start='0' end='`$serv-insts_length`' >
            <switch test='`$serv-insts[$serv-insts-index].vnf-list_length`'>
                <outcome value=''>
                    <block>
                        <set>
                            <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
  + $serv-insts[$serv-insts-index].service-instance-id`" />
                        </set>
                    </block>
                </outcome>
                <outcome value='0'>
                    <block>
                        <set>
                            <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
  + $serv-insts[$serv-insts-index].service-instance-id`" />
                        </set>
                    </block>
                </outcome>
                <outcome value='Other'>
                    <block>
                        <set>
                            <parameter name='matched-all-vnfs' value='true' />
                        </set>
                        <set>
                            <parameter name='serv-insts[$serv-insts-index].path-segments_length' value='0' />
                        </set>
                        <for index='left-vnf-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list_length - 1`' >
                            <block>
                                <set>
                                    <parameter name='found-match' value='false' />
                                </set>
                                <set>
                                    <parameter name='right-vnf-index' value='`$left-vnf-index + 1`' />
                                </set>
                                <switch test='`$match-type`'>
                                    <outcome value='network-name'>
                                        <for index='left-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
                                            <block>
                                                <for index='right-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
                                                    <switch test='`( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
    == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name )
   and 
    ( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role
    == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-role )`'>
                                                        <outcome value='true'>
                                                            <switch test="`$serv-insts[$serv-insts-index].vnf-list[$vnf-index].vnf-network-list[$vnf-network-index].network-name == 'oam'`">
                                                                <outcome value='false'>
                                                                    <block>
                                                                        <set>
                                                                            <parameter name='ps-index' value='`$serv-insts[$serv-insts-index].path-segments_length`' />
                                                                        </set>
                                                                        <set>
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-service-instance-id'
  value='`$serv-insts[$serv-insts-index].service-instance-id`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vnf-instance-id'
  value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-id`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vf-module-id'
  value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-service-instance-id'
  value='`$serv-insts[$serv-insts-index].service-instance-id`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vnf-instance-id'
  value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-id`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vf-module-id'
  value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-name'
  value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-role'
  value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
                                                                            <parameter name='serv-insts[$serv-insts-index].path-segments_length'
  value='`$serv-insts[$serv-insts-index].path-segments_length + 1`' />
                                                                        </set>
                                                                        <set>
                                                                            <parameter name='found-match' value='true' />
                                                                        </set>
                                                                        <break/>
                                                                    </block>
                                                                </outcome>
                                                            </switch>
                                                        </outcome>
                                                    </switch>
                                                </for>
                                                <switch test="`$found-match`">
                                                    <outcome value='true'>
                                                        <break/>
                                                    </outcome>
                                                </switch>
                                            </block>
                                        </for>
                                    </outcome>
                                </switch>
                                <switch test="`$found-match`">
                                    <outcome value='false'>
                                        <block>
                                            <set>
                                                <parameter name='matched-all-vnfs' value='false' />
                                            </set>
                                            <break/>
                                        </block>
                                    </outcome>
                                </switch>
                            </block>
                        </for>
                        <switch test="`$matched-all-vnfs`">
                            <outcome value='false'>
                                <block>
                                    <set>
                                        <parameter name='matching-error' value="`'Not able to find matches for all vnfs of service instance ' + $serv-insts[$serv-insts-index].service-instance-id`" />
                                    </set>
                                    <set>
                                        <parameter name='serv-insts[$serv-insts-index].path-segments.' value='' />
                                    </set>
                                </block>
                            </outcome>
                        </switch>
                    </block>
                </outcome>
            </switch>
        </for>
    </method>
</service-logic>