Add generic-resource-api DG seed code
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.json
1 [
2     {
3         "id": "704d0b14.d5c684",
4         "type": "dgstart",
5         "name": "DGSTART",
6         "outputs": 1,
7         "x": 98.33332824707031,
8         "y": 90.74698829650879,
9         "z": "31f1f0b7.be812",
10         "wires": [
11             [
12                 "72e4c75c.02dbd8"
13             ]
14         ]
15     },
16     {
17         "id": "72e4c75c.02dbd8",
18         "type": "service-logic",
19         "name": "GENERIC-RESOURCE-API ${project.version}",
20         "module": "GENERIC-RESOURCE-API",
21         "version": "${project.version}",
22         "comments": "",
23         "xml": "<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}'>",
24         "outputs": 1,
25         "x": 173.61903381347656,
26         "y": 130.98509979248047,
27         "z": "31f1f0b7.be812",
28         "wires": [
29             [
30                 "cf8e6aa3.702178"
31             ]
32         ]
33     },
34     {
35         "id": "cf8e6aa3.702178",
36         "type": "method",
37         "name": "method vnf-topology-operation-deactivate",
38         "xml": "<method rpc='vnf-topology-operation-deactivate' mode='sync'>\n",
39         "comments": "",
40         "outputs": 1,
41         "x": 200.76195526123047,
42         "y": 170.7469882965088,
43         "z": "31f1f0b7.be812",
44         "wires": [
45             [
46                 "cb96d310.99dca"
47             ]
48         ]
49     },
50     {
51         "id": "95de4493.48a0c8",
52         "type": "comment",
53         "name": "vnf-topology-operation-deactivate",
54         "info": "",
55         "comments": "",
56         "x": 492.67818450927734,
57         "y": 38.33333206176758,
58         "z": "31f1f0b7.be812",
59         "wires": []
60     },
61     {
62         "id": "163c9760.9a9a79",
63         "type": "switchNode",
64         "name": "switch request-action",
65         "xml": "<switch test='`$vnf-topology-operation-input.request-information.request-action`'>\n",
66         "comments": "",
67         "outputs": 1,
68         "x": 501.85713958740234,
69         "y": 269.6041259765625,
70         "z": "31f1f0b7.be812",
71         "wires": [
72             [
73                 "80b90203.c142f",
74                 "3890f05d.c33f7"
75             ]
76         ]
77     },
78     {
79         "id": "80b90203.c142f",
80         "type": "outcome",
81         "name": "DeleteVnfInstance",
82         "xml": "<outcome value='DeleteVnfInstance'>\n",
83         "comments": "",
84         "outputs": 1,
85         "x": 728.5714149475098,
86         "y": 245.08034229278564,
87         "z": "31f1f0b7.be812",
88         "wires": [
89             [
90                 "df5429cb.487c88"
91             ]
92         ]
93     },
94     {
95         "id": "3890f05d.c33f7",
96         "type": "other",
97         "name": "other",
98         "xml": "<outcome value='Other'>\n",
99         "comments": "",
100         "outputs": 1,
101         "x": 692.5713806152344,
102         "y": 290.79467010498047,
103         "z": "31f1f0b7.be812",
104         "wires": [
105             [
106                 "d4e21439.6c2c68"
107             ]
108         ]
109     },
110     {
111         "id": "df5429cb.487c88",
112         "type": "block",
113         "name": "block",
114         "xml": "<block>\n",
115         "atomic": "false",
116         "comments": "",
117         "outputs": 1,
118         "x": 915.4285430908203,
119         "y": 245.08037185668945,
120         "z": "31f1f0b7.be812",
121         "wires": [
122             []
123         ]
124     },
125     {
126         "id": "d4e21439.6c2c68",
127         "type": "returnFailure",
128         "name": "return failure",
129         "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"If svc-action is 'deactivate' then request-action must be 'DeleteVnfInstance'\" />\n",
130         "comments": "",
131         "x": 932.5713882446289,
132         "y": 290.79462814331055,
133         "z": "31f1f0b7.be812",
134         "wires": []
135     },
136     {
137         "id": "cb96d310.99dca",
138         "type": "block",
139         "name": "block : atomic",
140         "xml": "<block atomic=\"true\">",
141         "atomic": "true",
142         "outputs": 1,
143         "x": 174.99999237060547,
144         "y": 392.4136600494385,
145         "z": "31f1f0b7.be812",
146         "wires": [
147             [
148                 "163c9760.9a9a79",
149                 "791aad2d.6402d4",
150                 "5fe470c0.6326b",
151                 "314e05bd.fd765a",
152                 "2ee980dc.3023e",
153                 "c5ae4e0b.ba491",
154                 "2cdd37b1.513c28",
155                 "b687fc0c.6ee0d"
156             ]
157         ]
158     },
159     {
160         "id": "791aad2d.6402d4",
161         "type": "switchNode",
162         "name": "switch vnf_length",
163         "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",
164         "comments": "",
165         "outputs": 1,
166         "x": 488.33331298828125,
167         "y": 339.0803518295288,
168         "z": "31f1f0b7.be812",
169         "wires": [
170             [
171                 "69686a76.3c1234"
172             ]
173         ]
174     },
175     {
176         "id": "69686a76.3c1234",
177         "type": "other",
178         "name": "NULL",
179         "xml": "<outcome value=''>\n",
180         "comments": "",
181         "outputs": 1,
182         "x": 674.9999923706055,
183         "y": 338.413649559021,
184         "z": "31f1f0b7.be812",
185         "wires": [
186             [
187                 "6713d6bd.53f838"
188             ]
189         ]
190     },
191     {
192         "id": "6713d6bd.53f838",
193         "type": "returnFailure",
194         "name": "return failure",
195         "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"404\" />\n    <parameter name=\"error-message\" value=\"There are no VNFs in MD-SAL\" />\n",
196         "comments": "",
197         "x": 856.666618347168,
198         "y": 338.413649559021,
199         "z": "31f1f0b7.be812",
200         "wires": []
201     },
202     {
203         "id": "5fe470c0.6326b",
204         "type": "for",
205         "name": "for each vnf",
206         "xml": "<for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >\n",
207         "comments": "",
208         "outputs": 1,
209         "x": 469.99999237060547,
210         "y": 387.41366958618164,
211         "z": "31f1f0b7.be812",
212         "wires": [
213             [
214                 "813eeeef.71253"
215             ]
216         ]
217     },
218     {
219         "id": "813eeeef.71253",
220         "type": "switchNode",
221         "name": "switch this vnf-id == input vnf-id",
222         "xml": "<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>\n",
223         "comments": "",
224         "outputs": 1,
225         "x": 725.0000801086426,
226         "y": 386.08033752441406,
227         "z": "31f1f0b7.be812",
228         "wires": [
229             [
230                 "3f5d6dbd.824612"
231             ]
232         ]
233     },
234     {
235         "id": "3f5d6dbd.824612",
236         "type": "outcomeTrue",
237         "name": "true",
238         "xml": "<outcome value='true'>\n",
239         "comments": "",
240         "outputs": 1,
241         "x": 963.333366394043,
242         "y": 385.0803155899048,
243         "z": "31f1f0b7.be812",
244         "wires": [
245             [
246                 "92e2ba42.5870e8"
247             ]
248         ]
249     },
250     {
251         "id": "92e2ba42.5870e8",
252         "type": "set",
253         "name": "set vnf-index",
254         "xml": "<set>\n<parameter name='vnf-index' value='`$idx`' />\n",
255         "comments": "",
256         "x": 1131.666561126709,
257         "y": 385.08033752441406,
258         "z": "31f1f0b7.be812",
259         "wires": []
260     },
261     {
262         "id": "314e05bd.fd765a",
263         "type": "switchNode",
264         "name": "switch vnf-index",
265         "xml": "<switch test='`$vnf-index`'>\n",
266         "comments": "",
267         "outputs": 1,
268         "x": 481.6666488647461,
269         "y": 434.08033895492554,
270         "z": "31f1f0b7.be812",
271         "wires": [
272             [
273                 "dc4d0087.64549"
274             ]
275         ]
276     },
277     {
278         "id": "dc4d0087.64549",
279         "type": "other",
280         "name": "NULL",
281         "xml": "<outcome value=''>\n",
282         "comments": "",
283         "outputs": 1,
284         "x": 663.3332748413086,
285         "y": 433.41366958618164,
286         "z": "31f1f0b7.be812",
287         "wires": [
288             [
289                 "815b45d5.3c6cc8"
290             ]
291         ]
292     },
293     {
294         "id": "815b45d5.3c6cc8",
295         "type": "returnFailure",
296         "name": "return failure",
297         "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"404\" />\n    <parameter name=\"error-message\" value=\"'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'\" />\n",
298         "comments": "",
299         "x": 829.9999618530273,
300         "y": 433.08029556274414,
301         "z": "31f1f0b7.be812",
302         "wires": []
303     },
304     {
305         "id": "2ee980dc.3023e",
306         "type": "returnSuccess",
307         "name": "return success",
308         "xml": "<return status='success'>\n<parameter name=\"ack-final-indicator\" value=\"Y\" />\n<parameter name=\"error-code\" value=\"200\" />\n<parameter name=\"error-message\" value=\"`$error-message`\" />\n",
309         "comments": "",
310         "x": 474.9999771118164,
311         "y": 654.0803279876709,
312         "z": "31f1f0b7.be812",
313         "wires": []
314     },
315     {
316         "id": "c5ae4e0b.ba491",
317         "type": "set",
318         "name": "set vnf-level-oper-status to PendingDelete",
319         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />\n",
320         "comments": "",
321         "x": 562.4800567626953,
322         "y": 609.7507572174072,
323         "z": "31f1f0b7.be812",
324         "wires": []
325     },
326     {
327         "id": "2cdd37b1.513c28",
328         "type": "set",
329         "name": "copy input data",
330         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />\n\n",
331         "comments": "",
332         "x": 476.6665573120117,
333         "y": 567.4136371612549,
334         "z": "31f1f0b7.be812",
335         "wires": []
336     },
337     {
338         "id": "4fa6056b.b7de5c",
339         "type": "returnFailure",
340         "name": "return failure",
341         "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`\" />\n",
342         "comments": "",
343         "x": 1028.3332710266113,
344         "y": 520.0000114440918,
345         "z": "31f1f0b7.be812",
346         "wires": []
347     },
348     {
349         "id": "142a1a7a.ff7cd6",
350         "type": "failure",
351         "name": "failure",
352         "xml": "<outcome value='failure'>\n",
353         "comments": "",
354         "outputs": 1,
355         "x": 859.3571701049805,
356         "y": 476.28582286834717,
357         "z": "31f1f0b7.be812",
358         "wires": [
359             [
360                 "ec70e2bc.1d824"
361             ]
362         ]
363     },
364     {
365         "id": "20247378.f063bc",
366         "type": "not-found",
367         "name": "not-found",
368         "xml": "<outcome value='not-found'>\n",
369         "comments": "",
370         "outputs": 1,
371         "x": 867.9286003112793,
372         "y": 520.571536064148,
373         "z": "31f1f0b7.be812",
374         "wires": [
375             [
376                 "4fa6056b.b7de5c"
377             ]
378         ]
379     },
380     {
381         "id": "ec70e2bc.1d824",
382         "type": "returnFailure",
383         "name": "return failure",
384         "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"Error updating generic-vnf in AAI\" />\n",
385         "comments": "",
386         "x": 1031.0238647460938,
387         "y": 476.76221656799316,
388         "z": "31f1f0b7.be812",
389         "wires": []
390     },
391     {
392         "id": "b687fc0c.6ee0d",
393         "type": "save",
394         "name": "update generic-vnf orch-status to PendingDelete",
395         "xml": "<update plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\"\n   resource=\"generic-vnf\"\n   key=\"generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id\"\n   force=\"true\" pfx=\"tmp.AnAI-data\">\n<parameter name=\"orchestration-status\" value=\"PendingDelete\" />\n",
396         "comments": "",
397         "outputs": 1,
398         "x": 583.3332366943359,
399         "y": 496.00005054473877,
400         "z": "31f1f0b7.be812",
401         "wires": [
402             [
403                 "142a1a7a.ff7cd6",
404                 "20247378.f063bc"
405             ]
406         ]
407     }
408 ]