aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/datachange/src/main/xml/DataChange_update-tp-ttp-relationship.xml
blob: fd3a67d9a2eaa8f3a6b2f2ce2fcb70903a622f4c (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
<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='DataChange' version='${project.version}'>
    <method rpc='update-tp-ttp-relationship' mode='sync'>
        <block atomic="true">
            <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
                <parameter name="source" value="`$network-eth.network-id`"/>
                <parameter name="outputPath" value="tmp.original-network-eth.network-id"/>
                <parameter name="target" value="/"/>
                <parameter name="replacement" value="-"/>
            </execute>
            <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
                <parameter name="source" value="`$network-otn.network-id`"/>
                <parameter name="outputPath" value="tmp.original-network-otn.network-id"/>
                <parameter name="target" value="/"/>
                <parameter name="replacement" value="-"/>
            </execute>
            <set>
                <parameter name='tmp.network-eth.network-id' value="`$prop.sdncRestApi.thirdpartySdnc.id + '-' + $tmp.original-network-eth.network-id`" />
                <parameter name='tmp.network-otn.network-id' value="`$prop.sdncRestApi.thirdpartySdnc.id + '-' + $tmp.original-network-otn.network-id`" />
            </set>
            <for index='pethidx' start='0' end='`$network-eth.node_length`' >
                <set>
                    <parameter name='node-eth.' value='`$network-eth.node[$pethidx].`' />
                </set>
                <set>
                    <parameter name='unique-network-ethId' value='`$tmp.network-eth.network-id`' />
                </set>
                <set>
                    <parameter name='unique-node-ethId' value="`'networkId-' + $unique-network-ethId + '-nodeId-' + $node-eth.node-id`" />
                </set>
                <switch test='`$node-eth.termination-point_length`'>
                    <outcome value=''>
                        <block></block>
                    </outcome>
                    <outcome value='0'>
                        <block></block>
                    </outcome>
                    <outcome value='Other'>
                        <for index='tidx' start='0' end='`$node-eth.termination-point_length`' >
                            <set>
                                <parameter name='tp-eth.' value='' />
                            </set>
                            <set>
                                <parameter name='tp-eth.' value='`$node-eth.termination-point[$tidx].`' />
                            </set>
                            <set>
                                <parameter name='unique-ltpethId' value="`$unique-node-ethId + '-ltpId-' + $tp-eth.te-tp-id`" />
                            </set>
                            <set>
                                <parameter name='tp-inter-layer-lock-id' value='`$node-eth.termination-point[$tidx].te.inter-layer-lock-id[0]`' />
                            </set>
                            <for index='potnidx' start='0' end='`$network-otn.node_length`' >
                                <set>
                                    <parameter name='node-otn.' value='' />
                                    <parameter name='unique-network-otnId' value='' />
                                    <parameter name='unique-node-otnId' value="" />
                                </set>
                                <set>
                                    <parameter name='node-otn.' value='`$network-otn.node[$potnidx].`' />
                                </set>
                                <set>
                                    <parameter name='unique-network-otnId' value='`$tmp.network-otn.network-id`' />
                                </set>
                                <set>
                                    <parameter name='unique-node-otnId' value="`'networkId-' + $unique-network-otnId + '-nodeId-' + $node-otn.node-id`" />
                                </set>
                                <switch test='`$node-otn.te.tunnel-termination-point_length`'>
                                    <outcome value=''>
                                        <block></block>
                                    </outcome>
                                    <outcome value='0'>
                                        <block></block>
                                    </outcome>
                                    <outcome value='Other'>
                                        <for index='ttidx' start='0' end='`$node-otn.te.tunnel-termination-point_length`' >
                                            <set>
                                                <parameter name='ttp.' value='' />
                                            </set>
                                            <set>
                                                <parameter name='ttp.' value='`$node-otn.te.tunnel-termination-point[$ttidx].`' />
                                            </set>
                                            <set>
                                                <parameter name='unique-ttpId' value="`$unique-node-otnId + '-ttpId-' + $ttp.tunnel-tp-id`" />
                                            </set>
                                            <set>
                                                <parameter name='ttp-inter-layer-lock-id' value='`$node-otn.te.tunnel-termination-point[$ttidx].inter-layer-lock-id[0]`' />
                                            </set>
                                            <switch test='`$tp-inter-layer-lock-id`'>
                                                <outcome value='`$ttp-inter-layer-lock-id`'>
                                                    <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface:relationship-list'
                                                          key='p-interface.interface-name = $unique-ltpethId' force="true" pfx="tmp.AnAI-data">
                                                        <parameter name="relationship-list.relationship[0].related-to" value="tunnel-termination-point" />
                                                        <parameter name="relationship-list.relationship[0].related-link" value="/network/tunnel-termination-points/tunnel-termination-point/ + `$unique-ttpId`" />
                                                        <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="tunnel-termination-point.tunnel-tp-id" />
                                                        <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$unique-ttpId`" />
                                                    </save>
                                                </outcome>
                                            </switch>
                                        </for>
                                    </outcome>
                                </switch>
                            </for>
                        </for>
                    </outcome>
                </switch>
            </for>
        </block>
    </method>
</service-logic>