Add generic-resource-api DG seed code
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_vnf-topology-operation-activate.json
1 [
2     {
3         "id": "ebd3636c.7419d",
4         "type": "dgstart",
5         "name": "DGSTART",
6         "outputs": 1,
7         "x": 99.99999237060547,
8         "y": 81.66666412353516,
9         "z": "28c16236.105dde",
10         "wires": [
11             [
12                 "197d48ee.598fa7"
13             ]
14         ]
15     },
16     {
17         "id": "197d48ee.598fa7",
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": 175.28569793701172,
26         "y": 121.90477561950684,
27         "z": "28c16236.105dde",
28         "wires": [
29             [
30                 "e1950959.592288"
31             ]
32         ]
33     },
34     {
35         "id": "e1950959.592288",
36         "type": "method",
37         "name": "method vnf-topology-operation-activate",
38         "xml": "<method rpc='vnf-topology-operation-activate' mode='sync'>\n",
39         "comments": "",
40         "outputs": 1,
41         "x": 196.42861938476562,
42         "y": 161.66666412353516,
43         "z": "28c16236.105dde",
44         "wires": [
45             [
46                 "e344a3c.e6f6f6"
47             ]
48         ]
49     },
50     {
51         "id": "e9d65a3e.e8fb48",
52         "type": "comment",
53         "name": "vnf-topology-operation-activate",
54         "info": "",
55         "comments": "",
56         "x": 494.3448486328125,
57         "y": 29.253007888793945,
58         "z": "28c16236.105dde",
59         "wires": []
60     },
61     {
62         "id": "68902cc2.2a12a4",
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": 503.5238037109375,
69         "y": 260.52380180358887,
70         "z": "28c16236.105dde",
71         "wires": [
72             [
73                 "a0b4d245.da80d",
74                 "ad7ffb1a.cd9d28"
75             ]
76         ]
77     },
78     {
79         "id": "a0b4d245.da80d",
80         "type": "outcome",
81         "name": "CreateVnfInstance",
82         "xml": "<outcome value='CreateVnfInstance'>\n",
83         "comments": "",
84         "outputs": 1,
85         "x": 721.9047660827637,
86         "y": 237.66668605804443,
87         "z": "28c16236.105dde",
88         "wires": [
89             [
90                 "27d2abcf.c98e94"
91             ]
92         ]
93     },
94     {
95         "id": "ad7ffb1a.cd9d28",
96         "type": "other",
97         "name": "other",
98         "xml": "<outcome value='Other'>\n",
99         "comments": "",
100         "outputs": 1,
101         "x": 685.9047317504883,
102         "y": 283.38101387023926,
103         "z": "28c16236.105dde",
104         "wires": [
105             [
106                 "9aea2bb8.636f48"
107             ]
108         ]
109     },
110     {
111         "id": "27d2abcf.c98e94",
112         "type": "block",
113         "name": "block",
114         "xml": "<block>\n",
115         "atomic": "false",
116         "comments": "",
117         "outputs": 1,
118         "x": 908.7618942260742,
119         "y": 237.66671562194824,
120         "z": "28c16236.105dde",
121         "wires": [
122             []
123         ]
124     },
125     {
126         "id": "9aea2bb8.636f48",
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 'activate' then request-action must be 'CreateVnfInstance'\" />\n",
130         "comments": "",
131         "x": 925.9047393798828,
132         "y": 283.38097190856934,
133         "z": "28c16236.105dde",
134         "wires": []
135     },
136     {
137         "id": "e344a3c.e6f6f6",
138         "type": "block",
139         "name": "block : atomic",
140         "xml": "<block atomic=\"true\">",
141         "atomic": "true",
142         "outputs": 1,
143         "x": 176.66665649414062,
144         "y": 383.33333587646484,
145         "z": "28c16236.105dde",
146         "wires": [
147             [
148                 "68902cc2.2a12a4",
149                 "d49c04f8.2ace98",
150                 "788d0909.b021c8",
151                 "99811d90.fc82c",
152                 "7caed7a8.2e9948",
153                 "2fbd1822.35aeb8",
154                 "88b94012.df3c5",
155                 "20178755.68db48",
156                 "5ee26c61.c95f04"
157             ]
158         ]
159     },
160     {
161         "id": "d49c04f8.2ace98",
162         "type": "switchNode",
163         "name": "switch vnf_length",
164         "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",
165         "comments": "",
166         "outputs": 1,
167         "x": 489.9999771118164,
168         "y": 330.0000276565552,
169         "z": "28c16236.105dde",
170         "wires": [
171             [
172                 "85207fdf.7da98"
173             ]
174         ]
175     },
176     {
177         "id": "85207fdf.7da98",
178         "type": "other",
179         "name": "NULL",
180         "xml": "<outcome value=''>\n",
181         "comments": "",
182         "outputs": 1,
183         "x": 676.6666564941406,
184         "y": 329.33332538604736,
185         "z": "28c16236.105dde",
186         "wires": [
187             [
188                 "589c9a44.2b5c64"
189             ]
190         ]
191     },
192     {
193         "id": "589c9a44.2b5c64",
194         "type": "returnFailure",
195         "name": "return failure",
196         "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",
197         "comments": "",
198         "x": 858.3332824707031,
199         "y": 329.33332538604736,
200         "z": "28c16236.105dde",
201         "wires": []
202     },
203     {
204         "id": "788d0909.b021c8",
205         "type": "for",
206         "name": "for each vnf",
207         "xml": "<for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >\n",
208         "comments": "",
209         "outputs": 1,
210         "x": 471.6666564941406,
211         "y": 378.333345413208,
212         "z": "28c16236.105dde",
213         "wires": [
214             [
215                 "2e4255db.76c61a"
216             ]
217         ]
218     },
219     {
220         "id": "2e4255db.76c61a",
221         "type": "switchNode",
222         "name": "switch this vnf-id == input vnf-id",
223         "xml": "<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>\n",
224         "comments": "",
225         "outputs": 1,
226         "x": 726.6667442321777,
227         "y": 377.00001335144043,
228         "z": "28c16236.105dde",
229         "wires": [
230             [
231                 "e8e4ee61.d7a57"
232             ]
233         ]
234     },
235     {
236         "id": "e8e4ee61.d7a57",
237         "type": "outcomeTrue",
238         "name": "true",
239         "xml": "<outcome value='true'>\n",
240         "comments": "",
241         "outputs": 1,
242         "x": 965.0000305175781,
243         "y": 375.99999141693115,
244         "z": "28c16236.105dde",
245         "wires": [
246             [
247                 "bd084402.ebd418"
248             ]
249         ]
250     },
251     {
252         "id": "bd084402.ebd418",
253         "type": "set",
254         "name": "set vnf-index",
255         "xml": "<set>\n<parameter name='vnf-index' value='`$idx`' />\n",
256         "comments": "",
257         "x": 1133.3332252502441,
258         "y": 376.00001335144043,
259         "z": "28c16236.105dde",
260         "wires": []
261     },
262     {
263         "id": "99811d90.fc82c",
264         "type": "switchNode",
265         "name": "switch vnf-index",
266         "xml": "<switch test='`$vnf-index`'>\n",
267         "comments": "",
268         "outputs": 1,
269         "x": 483.3333206176758,
270         "y": 425.00001525878906,
271         "z": "28c16236.105dde",
272         "wires": [
273             [
274                 "cb5737d1.883a28"
275             ]
276         ]
277     },
278     {
279         "id": "cb5737d1.883a28",
280         "type": "other",
281         "name": "NULL",
282         "xml": "<outcome value=''>\n",
283         "comments": "",
284         "outputs": 1,
285         "x": 664.9999389648438,
286         "y": 424.333345413208,
287         "z": "28c16236.105dde",
288         "wires": [
289             [
290                 "4eb36fef.c52b2"
291             ]
292         ]
293     },
294     {
295         "id": "4eb36fef.c52b2",
296         "type": "returnFailure",
297         "name": "return failure",
298         "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",
299         "comments": "",
300         "x": 831.6666259765625,
301         "y": 423.9999713897705,
302         "z": "28c16236.105dde",
303         "wires": []
304     },
305     {
306         "id": "88b94012.df3c5",
307         "type": "returnSuccess",
308         "name": "return success",
309         "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",
310         "comments": "",
311         "x": 478.33325958251953,
312         "y": 686.6666707992554,
313         "z": "28c16236.105dde",
314         "wires": []
315     },
316     {
317         "id": "2fbd1822.35aeb8",
318         "type": "set",
319         "name": "set vnf-level-oper-status to Created",
320         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />\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",
321         "comments": "",
322         "x": 540.8133697509766,
323         "y": 639.0037975311279,
324         "z": "28c16236.105dde",
325         "wires": []
326     },
327     {
328         "id": "7caed7a8.2e9948",
329         "type": "set",
330         "name": "copy input data",
331         "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",
332         "comments": "",
333         "x": 481.66651153564453,
334         "y": 594.999979019165,
335         "z": "28c16236.105dde",
336         "wires": []
337     },
338     {
339         "id": "20178755.68db48",
340         "type": "switchNode",
341         "name": "switch current vnf-level-oper-status == PendingCreate",
342         "xml": "<switch test=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status == 'PendingCreate'`\">\n",
343         "comments": "",
344         "outputs": 1,
345         "x": 605.0000305175781,
346         "y": 468.33330059051514,
347         "z": "28c16236.105dde",
348         "wires": [
349             [
350                 "133f13c9.d4c06c"
351             ]
352         ]
353     },
354     {
355         "id": "133f13c9.d4c06c",
356         "type": "outcomeFalse",
357         "name": "false",
358         "xml": "<outcome value='false'>\n",
359         "comments": "",
360         "outputs": 1,
361         "x": 891.3333740234375,
362         "y": 467.9999485015869,
363         "z": "28c16236.105dde",
364         "wires": [
365             [
366                 "866ab955.d849b8"
367             ]
368         ]
369     },
370     {
371         "id": "866ab955.d849b8",
372         "type": "returnFailure",
373         "name": "return failure",
374         "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=\"`'Order status must be PendingCreate, but is currently '\n      + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status`\" />\n",
375         "comments": "",
376         "x": 1049.666648864746,
377         "y": 467.33327293395996,
378         "z": "28c16236.105dde",
379         "wires": []
380     },
381     {
382         "id": "6bd0646e.4cf91c",
383         "type": "returnFailure",
384         "name": "return failure",
385         "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",
386         "comments": "",
387         "x": 994.9999961853027,
388         "y": 555.6665868759155,
389         "z": "28c16236.105dde",
390         "wires": []
391     },
392     {
393         "id": "71f47c8b.cb4564",
394         "type": "failure",
395         "name": "failure",
396         "xml": "<outcome value='failure'>\n",
397         "comments": "",
398         "outputs": 1,
399         "x": 826.0238952636719,
400         "y": 511.9523983001709,
401         "z": "28c16236.105dde",
402         "wires": [
403             [
404                 "5e0a685d.6799c8"
405             ]
406         ]
407     },
408     {
409         "id": "16014f9b.9ff89",
410         "type": "not-found",
411         "name": "not-found",
412         "xml": "<outcome value='not-found'>\n",
413         "comments": "",
414         "outputs": 1,
415         "x": 834.5953254699707,
416         "y": 556.2381114959717,
417         "z": "28c16236.105dde",
418         "wires": [
419             [
420                 "6bd0646e.4cf91c"
421             ]
422         ]
423     },
424     {
425         "id": "5e0a685d.6799c8",
426         "type": "returnFailure",
427         "name": "return failure",
428         "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",
429         "comments": "",
430         "x": 997.6905899047852,
431         "y": 512.4287919998169,
432         "z": "28c16236.105dde",
433         "wires": []
434     },
435     {
436         "id": "5ee26c61.c95f04",
437         "type": "save",
438         "name": "update generic-vnf prov-status to NVTPROV",
439         "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=\"prov-status\" value=\"NVTPROV\" />\n",
440         "comments": "",
441         "outputs": 1,
442         "x": 573.3333206176758,
443         "y": 531.666654586792,
444         "z": "28c16236.105dde",
445         "wires": [
446             [
447                 "71f47c8b.cb4564",
448                 "16014f9b.9ff89"
449             ]
450         ]
451     }
452 ]