Add generic-resource-api DG seed code
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.json
1 [
2     {
3         "id": "9308e75f.05f858",
4         "type": "dgstart",
5         "name": "DGSTART",
6         "outputs": 1,
7         "x": 103.33332824707031,
8         "y": 78.33332824707031,
9         "z": "66718f17.55d5b",
10         "wires": [
11             [
12                 "878f150c.2e48d8"
13             ]
14         ]
15     },
16     {
17         "id": "878f150c.2e48d8",
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": 178.61903381347656,
26         "y": 118.57143974304199,
27         "z": "66718f17.55d5b",
28         "wires": [
29             [
30                 "a015909f.179d2"
31             ]
32         ]
33     },
34     {
35         "id": "a015909f.179d2",
36         "type": "method",
37         "name": "method vf-module-topology-operation-deactivate",
38         "xml": "<method rpc='vf-module-topology-operation-deactivate' mode='sync'>\n",
39         "comments": "",
40         "outputs": 1,
41         "x": 228.42862701416016,
42         "y": 158.33332443237305,
43         "z": "66718f17.55d5b",
44         "wires": [
45             [
46                 "c7c25d58.df7b4"
47             ]
48         ]
49     },
50     {
51         "id": "b22c04d8.425a68",
52         "type": "comment",
53         "name": "vf-module-topology-operation-deactivate",
54         "info": "",
55         "comments": "",
56         "x": 497.67818450927734,
57         "y": 25.9196720123291,
58         "z": "66718f17.55d5b",
59         "wires": []
60     },
61     {
62         "id": "9077c4fc.db6fb8",
63         "type": "switchNode",
64         "name": "switch request-action",
65         "xml": "<switch test='`$vf-module-topology-operation-input.request-information.request-action`'>\n",
66         "comments": "",
67         "outputs": 1,
68         "x": 506.85713958740234,
69         "y": 257.190465927124,
70         "z": "66718f17.55d5b",
71         "wires": [
72             [
73                 "36986752.8db598",
74                 "ae847a12.f2ba48"
75             ]
76         ]
77     },
78     {
79         "id": "36986752.8db598",
80         "type": "outcome",
81         "name": "DeleteVfModuleInstance",
82         "xml": "<outcome value='DeleteVfModuleInstance'>\n",
83         "comments": "",
84         "outputs": 1,
85         "x": 768.9047546386719,
86         "y": 234.33335208892822,
87         "z": "66718f17.55d5b",
88         "wires": [
89             [
90                 "6bfdb413.6dba6c"
91             ]
92         ]
93     },
94     {
95         "id": "ae847a12.f2ba48",
96         "type": "other",
97         "name": "other",
98         "xml": "<outcome value='Other'>\n",
99         "comments": "",
100         "outputs": 1,
101         "x": 712.5713996887207,
102         "y": 279.71434116363525,
103         "z": "66718f17.55d5b",
104         "wires": [
105             [
106                 "840b0e33.1be94"
107             ]
108         ]
109     },
110     {
111         "id": "6bfdb413.6dba6c",
112         "type": "block",
113         "name": "block",
114         "xml": "<block>\n",
115         "atomic": "false",
116         "comments": "",
117         "outputs": 1,
118         "x": 958.7619190216064,
119         "y": 234.33338356018066,
120         "z": "66718f17.55d5b",
121         "wires": [
122             []
123         ]
124     },
125     {
126         "id": "840b0e33.1be94",
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 'DeleteVfModuleInstance'\" />\n",
130         "comments": "",
131         "x": 977.5714073181152,
132         "y": 280.04765367507935,
133         "z": "66718f17.55d5b",
134         "wires": []
135     },
136     {
137         "id": "c7c25d58.df7b4",
138         "type": "block",
139         "name": "block : atomic",
140         "xml": "<block atomic=\"true\">",
141         "atomic": "true",
142         "outputs": 1,
143         "x": 126.66666412353516,
144         "y": 541.666618347168,
145         "z": "66718f17.55d5b",
146         "wires": [
147             [
148                 "9077c4fc.db6fb8",
149                 "bf2aa82.3dc7e58",
150                 "3439a9d8.ab9236",
151                 "8fb6cdcf.b16af",
152                 "cd383d34.c434c",
153                 "e644f473.82cda8",
154                 "2f8a8aae.f43eb6",
155                 "6a53a509.21c6fc",
156                 "a3c6b6a0.82de08",
157                 "fcd4522.e4775b",
158                 "b1395859.6a0108",
159                 "762c177b.08d768"
160             ]
161         ]
162     },
163     {
164         "id": "3439a9d8.ab9236",
165         "type": "switchNode",
166         "name": "switch service-data.vnfs.vnf_length",
167         "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",
168         "comments": "",
169         "outputs": 1,
170         "x": 553.3333129882812,
171         "y": 401.66664123535156,
172         "z": "66718f17.55d5b",
173         "wires": [
174             [
175                 "6917fb8.2adad04",
176                 "9afc044d.1d85f8"
177             ]
178         ]
179     },
180     {
181         "id": "6917fb8.2adad04",
182         "type": "other",
183         "name": "NULL",
184         "xml": "<outcome value=''>\n",
185         "comments": "",
186         "outputs": 1,
187         "x": 794.0475845336914,
188         "y": 378.80938148498535,
189         "z": "66718f17.55d5b",
190         "wires": [
191             [
192                 "683e93db.bf1b8c"
193             ]
194         ]
195     },
196     {
197         "id": "9afc044d.1d85f8",
198         "type": "other",
199         "name": "other",
200         "xml": "<outcome value='Other'>\n",
201         "comments": "",
202         "outputs": 1,
203         "x": 793.8094253540039,
204         "y": 419.7618999481201,
205         "z": "66718f17.55d5b",
206         "wires": [
207             [
208                 "93864c89.1db7a"
209             ]
210         ]
211     },
212     {
213         "id": "683e93db.bf1b8c",
214         "type": "returnFailure",
215         "name": "return failure",
216         "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=\"There are no VNFs defined in MD-SAL\" />\n",
217         "comments": "",
218         "x": 960.7141990661621,
219         "y": 378.09513664245605,
220         "z": "66718f17.55d5b",
221         "wires": []
222     },
223     {
224         "id": "93864c89.1db7a",
225         "type": "for",
226         "name": "for each vnf",
227         "xml": "<for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >\n",
228         "comments": "",
229         "outputs": 1,
230         "x": 956.0475692749023,
231         "y": 419.4285182952881,
232         "z": "66718f17.55d5b",
233         "wires": [
234             [
235                 "816952d1.278e1"
236             ]
237         ]
238     },
239     {
240         "id": "816952d1.278e1",
241         "type": "switchNode",
242         "name": "switch service data vnf == input vnf",
243         "xml": "<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>\n",
244         "comments": "",
245         "outputs": 1,
246         "x": 1207.380786895752,
247         "y": 419.09520530700684,
248         "z": "66718f17.55d5b",
249         "wires": [
250             [
251                 "4dae753e.0c4bac"
252             ]
253         ]
254     },
255     {
256         "id": "4dae753e.0c4bac",
257         "type": "outcomeTrue",
258         "name": "true",
259         "xml": "<outcome value='true'>\n",
260         "comments": "",
261         "outputs": 1,
262         "x": 1437.3808784484863,
263         "y": 418.4285593032837,
264         "z": "66718f17.55d5b",
265         "wires": [
266             [
267                 "3161b7a1.0cc078"
268             ]
269         ]
270     },
271     {
272         "id": "bf2aa82.3dc7e58",
273         "type": "set",
274         "name": "set vnf-index to -1",
275         "xml": "<set>\n<parameter name='vnf-index' value='-1' />\n",
276         "comments": "",
277         "x": 502.3809356689453,
278         "y": 333.0951404571533,
279         "z": "66718f17.55d5b",
280         "wires": []
281     },
282     {
283         "id": "78c0e49e.7d500c",
284         "type": "set",
285         "name": "set vnf-index to idx",
286         "xml": "<set>\n<parameter name='vnf-index' value='`$idx`' />\n",
287         "comments": "",
288         "x": 1759.0475158691406,
289         "y": 389.42851734161377,
290         "z": "66718f17.55d5b",
291         "wires": []
292     },
293     {
294         "id": "8fb6cdcf.b16af",
295         "type": "switchNode",
296         "name": "switch vnf-index",
297         "xml": "<switch test='`$vnf-index`'>\n",
298         "comments": "",
299         "outputs": 1,
300         "x": 492.38094329833984,
301         "y": 469.76183700561523,
302         "z": "66718f17.55d5b",
303         "wires": [
304             [
305                 "ee9f9bc9.c74618"
306             ]
307         ]
308     },
309     {
310         "id": "ee9f9bc9.c74618",
311         "type": "outcome",
312         "name": "-1",
313         "xml": "<outcome value='-1'>\n",
314         "comments": "",
315         "outputs": 1,
316         "x": 670.7143287658691,
317         "y": 469.09521293640137,
318         "z": "66718f17.55d5b",
319         "wires": [
320             [
321                 "d0b968e1.02fc78"
322             ]
323         ]
324     },
325     {
326         "id": "d0b968e1.02fc78",
327         "type": "returnFailure",
328         "name": "return failure",
329         "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=\"`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`\" />\n",
330         "comments": "",
331         "x": 830.7142372131348,
332         "y": 468.42851638793945,
333         "z": "66718f17.55d5b",
334         "wires": []
335     },
336     {
337         "id": "3161b7a1.0cc078",
338         "type": "block",
339         "name": "block",
340         "xml": "<block>\n",
341         "atomic": "false",
342         "comments": "",
343         "outputs": 1,
344         "x": 1585.714340209961,
345         "y": 417.34825801849365,
346         "z": "66718f17.55d5b",
347         "wires": [
348             [
349                 "78c0e49e.7d500c",
350                 "d8a1c30a.67ec2"
351             ]
352         ]
353     },
354     {
355         "id": "d8a1c30a.67ec2",
356         "type": "break",
357         "name": "break",
358         "xml": "<break>\n",
359         "comments": "",
360         "x": 1720.7143058776855,
361         "y": 439.01484394073486,
362         "z": "66718f17.55d5b",
363         "wires": []
364     },
365     {
366         "id": "e644f473.82cda8",
367         "type": "switchNode",
368         "name": "switch service-data...vf-module_length",
369         "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>\n",
370         "comments": "",
371         "outputs": 1,
372         "x": 566.6666259765625,
373         "y": 591.6666660308838,
374         "z": "66718f17.55d5b",
375         "wires": [
376             [
377                 "dabca98f.b55858",
378                 "d754c5bd.ecf668"
379             ]
380         ]
381     },
382     {
383         "id": "dabca98f.b55858",
384         "type": "other",
385         "name": "NULL",
386         "xml": "<outcome value=''>\n",
387         "comments": "",
388         "outputs": 1,
389         "x": 817.3809356689453,
390         "y": 570.4760694503784,
391         "z": "66718f17.55d5b",
392         "wires": [
393             [
394                 "13063c42.536de4"
395             ]
396         ]
397     },
398     {
399         "id": "d754c5bd.ecf668",
400         "type": "other",
401         "name": "other",
402         "xml": "<outcome value='Other'>\n",
403         "comments": "",
404         "outputs": 1,
405         "x": 817.1427764892578,
406         "y": 611.4285879135132,
407         "z": "66718f17.55d5b",
408         "wires": [
409             [
410                 "601e343c.8c78cc"
411             ]
412         ]
413     },
414     {
415         "id": "13063c42.536de4",
416         "type": "returnFailure",
417         "name": "return failure",
418         "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=\"`'There are no VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`\" />\n",
419         "comments": "",
420         "x": 984.047550201416,
421         "y": 569.7618246078491,
422         "z": "66718f17.55d5b",
423         "wires": []
424     },
425     {
426         "id": "601e343c.8c78cc",
427         "type": "for",
428         "name": "for each vf-module",
429         "xml": "<for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >\n",
430         "comments": "",
431         "outputs": 1,
432         "x": 979.3809204101562,
433         "y": 611.0952062606812,
434         "z": "66718f17.55d5b",
435         "wires": [
436             [
437                 "8c46688e.150378"
438             ]
439         ]
440     },
441     {
442         "id": "8c46688e.150378",
443         "type": "switchNode",
444         "name": "switch service data vf-module == input vf-module",
445         "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>\n",
446         "comments": "",
447         "outputs": 1,
448         "x": 1285.7140808105469,
449         "y": 610.76194190979,
450         "z": "66718f17.55d5b",
451         "wires": [
452             [
453                 "f337ae4d.c9823"
454             ]
455         ]
456     },
457     {
458         "id": "f337ae4d.c9823",
459         "type": "outcomeTrue",
460         "name": "true",
461         "xml": "<outcome value='true'>\n",
462         "comments": "",
463         "outputs": 1,
464         "x": 1555.7141342163086,
465         "y": 608.4285469055176,
466         "z": "66718f17.55d5b",
467         "wires": [
468             [
469                 "4421d8b3.cc5a98"
470             ]
471         ]
472     },
473     {
474         "id": "cd383d34.c434c",
475         "type": "set",
476         "name": "set vf-module-index to -1",
477         "xml": "<set>\n<parameter name='vf-module-index' value='-1' />\n",
478         "comments": "",
479         "x": 522.3809204101562,
480         "y": 526.428503036499,
481         "z": "66718f17.55d5b",
482         "wires": []
483     },
484     {
485         "id": "26c56276.cbbaee",
486         "type": "set",
487         "name": "set vf-module-index to idx",
488         "xml": "<set>\n<parameter name='vf-module-index' value='`$idx`' />\n",
489         "comments": "",
490         "x": 1885.714225769043,
491         "y": 579.4285259246826,
492         "z": "66718f17.55d5b",
493         "wires": []
494     },
495     {
496         "id": "2f8a8aae.f43eb6",
497         "type": "switchNode",
498         "name": "switch vf-module-index",
499         "xml": "<switch test='`$vf-module-index`'>\n",
500         "comments": "",
501         "outputs": 1,
502         "x": 514.0476036071777,
503         "y": 663.0952157974243,
504         "z": "66718f17.55d5b",
505         "wires": [
506             [
507                 "18ce1819.ff8848"
508             ]
509         ]
510     },
511     {
512         "id": "18ce1819.ff8848",
513         "type": "outcome",
514         "name": "-1",
515         "xml": "<outcome value='-1'>\n",
516         "comments": "",
517         "outputs": 1,
518         "x": 692.380989074707,
519         "y": 662.4285917282104,
520         "z": "66718f17.55d5b",
521         "wires": [
522             [
523                 "966d8d53.6b6fa"
524             ]
525         ]
526     },
527     {
528         "id": "966d8d53.6b6fa",
529         "type": "returnFailure",
530         "name": "return failure",
531         "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=\"`'Unable to find VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`\" />\n",
532         "comments": "",
533         "x": 852.3808975219727,
534         "y": 661.7618951797485,
535         "z": "66718f17.55d5b",
536         "wires": []
537     },
538     {
539         "id": "4421d8b3.cc5a98",
540         "type": "block",
541         "name": "block",
542         "xml": "<block>\n",
543         "atomic": "false",
544         "comments": "",
545         "outputs": 1,
546         "x": 1689.0476760864258,
547         "y": 607.3482866287231,
548         "z": "66718f17.55d5b",
549         "wires": [
550             [
551                 "26c56276.cbbaee",
552                 "8db1d4c2.4e5f98"
553             ]
554         ]
555     },
556     {
557         "id": "8db1d4c2.4e5f98",
558         "type": "break",
559         "name": "break",
560         "xml": "<break>\n",
561         "comments": "",
562         "x": 1824.0476417541504,
563         "y": 629.0148725509644,
564         "z": "66718f17.55d5b",
565         "wires": []
566     },
567     {
568         "id": "6a53a509.21c6fc",
569         "type": "set",
570         "name": "set order-status to PendingDelete",
571         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.order-status'\n  value='PendingDelete' />\n",
572         "comments": "",
573         "x": 550.0000305175781,
574         "y": 903.3332681655884,
575         "z": "66718f17.55d5b",
576         "wires": []
577     },
578     {
579         "id": "a3c6b6a0.82de08",
580         "type": "set",
581         "name": "set vf-module-status to PendingDelete",
582         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-topology.vf-module-assignments.vf-module-status' value='PendingDelete' />\n",
583         "comments": "",
584         "x": 561.3333435058594,
585         "y": 725.0000095367432,
586         "z": "66718f17.55d5b",
587         "wires": []
588     },
589     {
590         "id": "fcd4522.e4775b",
591         "type": "save",
592         "name": "update vf-module to PendingDelete",
593         "xml": "<update plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\"\n   resource=\"vf-module\"\n   key=\"vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id\n      AND generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id\"\n   force=\"true\" pfx=\"tmp.AnAI-data\">\n<parameter name=\"orchestration-status\" value=\"PendingDelete\" />\n",
594         "comments": "",
595         "outputs": 1,
596         "x": 551.6667175292969,
597         "y": 786.666618347168,
598         "z": "66718f17.55d5b",
599         "wires": [
600             [
601                 "1e182c2d.f61464",
602                 "7c1bc2f6.54919c"
603             ]
604         ]
605     },
606     {
607         "id": "19ff43f6.90e7bc",
608         "type": "returnFailure",
609         "name": "return failure",
610         "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 vf-module found in AAI for vf module ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`\" />\n",
611         "comments": "",
612         "x": 971.6667938232422,
613         "y": 811.6666450500488,
614         "z": "66718f17.55d5b",
615         "wires": []
616     },
617     {
618         "id": "1e182c2d.f61464",
619         "type": "failure",
620         "name": "failure",
621         "xml": "<outcome value='failure'>\n",
622         "comments": "",
623         "outputs": 1,
624         "x": 784.3573608398438,
625         "y": 768.6191148757935,
626         "z": "66718f17.55d5b",
627         "wires": [
628             [
629                 "b0f96d27.7ef2b"
630             ]
631         ]
632     },
633     {
634         "id": "7c1bc2f6.54919c",
635         "type": "not-found",
636         "name": "not-found",
637         "xml": "<outcome value='not-found'>\n",
638         "comments": "",
639         "outputs": 1,
640         "x": 792.9287910461426,
641         "y": 812.9048280715942,
642         "z": "66718f17.55d5b",
643         "wires": [
644             [
645                 "19ff43f6.90e7bc"
646             ]
647         ]
648     },
649     {
650         "id": "b0f96d27.7ef2b",
651         "type": "returnFailure",
652         "name": "return failure",
653         "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 vf-module in AAI\" />\n",
654         "comments": "",
655         "x": 974.3573875427246,
656         "y": 768.4288501739502,
657         "z": "66718f17.55d5b",
658         "wires": []
659     },
660     {
661         "id": "b1395859.6a0108",
662         "type": "set",
663         "name": "copy input data",
664         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'\n   value='$vf-module-topology-operation-input.sdnc-request-header.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.'\n   value='$vf-module-topology-operation-input.request-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.'\n   value='$vf-module-topology-operation-input.service-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.'\n   value='$vf-module-topology-operation-input.vnf-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.'\n   value='$vf-module-topology-operation-input.vf-module-information.' />\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.'\n   value='$vf-module-topology-operation-input.vf-module-request-input.' />\n\n",
665         "comments": "",
666         "x": 489.9999694824219,
667         "y": 856.6666259765625,
668         "z": "66718f17.55d5b",
669         "wires": []
670     },
671     {
672         "id": "762c177b.08d768",
673         "type": "returnSuccess",
674         "name": "return success",
675         "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",
676         "comments": "",
677         "x": 488.33331298828125,
678         "y": 953.3333129882812,
679         "z": "66718f17.55d5b",
680         "wires": []
681     }
682 ]