summaryrefslogtreecommitdiffstats
path: root/platform-logic/datachange/src/main/xml/DataChange_update-network-to-aai.xml
blob: 666d337a6ce84ff35aeb83ca8c246684847fd9c6 (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
<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-network-to-aai' mode='sync'>
        <block atomic="true">
            <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
                <parameter name="source" value="`$network.network-id`"/>
                <parameter name="outputPath" value="tmp.network-id"/>
                <parameter name="target" value="/"/>
                <parameter name="replacement" value="-"/>
            </execute>
            <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='network-resource'  
     key='network-resource.network-id = $tmp.network-id' >
                <parameter name='network-id' value='`$tmp.network-id`' />
                <parameter name='client-id' value='`$network.client-id`' />
                <parameter name='te-topo-id' value='`$network.te-topology-id`' />
                <parameter name='provider-id' value='`$network.provider-id`' />
            </save>
            <for index='pidx' start='0' end='`$network.node_length`' >
                <set>
                    <parameter name='node.' value='`$network.node[$pidx].`' />
                </set>
                <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf' 
      key='pnf.pnf-name = $node.node-id' >
                    <parameter name='pnf-name' value='`$node.node-id`' />
                    <parameter name='pnf-id' value='`$node.node-id`' />
                    <parameter name='operational-status' value='`$node.te.oper-status`' />
                    <parameter name='admin-status' value='`$node.te.te-node-attributes.admin-status`' />
                    <parameter name='in-maint' value='true' />
                </save>
                <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='pnf:relationship-list' 
      key='pnf.pnf-name = $node.node-id' force="true" pfx="tmp.AnAI-data">
                    <parameter name="relationship-list.relationship[0].related-to" value="network-resource" />
                    <parameter name="relationship-list.relationship[0].related-link" value="`'/network/network-resources/network-resource/' + $tmp.network-id`" />
                    <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-resource.network-id" />
                    <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.network-id`" />
                </save>
                <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='esr-thirdparty-sdnc:relationship-list' 
      key='esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.sdncRestApi.thirdpartySdnc.id' 
      force="true" pfx="tmp.AnAI-data">
                    <parameter name="relationship-list.relationship[0].related-to" value="pnf" />
                    <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $node.node-id`" />
                    <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="pnf.pnf-name" />
                    <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$node.node-id`" />
                </save>
                <for index='tidx' start='0' end='`$node.termination-point_length`' >
                    <set>
                        <parameter name='tp.' value='`$node.termination-point[$tidx].`' />
                    </set>
                    <set>
                        <parameter name='unique-ltpId' value="`'nodeId-' + $node.node-id + '-ltpId-' + $tp.te-tp-id`" />
                    </set>
                    <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface' 
      key='pnf.pnf-name = $node.node-id
      AND p-interface.interface-name = $unique-ltpId' >
                        <parameter name='interface-name' value='`$unique-ltpId`' />
                        <parameter name='network-ref' value='`$tp.supporting-termination-point[0].network-ref`' />
                        <parameter name='transparent' value='`$tp.svc.supported-classification.transparent`' />
                        <parameter name='speed-value' value='`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`' />
                        <parameter name='operational-status' value='`$tp.te.oper-status`' />
                        <parameter name='in-maint' value="true" />
                        <outcome value='success'>
                            <block></block>
                        </outcome>
                        <outcome value='failure'>
                            <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='p-interface' 
      key='pnf.pnf-name = $node.node-id
      AND p-interface.interface-name = $unique-ltpId' >
                                <parameter name='interface-name' value='`$unique-ltpId`' />
                                <parameter name='network-ref' value='`$tp.supporting-termination-point[0].network-ref`' />
                                <parameter name='transparent' value='`$tp.svc.supported-classification.transparent`' />
                                <parameter name='speed-value' value='`$tp.te.interface-switching-capability[0].max-lsp-bandwidth[0].te-bandwidth.eth-bandwidth`' />
                                <parameter name='operational-status' value='`$tp.te.oper-status`' />
                                <parameter name='in-maint' value="true" />
                            </update>
                        </outcome>
                    </save>
                </for>
            </for>
        </block>
    </method>
</service-logic>