131c2ed0b99cdb7f6264cbe831ae016c06e7cb57
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_site-vnf-topology-operation-create.json
1 [
2   {
3     "id": "1fe30678.9b6c5a",
4     "type": "dgstart",
5     "name": "DGSTART",
6     "outputs": 1,
7     "x": 122.03125,
8     "y": 82.03125,
9     "z": "c632d855.425948",
10     "wires": [
11       [
12         "6f581451.d6d46c"
13       ]
14     ]
15   },
16   {
17     "id": "6f581451.d6d46c",
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": 221.31694793701172,
26     "y": 156.26935789268464,
27     "z": "c632d855.425948",
28     "wires": [
29       [
30         "ffdaf6e4.8fe2a8"
31       ]
32     ]
33   },
34   {
35     "id": "ffdaf6e4.8fe2a8",
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": 242.4598617553711,
42     "y": 246.03124639671296,
43     "z": "c632d855.425948",
44     "wires": [
45       [
46         "4928aa8e.b25464"
47       ]
48     ]
49   },
50   {
51     "id": "4928aa8e.b25464",
52     "type": "block",
53     "name": "block : atomic",
54     "xml": "<block atomic=\"true\">",
55     "atomic": "true",
56     "outputs": 1,
57     "x": 222.69790649414062,
58     "y": 417.69791814964265,
59     "z": "c632d855.425948",
60     "wires": [
61       [
62         "290eb35e.b9e26c",
63         "2113cd25.2b0aa2",
64         "1e868a78.080646",
65         "63b1d38d.89ffcc",
66         "c8bfa3ce.63b66",
67         "81b868ec.b075e8",
68         "8129d44e.2d4828",
69         "66b4b0a.218e25",
70         "f33cfcda.f0c5d",
71         "87aab9f9.450f38",
72         "c3c6696a.6ae368",
73         "b6127d24.eca33",
74         "82b5aeb7.909dc"
75       ]
76     ]
77   },
78   {
79     "id": "2113cd25.2b0aa2",
80     "type": "set",
81     "name": "set vnf-level-oper-status to Created",
82     "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",
83     "comments": "",
84     "x": 650.8446578979492,
85     "y": 836.7018160820007,
86     "z": "c632d855.425948",
87     "wires": []
88   },
89   {
90     "id": "290eb35e.b9e26c",
91     "type": "set",
92     "name": "copy input data to service data",
93     "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",
94     "comments": "",
95     "x": 637.6978073120117,
96     "y": 734.6980319023132,
97     "z": "c632d855.425948",
98     "wires": []
99   },
100   {
101     "id": "81b868ec.b075e8",
102     "type": "execute",
103     "name": "execute generate-vnf-index",
104     "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >\n<parameter name=\"ctx-destination\" value=\"prop.vnf-index\"/>\n",
105     "comments": "",
106     "outputs": 1,
107     "x": 622.0313415527344,
108     "y": 661.3647031784058,
109     "z": "c632d855.425948",
110     "wires": [
111       []
112     ]
113   },
114   {
115     "id": "1e868a78.080646",
116     "type": "set",
117     "name": "set vnf-index to service data",
118     "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id' value='`$prop.vnf-index`' />\n",
119     "comments": "",
120     "x": 628.0313034057617,
121     "y": 790.3646578788757,
122     "z": "c632d855.425948",
123     "wires": []
124   },
125   {
126     "id": "63b1d38d.89ffcc",
127     "type": "switchNode",
128     "name": "switch service-data.vnfs.vnf_length",
129     "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",
130     "comments": "",
131     "outputs": 1,
132     "x": 652.0312271118164,
133     "y": 296.36460971832275,
134     "z": "c632d855.425948",
135     "wires": [
136       [
137         "65a65f43.d7119",
138         "e1777473.61ad38"
139       ]
140     ]
141   },
142   {
143     "id": "65a65f43.d7119",
144     "type": "other",
145     "name": "NULL",
146     "xml": "<outcome value=''>\n",
147     "comments": "",
148     "outputs": 1,
149     "x": 886.7456130981445,
150     "y": 291.5074300765991,
151     "z": "c632d855.425948",
152     "wires": [
153       [
154         "1145bf21.5d5e11"
155       ]
156     ]
157   },
158   {
159     "id": "1145bf21.5d5e11",
160     "type": "set",
161     "name": "set vnf-index=0",
162     "xml": "<set>\n<parameter name='vnf-index' value='0' />\n",
163     "comments": "",
164     "x": 1047.0313186645508,
165     "y": 291.5075216293335,
166     "z": "c632d855.425948",
167     "wires": []
168   },
169   {
170     "id": "e1777473.61ad38",
171     "type": "other",
172     "name": "other",
173     "xml": "<outcome value='Other'>\n",
174     "comments": "",
175     "outputs": 1,
176     "x": 883.1741523742676,
177     "y": 324.79326152801514,
178     "z": "c632d855.425948",
179     "wires": [
180       [
181         "43f60e81.7293"
182       ]
183     ]
184   },
185   {
186     "id": "3c64116d.221f3e",
187     "type": "set",
188     "name": "set vnf-index = vnf_length",
189     "xml": "<set>\n<parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />\n",
190     "comments": "",
191     "x": 1276.031394958496,
192     "y": 303.07898712158203,
193     "z": "c632d855.425948",
194     "wires": []
195   },
196   {
197     "id": "2bf3f4e0.d3268c",
198     "type": "for",
199     "name": "for each existing VNF",
200     "xml": "<for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >\n",
201     "comments": "",
202     "outputs": 1,
203     "x": 1264.4600143432617,
204     "y": 338.0789589881897,
205     "z": "c632d855.425948",
206     "wires": [
207       [
208         "8fa582ed.781d1"
209       ]
210     ]
211   },
212   {
213     "id": "43f60e81.7293",
214     "type": "block",
215     "name": "block",
216     "xml": "<block>\n",
217     "atomic": "false",
218     "comments": "",
219     "outputs": 1,
220     "x": 1017.8884353637695,
221     "y": 326.793231010437,
222     "z": "c632d855.425948",
223     "wires": [
224       [
225         "3c64116d.221f3e",
226         "2bf3f4e0.d3268c"
227       ]
228     ]
229   },
230   {
231     "id": "8fa582ed.781d1",
232     "type": "switchNode",
233     "name": "switch vnf-information.vnf-id == service-data.vnfs.vnf[].vnf-id",
234     "xml": "<switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>\n",
235     "comments": "",
236     "outputs": 1,
237     "x": 1657.745750427246,
238     "y": 338.6504430770874,
239     "z": "c632d855.425948",
240     "wires": [
241       [
242         "d1ebb0ef.628be"
243       ]
244     ]
245   },
246   {
247     "id": "d1ebb0ef.628be",
248     "type": "outcomeTrue",
249     "name": "true",
250     "xml": "<outcome value='true'>\n",
251     "comments": "",
252     "outputs": 1,
253     "x": 1939.031452178955,
254     "y": 337.221848487854,
255     "z": "c632d855.425948",
256     "wires": [
257       [
258         "43f17df2.e71f94"
259       ]
260     ]
261   },
262   {
263     "id": "25d81b97.ed5734",
264     "type": "comment",
265     "name": "make sure this vnf-id doesn't exist already",
266     "info": "",
267     "comments": "",
268     "x": 1626.8883666992188,
269     "y": 302.2218351364136,
270     "z": "c632d855.425948",
271     "wires": []
272   },
273   {
274     "id": "c8bfa3ce.63b66",
275     "type": "set",
276     "name": "set new vnf_length",
277     "xml": "<set>\n<parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />\n",
278     "comments": "",
279     "x": 604.0313034057617,
280     "y": 628.3646578788757,
281     "z": "c632d855.425948",
282     "wires": []
283   },
284   {
285     "id": "f33cfcda.f0c5d",
286     "type": "returnSuccess",
287     "name": "return success",
288     "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",
289     "comments": "",
290     "x": 606.0313301086426,
291     "y": 1059.6282849311829,
292     "z": "c632d855.425948",
293     "wires": []
294   },
295   {
296     "id": "8129d44e.2d4828",
297     "type": "save",
298     "name": "save siteInstance configuration in AAI",
299     "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",
300     "comments": "",
301     "outputs": 1,
302     "x": 654.6980743408203,
303     "y": 931.8503160476685,
304     "z": "c632d855.425948",
305     "wires": [
306       []
307     ]
308   },
309   {
310     "id": "66b4b0a.218e25",
311     "type": "save",
312     "name": "save service relationship in AAI",
313     "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`\" />",
314     "comments": "",
315     "outputs": 1,
316     "x": 643.6980781555176,
317     "y": 994.6281986236572,
318     "z": "c632d855.425948",
319     "wires": [
320       []
321     ]
322   },
323   {
324     "id": "87aab9f9.450f38",
325     "type": "set",
326     "name": "set vnf-index and vnf-object-path",
327     "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/'` \" />",
328     "comments": "",
329     "x": 645.0313262939453,
330     "y": 880.6280870437622,
331     "z": "c632d855.425948",
332     "wires": []
333   },
334   {
335     "id": "c3c6696a.6ae368",
336     "type": "for",
337     "name": "for loop idx - VNF input parameters",
338     "xml": "<for index=\"idx\" start=\"0\" end=\"`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`\">\n",
339     "comments": "",
340     "outputs": 1,
341     "x": 638.0313415527344,
342     "y": 435.0313129425049,
343     "z": "c632d855.425948",
344     "wires": [
345       [
346         "8cb85abf.a9b198"
347       ]
348     ]
349   },
350   {
351     "id": "8cb85abf.a9b198",
352     "type": "block",
353     "name": "block",
354     "xml": "<block>\n",
355     "atomic": "false",
356     "comments": "",
357     "outputs": 1,
358     "x": 852.809684753418,
359     "y": 432.5868968963623,
360     "z": "c632d855.425948",
361     "wires": [
362       [
363         "e6a0ec42.6ba",
364         "cdd1aefb.fa2f8"
365       ]
366     ]
367   },
368   {
369     "id": "e6a0ec42.6ba",
370     "type": "execute",
371     "name": "execute split parameterName",
372     "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",
373     "comments": "",
374     "outputs": 1,
375     "x": 1049.0658874511719,
376     "y": 410.3350353240967,
377     "z": "c632d855.425948",
378     "wires": [
379       []
380     ]
381   },
382   {
383     "id": "cdd1aefb.fa2f8",
384     "type": "set",
385     "name": "set parameterName",
386     "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",
387     "comments": "",
388     "x": 1018.5103149414062,
389     "y": 447.3351516723633,
390     "z": "c632d855.425948",
391     "wires": []
392   },
393   {
394     "id": "b6127d24.eca33",
395     "type": "set",
396     "name": "set vnf-request-input.",
397     "xml": "<set>\n<parameter name='vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' />\n",
398     "comments": "",
399     "x": 600.0309600830078,
400     "y": 509.3560276031494,
401     "z": "c632d855.425948",
402     "wires": []
403   },
404   {
405     "id": "82b5aeb7.909dc",
406     "type": "call",
407     "name": "call sdwan-get-site-param",
408     "xml": "<call module='GENERIC-RESOURCE-API' rpc='sdwan-get-site-param' mode='sync' >\n",
409     "comments": "",
410     "outputs": 1,
411     "x": 616.0313262939453,
412     "y": 541.3562316894531,
413     "z": "c632d855.425948",
414     "wires": [
415       []
416     ]
417   },
418   {
419     "id": "43f17df2.e71f94",
420     "type": "returnFailure",
421     "name": "return failure",
422     "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",
423     "comments": "",
424     "x": 2067.6028213500977,
425     "y": 388.22186279296875,
426     "z": "c632d855.425948",
427     "wires": []
428   },
429   {
430     "id": "ee62377b.687508",
431     "type": "comment",
432     "name": "Take the parameter names by removing prefix",
433     "info": "",
434     "comments": "",
435     "x": 1361.0314331054688,
436     "y": 391.6979293823242,
437     "z": "c632d855.425948",
438     "wires": []
439   }
440 ]