aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_managed-network-notification.xml
blob: 1654a83919743cd32599bc4f5f7c8e5f72154764 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
<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='SUBNET-API' version='${project.version}'>
    <method rpc='managed-network-notification' mode='sync'>
        <block>
            <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
                <parameter name="logger" value="message-log"/>
                <parameter name="field1" value="__TIMESTAMP__"/>
                <parameter name="field2" value="managed-network-notification"/>
                <parameter name="field3" value="`$managed-network-notification-input.request-id`"/>
                <parameter name="field4" value="`$managed-network-notification-input.managed-network-status.status.code`"/>
                <parameter name="field5" value="`$managed-network-notification-input.managed-network-status.status.description`"/>
                <parameter name="field6" value="`$managed-network-notification-input.managed-network-status.final-notification-indicator`"/>
            </record>
            <switch test="`$managed-network-notification-input.managed-network-status.status.code`">
                <outcome value="Success">
                    <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
                        <outcome value="success">
                            <block>
                                <get-resource
        plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * FROM VPE_POOL where vpe_name = $eipam-ip-block.ptnii-name ;"
        pfx='tmp.vpe-pool-row'></get-resource>
                                <save 
	plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' 
	resource='SQL'
	key="UPDATE EIPAM_IP_SUBNETS
             SET status = 'ACTIVE' 
             WHERE entity_id = $eipam-ip-block.entity-id ; "
    force='true'
        pfx='pfx.eipam-subnet-row'></save>
                                <set>
                                    <parameter name="eipam-ip-block.status" value="ACTIVE" />
                                </set>
                                <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
                                    <parameter name="eipam-ip-block.status" value="ACTIVE" />
                                </save>
                                <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool-row.vpe-id" pfx="vpe-after">
                                    <parameter name="orchestration-status" value="Activated" />
                                    <parameter name="prov-status" value="NVTPROV" />
                                </update>
                                <return status="success"></return>
                            </block>
                        </outcome>
                        <outcome value="Other">
                            <block>
                                <save 
	plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' 
	resource='SQL'
	key="UPDATE EIPAM_IP_SUBNETS
             SET status = 'ACTIVATE_ERROR' 
             WHERE entity_id = $eipam-ip-block.entity-id ; "
    force='true'
        pfx='pfx.eipam-subnet-row'></save>
                                <set>
                                    <parameter name="eipam-ip-block.status" value="ERROR" />
                                </set>
                                <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
                                    <parameter name="eipam-ip-block.status" value="EIPAM_ACTIVATESUBNET_ERROR" />
                                </save>
                                <return status="failure">
                                    <parameter name="error-code" value="3000" />
                                    <parameter name="error-message" value="ActivateSubnet failure, need to manually activate in EIPAM" />
                                </return>
                            </block>
                        </outcome>
                    </execute>
                </outcome>
                <outcome value="Other">
                    <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
                    <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
                        <outcome value="success">
                            <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
                            <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool">
                                <outcome value="success">
                                    <block>
                                        <set>
                                            <parameter name="eipam-ip-block.status" value="DELETED" />
                                        </set>
                                        <return status="failure">
                                            <parameter name="error-code" value="2000" />
                                            <parameter name="error-message" value="Failure from NCS and deleted pool/subnet in EIPAM"/>
                                        </return>
                                    </block>
                                </outcome>
                                <outcome value="Other">
                                    <block>
                                        <save 
	plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' 
	resource='SQL'
	key="UPDATE EIPAM_IP_SUBNETS
             SET status = 'DEALLOCATED' 
             WHERE entity_id = $eipam-ip-block.entity-id ; "
    force='true'
        pfx='pfx.eipam-subnet-row'></save>
                                        <set>
                                            <parameter name="eipam-ip-block.status" value="ERROR" />
                                        </set>
                                        <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
                                            <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" />
                                        </save>
                                        <return status="failure">
                                            <parameter name="error-code" value="1000" />
                                            <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." />
                                        </return>
                                    </block>
                                </outcome>
                            </execute>
                        </outcome>
                        <outcome value="Other">
                            <block>
                                <save 
	plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' 
	resource='SQL'
	key="UPDATE EIPAM_IP_SUBNETS
             SET status = 'DEALLOCSUBNET_ERROR' 
             WHERE entity_id = $eipam-ip-block.entity-id ; "
    force='true'
        pfx='pfx.eipam-subnet-row'></save>
                                <set>
                                    <parameter name="eipam-ip-block.status" value="ERROR" />
                                </set>
                                <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
                                    <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" />
                                </save>
                                <return status="failure">
                                    <parameter name="error-code" value="1000" />
                                    <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." />
                                </return>
                            </block>
                        </outcome>
                    </execute>
                </outcome>
            </switch>
        </block>
    </method>
</service-logic>