blob: 00848f9842803653d088ae973d2825a3b4cd3361 (
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
<?xml version="1.0" encoding="UTF-8"?>
<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="network-topology-operation" mode="sync">
<block atomic="true">
<call module="GENERIC-RESOURCE-API" rpc="validate-network-input" mode="sync" />
<switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`">
<outcome value="assign">
<block atomic="true">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-assign" mode="sync" />
</block>
</outcome>
<outcome value="activate">
<switch test="`$network-topology-operation-input.request-information.request-action`">
<outcome value="ActivateDCINetworkInstance">
<call module="GENERIC-RESOURCE-API" rpc="dci-connects-network-topology-operation-activate" mode="sync" />
</outcome>
<outcome value="other">
<block atomic="true">
<switch test="`$service-data.networks.network_length`">
<outcome value="">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
<outcome value="Other">
<block atomic="true">
<for index="nidx" start="0" end="`$service-data.networks.network_length`">
<switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
<outcome value="true">
<set>
<parameter name="tmp.nidx" value="`$nidx`" />
<parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
</set>
</outcome>
</switch>
</for>
<switch test="`$tmp.nidx`">
<outcome value="">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
</switch>
</block>
</outcome>
</switch>
<switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`">
<outcome value="PendingCreate">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-activate" mode="sync" />
</outcome>
<outcome value="Other">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
</return>
</outcome>
</switch>
</block>
</outcome>
</switch>
</outcome>
<outcome value="deactivate">
<switch test="`$network-topology-operation-input.request-information.request-action`">
<outcome value="DeActivateDCINetworkInstance">
<call module="GENERIC-RESOURCE-API" rpc="dci-connects-network-topology-operation-deactivate" mode="sync" />
</outcome>
<outcome value="other">
<block atomic="true">
<switch test="`$service-data.networks.network_length`">
<outcome value="">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
<outcome value="Other">
<block atomic="true">
<for index="nidx" start="0" end="`$service-data.networks.network_length`">
<switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
<outcome value="true">
<set>
<parameter name="tmp.nidx" value="`$nidx`" />
<parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
</set>
</outcome>
</switch>
</for>
<switch test="`$tmp.nidx`">
<outcome value="">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
</switch>
</block>
</outcome>
</switch>
<switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`">
<outcome value="Created">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-deactivate" mode="sync" />
</outcome>
<outcome value="Other">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Network is not in appropriate state for deactivate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
</return>
</outcome>
</switch>
</block>
</outcome>
</switch>
</outcome>
<outcome value="unassign">
<block atomic="true">
<switch test="`$service-data.networks.network_length`">
<outcome value="">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
<outcome value="Other">
<block atomic="true">
<for index="nidx" start="0" end="`$service-data.networks.network_length`">
<switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
<outcome value="true">
<set>
<parameter name="tmp.nidx" value="`$nidx`" />
<parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
</set>
</outcome>
</switch>
</for>
<switch test="`$tmp.nidx`">
<outcome value="">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
</switch>
</block>
</outcome>
</switch>
<switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`">
<outcome value="PendingCreate">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-unassign" mode="sync" />
</outcome>
<outcome value="PendingDelete">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-unassign" mode="sync" />
</outcome>
<outcome value="Other">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Network is not in appropriate state for unassign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
</return>
</outcome>
</switch>
</block>
</outcome>
<outcome value="Other">
<return status="failure">
<parameter name="ack-final" value="Y" />
<parameter name="error-code" value="500" />
<parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
</return>
</outcome>
<outcome value="create">
<block atomic="true">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-create" mode="sync" />
</block>
</outcome>
<outcome value="delete">
<block atomic="true">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-delete" mode="sync" />
</block>
</outcome>
</switch>
<set>
<parameter name="ack-final" value="Y" />
</set>
<return status="success">
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
<parameter name="error-message" value="`$error-message`" />
</return>
</block>
</method>
</service-logic>
|