SDWAN VPN DG addition
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_sdwan-network-topology-operation-create.json
1 [
2   {
3     "id": "688d11a7.db457",
4     "type": "dgstart",
5     "name": "DGSTART",
6     "outputs": 1,
7     "x": 119.00390625,
8     "y": 85.28888085437939,
9     "z": "60d023c5.cabe1c",
10     "wires": [
11       [
12         "e1d5eba9.a13628"
13       ]
14     ]
15   },
16   {
17     "id": "e1d5eba9.a13628",
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": 373.50390625,
26     "y": 85.28888085437939,
27     "z": "60d023c5.cabe1c",
28     "wires": [
29       [
30         "d4ccfb4f.558f18"
31       ]
32     ]
33   },
34   {
35     "id": "d4ccfb4f.558f18",
36     "type": "method",
37     "name": "sdwan-network-topology-operation-create",
38     "xml": "<method rpc='sdwan-network-topology-operation-create' mode='sync'>\n",
39     "comments": "",
40     "outputs": 1,
41     "x": 372.50390625,
42     "y": 185.28888085437939,
43     "z": "60d023c5.cabe1c",
44     "wires": [
45       [
46         "6f5dfed8.385d3"
47       ]
48     ]
49   },
50   {
51     "id": "6f5dfed8.385d3",
52     "type": "block",
53     "name": "block : atomic",
54     "xml": "<block atomic=\"true\">\n",
55     "atomic": "false",
56     "comments": "",
57     "outputs": 1,
58     "x": 512.50390625,
59     "y": 285.2888808543794,
60     "z": "60d023c5.cabe1c",
61     "wires": [
62       [
63         "122df2f8.6d274d",
64         "a575c3fa.61f11",
65         "922e69e7.a3d7a8",
66         "5d7736de.4069b8",
67         "27cb2b03.b23a84",
68         "47c22ea2.aab27",
69         "8f02d925.52aa28",
70         "eec5382a.01c068",
71         "6cba311b.177c7",
72         "aba522ee.20d06",
73         "6bb7e42.0db951c"
74       ]
75     ]
76   },
77   {
78     "id": "122df2f8.6d274d",
79     "type": "call",
80     "name": "call GENERIC-RESOURCE-API:validate-sdwan-network-input-parameters",
81     "xml": "<call module='GENERIC-RESOURCE-API' rpc='validate-sdwan-network-input-parameters' mode='sync' >\n",
82     "comments": "",
83     "outputs": 1,
84     "x": 942.5039176940918,
85     "y": 103.06663277698681,
86     "z": "60d023c5.cabe1c",
87     "wires": [
88       []
89     ]
90   },
91   {
92     "id": "a575c3fa.61f11",
93     "type": "record",
94     "name": "record",
95     "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/svclogic.log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"sdwan-network-topology-operation-create\"/>\n<parameter name=\"field3\" value=\"SDWAN-Config\"/>\n",
96     "comments": "",
97     "outputs": 1,
98     "x": 736.0595626831055,
99     "y": 280.5110926628113,
100     "z": "60d023c5.cabe1c",
101     "wires": [
102       []
103     ]
104   },
105   {
106     "id": "922e69e7.a3d7a8",
107     "type": "execute",
108     "name": "execute generate prop.sdwan.network-id",
109     "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >\n<parameter name=\"ctx-destination\" value=\"prop.sdwan.network-id\"/>\n",
110     "comments": "",
111     "outputs": 1,
112     "x": 838.5039138793945,
113     "y": 147.06663513183594,
114     "z": "60d023c5.cabe1c",
115     "wires": [
116       []
117     ]
118   },
119   {
120     "id": "5d7736de.4069b8",
121     "type": "switchNode",
122     "name": "switch service-data.networks_length",
123     "xml": "<switch test='`$service-data.networks.network_length`'>\n",
124     "comments": "",
125     "outputs": 1,
126     "x": 827.0595626831055,
127     "y": 240.51109266281128,
128     "z": "60d023c5.cabe1c",
129     "wires": [
130       [
131         "18f092a5.32926d",
132         "30abb8ec.b5d758"
133       ]
134     ]
135   },
136   {
137     "id": "18f092a5.32926d",
138     "type": "other",
139     "name": "Null",
140     "xml": "<outcome value=''>\n",
141     "comments": "",
142     "outputs": 1,
143     "x": 1056.0595626831055,
144     "y": 220.51109266281128,
145     "z": "60d023c5.cabe1c",
146     "wires": [
147       [
148         "6b96ad21.6fe954"
149       ]
150     ]
151   },
152   {
153     "id": "30abb8ec.b5d758",
154     "type": "other",
155     "name": "other",
156     "xml": "<outcome value='Other'>\n",
157     "comments": "",
158     "outputs": 1,
159     "x": 1056.0595626831055,
160     "y": 260.5110926628113,
161     "z": "60d023c5.cabe1c",
162     "wires": [
163       [
164         "9b1eb0f3.03df9"
165       ]
166     ]
167   },
168   {
169     "id": "6b96ad21.6fe954",
170     "type": "set",
171     "name": "set nidx",
172     "xml": "<set>\n<parameter name='nidx' value='0' />\n",
173     "comments": "",
174     "x": 1198.5595626831055,
175     "y": 220.51109266281128,
176     "z": "60d023c5.cabe1c",
177     "wires": []
178   },
179   {
180     "id": "144f1430.6e2a2c",
181     "type": "set",
182     "name": "set nidx",
183     "xml": "<set>\n<parameter name='nidx' value='`$service-data.networks.network_length`' />\n",
184     "comments": "",
185     "x": 1332.1150817871094,
186     "y": 222.06670236587524,
187     "z": "60d023c5.cabe1c",
188     "wires": []
189   },
190   {
191     "id": "27cb2b03.b23a84",
192     "type": "set",
193     "name": "set network in service-data",
194     "xml": "<set>\n<parameter name='service-data.networks.network[$nidx].network-id' value='`$prop.sdwan.network-id`' />\n<parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />\n<parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />\n<parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />\n<parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />\n<parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />\n<parameter name='service-data.networks.network_length' value='`$nidx+1`' />\n\n",
195     "comments": "",
196     "x": 797.5595626831055,
197     "y": 320.5110926628113,
198     "z": "60d023c5.cabe1c",
199     "wires": []
200   },
201   {
202     "id": "47c22ea2.aab27",
203     "type": "set",
204     "name": "set networkId and network-object-path",
205     "xml": "<set>\n<parameter name='networkId' value='`$prop.sdwan.network-id`' />\n<parameter name=\"network-object-path\" value=\"`'restconf/config/GENERIC-RESOURCE-API:services/service/'  + $network-topology-operation-input.service-information.service-instance-id  + '/service-data/networks/network/'  + $prop.sdwan.network-id  + '/network-data/'` \" />",
206     "comments": "",
207     "x": 833.0595626831055,
208     "y": 360.5110926628113,
209     "z": "60d023c5.cabe1c",
210     "wires": []
211   },
212   {
213     "id": "8f02d925.52aa28",
214     "type": "returnSuccess",
215     "name": "return success",
216     "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",
217     "comments": "",
218     "x": 757.7264022827148,
219     "y": 530.1778182983398,
220     "z": "60d023c5.cabe1c",
221     "wires": []
222   },
223   {
224     "id": "eec5382a.01c068",
225     "type": "set",
226     "name": "set network-level-oper-status",
227     "xml": "<set>\n<parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='Created' />\n<parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />\n<parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />",
228     "comments": "",
229     "x": 804.5595626831055,
230     "y": 400.5110926628113,
231     "z": "60d023c5.cabe1c",
232     "wires": []
233   },
234   {
235     "id": "97c23cb8.cc8d8",
236     "type": "for",
237     "name": "for each existing network",
238     "xml": "<for index='idx' start='0' end='`$nidx`' >\n",
239     "comments": "",
240     "outputs": 1,
241     "x": 1201.5436248779297,
242     "y": 365.28884455608204,
243     "z": "60d023c5.cabe1c",
244     "wires": [
245       [
246         "30c4fff.3f577"
247       ]
248     ]
249   },
250   {
251     "id": "9b1eb0f3.03df9",
252     "type": "block",
253     "name": "block",
254     "xml": "<block>\n",
255     "atomic": "false",
256     "comments": "",
257     "outputs": 1,
258     "x": 1200.4166069030762,
259     "y": 260.4476046562195,
260     "z": "60d023c5.cabe1c",
261     "wires": [
262       [
263         "97c23cb8.cc8d8",
264         "144f1430.6e2a2c"
265       ]
266     ]
267   },
268   {
269     "id": "30c4fff.3f577",
270     "type": "switchNode",
271     "name": "switch networkid found",
272     "xml": "<switch test=\"`$service-data.networks.network[$idx].network-id == $network-topology-operation-input.network-information.network-id`\">\n",
273     "comments": "",
274     "outputs": 1,
275     "x": 1476.829345703125,
276     "y": 364.8603472416289,
277     "z": "60d023c5.cabe1c",
278     "wires": [
279       [
280         "d2ce2b28.5e29e8"
281       ]
282     ]
283   },
284   {
285     "id": "d2ce2b28.5e29e8",
286     "type": "outcomeTrue",
287     "name": "true",
288     "xml": "<outcome value='true'>\n",
289     "comments": "",
290     "outputs": 1,
291     "x": 1377.5595436096191,
292     "y": 423.43177840160206,
293     "z": "60d023c5.cabe1c",
294     "wires": [
295       [
296         "f1e681ab.ee1c1"
297       ]
298     ]
299   },
300   {
301     "id": "5f52499a.1b3a58",
302     "type": "comment",
303     "name": "make sure this network doesn't exist already",
304     "info": "",
305     "comments": "",
306     "x": 1425.1943550109863,
307     "y": 323.5429019634612,
308     "z": "60d023c5.cabe1c",
309     "wires": []
310   },
311   {
312     "id": "f1e681ab.ee1c1",
313     "type": "returnFailure",
314     "name": "return failure",
315     "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=\"network-topology-operation-input.network-request-input.network-id already found in service-data\" />\n",
316     "comments": "",
317     "x": 1525.3096466064453,
318     "y": 423.28897047042847,
319     "z": "60d023c5.cabe1c",
320     "wires": []
321   },
322   {
323     "id": "3715a6c8.5b9a7a",
324     "type": "block",
325     "name": "block",
326     "xml": "<block>\n",
327     "atomic": "false",
328     "comments": "",
329     "outputs": 1,
330     "x": 1491.961139678955,
331     "y": 193.06668996810913,
332     "z": "60d023c5.cabe1c",
333     "wires": [
334       [
335         "e8cbf5d3.3c9d38",
336         "54012a96.723714"
337       ]
338     ]
339   },
340   {
341     "id": "e8cbf5d3.3c9d38",
342     "type": "switchNode",
343     "name": "switch name",
344     "xml": "<switch test=\"`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`\">\n",
345     "comments": "",
346     "outputs": 1,
347     "x": 1680.1829833984375,
348     "y": 175.39999413490295,
349     "z": "60d023c5.cabe1c",
350     "wires": [
351       [
352         "f228e37d.0f2a2"
353       ]
354     ]
355   },
356   {
357     "id": "f228e37d.0f2a2",
358     "type": "outcomeTrue",
359     "name": "true",
360     "xml": "<outcome value='true'>\n",
361     "comments": "",
362     "outputs": 1,
363     "x": 1867.1829833984375,
364     "y": 171.39999413490295,
365     "z": "60d023c5.cabe1c",
366     "wires": [
367       [
368         "7c1c28e6.2d07b8"
369       ]
370     ]
371   },
372   {
373     "id": "7c1c28e6.2d07b8",
374     "type": "set",
375     "name": "set name",
376     "xml": "<set>\n<parameter name='prop.name' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`' />\n",
377     "comments": "",
378     "x": 2017.1831130981445,
379     "y": 170.00000071525574,
380     "z": "60d023c5.cabe1c",
381     "wires": []
382   },
383   {
384     "id": "54012a96.723714",
385     "type": "switchNode",
386     "name": "switch topology",
387     "xml": "<switch test=\"`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'topology'`\">\n",
388     "comments": "",
389     "outputs": 1,
390     "x": 1691.0226440429688,
391     "y": 215.39999222755432,
392     "z": "60d023c5.cabe1c",
393     "wires": [
394       [
395         "e98b9c1d.e4ed8"
396       ]
397     ]
398   },
399   {
400     "id": "e98b9c1d.e4ed8",
401     "type": "outcomeTrue",
402     "name": "true",
403     "xml": "<outcome value='true'>\n",
404     "comments": "",
405     "outputs": 1,
406     "x": 1861.0226440429688,
407     "y": 211.39999222755432,
408     "z": "60d023c5.cabe1c",
409     "wires": [
410       [
411         "dbc89ad1.a2ed48"
412       ]
413     ]
414   },
415   {
416     "id": "dbc89ad1.a2ed48",
417     "type": "set",
418     "name": "set topology",
419     "xml": "<set>\n<parameter name='prop.topology' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`' />\n",
420     "comments": "",
421     "x": 2048.3560848236084,
422     "y": 209.8611490726471,
423     "z": "60d023c5.cabe1c",
424     "wires": []
425   },
426   {
427     "id": "6cba311b.177c7",
428     "type": "for",
429     "name": "for loop i - Network input parameters",
430     "xml": "<for index=\"idx\" start=\"0\" end=\"`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`\">\n",
431     "comments": "",
432     "outputs": 1,
433     "x": 829.7383041381836,
434     "y": 190.8444209098816,
435     "z": "60d023c5.cabe1c",
436     "wires": [
437       [
438         "3715a6c8.5b9a7a"
439       ]
440     ]
441   },
442   {
443     "id": "35a9ce0f.ae54c2",
444     "type": "comment",
445     "name": "TODO: Recheck AAI schemas",
446     "info": "",
447     "comments": "",
448     "x": 801.0351867675781,
449     "y": 49.43131971359253,
450     "z": "60d023c5.cabe1c",
451     "wires": []
452   },
453   {
454     "id": "aba522ee.20d06",
455     "type": "save",
456     "name": "save sdwan vpn resource in AAI",
457     "xml": "<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='sdwan-vpn' \n      key='sdwan-vpn.id = $prop.sdwan.network-id' >\n<parameter name='id' value='`$prop.sdwan.network-id`' />\n<parameter name='name' value='`$prop.name`' />\n<parameter name='topology' value='`$prop.topology`' />\n<parameter name='operational-status' value='Created' />\n<parameter name='model-customization-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`' />\n<parameter name='model-invariant-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`' />\n<parameter name='model-version-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`' />\n<parameter name='selflink' value=\"`'restconf/config/GENERIC-RESOURCE-API:services/service/'  + $network-topology-operation-input.service-information.service-instance-id  + '/service-data/networks/network/'  + $prop.sdwan.network-id  + '/network-data/'` \" />",
458     "comments": "",
459     "outputs": 1,
460     "x": 814.0038986206055,
461     "y": 440.0039348602295,
462     "z": "60d023c5.cabe1c",
463     "wires": [
464       []
465     ]
466   },
467   {
468     "id": "6bb7e42.0db951c",
469     "type": "save",
470     "name": "save service relationship in AAI",
471     "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.networks.network[$nidx].network-data.service-information.global-customer-id \n         AND service-subscription.service-type = $service-data.networks.network[$nidx].network-data.service-information.subscription-service-type' \n      force=\"true\" pfx=\"tmp.AnAI-data\">\n<parameter name=\"relationship-list.relationship[0].related-to\" value=\"sdwan-vpn\" />\n<parameter name=\"relationship-list.relationship[0].related-link\" value=\"`'/network/sdwan-vpns/sdwan-vpn/' + $prop.sdwan.network-id`\" />\n<parameter name=\"relationship-list.relationship[0].relationship-data[0].relationship-key\" value=\"sdwan-vpn.id\" />\n<parameter name=\"relationship-list.relationship[0].relationship-data[0].relationship-value\" value=\"`$prop.sdwan.network-id`\" />",
472     "comments": "",
473     "outputs": 1,
474     "x": 810.00390625,
475     "y": 487.00390625,
476     "z": "60d023c5.cabe1c",
477     "wires": [
478       []
479     ]
480   }
481 ]