SDWAN flow based end-end test and issue fix
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_site-vnf-topology-operation-create.json
1 [
2   {
3     "id": "d0010b4e.1448a8",
4     "type": "dgstart",
5     "name": "DGSTART",
6     "outputs": 1,
7     "x": 135.00390625,
8     "y": 59.999999046325684,
9     "z": "32a9459d.29ba0a",
10     "wires": [
11       [
12         "7fc8b438.987c3c"
13       ]
14     ]
15   },
16   {
17     "id": "7fc8b438.987c3c",
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": 234.28960418701172,
26     "y": 134.23810693901032,
27     "z": "32a9459d.29ba0a",
28     "wires": [
29       [
30         "18f3c53b.5e40fb"
31       ]
32     ]
33   },
34   {
35     "id": "18f3c53b.5e40fb",
36     "type": "method",
37     "name": "method site-vnf-topology-operation-create",
38     "xml": "<method rpc='site-vnf-topology-operation-create' mode='sync'>\n",
39     "comments": "",
40     "outputs": 1,
41     "x": 255.4325180053711,
42     "y": 223.99999544303864,
43     "z": "32a9459d.29ba0a",
44     "wires": [
45       [
46         "286c6526.b613ca"
47       ]
48     ]
49   },
50   {
51     "id": "286c6526.b613ca",
52     "type": "block",
53     "name": "block : atomic",
54     "xml": "<block atomic=\"true\">",
55     "atomic": "true",
56     "outputs": 1,
57     "x": 235.67056274414062,
58     "y": 395.66666719596833,
59     "z": "32a9459d.29ba0a",
60     "wires": [
61       [
62         "2a8f2c14.d43db4",
63         "5fbde6da.2bd958",
64         "cc1a93a5.7ab76",
65         "18b24e84.30ff61",
66         "a5742836.13c218",
67         "671e4dac.744e44",
68         "2dfa8b04.f64514",
69         "c4eecb83.953aa8",
70         "ee03e646.5fd808",
71         "d81ebfe3.370b",
72         "d3dc22e.6b5c4e",
73         "4ed7986f.14fb68"
74       ]
75     ]
76   },
77   {
78     "id": "5fbde6da.2bd958",
79     "type": "set",
80     "name": "set vnf-level-oper-status to Created",
81     "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",
82     "comments": "",
83     "x": 663.8173141479492,
84     "y": 814.6705651283264,
85     "z": "32a9459d.29ba0a",
86     "wires": []
87   },
88   {
89     "id": "2a8f2c14.d43db4",
90     "type": "set",
91     "name": "copy input data to service data",
92     "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-index`' />\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",
93     "comments": "",
94     "x": 650.6704635620117,
95     "y": 712.6667809486389,
96     "z": "32a9459d.29ba0a",
97     "wires": []
98   },
99   {
100     "id": "a5742836.13c218",
101     "type": "execute",
102     "name": "execute generate-vnf-index",
103     "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >\n<parameter name=\"ctx-destination\" value=\"prop.vnf-index\"/>\n",
104     "comments": "",
105     "outputs": 1,
106     "x": 635.0039978027344,
107     "y": 639.3334522247314,
108     "z": "32a9459d.29ba0a",
109     "wires": [
110       []
111     ]
112   },
113   {
114     "id": "6d87bfd7.c22d1",
115     "type": "set",
116     "name": "set vnf-index to service data",
117     "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id' value='`$prop.vnf-index`' />\n",
118     "comments": "",
119     "x": 648.0040626525879,
120     "y": 768.3334197998047,
121     "z": "32a9459d.29ba0a",
122     "wires": []
123   },
124   {
125     "id": "cc1a93a5.7ab76",
126     "type": "switchNode",
127     "name": "switch service-data.vnfs.vnf_length",
128     "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",
129     "comments": "",
130     "outputs": 1,
131     "x": 665.0038833618164,
132     "y": 274.33335876464844,
133     "z": "32a9459d.29ba0a",
134     "wires": [
135       [
136         "6a52e61c.b473b8",
137         "ceafd752.94f398"
138       ]
139     ]
140   },
141   {
142     "id": "6a52e61c.b473b8",
143     "type": "other",
144     "name": "NULL",
145     "xml": "<outcome value=''>\n",
146     "comments": "",
147     "outputs": 1,
148     "x": 899.7182693481445,
149     "y": 269.4761791229248,
150     "z": "32a9459d.29ba0a",
151     "wires": [
152       [
153         "98d935d6.adba58"
154       ]
155     ]
156   },
157   {
158     "id": "98d935d6.adba58",
159     "type": "set",
160     "name": "set vnf-index=0",
161     "xml": "<set>\n<parameter name='vnf-index' value='0' />\n",
162     "comments": "",
163     "x": 1060.0039749145508,
164     "y": 269.4762706756592,
165     "z": "32a9459d.29ba0a",
166     "wires": []
167   },
168   {
169     "id": "ceafd752.94f398",
170     "type": "other",
171     "name": "other",
172     "xml": "<outcome value='Other'>\n",
173     "comments": "",
174     "outputs": 1,
175     "x": 896.1468086242676,
176     "y": 302.7620105743408,
177     "z": "32a9459d.29ba0a",
178     "wires": [
179       [
180         "2edf4169.726dbe"
181       ]
182     ]
183   },
184   {
185     "id": "f2ec0c7c.259ee",
186     "type": "set",
187     "name": "set vnf-index = vnf_length",
188     "xml": "<set>\n<parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />\n",
189     "comments": "",
190     "x": 1289.004051208496,
191     "y": 281.0477361679077,
192     "z": "32a9459d.29ba0a",
193     "wires": []
194   },
195   {
196     "id": "728dfb90.8e3944",
197     "type": "for",
198     "name": "for each existing VNF",
199     "xml": "<for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >\n",
200     "comments": "",
201     "outputs": 1,
202     "x": 1277.4326705932617,
203     "y": 316.0477080345154,
204     "z": "32a9459d.29ba0a",
205     "wires": [
206       [
207         "f1186372.a0982"
208       ]
209     ]
210   },
211   {
212     "id": "2edf4169.726dbe",
213     "type": "block",
214     "name": "block",
215     "xml": "<block>\n",
216     "atomic": "false",
217     "comments": "",
218     "outputs": 1,
219     "x": 1030.8610916137695,
220     "y": 304.7619800567627,
221     "z": "32a9459d.29ba0a",
222     "wires": [
223       [
224         "f2ec0c7c.259ee",
225         "728dfb90.8e3944"
226       ]
227     ]
228   },
229   {
230     "id": "f1186372.a0982",
231     "type": "switchNode",
232     "name": "switch vnf-information.vnf-id == service-data.vnfs.vnf[].vnf-id",
233     "xml": "<switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>\n",
234     "comments": "",
235     "outputs": 1,
236     "x": 1670.718406677246,
237     "y": 316.6191921234131,
238     "z": "32a9459d.29ba0a",
239     "wires": [
240       [
241         "32b0d35f.e4b42c"
242       ]
243     ]
244   },
245   {
246     "id": "32b0d35f.e4b42c",
247     "type": "outcomeTrue",
248     "name": "true",
249     "xml": "<outcome value='true'>\n",
250     "comments": "",
251     "outputs": 1,
252     "x": 1952.004108428955,
253     "y": 315.1905975341797,
254     "z": "32a9459d.29ba0a",
255     "wires": [
256       [
257         "c7f17107.aecae"
258       ]
259     ]
260   },
261   {
262     "id": "8ccad497.cccb38",
263     "type": "comment",
264     "name": "make sure this vnf-id doesn't exist already",
265     "info": "",
266     "comments": "",
267     "x": 1639.8610229492188,
268     "y": 280.19058418273926,
269     "z": "32a9459d.29ba0a",
270     "wires": []
271   },
272   {
273     "id": "18b24e84.30ff61",
274     "type": "set",
275     "name": "set new vnf_length",
276     "xml": "<set>\n<parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />\n",
277     "comments": "",
278     "x": 617.0039596557617,
279     "y": 606.3334069252014,
280     "z": "32a9459d.29ba0a",
281     "wires": []
282   },
283   {
284     "id": "c4eecb83.953aa8",
285     "type": "returnSuccess",
286     "name": "return success",
287     "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",
288     "comments": "",
289     "x": 619.0039863586426,
290     "y": 1037.5970339775085,
291     "z": "32a9459d.29ba0a",
292     "wires": []
293   },
294   {
295     "id": "671e4dac.744e44",
296     "type": "save",
297     "name": "save siteInstance configuration in AAI",
298     "xml": "<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='site-resource' \n      key='site-resource.id = $prop.vnf-index' >\n<parameter name='id' value='`$prop.vnf-index`' />      \n<parameter name='name' value='`$prop.site.name`' />\n<parameter name='description' value='`$prop.site.description`' />\n<parameter name='type' value='prop.site.type' />\n<parameter name='role' value='prop.site.role' />\n<parameter name='operational-status' value='Created' />\n<parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />\n<parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />\n<parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />\n<parameter name='selflink' value=\"`'restconf/config/GENERIC-RESOURCE-API:services/service/'  + $vnf-topology-operation-input.service-information.service-instance-id  + '/service-data/vnfs/vnf/'  + $prop.vnf-index  + '/vnf-data/'` \" />\n",
299     "comments": "",
300     "outputs": 1,
301     "x": 667.6707305908203,
302     "y": 909.8190650939941,
303     "z": "32a9459d.29ba0a",
304     "wires": [
305       []
306     ]
307   },
308   {
309     "id": "2dfa8b04.f64514",
310     "type": "save",
311     "name": "save service relationship in AAI",
312     "xml": "<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list' \n      key='service-instance.service-instance-id = $service-data.service-information.service-instance-id \n         AND customer.global-customer-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.global-customer-id \n         AND service-subscription.service-type = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.subscription-service-type' \n      force=\"true\" pfx=\"tmp.AnAI-data\">\n<parameter name=\"relationship-list.relationship[0].related-to\" value=\"site-resource\" />\n<parameter name=\"relationship-list.relationship[0].related-link\" value=\"`'/network/site-resources/site-resource/' + $prop.vnf-index`\" />\n<parameter name=\"relationship-list.relationship[0].relationship-data[0].relationship-key\" value=\"site-resource.id\" />\n<parameter name=\"relationship-list.relationship[0].relationship-data[0].relationship-value\" value=\"`$prop.vnf-index`\" />",
313     "comments": "",
314     "outputs": 1,
315     "x": 656.6707344055176,
316     "y": 972.5969476699829,
317     "z": "32a9459d.29ba0a",
318     "wires": [
319       []
320     ]
321   },
322   {
323     "id": "ee03e646.5fd808",
324     "type": "set",
325     "name": "set vnf-index and vnf-object-path",
326     "xml": "<set>\n<parameter name='vnfId' value='`$prop.vnf-index`' />\n<parameter name=\"vnf-object-path\" value=\"`'restconf/config/GENERIC-RESOURCE-API:services/service/'  + $vnf-topology-operation-input.service-information.service-instance-id  + '/service-data/vnfs/vnf/'  + $prop.vnf-index  + '/vnf-data/'` \" />",
327     "comments": "",
328     "x": 658.0039825439453,
329     "y": 858.5968360900879,
330     "z": "32a9459d.29ba0a",
331     "wires": []
332   },
333   {
334     "id": "d81ebfe3.370b",
335     "type": "for",
336     "name": "for loop idx - VNF input parameters",
337     "xml": "<for index=\"idx\" start=\"0\" end=\"`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`\">\n",
338     "comments": "",
339     "outputs": 1,
340     "x": 651.0039978027344,
341     "y": 413.00006198883057,
342     "z": "32a9459d.29ba0a",
343     "wires": [
344       [
345         "610b8a5.566b074"
346       ]
347     ]
348   },
349   {
350     "id": "610b8a5.566b074",
351     "type": "block",
352     "name": "block",
353     "xml": "<block>\n",
354     "atomic": "false",
355     "comments": "",
356     "outputs": 1,
357     "x": 865.782341003418,
358     "y": 410.555645942688,
359     "z": "32a9459d.29ba0a",
360     "wires": [
361       [
362         "544f33c4.6ec91c",
363         "77273637.aeb898"
364       ]
365     ]
366   },
367   {
368     "id": "544f33c4.6ec91c",
369     "type": "execute",
370     "name": "execute split parameterName",
371     "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >\n<parameter name=\"original_string\" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`'/>\n<parameter name=\"regex\" value=\"_\"/>\n<parameter name=\"ctx_memory_result_key\" value=\"param-prefix\"/>\n",
372     "comments": "",
373     "outputs": 1,
374     "x": 1062.0385437011719,
375     "y": 388.30378437042236,
376     "z": "32a9459d.29ba0a",
377     "wires": [
378       []
379     ]
380   },
381   {
382     "id": "77273637.aeb898",
383     "type": "set",
384     "name": "set parameterName",
385     "xml": "<set>\n<parameter name=\"`vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`\" value='`$param-prefix[$param-prefix_length -1]`'/>\n",
386     "comments": "",
387     "x": 1031.4829711914062,
388     "y": 425.30390071868896,
389     "z": "32a9459d.29ba0a",
390     "wires": []
391   },
392   {
393     "id": "d3dc22e.6b5c4e",
394     "type": "set",
395     "name": "set vnf-request-input.",
396     "xml": "<set>\n<parameter name='vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' />\n",
397     "comments": "",
398     "x": 613.0036163330078,
399     "y": 487.3247766494751,
400     "z": "32a9459d.29ba0a",
401     "wires": []
402   },
403   {
404     "id": "4ed7986f.14fb68",
405     "type": "call",
406     "name": "call sdwan-get-site-param",
407     "xml": "<call module='GENERIC-RESOURCE-API' rpc='sdwan-get-site-param' mode='sync' >\n",
408     "comments": "",
409     "outputs": 1,
410     "x": 629.0039825439453,
411     "y": 519.3249807357788,
412     "z": "32a9459d.29ba0a",
413     "wires": [
414       []
415     ]
416   },
417   {
418     "id": "c7f17107.aecae",
419     "type": "returnFailure",
420     "name": "return failure",
421     "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=\"`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id\n      + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`\" />\n",
422     "comments": "",
423     "x": 2080.5754776000977,
424     "y": 366.19061183929443,
425     "z": "32a9459d.29ba0a",
426     "wires": []
427   },
428   {
429     "id": "9be618c6.476348",
430     "type": "comment",
431     "name": "Take the parameter names by removing prefix",
432     "info": "",
433     "comments": "",
434     "x": 1374.0040893554688,
435     "y": 369.6666784286499,
436     "z": "32a9459d.29ba0a",
437     "wires": []
438   }
439 ]