blob: 4901bf0fc4ed4b5e0a5c517dc4bd7a4615508cc8 (
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
<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='optical-service' version='${project.version}'>
<method rpc='service-delete-tapi' mode='sync'>
<block atomic="true">
<set>
<parameter name='request-id' value='`$optical-service-delete-input.request-id`' />
</set>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Inside optical service delete tapi"/>
</record>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from REQUEST_DETAILS WHERE request_id = $request-id '
pfx='output'></get-resource>
<set>
<parameter name='esr-id' value='`$output.controller-id`' />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
<parameter name="original_string" value='`$esr-id`'/>
<parameter name="regex" value="_"/>
<parameter name="ctx_memory_result_key" value="new-esr"/>
</execute>
<set>
<parameter name='service-name' value="`$optical-service-delete-input.payload.service-name + $new-esr[2]`" />
<parameter name='controller-ip' value="`$new-esr[1]`" />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.get.services.url + $service-name`" />
<parameter name="restapiUser" value="admin"/>
<parameter name="restapiPassword" value="admin"/>
<parameter name="httpMethod" value="GET"/>
<parameter name="responsePrefix" value="services-response"/>
<parameter name='contentType' value='application/json' />
<parameter name='format' value='json' />
<parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
<parameter name="trustStorePassword" value="adminadmin"/>
<parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
<parameter name="keyStorePassword" value="adminadmin"/>
<outcome value='failure'></outcome>
<outcome value='success'>
<block atomic='true'>
<set>
<parameter name='aend-nep' value="`$services-response.service[0].end-point[0].connection-end-point[0].node-edge-point-uuid`" />
<parameter name='zend-nep' value="`$services-response.service[0].end-point[1].connection-end-point[0].node-edge-point-uuid`" />
<parameter name='aend-cep' value="`$services-response.service[0].end-point[0].connection-end-point[0].connection-end-point-uuid`" />
<parameter name='zend-cep' value="`$services-response.service[0].end-point[1].connection-end-point[0].connection-end-point-uuid`" />
</set>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT *
from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
WHERE interface_name = $aend-nep'
pfx='db-aend'></get-resource>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT *
from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
WHERE interface_name = $zend-nep'
pfx='db-zend'></get-resource>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.delete.service.url + $service-name`" />
<parameter name="restapiUser" value="admin"/>
<parameter name="restapiPassword" value="admin"/>
<parameter name="httpMethod" value="DELETE"/>
<parameter name="responsePrefix" value="tapi-service-response"/>
<parameter name='contentType' value='application/json' />
<parameter name='format' value='json' />
<parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
<parameter name="trustStorePassword" value="adminadmin"/>
<parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
<parameter name="keyStorePassword" value="adminadmin"/>
<outcome value='failure'>
<block atomic='true'>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='Service Deletion failed' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</block>
</outcome>
<outcome value='success'>
<block atomic='true'>
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="p-interface"
key="pnf.pnf-name = $db-aend.pnf-name AND
p-interface.interface-name = $aend-nep"
pfx='aend' local-only='false'></get-resource>
<switch test='`$aend.network-interface-type`'>
<outcome value='UNI'>
<set>
<parameter name='aend-new' value='`$aend-cep`' />
</set>
</outcome>
<outcome value='Other'>
<switch test='`$db-aend.connection-point`'>
<outcome value=''>
<set>
<parameter name='aend-new' value="`$aend-cep`" />
</set>
</outcome>
<outcome value='Other'>
<set>
<parameter name='aend-new' value="`$db-aend.connection-point + ',' + $aend-cep`" />
</set>
</outcome>
</switch>
</outcome>
</switch>
<save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET connection_point = $aend-new WHERE interface_name = $aend-nep'
force='true' pfx='save-result'></save>
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="p-interface"
key="pnf.pnf-name = $db-zend.pnf-name AND
p-interface.interface-name = $zend-nep"
pfx='zend' local-only='false'></get-resource>
<switch test='`$zend.network-interface-type`'>
<outcome value='UNI'>
<set>
<parameter name='zend-new' value='`$zend-cep`' />
</set>
</outcome>
<outcome value='Other'>
<switch test='`$db-zend.connection-point`'>
<outcome value=''>
<set>
<parameter name='zend-new' value="`$zend-cep`" />
</set>
</outcome>
<outcome value='Other'>
<set>
<parameter name='zend-new' value="`$db-zend.connection-point + ',' + $zend-cep`" />
</set>
</outcome>
</switch>
</outcome>
</switch>
<save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET connection_point = $zend-new WHERE interface_name = $zend-nep'
force='true' pfx='save-result'></save>
<delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-instance"
key='customer.global-customer-id = $output.global-customer-id AND
service-subscription.service-type = $output.service-type AND
service-instance.service-instance-id = $output.service-instance-id'></delete>
<delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource="SQL"
key="DELETE FROM REQUEST_DETAILS WHERE request_id = $request-id"></delete>
<set>
<parameter name='final-response-code' value="200" />
</set>
</block>
</outcome>
</execute>
</block>
</outcome>
</execute>
</block>
</method>
</service-logic>
|