HTTPS Proxy support for A1 adapter southbound
[ccsdk/distribution.git] / platform-logic / a1Adapter-api / src / main / json / A1-ADAPTER-API_putA1Policy.json
1 [
2     {
3         "id": "a6683616.46e428",
4         "type": "service-logic",
5         "name": "A1-ADAPTER-API ${project.version}",
6         "module": "A1-ADAPTER-API",
7         "version": "${project.version}",
8         "comments": "",
9         "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='A1-ADAPTER-API' version='${project.version}'>",
10         "outputs": 1,
11         "x": 209,
12         "y": 202,
13         "z": "7db096e2.c70bf8",
14         "wires": [
15             [
16                 "55ac3f1d.94381"
17             ]
18         ]
19     },
20     {
21         "id": "55ac3f1d.94381",
22         "type": "method",
23         "name": "method putA1Policy",
24         "xml": "<method rpc='putA1Policy' mode='sync'>\n",
25         "comments": "",
26         "outputs": 1,
27         "x": 196,
28         "y": 271,
29         "z": "7db096e2.c70bf8",
30         "wires": [
31             [
32                 "dcec6661.43fb88"
33             ]
34         ]
35     },
36     {
37         "id": "b9d05c94.6e887",
38         "type": "record",
39         "name": "record",
40         "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/A1-Adapter.log\" />\n<parameter name=\"level\" value=\"info\" />\n<parameter name=\"field1\" value=\"Put A1 Policy :\"/>\n<parameter name=\"field2\" value=\"`$put-a1-policy-input.near-rt-ric-url`\"/>\n<parameter name=\"field3\" value=\"`$put-a1-policy-input.body`\"/>\n",
41         "comments": "",
42         "outputs": 1,
43         "x": 510,
44         "y": 239,
45         "z": "7db096e2.c70bf8",
46         "wires": [
47             []
48         ]
49     },
50     {
51         "id": "dcec6661.43fb88",
52         "type": "block",
53         "name": "block : atomic",
54         "xml": "<block atomic='true'>",
55         "atomic": "true",
56         "comments": "",
57         "outputs": 1,
58         "x": 260,
59         "y": 338,
60         "z": "7db096e2.c70bf8",
61         "wires": [
62             [
63                 "b9d05c94.6e887",
64                 "5edc5dc0.aa7554",
65                 "de4ae81.e69d418",
66                 "c913644.23cbe98"
67             ]
68         ]
69     },
70     {
71         "id": "6234cc0e.af53d4",
72         "type": "dgstart",
73         "name": "DGSTART",
74         "outputs": 1,
75         "x": 137,
76         "y": 140,
77         "z": "7db096e2.c70bf8",
78         "wires": [
79             [
80                 "a6683616.46e428"
81             ]
82         ]
83     },
84     {
85         "id": "5edc5dc0.aa7554",
86         "type": "execute",
87         "name": "execute Properties",
88         "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >\n    <parameter name='fileName' value='/opt/onap/ccsdk/data/properties/a1-adapter-api-dg.properties' />\n    <parameter name='contextPrefix' value='prop' />\n",
89         "comments": "",
90         "outputs": 1,
91         "x": 544,
92         "y": 337,
93         "z": "7db096e2.c70bf8",
94         "wires": [
95             []
96         ]
97     },
98     {
99         "id": "cfebc3e6.36acd",
100         "type": "failure",
101         "name": "failure",
102         "xml": "<outcome value='failure'>\n",
103         "comments": "",
104         "outputs": 1,
105         "x": 1026.0001220703125,
106         "y": 415.00006103515625,
107         "z": "7db096e2.c70bf8",
108         "wires": [
109             [
110                 "42f98b0.e003174"
111             ]
112         ]
113     },
114     {
115         "id": "6387e9e5.fcf6e8",
116         "type": "success",
117         "name": "success",
118         "xml": "<outcome value='success'>\n",
119         "comments": "",
120         "outputs": 1,
121         "x": 1033.0003051757812,
122         "y": 505.0000457763672,
123         "z": "7db096e2.c70bf8",
124         "wires": [
125             [
126                 "38ff960.c37ae6a"
127             ]
128         ]
129     },
130     {
131         "id": "38ff960.c37ae6a",
132         "type": "block",
133         "name": "block",
134         "xml": "<block>\n",
135         "atomic": "false",
136         "comments": "",
137         "outputs": 1,
138         "x": 1174.9999389648438,
139         "y": 501.00006103515625,
140         "z": "7db096e2.c70bf8",
141         "wires": [
142             [
143                 "13a7ce3e.7474d2"
144             ]
145         ]
146     },
147     {
148         "id": "6cc48a1a.2c90b4",
149         "type": "set",
150         "name": "set tmp variables for input RPC parms",
151         "xml": "<set>\n<parameter name=\"tmp.near-rt-ric-url\" value=\"`$put-a1-policy-input.near-rt-ric-url`\"/>\n<parameter name=\"tmp.body\" value=\"`$put-a1-policy-input.body`\"/>",
152         "comments": "",
153         "x": 928.0010375976562,
154         "y": 63.88909912109375,
155         "z": "7db096e2.c70bf8",
156         "wires": []
157     },
158     {
159         "id": "41cd845d.cbb3bc",
160         "type": "execute",
161         "name": "Put A1 Policy",
162         "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >\n<parameter name=\"restapiUrl\" value=\"`$tmp.near-rt-ric-url`\"/>\n<parameter name=\"format\" value=\"json\"/>\n<parameter name=\"httpMethod\" value=\"PUT\"/>\n<parameter name=\"responsePrefix\" value=\"a1MediatorRsp\"/>\n<parameter name='contentType' value='application/json' />\n<parameter name='accept' value='application/json' />\n<parameter name=\"requestBody\" value=\"`$tmp.body`\"/>\n<parameter name=\"convertResponse\" value=\"false\"/>\n",
163         "comments": "",
164         "outputs": 1,
165         "x": 849.00048828125,
166         "y": 463.0103759765625,
167         "z": "7db096e2.c70bf8",
168         "wires": [
169             [
170                 "cfebc3e6.36acd",
171                 "6387e9e5.fcf6e8"
172             ]
173         ]
174     },
175     {
176         "id": "c913644.23cbe98",
177         "type": "block",
178         "name": "A1 Mediator RestAPI Invocation",
179         "xml": "<block atomic='true'>",
180         "atomic": "true",
181         "comments": "",
182         "outputs": 1,
183         "x": 580.0000305175781,
184         "y": 402.00006103515625,
185         "z": "7db096e2.c70bf8",
186         "wires": [
187             [
188                 "1f2f09a.5ad55f6",
189                 "6cc48a1a.2c90b4",
190                 "41cd845d.cbb3bc",
191                 "378c77.9a4d338a"
192             ]
193         ]
194     },
195     {
196         "id": "1f2f09a.5ad55f6",
197         "type": "record",
198         "name": "record",
199         "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/A1-Adapter.log\" />\n<parameter name=\"level\" value=\"info\" />\n<parameter name=\"field1\" value=\"Setting variables for Put A1 Policy.\"/>\n<parameter name=\"field2\" value=\"`$tmp.near-rt-ric-url`\"/>\n<parameter name=\"field3\" value=\"`$tmp.body`\"/>",
200         "comments": "",
201         "outputs": 1,
202         "x": 830.0000610351562,
203         "y": 417,
204         "z": "7db096e2.c70bf8",
205         "wires": [
206             []
207         ]
208     },
209     {
210         "id": "13a7ce3e.7474d2",
211         "type": "record",
212         "name": "record",
213         "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/A1-Adapter.log\" />\n<parameter name=\"level\" value=\"info\" />\n<parameter name=\"field1\" value=\"A1 Policy Instance Created.\"/>",
214         "comments": "",
215         "outputs": 1,
216         "x": 1331,
217         "y": 500.00006103515625,
218         "z": "7db096e2.c70bf8",
219         "wires": [
220             []
221         ]
222     },
223     {
224         "id": "5e390699.7a2918",
225         "type": "returnFailure",
226         "name": "return failure",
227         "xml": "<return status='failure'>\n<parameter name='ack-final' value='Y'/>\n<parameter name=\"response-code\" value=\"404\" />\n<parameter name=\"response-message\" value=\"Error creating A1 Policy. Aborting A1 Policy creation\" />",
228         "comments": "",
229         "x": 1324,
230         "y": 453,
231         "z": "7db096e2.c70bf8",
232         "wires": []
233     },
234     {
235         "id": "de4ae81.e69d418",
236         "type": "set",
237         "name": "set default status value",
238         "xml": "<set>\n<parameter name='response-code' value='200' />\n<parameter name='response-message' value='Put A1 Policy executed successfully' />",
239         "comments": "",
240         "x": 555,
241         "y": 292,
242         "z": "7db096e2.c70bf8",
243         "wires": []
244     },
245     {
246         "id": "42f98b0.e003174",
247         "type": "block",
248         "name": "block",
249         "xml": "<block>\n",
250         "atomic": "false",
251         "comments": "",
252         "outputs": 1,
253         "x": 1162,
254         "y": 413,
255         "z": "7db096e2.c70bf8",
256         "wires": [
257             [
258                 "45242a9a.990c74",
259                 "5e390699.7a2918"
260             ]
261         ]
262     },
263     {
264         "id": "45242a9a.990c74",
265         "type": "set",
266         "name": "set",
267         "xml": "<set>\n<parameter name='response-code' value='500'/>\n<parameter name='response-message' value='Seems A1 Mediator Not Healthy'/>\n",
268         "comments": "",
269         "x": 1306,
270         "y": 359,
271         "z": "7db096e2.c70bf8",
272         "wires": []
273     },
274     {
275         "id": "6a96fe57.d042e",
276         "type": "execute",
277         "name": "split near-rt-ric URL",
278         "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>\n    <parameter name=\"original_string\" value=\"`$tmp.near-rt-ric-url`\" />\n    <parameter name=\"regex\" value=\"/\"/>\n    <parameter name=\"ctx_memory_result_key\" value=\"tmp.near-rt-ric-url-splitList\"/>",
279         "comments": "",
280         "outputs": 1,
281         "x": 1878,
282         "y": 180,
283         "z": "7db096e2.c70bf8",
284         "wires": [
285             []
286         ]
287     },
288     {
289         "id": "bba56b28.73aad8",
290         "type": "for",
291         "name": "for",
292         "xml": "<for index='idx' start='3' end=\"`$tmp.near-rt-ric-url-splitList_length`\" >",
293         "comments": "",
294         "outputs": 1,
295         "x": 1844,
296         "y": 250,
297         "z": "7db096e2.c70bf8",
298         "wires": [
299             [
300                 "efb1667d.1585f8"
301             ]
302         ]
303     },
304     {
305         "id": "efb1667d.1585f8",
306         "type": "execute",
307         "name": "set concat url",
308         "xml": "<set>\n<parameter name='tmp.proxy-url' value=\"`$tmp.proxy-url +'/' + $tmp.near-rt-ric-url-splitList[$idx] `\" />\n\n\n",
309         "comments": "",
310         "outputs": 1,
311         "x": 2022,
312         "y": 250,
313         "z": "7db096e2.c70bf8",
314         "wires": [
315             []
316         ]
317     },
318     {
319         "id": "d31b610e.4b717",
320         "type": "record",
321         "name": "record",
322         "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/A1-Adapter.log\" />\n<parameter name=\"level\" value=\"info\" />\n<parameter name=\"field1\" value=\"Put A1 Policy: Url with proxy: \"/>\n<parameter name=\"field2\" value=\"`$tmp.proxy-url`\"/>\n\n",
323         "comments": "",
324         "outputs": 1,
325         "x": 1844,
326         "y": 307,
327         "z": "7db096e2.c70bf8",
328         "wires": [
329             []
330         ]
331     },
332     {
333         "id": "10f86c59.93f224",
334         "type": "record",
335         "name": "record",
336         "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/A1-Adapter.log\" />\n<parameter name=\"level\" value=\"info\" />\n<parameter name=\"field1\" value=\"Put A1 Policy: No proxy found on properties file \"/>\n",
337         "comments": "",
338         "outputs": 1,
339         "x": 1648,
340         "y": 216,
341         "z": "7db096e2.c70bf8",
342         "wires": [
343             []
344         ]
345     },
346     {
347         "id": "a1eabac4.71c208",
348         "type": "block",
349         "name": "block",
350         "xml": "<block>\n",
351         "atomic": "false",
352         "comments": "",
353         "outputs": 1,
354         "x": 1640,
355         "y": 284,
356         "z": "7db096e2.c70bf8",
357         "wires": [
358             [
359                 "6a96fe57.d042e",
360                 "bba56b28.73aad8",
361                 "d31b610e.4b717",
362                 "2462752b.bd93aa"
363             ]
364         ]
365     },
366     {
367         "id": "2462752b.bd93aa",
368         "type": "set",
369         "name": "set variables for A1 Mediator with proxy url",
370         "xml": "<set>\n<parameter name=\"tmp.near-rt-ric-url\" value=\"`$tmp.proxy-url`\"/>",
371         "comments": "",
372         "x": 1954,
373         "y": 363,
374         "z": "7db096e2.c70bf8",
375         "wires": []
376     },
377     {
378         "id": "8b5f261e.23f748",
379         "type": "outcome",
380         "name": "No proxy URL",
381         "xml": "<outcome value=''>\n",
382         "comments": "",
383         "outputs": 1,
384         "x": 1480,
385         "y": 216,
386         "z": "7db096e2.c70bf8",
387         "wires": [
388             [
389                 "10f86c59.93f224"
390             ]
391         ]
392     },
393     {
394         "id": "fcbbd2a7.10f08",
395         "type": "outcome",
396         "name": "Otherwise",
397         "xml": "<outcome value='Other'>\n",
398         "comments": "",
399         "outputs": 1,
400         "x": 1476,
401         "y": 284,
402         "z": "7db096e2.c70bf8",
403         "wires": [
404             [
405                 "a1eabac4.71c208"
406             ]
407         ]
408     },
409     {
410         "id": "921d95cc.6097d8",
411         "type": "set",
412         "name": "set tmp url variables with proxy information",
413         "xml": "<set>\n<parameter name=\"tmp.proxy-url\" value=\"`$prop.a1Mediator.proxy.url`\"/>",
414         "comments": "",
415         "x": 1419,
416         "y": 92,
417         "z": "7db096e2.c70bf8",
418         "wires": []
419     },
420     {
421         "id": "1fb088e3.0e4167",
422         "type": "record",
423         "name": "record",
424         "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">\n<parameter name=\"file\" value=\"/opt/opendaylight/current/data/log/A1-Adapter.log\" />\n<parameter name=\"level\" value=\"info\" />\n<parameter name=\"field1\" value=\"Put A1 Policy: Check for proxy url: \"/>\n<parameter name=\"field2\" value=\"`$tmp.proxy-url`\"/>\n\n",
425         "comments": "",
426         "outputs": 1,
427         "x": 1302,
428         "y": 167,
429         "z": "7db096e2.c70bf8",
430         "wires": [
431             []
432         ]
433     },
434     {
435         "id": "cea9d686.3a7118",
436         "type": "switchNode",
437         "name": "switch",
438         "xml": "<switch test='`$tmp.proxy-url`'>\n",
439         "comments": "",
440         "outputs": 1,
441         "x": 1301,
442         "y": 250,
443         "z": "7db096e2.c70bf8",
444         "wires": [
445             [
446                 "8b5f261e.23f748",
447                 "fcbbd2a7.10f08"
448             ]
449         ]
450     },
451     {
452         "id": "378c77.9a4d338a",
453         "type": "block",
454         "name": "block Substitute proxy address if available",
455         "xml": "<block>\n",
456         "atomic": "false",
457         "comments": "",
458         "outputs": 1,
459         "x": 964,
460         "y": 249,
461         "z": "7db096e2.c70bf8",
462         "wires": [
463             [
464                 "921d95cc.6097d8",
465                 "1fb088e3.0e4167",
466                 "cea9d686.3a7118"
467             ]
468         ]
469     }
470 ]