Chore: Add gerrit maven verify GHA workflow
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / json / GENERIC-RESOURCE-API_policy-update-notify-operation.json
1 [
2     {
3         "id": "2b8f0645.8e4dda",
4         "type": "comment",
5         "name": "POLICY-UPDATE-NOTIFY-OPERATION",
6         "info": "",
7         "comments": "",
8         "x": 538.3928527832031,
9         "y": 34.28571319580078,
10         "z": "c4ddb531.504de8",
11         "wires": []
12     },
13     {
14         "id": "640c5bf2.e2b254",
15         "type": "dgstart",
16         "name": "DGSTART",
17         "outputs": 1,
18         "x": 110.14285278320312,
19         "y": 85.03571319580078,
20         "z": "c4ddb531.504de8",
21         "wires": [
22             [
23                 "6371d353.9eabbc"
24             ]
25         ]
26     },
27     {
28         "id": "6371d353.9eabbc",
29         "type": "service-logic",
30         "name": "GENERIC-RESOURCE-API ${project.version}",
31         "module": "GENERIC-RESOURCE-API",
32         "version": "${project.version}",
33         "comments": "",
34         "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}'>",
35         "outputs": 1,
36         "x": 224.46426391601562,
37         "y": 124.7023868560791,
38         "z": "c4ddb531.504de8",
39         "wires": [
40             [
41                 "af806a5c.37c7f8"
42             ]
43         ]
44     },
45     {
46         "id": "af806a5c.37c7f8",
47         "type": "method",
48         "name": "method policy-update-notify-operation",
49         "xml": "<method rpc='policy-update-notify-operation' mode='sync'>\n",
50         "comments": "",
51         "outputs": 1,
52         "x": 201,
53         "y": 165.0357151031494,
54         "z": "c4ddb531.504de8",
55         "wires": [
56             [
57                 "59ff8d7a.32d3d4"
58             ]
59         ]
60     },
61     {
62         "id": "d17a989.54e5868",
63         "type": "returnSuccess",
64         "name": "return success",
65         "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=\"success\" />\n",
66         "comments": "",
67         "x": 325.04773712158203,
68         "y": 783.9882183074951,
69         "z": "c4ddb531.504de8",
70         "wires": []
71     },
72     {
73         "id": "3cfb5438.adb59c",
74         "type": "block",
75         "name": "block : atomic",
76         "xml": "<block atomic=\"true\">",
77         "atomic": "true",
78         "outputs": 1,
79         "x": 665.2977752685547,
80         "y": 443.8095178604126,
81         "z": "c4ddb531.504de8",
82         "wires": [
83             [
84                 "bbad0a81.e6a3e8",
85                 "dadfe54.591ea18",
86                 "5210aeb1.e5ac2",
87                 "7d21e501.763d7c",
88                 "4ca8d575.f2c99c",
89                 "5d81f8f2.13ee78",
90                 "9cb05511.ecfcc8",
91                 "5bf6f09a.aa2a",
92                 "4c9eba0e.d56fd4"
93             ]
94         ]
95     },
96     {
97         "id": "4c9eba0e.d56fd4",
98         "type": "execute",
99         "name": "RestapiCallnode getConfig",
100         "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >\n    <parameter name='templateFileName' value=\"`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`\" />\n    <parameter name='restapiUrl' value=\"`$prop.policy-manager.url + '/pdp/api/getConfig'`\" />\n    <parameter name='format' value='json' />\n    <parameter name='httpMethod' value='POST' />\n    <parameter name='responsePrefix' value=\"policy\" />    \n    <parameter name='customHttpHeaders'\n      value=\"`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `\" />\n",
101         "comments": "",
102         "outputs": 1,
103         "x": 936.9048233032227,
104         "y": 420.7142581939697,
105         "z": "c4ddb531.504de8",
106         "wires": [
107             [
108                 "371b8aa7.b584d6",
109                 "eb8e6d2.61e729"
110             ]
111         ]
112     },
113     {
114         "id": "bbad0a81.e6a3e8",
115         "type": "execute",
116         "name": "readProperties",
117         "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >\n    <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />\n    <parameter name='contextPrefix' value='prop' />\n",
118         "comments": "",
119         "outputs": 1,
120         "x": 904.285774230957,
121         "y": 198.57144355773926,
122         "z": "c4ddb531.504de8",
123         "wires": [
124             []
125         ]
126     },
127     {
128         "id": "371b8aa7.b584d6",
129         "type": "success",
130         "name": "success",
131         "xml": "<outcome value='success'>\n",
132         "comments": "",
133         "outputs": 1,
134         "x": 1144.0476684570312,
135         "y": 397.857141494751,
136         "z": "c4ddb531.504de8",
137         "wires": [
138             [
139                 "bc023fa9.fe4ae"
140             ]
141         ]
142     },
143     {
144         "id": "bc023fa9.fe4ae",
145         "type": "block",
146         "name": "block: atomic",
147         "xml": "<block atomic=\"true\">\n",
148         "atomic": "false",
149         "comments": "",
150         "outputs": 1,
151         "x": 1307.7619934082031,
152         "y": 397.785617351532,
153         "z": "c4ddb531.504de8",
154         "wires": [
155             []
156         ]
157     },
158     {
159         "id": "eb8e6d2.61e729",
160         "type": "other",
161         "name": "other",
162         "xml": "<outcome value='Other'>\n",
163         "comments": "",
164         "outputs": 1,
165         "x": 1140.1852073669434,
166         "y": 445.7803544998169,
167         "z": "c4ddb531.504de8",
168         "wires": [
169             [
170                 "c447c4e0.dd61f8"
171             ]
172         ]
173     },
174     {
175         "id": "c447c4e0.dd61f8",
176         "type": "returnFailure",
177         "name": "return failure",
178         "xml": "<return status='failure'>\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value='Failed to get policy from Policy Manager' />\n",
179         "comments": "",
180         "x": 1304.6190910339355,
181         "y": 445.4285640716553,
182         "z": "c4ddb531.504de8",
183         "wires": []
184     },
185     {
186         "id": "5bf6f09a.aa2a",
187         "type": "execute",
188         "name": "execute Contrail API update network policy",
189         "xml": "<execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >\n<parameter name='api-name' value='network-policy' />\n<parameter name='api-action' value='update' />\n<parameter name='resp-prefix' value='contrailResp' />\n<parameter name='cloud-region-id' value='`$policy-splits[1]`' />\n<parameter name='update-network-policy-json' value='`$policy.config`' />",
190         "comments": "",
191         "outputs": 1,
192         "x": 973.8094635009766,
193         "y": 725.4761505126953,
194         "z": "c4ddb531.504de8",
195         "wires": [
196             [
197                 "fca9fae0.1cd838",
198                 "cadf6d1d.e304e"
199             ]
200         ]
201     },
202     {
203         "id": "fca9fae0.1cd838",
204         "type": "success",
205         "name": "success",
206         "xml": "<outcome value='success'>\n",
207         "comments": "",
208         "outputs": 1,
209         "x": 1226.6666412353516,
210         "y": 702.6189994812012,
211         "z": "c4ddb531.504de8",
212         "wires": [
213             [
214                 "9b561741.693e18"
215             ]
216         ]
217     },
218     {
219         "id": "9b561741.693e18",
220         "type": "block",
221         "name": "block: atomic",
222         "xml": "<block atomic=\"true\">\n",
223         "atomic": "false",
224         "comments": "",
225         "outputs": 1,
226         "x": 1390.3809661865234,
227         "y": 702.5474753379822,
228         "z": "c4ddb531.504de8",
229         "wires": [
230             []
231         ]
232     },
233     {
234         "id": "cadf6d1d.e304e",
235         "type": "other",
236         "name": "other",
237         "xml": "<outcome value='Other'>\n",
238         "comments": "",
239         "outputs": 1,
240         "x": 1222.8041801452637,
241         "y": 750.5422124862671,
242         "z": "c4ddb531.504de8",
243         "wires": [
244             [
245                 "bc7e3f77.a2464"
246             ]
247         ]
248     },
249     {
250         "id": "bc7e3f77.a2464",
251         "type": "returnFailure",
252         "name": "return failure",
253         "xml": "<return status='failure'>\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value=\"`'Error updating Contrail: ' + $contrailResp.resp-message`\" />\n",
254         "comments": "",
255         "x": 1385.809440612793,
256         "y": 751.6189785003662,
257         "z": "c4ddb531.504de8",
258         "wires": []
259     },
260     {
261         "id": "50b08b49.336914",
262         "type": "switchNode",
263         "name": "switch update-type",
264         "xml": "<switch test='`$policy-update-notify-operation-input.update-type`'>\n",
265         "comments": "",
266         "outputs": 1,
267         "x": 334.99998474121094,
268         "y": 444.28569412231445,
269         "z": "c4ddb531.504de8",
270         "wires": [
271             [
272                 "8100e6ab.3c2318"
273             ]
274         ]
275     },
276     {
277         "id": "59ff8d7a.32d3d4",
278         "type": "block",
279         "name": "block : atomic",
280         "xml": "<block atomic=\"true\">",
281         "atomic": "true",
282         "outputs": 1,
283         "x": 123.33332824707031,
284         "y": 614.0476264953613,
285         "z": "c4ddb531.504de8",
286         "wires": [
287             [
288                 "50b08b49.336914",
289                 "d17a989.54e5868"
290             ]
291         ]
292     },
293     {
294         "id": "8100e6ab.3c2318",
295         "type": "outcome",
296         "name": "Update",
297         "xml": "<outcome value='Update'>\n",
298         "comments": "",
299         "outputs": 1,
300         "x": 508.5714530944824,
301         "y": 443.8571300506592,
302         "z": "c4ddb531.504de8",
303         "wires": [
304             [
305                 "3cfb5438.adb59c"
306             ]
307         ]
308     },
309     {
310         "id": "dadfe54.591ea18",
311         "type": "save",
312         "name": "insert to POLICY_UPDATE_NOTIFICATION",
313         "xml": "<save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n  key=\"`$tmp.sql`\" pfx='pfx'>\n",
314         "comments": "",
315         "outputs": 1,
316         "x": 992.8572158813477,
317         "y": 294.28569889068604,
318         "z": "c4ddb531.504de8",
319         "wires": [
320             []
321         ]
322     },
323     {
324         "id": "5210aeb1.e5ac2",
325         "type": "set",
326         "name": "set sql statement",
327         "xml": "<set>\n<parameter name='tmp.sql' value=\"`'insert into POLICY_UPDATE_NOTIFICATION (policy_name,version_id,update_type) values ( '\n+ ' $policy-update-notify-operation-input.policy-name , $policy-update-notify-operation-input.version-id , $policy-update-notify-operation-input.update-type )'`\" />\n\n",
328         "comments": "",
329         "x": 909.9999465942383,
330         "y": 245.71427249908447,
331         "z": "c4ddb531.504de8",
332         "wires": []
333     },
334     {
335         "id": "7d21e501.763d7c",
336         "type": "set",
337         "name": "set tmp.policy-name",
338         "xml": "<set>\n<parameter name='tmp.policy-name' value='`$policy-update-notify-operation-input.policy-name`' />\n",
339         "comments": "",
340         "x": 916.6665954589844,
341         "y": 343.33336639404297,
342         "z": "c4ddb531.504de8",
343         "wires": []
344     },
345     {
346         "id": "4ca8d575.f2c99c",
347         "type": "execute",
348         "name": "convert json config to variables",
349         "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' >\n    <parameter name='source' value=\"policy.config\" />\n    <parameter name='outputPath' value=\"tmp.config-ctx\" />\n    <parameter name='isEscaped' value='false' />\n",
350         "comments": "",
351         "outputs": 1,
352         "x": 938.3333129882812,
353         "y": 520,
354         "z": "c4ddb531.504de8",
355         "wires": [
356             [
357                 "215a8f00.3a1142",
358                 "bf040853.679c08"
359             ]
360         ]
361     },
362     {
363         "id": "215a8f00.3a1142",
364         "type": "success",
365         "name": "success",
366         "xml": "<outcome value='success'>\n",
367         "comments": "",
368         "outputs": 1,
369         "x": 1145.4761581420898,
370         "y": 497.14288330078125,
371         "z": "c4ddb531.504de8",
372         "wires": [
373             [
374                 "dc65e70.190b018"
375             ]
376         ]
377     },
378     {
379         "id": "dc65e70.190b018",
380         "type": "block",
381         "name": "block: atomic",
382         "xml": "<block atomic=\"true\">\n",
383         "atomic": "false",
384         "comments": "",
385         "outputs": 1,
386         "x": 1309.1904830932617,
387         "y": 497.07135915756226,
388         "z": "c4ddb531.504de8",
389         "wires": [
390             []
391         ]
392     },
393     {
394         "id": "bf040853.679c08",
395         "type": "other",
396         "name": "other",
397         "xml": "<outcome value='Other'>\n",
398         "comments": "",
399         "outputs": 1,
400         "x": 1141.613697052002,
401         "y": 545.0660963058472,
402         "z": "c4ddb531.504de8",
403         "wires": [
404             [
405                 "c3c3e9d5.9be4c8"
406             ]
407         ]
408     },
409     {
410         "id": "c3c3e9d5.9be4c8",
411         "type": "returnFailure",
412         "name": "return failure",
413         "xml": "<return status='failure'>\n<parameter name='error-code' value='500' />\n<parameter name='error-message' value='Failed to convert config variable from PolicyManager' />\n",
414         "comments": "",
415         "x": 1306.0475807189941,
416         "y": 544.7143058776855,
417         "z": "c4ddb531.504de8",
418         "wires": []
419     },
420     {
421         "id": "5d81f8f2.13ee78",
422         "type": "set",
423         "name": "set policy-name",
424         "xml": "<set>\n<parameter name='policy-name' value='`$tmp.config-ctx.content.fq_name[2]`' />\n",
425         "comments": "",
426         "x": 888.3333282470703,
427         "y": 608.3333606719971,
428         "z": "c4ddb531.504de8",
429         "wires": []
430     },
431     {
432         "id": "9cb05511.ecfcc8",
433         "type": "execute",
434         "name": "execute split",
435         "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >\n    <parameter name=\"original_string\" value=\"`$policy-name`\" />\n    <parameter name=\"regex\" value=\"_\"/>\n    <parameter name=\"limit\" value=\"3\" />\n    <parameter name=\"ctx_memory_result_key\" value=\"policy-splits\" />\n",
436         "comments": "",
437         "outputs": 1,
438         "x": 876.9047546386719,
439         "y": 657.6190423965454,
440         "z": "c4ddb531.504de8",
441         "wires": [
442             []
443         ]
444     }
445 ]