HTTPS Proxy support for A1 adapter southbound
[ccsdk/distribution.git] / platform-logic / a1Adapter-api / src / main / json / A1-ADAPTER-API_getA1Policy.json
1 [
2     {
3         "id": "a60fb60b.241a28",
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": 175,
12         "y": 269,
13         "z": "7304d8ed.dab258",
14         "wires": [
15             [
16                 "57fe6f06.92d82"
17             ]
18         ]
19     },
20     {
21         "id": "57fe6f06.92d82",
22         "type": "method",
23         "name": "method getA1Policy",
24         "xml": "<method rpc='getA1Policy' mode='sync'>\n",
25         "comments": "",
26         "outputs": 1,
27         "x": 234,
28         "y": 390,
29         "z": "7304d8ed.dab258",
30         "wires": [
31             [
32                 "5bd5c7d.75cdd38"
33             ]
34         ]
35     },
36     {
37         "id": "6c7eeb3b.b216c4",
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=\"Get A1 Policy:\"/>\n<parameter name=\"field2\" value=\"`$get-a1-policy-input.near-rt-ric-url`\"/>",
41         "comments": "",
42         "outputs": 1,
43         "x": 695,
44         "y": 191,
45         "z": "7304d8ed.dab258",
46         "wires": [
47             []
48         ]
49     },
50     {
51         "id": "5bd5c7d.75cdd38",
52         "type": "block",
53         "name": "block : atomic",
54         "xml": "<block atomic='true'>",
55         "atomic": "true",
56         "comments": "",
57         "outputs": 1,
58         "x": 439,
59         "y": 344,
60         "z": "7304d8ed.dab258",
61         "wires": [
62             [
63                 "6c7eeb3b.b216c4",
64                 "ca0351d6.caa3e",
65                 "18c8dded.66a2f2",
66                 "236f6af1.570056",
67                 "bfb54edb.3da1b"
68             ]
69         ]
70     },
71     {
72         "id": "24f44e9b.4aa622",
73         "type": "dgstart",
74         "name": "DGSTART",
75         "outputs": 1,
76         "x": 106,
77         "y": 206,
78         "z": "7304d8ed.dab258",
79         "wires": [
80             [
81                 "a60fb60b.241a28"
82             ]
83         ]
84     },
85     {
86         "id": "ca0351d6.caa3e",
87         "type": "set",
88         "name": "set default status value",
89         "xml": "<set>\n<parameter name='response-code' value='200' />\n<parameter name='response-message' value='Get A1 Policy executed successfully' />",
90         "comments": "",
91         "x": 739.0000610351562,
92         "y": 259,
93         "z": "7304d8ed.dab258",
94         "wires": []
95     },
96     {
97         "id": "18c8dded.66a2f2",
98         "type": "execute",
99         "name": "execute Properties",
100         "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",
101         "comments": "",
102         "outputs": 1,
103         "x": 738,
104         "y": 312,
105         "z": "7304d8ed.dab258",
106         "wires": [
107             []
108         ]
109     },
110     {
111         "id": "bfb54edb.3da1b",
112         "type": "block",
113         "name": "A1 Mediator RestAPI Invocation",
114         "xml": "<block atomic='true'>",
115         "atomic": "true",
116         "comments": "",
117         "outputs": 1,
118         "x": 768.0001220703125,
119         "y": 396,
120         "z": "7304d8ed.dab258",
121         "wires": [
122             [
123                 "a8547794.9858e8",
124                 "ddc15ef5.9b7b4",
125                 "8a8335fe.a1c9b8",
126                 "2e1a3941.d3ca26"
127             ]
128         ]
129     },
130     {
131         "id": "ddc15ef5.9b7b4",
132         "type": "set",
133         "name": "set tmp variables for A1 Mediator REST API call",
134         "xml": "<set>\n<parameter name=\"tmp.near-rt-ric-url\" value=\"`$get-a1-policy-input.near-rt-ric-url`\"/>",
135         "comments": "",
136         "x": 1139.00146484375,
137         "y": 190.88912963867188,
138         "z": "7304d8ed.dab258",
139         "wires": []
140     },
141     {
142         "id": "a8547794.9858e8",
143         "type": "record",
144         "name": "record",
145         "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 A1 Adapter Get Policy Instance.\"/>\n<parameter name=\"field2\" value=\"`$tmp.near-rt-ric-url`\"/>",
146         "comments": "",
147         "outputs": 1,
148         "x": 1024.0001220703125,
149         "y": 395,
150         "z": "7304d8ed.dab258",
151         "wires": [
152             []
153         ]
154     },
155     {
156         "id": "8a8335fe.a1c9b8",
157         "type": "execute",
158         "name": "Get Policy Instance",
159         "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=\"GET\"/>\n<parameter name=\"responsePrefix\" value=\"a1MediatorRsp\"/>\n<parameter name='contentType' value='application/json' />\n<parameter name='accept' value='application/json' />\n<parameter name=\"convertResponse\" value=\"false\"/>",
160         "comments": "",
161         "outputs": 1,
162         "x": 1057.0006103515625,
163         "y": 543.0104064941406,
164         "z": "7304d8ed.dab258",
165         "wires": [
166             [
167                 "e4a64d8c.fd97",
168                 "5a45e869.670878"
169             ]
170         ]
171     },
172     {
173         "id": "e4a64d8c.fd97",
174         "type": "failure",
175         "name": "failure",
176         "xml": "<outcome value='failure'>\n",
177         "comments": "",
178         "outputs": 1,
179         "x": 1267,
180         "y": 641.0001220703125,
181         "z": "7304d8ed.dab258",
182         "wires": [
183             [
184                 "13b0f676.750d9a"
185             ]
186         ]
187     },
188     {
189         "id": "5a45e869.670878",
190         "type": "success",
191         "name": "success",
192         "xml": "<outcome value='success'>\n",
193         "comments": "",
194         "outputs": 1,
195         "x": 1274.000244140625,
196         "y": 542.0000305175781,
197         "z": "7304d8ed.dab258",
198         "wires": [
199             [
200                 "2c53bf53.3bc33"
201             ]
202         ]
203     },
204     {
205         "id": "df221ec3.a4a66",
206         "type": "returnFailure",
207         "name": "return failure",
208         "xml": "<return status='failure'>\n<parameter name='ack-final' value='Y'/>\n<parameter name=\"response-code\" value=\"500\" />\n<parameter name=\"response-message\" value=\"Error in Getting A1 Policy Instance. Aborting\" />",
209         "comments": "",
210         "x": 1591.0006103515625,
211         "y": 751.0000610351562,
212         "z": "7304d8ed.dab258",
213         "wires": []
214     },
215     {
216         "id": "2c53bf53.3bc33",
217         "type": "block",
218         "name": "block",
219         "xml": "<block>\n",
220         "atomic": "false",
221         "comments": "",
222         "outputs": 1,
223         "x": 1430.9998779296875,
224         "y": 541.0000610351562,
225         "z": "7304d8ed.dab258",
226         "wires": [
227             [
228                 "cbc08871.96e018",
229                 "98154503.e4bc58",
230                 "168fc93b.3defa7"
231             ]
232         ]
233     },
234     {
235         "id": "cbc08871.96e018",
236         "type": "record",
237         "name": "record",
238         "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 Get Policy Information \"/>\n<parameter name=\"field2\" value=\"`$tmp.a1-mediator-restapi.httpResponse`\"/>",
239         "comments": "",
240         "outputs": 1,
241         "x": 1582,
242         "y": 539,
243         "z": "7304d8ed.dab258",
244         "wires": [
245             []
246         ]
247     },
248     {
249         "id": "9092f8ee.72e568",
250         "type": "set",
251         "name": "set",
252         "xml": "<set>\n<parameter name='response-code' value='500'/>\n<parameter name='response-message' value='Seems A1 Mediator Not Healthy'/>\n",
253         "comments": "",
254         "x": 1581.75390625,
255         "y": 667.00390625,
256         "z": "7304d8ed.dab258",
257         "wires": []
258     },
259     {
260         "id": "236f6af1.570056",
261         "type": "block",
262         "name": "block",
263         "xml": "<block>\n",
264         "atomic": "false",
265         "comments": "",
266         "outputs": 1,
267         "x": 701.75390625,
268         "y": 568.00390625,
269         "z": "7304d8ed.dab258",
270         "wires": [
271             [
272                 "a1bd774.c21d588"
273             ]
274         ]
275     },
276     {
277         "id": "a1bd774.c21d588",
278         "type": "returnSuccess",
279         "name": "return success",
280         "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<parameter name='response-code' value='200' />\n<parameter name='response-message' value='Get PolicyInstance executed successfully'/>\n<parameter name='ack-final' value='Y'/>\n",
281         "comments": "",
282         "x": 862.7539672851562,
283         "y": 568.0039672851562,
284         "z": "7304d8ed.dab258",
285         "wires": []
286     },
287     {
288         "id": "13b0f676.750d9a",
289         "type": "block",
290         "name": "block",
291         "xml": "<block>\n",
292         "atomic": "false",
293         "comments": "",
294         "outputs": 1,
295         "x": 1427.00390625,
296         "y": 705.00390625,
297         "z": "7304d8ed.dab258",
298         "wires": [
299             [
300                 "9092f8ee.72e568",
301                 "df221ec3.a4a66"
302             ]
303         ]
304     },
305     {
306         "id": "98154503.e4bc58",
307         "type": "execute",
308         "name": "set",
309         "xml": "<set>\n<parameter name='responseBody' value='`$tmp.a1-mediator-restapi.httpResponse`'/>",
310         "comments": "",
311         "outputs": 1,
312         "x": 1581,
313         "y": 584,
314         "z": "7304d8ed.dab258",
315         "wires": [
316             []
317         ]
318     },
319     {
320         "id": "168fc93b.3defa7",
321         "type": "execute",
322         "name": "execute",
323         "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replaceAll' >\n    <parameter name=\"source\" value=\"`$a1MediatorRsp.httpResponse`\"/>\n    <parameter name=\"outputPath\" value=\"tmp.a1-mediator-restapi.httpResponse\"/>\n    <parameter name=\"target\" value=\"\\n\"/>\n    <parameter name=\"replacement\" value=\"\"/>",
324         "comments": "",
325         "outputs": 1,
326         "x": 1587,
327         "y": 490,
328         "z": "7304d8ed.dab258",
329         "wires": [
330             []
331         ]
332     },
333     {
334         "id": "2e1a3941.d3ca26",
335         "type": "block",
336         "name": "block Substitute proxy address if available",
337         "xml": "<block>\n",
338         "atomic": "false",
339         "comments": "",
340         "outputs": 1,
341         "x": 1144,
342         "y": 304,
343         "z": "7304d8ed.dab258",
344         "wires": [
345             [
346                 "75b00f49.dcc31",
347                 "c836a6e6.960ec8",
348                 "e1b6f74c.e43ab8"
349             ]
350         ]
351     },
352     {
353         "id": "75b00f49.dcc31",
354         "type": "set",
355         "name": "set tmp url variables with proxy information",
356         "xml": "<set>\n<parameter name=\"tmp.proxy-url\" value=\"`$prop.a1Mediator.proxy.url`\"/>",
357         "comments": "",
358         "x": 1546,
359         "y": 181,
360         "z": "7304d8ed.dab258",
361         "wires": []
362     },
363     {
364         "id": "c836a6e6.960ec8",
365         "type": "record",
366         "name": "record",
367         "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 Get Policy Information: Check for proxy url: \"/>\n<parameter name=\"field2\" value=\"`$tmp.proxy-url`\"/>\n\n",
368         "comments": "",
369         "outputs": 1,
370         "x": 1429,
371         "y": 256,
372         "z": "7304d8ed.dab258",
373         "wires": [
374             []
375         ]
376     },
377     {
378         "id": "26ee6f37.aa426",
379         "type": "execute",
380         "name": "split near-rt-ric URL",
381         "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\"/>",
382         "comments": "",
383         "outputs": 1,
384         "x": 1978,
385         "y": 338,
386         "z": "7304d8ed.dab258",
387         "wires": [
388             []
389         ]
390     },
391     {
392         "id": "2545ffb.f98f8",
393         "type": "for",
394         "name": "for",
395         "xml": "<for index='idx' start='3' end=\"`$tmp.near-rt-ric-url-splitList_length`\" >",
396         "comments": "",
397         "outputs": 1,
398         "x": 1944,
399         "y": 408,
400         "z": "7304d8ed.dab258",
401         "wires": [
402             [
403                 "79fcf81b.cca0a8"
404             ]
405         ]
406     },
407     {
408         "id": "79fcf81b.cca0a8",
409         "type": "execute",
410         "name": "set concat url",
411         "xml": "<set>\n<parameter name='tmp.proxy-url' value=\"`$tmp.proxy-url +'/' + $tmp.near-rt-ric-url-splitList[$idx] `\" />\n\n\n",
412         "comments": "",
413         "outputs": 1,
414         "x": 2122,
415         "y": 408,
416         "z": "7304d8ed.dab258",
417         "wires": [
418             []
419         ]
420     },
421     {
422         "id": "4d7fe169.4b287",
423         "type": "record",
424         "name": "record",
425         "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 Get Policy Information: Url with proxy: \"/>\n<parameter name=\"field2\" value=\"`$tmp.proxy-url`\"/>\n\n",
426         "comments": "",
427         "outputs": 1,
428         "x": 1944,
429         "y": 471,
430         "z": "7304d8ed.dab258",
431         "wires": [
432             []
433         ]
434     },
435     {
436         "id": "e1b6f74c.e43ab8",
437         "type": "switchNode",
438         "name": "switch",
439         "xml": "<switch test='`$tmp.proxy-url`'>\n",
440         "comments": "",
441         "outputs": 1,
442         "x": 1428,
443         "y": 339,
444         "z": "7304d8ed.dab258",
445         "wires": [
446             [
447                 "8d722c43.e9664",
448                 "1b872074.8d5e4"
449             ]
450         ]
451     },
452     {
453         "id": "8d722c43.e9664",
454         "type": "outcome",
455         "name": "No proxy URL",
456         "xml": "<outcome value=''>\n",
457         "comments": "",
458         "outputs": 1,
459         "x": 1607,
460         "y": 305,
461         "z": "7304d8ed.dab258",
462         "wires": [
463             [
464                 "af216f88.1be42"
465             ]
466         ]
467     },
468     {
469         "id": "af216f88.1be42",
470         "type": "record",
471         "name": "record",
472         "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 Get Policy Information: No proxy found on properties file \"/>\n",
473         "comments": "",
474         "outputs": 1,
475         "x": 1775,
476         "y": 305,
477         "z": "7304d8ed.dab258",
478         "wires": [
479             []
480         ]
481     },
482     {
483         "id": "1b872074.8d5e4",
484         "type": "outcome",
485         "name": "Otherwise",
486         "xml": "<outcome value='Other'>\n",
487         "comments": "",
488         "outputs": 1,
489         "x": 1603,
490         "y": 373,
491         "z": "7304d8ed.dab258",
492         "wires": [
493             [
494                 "6c54e9b2.79a338"
495             ]
496         ]
497     },
498     {
499         "id": "6c54e9b2.79a338",
500         "type": "block",
501         "name": "block",
502         "xml": "<block>\n",
503         "atomic": "false",
504         "comments": "",
505         "outputs": 1,
506         "x": 1767,
507         "y": 373,
508         "z": "7304d8ed.dab258",
509         "wires": [
510             [
511                 "26ee6f37.aa426",
512                 "2545ffb.f98f8",
513                 "4d7fe169.4b287",
514                 "b2366d8c.1909"
515             ]
516         ]
517     },
518     {
519         "id": "b2366d8c.1909",
520         "type": "set",
521         "name": "set variables for A1 Mediator with proxy url",
522         "xml": "<set>\n<parameter name=\"tmp.near-rt-ric-url\" value=\"`$tmp.proxy-url`\"/>",
523         "comments": "",
524         "x": 2054,
525         "y": 532,
526         "z": "7304d8ed.dab258",
527         "wires": []
528     }
529 ]