Add generic-resource-api DG seed code
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_vnf-topology-operation-unassign.json
1 [
2     {
3         "id": "96001a8c.4d0748",
4         "type": "dgstart",
5         "name": "DGSTART",
6         "outputs": 1,
7         "x": 101.66666412353516,
8         "y": 81.66666412353516,
9         "z": "ff974913.290918",
10         "wires": [
11             [
12                 "7c64b7f3.ff25c8"
13             ]
14         ]
15     },
16     {
17         "id": "7c64b7f3.ff25c8",
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": 176.9523696899414,
26         "y": 121.90477561950684,
27         "z": "ff974913.290918",
28         "wires": [
29             [
30                 "e77f5801.4ec068"
31             ]
32         ]
33     },
34     {
35         "id": "e77f5801.4ec068",
36         "type": "method",
37         "name": "method vnf-topology-operation-unassign",
38         "xml": "<method rpc='vnf-topology-operation-unassign' mode='sync'>\n",
39         "comments": "",
40         "outputs": 1,
41         "x": 200.0952911376953,
42         "y": 161.66666412353516,
43         "z": "ff974913.290918",
44         "wires": [
45             [
46                 "3346143.6ec13ec"
47             ]
48         ]
49     },
50     {
51         "id": "97471b5d.533f18",
52         "type": "comment",
53         "name": "vnf-topology-operation-unassign",
54         "info": "",
55         "comments": "",
56         "x": 496.0115203857422,
57         "y": 29.253007888793945,
58         "z": "ff974913.290918",
59         "wires": []
60     },
61     {
62         "id": "7ffc5961.3c2bf8",
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": 505.1904754638672,
69         "y": 260.52380180358887,
70         "z": "ff974913.290918",
71         "wires": [
72             [
73                 "88a6a6b8.f339b8",
74                 "bae1be9d.b2504"
75             ]
76         ]
77     },
78     {
79         "id": "88a6a6b8.f339b8",
80         "type": "outcome",
81         "name": "DeleteVnfInstance",
82         "xml": "<outcome value='DeleteVnfInstance'>\n",
83         "comments": "",
84         "outputs": 1,
85         "x": 758.9047698974609,
86         "y": 237.66668319702148,
87         "z": "ff974913.290918",
88         "wires": [
89             [
90                 "69c905eb.131a1c"
91             ]
92         ]
93     },
94     {
95         "id": "bae1be9d.b2504",
96         "type": "other",
97         "name": "other",
98         "xml": "<outcome value='Other'>\n",
99         "comments": "",
100         "outputs": 1,
101         "x": 720.9047355651855,
102         "y": 283.3810110092163,
103         "z": "ff974913.290918",
104         "wires": [
105             [
106                 "3461fef6.36d722"
107             ]
108         ]
109     },
110     {
111         "id": "69c905eb.131a1c",
112         "type": "block",
113         "name": "block",
114         "xml": "<block>\n",
115         "atomic": "false",
116         "comments": "",
117         "outputs": 1,
118         "x": 943.7618980407715,
119         "y": 237.6667127609253,
120         "z": "ff974913.290918",
121         "wires": [
122             []
123         ]
124     },
125     {
126         "id": "3461fef6.36d722",
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": 960.9047431945801,
132         "y": 283.3809690475464,
133         "z": "ff974913.290918",
134         "wires": []
135     },
136     {
137         "id": "3346143.6ec13ec",
138         "type": "block",
139         "name": "block : atomic",
140         "xml": "<block atomic=\"true\">",
141         "atomic": "true",
142         "outputs": 1,
143         "x": 180,
144         "y": 554.9999980926514,
145         "z": "ff974913.290918",
146         "wires": [
147             [
148                 "7ffc5961.3c2bf8",
149                 "c3ee1f54.e9c49",
150                 "6f08ad34.331214",
151                 "f989a9a8.a235a8",
152                 "51b5c082.75d5f",
153                 "6b1e8937.811c58",
154                 "796a94e1.89abac",
155                 "9a9f9c4c.fbd22"
156             ]
157         ]
158     },
159     {
160         "id": "c3ee1f54.e9c49",
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": 491.6666488647461,
167         "y": 330.0000276565552,
168         "z": "ff974913.290918",
169         "wires": [
170             [
171                 "14653468.3f5d1c"
172             ]
173         ]
174     },
175     {
176         "id": "14653468.3f5d1c",
177         "type": "other",
178         "name": "NULL",
179         "xml": "<outcome value=''>\n",
180         "comments": "",
181         "outputs": 1,
182         "x": 678.3333282470703,
183         "y": 329.33332538604736,
184         "z": "ff974913.290918",
185         "wires": [
186             [
187                 "15374e8a.9b3331"
188             ]
189         ]
190     },
191     {
192         "id": "15374e8a.9b3331",
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": 859.9999542236328,
198         "y": 329.33332538604736,
199         "z": "ff974913.290918",
200         "wires": []
201     },
202     {
203         "id": "6b1e8937.811c58",
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": 473.3333282470703,
210         "y": 378.333345413208,
211         "z": "ff974913.290918",
212         "wires": [
213             [
214                 "ac39155f.e69998"
215             ]
216         ]
217     },
218     {
219         "id": "ac39155f.e69998",
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": 728.3334159851074,
226         "y": 377.00001335144043,
227         "z": "ff974913.290918",
228         "wires": [
229             [
230                 "2a9affc9.05758"
231             ]
232         ]
233     },
234     {
235         "id": "2a9affc9.05758",
236         "type": "outcomeTrue",
237         "name": "true",
238         "xml": "<outcome value='true'>\n",
239         "comments": "",
240         "outputs": 1,
241         "x": 966.6667022705078,
242         "y": 375.99999141693115,
243         "z": "ff974913.290918",
244         "wires": [
245             [
246                 "f089091c.aad928"
247             ]
248         ]
249     },
250     {
251         "id": "f089091c.aad928",
252         "type": "set",
253         "name": "set vnf-index",
254         "xml": "<set>\n<parameter name='vnf-index' value='`$idx`' />\n",
255         "comments": "",
256         "x": 1134.9998970031738,
257         "y": 376.00001335144043,
258         "z": "ff974913.290918",
259         "wires": []
260     },
261     {
262         "id": "796a94e1.89abac",
263         "type": "switchNode",
264         "name": "switch vnf-index",
265         "xml": "<switch test='`$vnf-index`'>\n",
266         "comments": "",
267         "outputs": 1,
268         "x": 484.99999237060547,
269         "y": 425.00001525878906,
270         "z": "ff974913.290918",
271         "wires": [
272             [
273                 "7c43e234.9e600c"
274             ]
275         ]
276     },
277     {
278         "id": "7c43e234.9e600c",
279         "type": "other",
280         "name": "NULL",
281         "xml": "<outcome value=''>\n",
282         "comments": "",
283         "outputs": 1,
284         "x": 666.6666107177734,
285         "y": 424.333345413208,
286         "z": "ff974913.290918",
287         "wires": [
288             [
289                 "54a44960.3d1bc8"
290             ]
291         ]
292     },
293     {
294         "id": "54a44960.3d1bc8",
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": 833.3332977294922,
300         "y": 423.9999713897705,
301         "z": "ff974913.290918",
302         "wires": []
303     },
304     {
305         "id": "6f08ad34.331214",
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": 476.3333168029785,
311         "y": 843.3332319259644,
312         "z": "ff974913.290918",
313         "wires": []
314     },
315     {
316         "id": "28425fad.bcfa3",
317         "type": "for",
318         "name": "for each vnf",
319         "xml": "<for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >\n",
320         "comments": "",
321         "outputs": 1,
322         "x": 999.1126251220703,
323         "y": 683.3332605361938,
324         "z": "ff974913.290918",
325         "wires": [
326             [
327                 "95eae07b.ee605"
328             ]
329         ]
330     },
331     {
332         "id": "fcd23488.435248",
333         "type": "comment",
334         "name": "Remove VNF from service data",
335         "info": "",
336         "comments": "",
337         "x": 441.2713928222656,
338         "y": 641.9049129486084,
339         "z": "ff974913.290918",
340         "wires": []
341     },
342     {
343         "id": "95eae07b.ee605",
344         "type": "set",
345         "name": "move vnf to remove one",
346         "xml": "<set>\n\t<parameter name=\"$tmpidx\" value=\"`$idx - 1`\"/>\n\t<parameter name=\"service-data.vnfs.vnf[$tmpidx].\" value=\"$service-data.vnfs.vnf[$idx].\" />\n\t\n",
347         "comments": "",
348         "x": 1232.703758239746,
349         "y": 682.3572120666504,
350         "z": "ff974913.290918",
351         "wires": []
352     },
353     {
354         "id": "51b5c082.75d5f",
355         "type": "switchNode",
356         "name": "switch vnf_length",
357         "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",
358         "comments": "",
359         "outputs": 1,
360         "x": 485.37048721313477,
361         "y": 684.9128894805908,
362         "z": "ff974913.290918",
363         "wires": [
364             [
365                 "7b55138b.dcab3c",
366                 "75e73554.80932c"
367             ]
368         ]
369     },
370     {
371         "id": "7b55138b.dcab3c",
372         "type": "outcome",
373         "name": "1",
374         "xml": "<outcome value='1'>\n",
375         "comments": "",
376         "outputs": 1,
377         "x": 662.3705291748047,
378         "y": 645.5794763565063,
379         "z": "ff974913.290918",
380         "wires": [
381             [
382                 "4cc25dc3.e0aa74"
383             ]
384         ]
385     },
386     {
387         "id": "4cc25dc3.e0aa74",
388         "type": "set",
389         "name": "Remove vnfs",
390         "xml": "<set>\n\t<parameter name=\"service-data.vnfs.\" value=\"\"/>\n\n",
391         "comments": "",
392         "x": 826.0370254516602,
393         "y": 645.5795755386353,
394         "z": "ff974913.290918",
395         "wires": []
396     },
397     {
398         "id": "75e73554.80932c",
399         "type": "other",
400         "name": "other",
401         "xml": "<outcome value='Other'>\n",
402         "comments": "",
403         "outputs": 1,
404         "x": 661.0372734069824,
405         "y": 728.9127492904663,
406         "z": "ff974913.290918",
407         "wires": [
408             [
409                 "ac4d3a04.d29a88"
410             ]
411         ]
412     },
413     {
414         "id": "9a214120.4a1eb",
415         "type": "set",
416         "name": "set new vnf length",
417         "xml": "<set>\n\t<parameter name=\"service-data.vnfs.vnf_length\" value=\"`$service-data.vnfs.vnf_length - 1`\"/>\n\n\t\n",
418         "comments": "",
419         "x": 1018.6667137145996,
420         "y": 773.9128341674805,
421         "z": "ff974913.290918",
422         "wires": []
423     },
424     {
425         "id": "4989e0b1.ae7b3",
426         "type": "set",
427         "name": "Remove the last vnf in the list",
428         "xml": "<set>\n\t<parameter name=\"service-data.vnfs.vnf[$service-data.vnfs.vnf_length-1].\" value=\"\"/>\n\n",
429         "comments": "",
430         "x": 1054.3703689575195,
431         "y": 729.0238552093506,
432         "z": "ff974913.290918",
433         "wires": []
434     },
435     {
436         "id": "ac4d3a04.d29a88",
437         "type": "block",
438         "name": "block : atomic",
439         "xml": "<block atomic=\"true\">",
440         "atomic": "true",
441         "outputs": 1,
442         "x": 829.7037620544434,
443         "y": 729.5793962478638,
444         "z": "ff974913.290918",
445         "wires": [
446             [
447                 "28425fad.bcfa3",
448                 "4989e0b1.ae7b3",
449                 "9a214120.4a1eb"
450             ]
451         ]
452     },
453     {
454         "id": "9a9f9c4c.fbd22",
455         "type": "switchNode",
456         "name": "switch current vnf-level-oper-status == Created",
457         "xml": "<switch test=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status == 'Created'`\">\n",
458         "comments": "",
459         "outputs": 1,
460         "x": 584.3333053588867,
461         "y": 470.6666851043701,
462         "z": "ff974913.290918",
463         "wires": [
464             [
465                 "11283b53.5e5e25"
466             ]
467         ]
468     },
469     {
470         "id": "11283b53.5e5e25",
471         "type": "outcomeFalse",
472         "name": "true",
473         "xml": "<outcome value='true'>\n",
474         "comments": "",
475         "outputs": 1,
476         "x": 889.0000228881836,
477         "y": 470.33332443237305,
478         "z": "ff974913.290918",
479         "wires": [
480             [
481                 "54f5d0c9.b7a0e"
482             ]
483         ]
484     },
485     {
486         "id": "54f5d0c9.b7a0e",
487         "type": "returnFailure",
488         "name": "return failure",
489         "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=\"Cannot delete a VNF in a Created state\" />\n",
490         "comments": "",
491         "x": 1047.3332977294922,
492         "y": 469.6666488647461,
493         "z": "ff974913.290918",
494         "wires": []
495     },
496     {
497         "id": "f989a9a8.a235a8",
498         "type": "switchNode",
499         "name": "switch current vf-module_length",
500         "xml": "<switch test=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`\">\n",
501         "comments": "",
502         "outputs": 1,
503         "x": 534.6666488647461,
504         "y": 556.6666507720947,
505         "z": "ff974913.290918",
506         "wires": [
507             [
508                 "5339c0a3.6e70e",
509                 "4bffbedb.077b6",
510                 "58060ac1.258e84"
511             ]
512         ]
513     },
514     {
515         "id": "5339c0a3.6e70e",
516         "type": "outcome",
517         "name": "0",
518         "xml": "<outcome value='0'>\n",
519         "comments": "",
520         "outputs": 1,
521         "x": 763.3332901000977,
522         "y": 513.3332920074463,
523         "z": "ff974913.290918",
524         "wires": [
525             [
526                 "8ae2c8.5df55d38"
527             ]
528         ]
529     },
530     {
531         "id": "4bffbedb.077b6",
532         "type": "outcome",
533         "name": "NULL",
534         "xml": "<outcome value=''>",
535         "comments": "",
536         "outputs": 1,
537         "x": 761.9047012329102,
538         "y": 554.7619495391846,
539         "z": "ff974913.290918",
540         "wires": [
541             [
542                 "8ae2c8.5df55d38"
543             ]
544         ]
545     },
546     {
547         "id": "8ae2c8.5df55d38",
548         "type": "block",
549         "name": "block",
550         "xml": "<block>\n",
551         "atomic": "false",
552         "comments": "",
553         "outputs": 1,
554         "x": 910.4762153625488,
555         "y": 534.7619504928589,
556         "z": "ff974913.290918",
557         "wires": [
558             []
559         ]
560     },
561     {
562         "id": "58060ac1.258e84",
563         "type": "other",
564         "name": "other",
565         "xml": "<outcome value='Other'>\n",
566         "comments": "",
567         "outputs": 1,
568         "x": 761.9047508239746,
569         "y": 596.1905374526978,
570         "z": "ff974913.290918",
571         "wires": [
572             [
573                 "90982233.8ef03"
574             ]
575         ]
576     },
577     {
578         "id": "90982233.8ef03",
579         "type": "returnFailure",
580         "name": "return failure",
581         "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=\"Cannot delete the VNF because there are VFs defined\" />\n",
582         "comments": "",
583         "x": 929.0476455688477,
584         "y": 595.7619256973267,
585         "z": "ff974913.290918",
586         "wires": []
587     }
588 ]