Rework the logs
[clamp.git] / src / main / resources / clds / camel / rest / clamp-api-v2.xml
1 <rests xmlns="http://camel.apache.org/schema/spring">
2         <rest>
3                 <get uri="/v2/loop/getAllNames" outType="java.lang.String[]"
4                         produces="application/json">
5                         <route>
6                                 <removeHeaders pattern="*" />
7                                 <doTry>
8                                         <to
9                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop')" />
10                                         <to
11                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
12                                         <to
13                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoopNames()" />
14                                         <to
15                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
16                                         <doCatch>
17                                                 <exception>java.lang.Exception</exception>
18                                                 <handled>
19                                                         <constant>true</constant>
20                                                 </handled>
21                                                 <to
22                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
23                                                 <log loggingLevel="ERROR"
24                                                          message="GET All Loop names FAILED: ${exception.stacktrace}" />
25
26                                                 <setHeader headerName="CamelHttpResponseCode">
27                                                         <constant>500</constant>
28                                                 </setHeader>
29                                                 <setBody>
30                                                         <simple>GET All Loop names FAILED</simple>
31                                                 </setBody>
32                                         </doCatch>
33                                 </doTry>
34                         </route>
35                 </get>
36                 <get uri="/v2/loop/{loopName}" outType="org.onap.clamp.loop.Loop"
37                         produces="application/json">
38                         <route>
39                                 <removeHeaders pattern="*" excludePattern="loopName" />
40                                 <doTry>
41                                         <to
42                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Loop')" />
43                                         <to
44                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
45                                         <to
46                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
47                                         <to
48                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
49                                         <doCatch>
50                                                 <exception>java.lang.Exception</exception>
51                                                 <handled>
52                                                         <constant>true</constant>
53                                                 </handled>
54                                                 <to
55                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
56                                                 <log loggingLevel="ERROR"
57                                                          message="GET Loop request failed for loop: ${header.loopName}, ${exception.stacktrace}" />
58
59                                                 <setHeader headerName="CamelHttpResponseCode">
60                                                         <constant>500</constant>
61                                                 </setHeader>
62                                                 <setBody>
63                                                         <simple>GET Loop FAILED</simple>
64                                                 </setBody>
65                                         </doCatch>
66                                 </doTry>
67                         </route>
68                 </get>
69                 <get uri="/v2/loop/svgRepresentation/{loopName}"
70                         outType="java.lang.String" produces="application/xml">
71                         <route>
72                                 <removeHeaders pattern="*" excludePattern="loopName" />
73                                 <doTry>
74                                         <to
75                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation')" />
76                                         <to
77                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
78                                         <to
79                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getSvgRepresentation(${header.loopName})" />
80                                         <to
81                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
82                                         <doCatch>
83                                                 <exception>java.lang.Exception</exception>
84                                                 <handled>
85                                                         <constant>true</constant>
86                                                 </handled>
87                                                 <to
88                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
89                                                 <log loggingLevel="ERROR"
90                                                          message="GET SVG request failed for loop: ${header.loopName}, ${exception.stacktrace}" />
91
92                                                 <setHeader headerName="CamelHttpResponseCode">
93                                                         <constant>500</constant>
94                                                 </setHeader>
95                                                 <setBody>
96                                                         <simple>GET SVG For loop FAILED</simple>
97                                                 </setBody>
98                                         </doCatch>
99                                 </doTry>
100                         </route>
101                 </get>
102
103                 <post uri="/v2/loop/updateGlobalProperties/{loopName}"
104                         type="com.google.gson.JsonObject" consumes="application/json"
105                         outType="org.onap.clamp.loop.Loop" produces="application/json">
106                         <route>
107                                 <removeHeaders pattern="*" excludePattern="loopName" />
108                                 <doTry>
109                                         <to
110                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" />
111                                         <to
112                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
113                                         <setHeader headerName="GlobalPropertiesJson">
114                                                 <simple>${body}</simple>
115                                         </setHeader>
116                                         <to uri="direct:load-loop" />
117                                         <to
118                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" />
119                                         <to
120                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" />
121                                         <to
122                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
123                                         <doCatch>
124                                                 <exception>java.lang.Exception</exception>
125                                                 <handled>
126                                                         <constant>true</constant>
127                                                 </handled>
128                                                 <to
129                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
130                                                 <log loggingLevel="ERROR"
131                                                          message="UPDATE Global properties FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
132
133                                                 <setHeader headerName="CamelHttpResponseCode">
134                                                         <constant>500</constant>
135                                                 </setHeader>
136                                                 <setBody>
137                                                         <simple>UPDATE Global properties FAILED </simple>
138                                                 </setBody>
139                                         </doCatch>
140                                 </doTry>
141                         </route>
142                 </post>
143                 <post uri="/v2/loop/updateOperationalPolicies/{loopName}"
144                         type="com.google.gson.JsonArray" consumes="application/json"
145                         outType="org.onap.clamp.loop.Loop" produces="application/json">
146                         <route>
147                                 <removeHeaders pattern="*" excludePattern="loopName" />
148                                 <doTry>
149                                         <to
150                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" />
151                                         <to
152                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
153                                         <setHeader headerName="OperationalPoliciesArray">
154                                                 <simple>${body}</simple>
155                                         </setHeader>
156                                         <to uri="direct:load-loop" />
157                                         <to
158                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
159                                         <to
160                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
161                                         <to
162                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
163                                         <doCatch>
164                                                 <exception>java.lang.Exception</exception>
165                                                 <handled>
166                                                         <constant>true</constant>
167                                                 </handled>
168                                                 <to
169                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
170                                                 <log loggingLevel="ERROR"
171                                                          message="UPDATE Operational policies FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
172                                                 <to
173                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UPDATE Operational policies request FAILED, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" />
174
175                                                 <setHeader headerName="CamelHttpResponseCode">
176                                                         <constant>500</constant>
177                                                 </setHeader>
178                                                 <setBody>
179                                                         <simple>UPDATE Operational policies FAILED</simple>
180                                                 </setBody>
181                                         </doCatch>
182                                 </doTry>
183                         </route>
184                 </post>
185                 <post uri="/v2/loop/updateMicroservicePolicy/{loopName}"
186                         type="org.onap.clamp.policy.microservice.MicroServicePolicy"
187                         consumes="application/json"
188                         outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
189                         produces="application/json">
190                         <route>
191                                 <removeHeaders pattern="*" excludePattern="loopName" />
192                                 <doTry>
193                                         <to
194                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" />
195                                         <to
196                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
197                                         <setProperty propertyName="MicroServicePolicyObject">
198                                                 <simple>${body}</simple>
199                                         </setProperty>
200
201                                         <to uri="direct:load-loop" />
202                                         <to
203                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" />
204                                         <to
205                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
206                                         <to
207                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
208                                         <doCatch>
209                                                 <exception>java.lang.Exception</exception>
210                                                 <handled>
211                                                         <constant>true</constant>
212                                                 </handled>
213                                                 <to
214                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
215                                                 <log loggingLevel="ERROR"
216                                                          message="UPDATE MicroService policy FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
217                                                 <to
218                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UPDATE MicroService policy request FAILED, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})" />
219                                                 <setHeader headerName="CamelHttpResponseCode">
220                                                         <constant>500</constant>
221                                                 </setHeader>
222                                                 <setBody>
223                                                         <simple>UPDATE MicroService policy FAILED</simple>
224                                                 </setBody>
225                                         </doCatch>
226                                 </doTry>
227                         </route>
228                 </post>
229                 <put uri="/v2/loop/deploy/{loopName}"
230                         outType="org.onap.clamp.loop.Loop" produces="application/json">
231                         <route>
232                                 <removeHeaders pattern="*" excludePattern="loopName" />
233                                 <doTry>
234                                         <log loggingLevel="INFO"
235                                                 message="DCAE DEPLOY request for loop: ${header.loopName}" />
236                                         <to
237                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" />
238                                         <to
239                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
240                                         <to uri="direct:load-loop" />
241                                         <to
242                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" />
243
244                                         <to uri="direct:deploy-loop" />
245
246                                         <log loggingLevel="INFO"
247                                                 message="DEPLOY request successfully executed for loop: ${header.loopName}" />
248                                         <to
249                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
250                                         <to
251                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
252                                         <doCatch>
253                                                 <exception>java.lang.Exception</exception>
254                                                 <handled>
255                                                         <constant>true</constant>
256                                                 </handled>
257                                                 <to
258                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
259                                                 <log loggingLevel="ERROR"
260                                                          message="DEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
261                                                 <to
262                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
263                                                 <setHeader headerName="CamelHttpResponseCode">
264                                                         <constant>500</constant>
265                                                 </setHeader>
266                                                 <setBody>
267                                                         <simple>DEPLOY request FAILED</simple>
268                                                 </setBody>
269                                         </doCatch>
270                                 </doTry>
271                         </route>
272                 </put>
273                 <put uri="/v2/loop/refreshMicroServicePolicyJsonSchema/{loopName}/{microServicePolicyName}"
274                          outType="org.onap.clamp.loop.Loop" produces="application/json">
275                         <route>
276                                 <removeHeaders pattern="*" excludePattern="loopName|microServicePolicyName" />
277                                 <doTry>
278                                         <log loggingLevel="INFO"
279                                                  message="Refresh Micro Service Policy UI for loop: ${header.loopName} and ${header.microServicePolicyName}" />
280                                         <to
281                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Micro Service Policy UI request')" />
282                                         <to
283                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
284                                         <to uri="direct:load-loop" />
285                                         <to
286                                                         uri="bean:org.onap.clamp.loop.LoopController?method=refreshMicroServicePolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.microServicePolicyName}})" />
287                                         <log loggingLevel="INFO"
288                                                  message="REFRESH Micro Service policy request successfully executed for loop: ${header.loopName}" />
289                                         <to
290                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Micro Service policy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
291                                         <to
292                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
293                                         <doCatch>
294                                                 <exception>java.lang.Exception</exception>
295                                                 <handled>
296                                                         <constant>true</constant>
297                                                 </handled>
298                                                 <to
299                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
300                                                 <log loggingLevel="ERROR"
301                                                          message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
302                                                 <to
303                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
304                                                 <setHeader headerName="CamelHttpResponseCode">
305                                                         <constant>500</constant>
306                                                 </setHeader>
307                                                 <setBody>
308                                                         <simple>REFRESH json schema request FAILED</simple>
309                                                 </setBody>
310                                         </doCatch>
311                                 </doTry>
312                         </route>
313                 </put>
314                 <put uri="/v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}"
315                         outType="org.onap.clamp.loop.Loop" produces="application/json">
316                         <route>
317                                 <removeHeaders pattern="*" excludePattern="loopName|operationalPolicyName" />
318                                 <doTry>
319                                         <log loggingLevel="INFO"
320                                                 message="Refresh Operational Policy UI for loop: ${header.loopName} and ${header.operationalPolicyName}" />
321                                         <to
322                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Operational Policy UI request')" />
323                                         <to
324                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
325                                         <to uri="direct:load-loop" />
326                                         <to
327                                                 uri="bean:org.onap.clamp.loop.LoopController?method=refreshOperationalPolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.operationalPolicyName}})" />
328                                         <log loggingLevel="INFO"
329                                                 message="REFRESH operational policy request successfully executed for loop: ${header.loopName}" />
330                                         <to
331                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH operational policy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
332                                         <to
333                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
334                                         <doCatch>
335                                                 <exception>java.lang.Exception</exception>
336                                                 <handled>
337                                                         <constant>true</constant>
338                                                 </handled>
339                                                 <to
340                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
341                                                 <log loggingLevel="ERROR"
342                                                          message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
343                                                 <to
344                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
345                                                 <setHeader headerName="CamelHttpResponseCode">
346                                                         <constant>500</constant>
347                                                 </setHeader>
348                                                 <setBody>
349                                                         <simple>REFRESH json schema request FAILED</simple>
350                                                 </setBody>
351                                         </doCatch>
352                                 </doTry>
353                         </route>
354                 </put>
355                 <put uri="/v2/loop/undeploy/{loopName}"
356                         outType="org.onap.clamp.loop.Loop" produces="application/json">
357                         <route>
358                                 <removeHeaders pattern="*" excludePattern="loopName" />
359                                 <doTry>
360                                         <log loggingLevel="INFO"
361                                                 message="DCAE UNDEPLOY request for loop: ${header.loopName}" />
362                                         <to
363                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" />
364                                         <to
365                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
366                                         <to uri="direct:load-loop" />
367                                         <to
368                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" />
369                                         <to uri="direct:undeploy-loop" />
370
371                                         <log loggingLevel="INFO"
372                                                 message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
373                                         <to
374                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
375                                         <to
376                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
377                                         <doCatch>
378                                                 <exception>java.lang.Exception</exception>
379                                                 <handled>
380                                                         <constant>true</constant>
381                                                 </handled>
382                                                 <to
383                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
384                                                 <log loggingLevel="ERROR"
385                                                          message="UNDEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
386                                                 <to
387                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
388                                                 <setHeader headerName="CamelHttpResponseCode">
389                                                         <constant>500</constant>
390                                                 </setHeader>
391                                                 <setBody>
392                                                         <simple>UNDEPLOY request FAILED</simple>
393                                                 </setBody>
394                                         </doCatch>
395                                 </doTry>
396                         </route>
397                 </put>
398                 <put uri="/v2/loop/stop/{loopName}"
399                         outType="org.onap.clamp.loop.Loop" produces="application/json">
400                         <route>
401                                 <removeHeaders pattern="*" excludePattern="loopName" />
402                                 <doTry>
403                                         <log loggingLevel="INFO"
404                                                 message="STOP request for loop: ${header.loopName}" />
405                                         <to
406                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" />
407                                         <to
408                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
409                                         <to uri="direct:load-loop" />
410                                         <to
411                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" />
412
413                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
414                                         <log loggingLevel="INFO"
415                                                 message="STOP request successfully executed for loop: ${header.loopName}" />
416                                         <to
417                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
418                                         <to
419                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
420                                         <doCatch>
421                                                 <exception>java.lang.Exception</exception>
422                                                 <handled>
423                                                         <constant>true</constant>
424                                                 </handled>
425                                                 <to
426                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
427                                                 <log loggingLevel="ERROR"
428                                                          message="STOP request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
429                                                 <to
430                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
431                                                 <setHeader headerName="CamelHttpResponseCode">
432                                                         <constant>500</constant>
433                                                 </setHeader>
434                                                 <setBody>
435                                                         <simple>STOP request FAILED</simple>
436                                                 </setBody>
437                                         </doCatch>
438                                 </doTry>
439                         </route>
440                 </put>
441                 <put uri="/v2/loop/restart/{loopName}"
442                         outType="org.onap.clamp.loop.Loop" produces="application/json">
443                         <route>
444                                 <removeHeaders pattern="*" excludePattern="loopName" />
445                                 <doTry>
446                                         <log loggingLevel="INFO"
447                                                 message="RESTART request for loop: ${header.loopName}" />
448                                         <to
449                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" />
450                                         <to
451                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
452                                         <to uri="direct:load-loop" />
453
454                                         <to
455                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" />
456
457                                         <to uri="direct:add-all-to-active-pdp-group" />
458                                         <log loggingLevel="INFO"
459                                                 message="RESTART request successfully executed for loop: ${header.loopName}" />
460                                         <to
461                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" />
462                                         <to
463                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
464                                         <doCatch>
465                                                 <exception>java.lang.Exception</exception>
466                                                 <handled>
467                                                         <constant>true</constant>
468                                                 </handled>
469                                                 <to
470                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
471                                                 <log loggingLevel="ERROR"
472                                                          message="RESTART request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
473                                                 <to
474                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
475                                                 <setHeader headerName="CamelHttpResponseCode">
476                                                         <constant>500</constant>
477                                                 </setHeader>
478                                                 <setBody>
479                                                         <simple>RESTART request FAILED</simple>
480                                                 </setBody>
481                                         </doCatch>
482                                 </doTry>
483                         </route>
484                 </put>
485                 <put uri="/v2/loop/submit/{loopName}"
486                         outType="org.onap.clamp.loop.Loop" produces="application/json">
487                         <route>
488                                 <removeHeaders pattern="*" excludePattern="loopName" />
489                                 <doTry>
490                                         <log loggingLevel="INFO"
491                                                 message="POLICY SUBMIT request for loop: ${header.loopName}" />
492                                         <to
493                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" />
494                                         <to
495                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
496                                         <to uri="direct:load-loop" />
497                                         <to
498                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
499                                         <setProperty propertyName="raiseHttpExceptionFlag">
500                                                 <simple resultType="java.lang.Boolean">false</simple>
501                                         </setProperty>
502                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
503                                         <log loggingLevel="INFO"
504                                                 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
505                                         <split>
506                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
507                                                 </simple>
508                                                 <setProperty propertyName="policy">
509                                                         <simple>${body}</simple>
510                                                 </setProperty>
511                                                 <log loggingLevel="INFO"
512                                                         message="Processing Micro Service Policy: ${exchangeProperty[policy].getName()}" />
513                                                 <setProperty propertyName="raiseHttpExceptionFlag">
514                                                         <simple resultType="java.lang.Boolean">false</simple>
515                                                 </setProperty>
516                                                 <to uri="direct:delete-policy" />
517                                                 <to uri="direct:create-policy" />
518                                         </split>
519                                         <log loggingLevel="INFO"
520                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
521                                         <split>
522                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
523                                                 </simple>
524                                                 <setProperty propertyName="policy">
525                                                         <simple>${body}</simple>
526                                                 </setProperty>
527                                                 <log loggingLevel="INFO"
528                                                         message="Processing Operational Policy: ${exchangeProperty[policy].getName()}" />
529                                                 <setProperty propertyName="raiseHttpExceptionFlag">
530                                                         <simple resultType="java.lang.Boolean">false</simple>
531                                                 </setProperty>
532
533                                                 <to uri="direct:delete-policy" />
534                                                 <to uri="direct:create-policy" />
535                                                 <choice>
536                                                         <when>
537                                                                 <simple>${exchangeProperty['policy'].isLegacy()} == true
538                                                                 </simple>
539                                                                 <log loggingLevel="INFO"
540                                                                         message="Processing all GUARD policies (LEGACY) defined in loop ${exchangeProperty[loopObject].getName()}" />
541                                                                 <split>
542                                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
543                                                                         </simple>
544                                                                         <setProperty propertyName="guardPolicy">
545                                                                                 <simple>${body}</simple>
546                                                                         </setProperty>
547                                                                         <log loggingLevel="INFO"
548                                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
549
550                                                                         <setProperty propertyName="raiseHttpExceptionFlag">
551                                                                                 <simple resultType="java.lang.Boolean">false</simple>
552                                                                         </setProperty>
553                                                                         <to uri="direct:delete-guard-policy" />
554                                                                         <to uri="direct:create-guard-policy" />
555                                                                 </split>
556                                                         </when>
557                                                 </choice>
558                                         </split>
559
560                                         <delay>
561                                                 <constant>3000</constant>
562                                         </delay>
563
564                                         <to uri="direct:add-all-to-active-pdp-group" />
565
566                                         <log loggingLevel="INFO"
567                                                 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
568                                         <to
569                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
570                                         <to
571                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
572                                         <doCatch>
573                                                 <exception>java.lang.Exception</exception>
574                                                 <handled>
575                                                         <constant>true</constant>
576                                                 </handled>
577                                                 <to
578                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
579                                                 <log loggingLevel="ERROR"
580                                                          message="SUBMIT request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
581                                                 <to
582                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
583                                                 <setHeader headerName="CamelHttpResponseCode">
584                                                         <constant>500</constant>
585                                                 </setHeader>
586                                                 <setBody>
587                                                         <simple>SUBMIT request FAILED</simple>
588                                                 </setBody>
589                                         </doCatch>
590                                 </doTry>
591                         </route>
592                 </put>
593                 <put uri="/v2/loop/delete/{loopName}">
594                         <route>
595                                 <removeHeaders pattern="*" excludePattern="loopName" />
596                                 <doTry>
597                                         <log loggingLevel="INFO"
598                                                 message="DELETE request for loop: ${header.loopName}" />
599                                         <to
600                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
601                                         <to
602                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
603                                         <to uri="direct:load-loop" />
604                                         <to
605                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" />
606                                         <to uri="direct:undeploy-loop" />
607                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
608                                         <split>
609                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
610                                                 </simple>
611                                                 <setProperty propertyName="microServicePolicy">
612                                                         <simple>${body}</simple>
613                                                 </setProperty>
614                                                 <log loggingLevel="INFO"
615                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
616                                                 <to uri="direct:delete-micro-service-policy" />
617                                         </split>
618
619                                         <log loggingLevel="INFO"
620                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
621                                         <split>
622                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
623                                                 </simple>
624                                                 <setProperty propertyName="operationalPolicy">
625                                                         <simple>${body}</simple>
626                                                 </setProperty>
627                                                 <log loggingLevel="INFO"
628                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
629                                                 <to uri="direct:delete-operational-policy" />
630                                                 <log loggingLevel="INFO"
631                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
632                                                 <split>
633                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
634                                                         </simple>
635                                                         <setProperty propertyName="guardPolicy">
636                                                                 <simple>${body}</simple>
637                                                         </setProperty>
638                                                         <log loggingLevel="INFO"
639                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
640                                                         <to uri="direct:delete-guard-policy" />
641                                                 </split>
642                                         </split>
643                                         <to
644                                                 uri="bean:org.onap.clamp.loop.log.LoopController?method=deleteLoop(${header.loopName})" />
645                                         <log loggingLevel="INFO"
646                                                 message="DELETE request successfully executed for loop: ${header.loopName}" />
647                                         <to
648                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
649                                         <to
650                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
651                                         <doCatch>
652                                                 <exception>java.lang.Exception</exception>
653                                                 <handled>
654                                                         <constant>true</constant>
655                                                 </handled>
656                                                 <to
657                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
658                                                 <log loggingLevel="ERROR"
659                                                          message="DELETE request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
660                                                 <to
661                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
662                                                 <setHeader headerName="CamelHttpResponseCode">
663                                                         <constant>500</constant>
664                                                 </setHeader>
665                                                 <setBody>
666                                                         <simple>DELETE request FAILED</simple>
667                                                 </setBody>
668                                         </doCatch>
669                                 </doTry>
670                         </route>
671                 </put>
672                 <get uri="/v2/loop/getstatus/{loopName}"
673                         outType="org.onap.clamp.loop.Loop" produces="application/json">
674                         <route>
675                                 <removeHeaders pattern="*" excludePattern="loopName" />
676                                 <doTry>
677                                         <log loggingLevel="INFO"
678                                                 message="GET STATUS request for loop: ${header.loopName}" />
679                                         <to
680                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" />
681                                         <to
682                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
683                                         <to uri="direct:load-loop" />
684                                         <to
685                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
686                                         <doTry>
687                                                 <to uri="direct:update-policy-status-for-loop" />
688                                                 <to uri="direct:update-dcae-status-for-loop" />
689                                                 <to uri="direct:update-loop-state" />
690
691                                                 <to
692                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request successfully executed','INFO',${exchangeProperty[loopObject]})" />
693                                                 <to
694                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
695                                         </doTry>
696                                         <doCatch>
697                                                 <exception>java.lang.Exception</exception>
698                                                 <handled>
699                                                         <constant>true</constant>
700                                                 </handled>
701                                                 <to
702                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
703                                                 <log loggingLevel="ERROR"
704                                                          message="GET STATUS request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
705                                                 <to
706                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
707                                                 <setHeader headerName="CamelHttpResponseCode">
708                                                         <constant>500</constant>
709                                                 </setHeader>
710                                                 <setBody>
711                                                         <simple>GET STATUS request FAILED</simple>
712                                                 </setBody>
713                                         </doCatch>
714                                         <doFinally>
715                                                 <setBody>
716                                                         <simple>${exchangeProperty[loopObject]}</simple>
717                                                 </setBody>
718                                         </doFinally>
719                                 </doTry>
720                         </route>
721                 </get>
722
723                 <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
724                         <route>
725                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
726                                 <doTry>
727                                         <to
728                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" />
729                                         <to
730                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
731                                         <to uri="direct:load-loop" />
732                                         <to
733                                                         uri="bean:org.onap.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
734                                         <to
735                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
736                                         <to
737                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
738                                         <doCatch>
739                                                 <exception>java.lang.Exception</exception>
740                                                 <handled>
741                                                         <constant>true</constant>
742                                                 </handled>
743                                                 <to
744                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
745                                                 <log loggingLevel="ERROR"
746                                                          message="ADD operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
747                                                 <to
748                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
749                                                 <setHeader headerName="CamelHttpResponseCode">
750                                                         <constant>500</constant>
751                                                 </setHeader>
752                                                 <setBody>
753                                                         <simple>ADD Operational policy request FAILED</simple>
754                                                 </setBody>
755                                         </doCatch>
756                                 </doTry>
757                         </route>
758                 </put>
759                 <put uri="/v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
760                         <route>
761                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
762                                 <doTry>
763                                         <to
764                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REMOVE operational Policy')" />
765                                         <to
766                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
767                                         <to uri="direct:load-loop" />
768                                         <to
769                                                         uri="bean:org.onap.clamp.loop.LoopController?method=removeOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
770                                         <to
771                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
772                                         <to
773                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
774                                         <doCatch>
775                                                 <exception>java.lang.Exception</exception>
776                                                 <handled>
777                                                         <constant>true</constant>
778                                                 </handled>
779                                                 <to
780                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
781                                                 <log loggingLevel="ERROR"
782                                                          message="REMOVE operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
783                                                 <to
784                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
785                                                 <setHeader headerName="CamelHttpResponseCode">
786                                                         <constant>500</constant>
787                                                 </setHeader>
788                                                 <setBody>
789                                                         <simple>REMOVE Operational policy request FAILED</simple>
790                                                 </setBody>
791                                         </doCatch>
792                                 </doTry>
793                         </route>
794                 </put>
795                 <post
796                                 uri="/v2/loop/create/{loopName}?templateName={templateName}"
797                                 outType="org.onap.clamp.loop.Loop" consumes="application/json"
798                                 produces="application/json">
799                         <route>
800                                 <removeHeaders
801                                                 pattern="*"
802                                                 excludePattern="loopName|templateName" />
803                                 <doTry>
804                                         <to
805                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" />
806                                         <to
807                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
808                                         <to
809                                                         uri="bean:org.onap.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" />
810                                         <to
811                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
812                                         <doCatch>
813                                                 <exception>java.lang.Exception</exception>
814                                                 <handled>
815                                                         <constant>true</constant>
816                                                 </handled>
817                                                 <to
818                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
819                                                 <log loggingLevel="ERROR"
820                                                          message="CREATE Loop from Template request failed for loop: ${header.loopName}, ${exception.stacktrace}" />
821                                                 <to
822                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('CREATE Loop from template request failed','ERROR',${exchangeProperty[loopObject]})" />
823                                                 <setHeader headerName="CamelHttpResponseCode">
824                                                         <constant>500</constant>
825                                                 </setHeader>
826                                                 <setBody>
827                                                         <simple>CREATE Loop from template FAILED</simple>
828                                                 </setBody>
829                                         </doCatch>
830                                 </doTry>
831                         </route>
832                 </post>
833                 <get uri="/v2/dictionary"
834                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
835                         <route>
836                                 <removeHeaders pattern="*" />
837                                 <doTry>
838                                         <to
839                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" />
840                                         <to
841                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
842                                         <to
843                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" />
844                                         <to
845                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
846                                         <doCatch>
847                                                 <exception>java.lang.Exception</exception>
848                                                 <handled>
849                                                         <constant>true</constant>
850                                                 </handled>
851                                                 <to
852                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
853                                                 <log loggingLevel="ERROR"
854                                                          message="GET Dictionary request failed: ${exception.stacktrace}" />
855                                                 <setHeader headerName="CamelHttpResponseCode">
856                                                         <constant>500</constant>
857                                                 </setHeader>
858                                                 <setBody>
859                                                         <simple>GET Dictionary FAILED</simple>
860                                                 </setBody>
861                                         </doCatch>
862                                 </doTry>
863                         </route>
864                 </get>
865
866                 <get uri="/v2/dictionary/secondary/names"
867                         outType="java.lang.String[]" produces="application/json">
868                         <route>
869                                 <removeHeaders pattern="*" />
870                                 <doTry>
871                                         <to
872                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" />
873                                         <to
874                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
875                                         <to
876                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" />
877                                         <to
878                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
879                                         <doCatch>
880                                                 <exception>java.lang.Exception</exception>
881                                                 <handled>
882                                                         <constant>true</constant>
883                                                 </handled>
884                                                 <to
885                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
886                                                 <log loggingLevel="ERROR"
887                                                          message="GET Dictionary request failed: ${exception.stacktrace}" />
888                                                 <setHeader headerName="CamelHttpResponseCode">
889                                                         <constant>500</constant>
890                                                 </setHeader>
891                                                 <setBody>
892                                                         <simple>GET Dictionary FAILED</simple>
893                                                 </setBody>
894                                         </doCatch>
895                                 </doTry>
896                         </route>
897                 </get>
898                 <get uri="/v2/dictionary/{dictionaryName}"
899                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
900                         <route>
901                                 <removeHeaders pattern="*"
902                                         excludePattern="dictionaryName" />
903                                 <doTry>
904                                         <to
905                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" />
906                                         <to
907                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
908                                         <to
909                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" />
910                                         <to
911                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
912                                         <doCatch>
913                                                 <exception>java.lang.Exception</exception>
914                                                 <handled>
915                                                         <constant>true</constant>
916                                                 </handled>
917                                                 <to
918                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
919                                                 <log loggingLevel="ERROR"
920                                                          message="GET Dictionary request failed for: ${header.dictionaryName}, ${exception.stacktrace}" />
921                                                 <setHeader headerName="CamelHttpResponseCode">
922                                                         <constant>500</constant>
923                                                 </setHeader>
924                                                 <setBody>
925                                                         <simple>GET Dictionary FAILED</simple>
926                                                 </setBody>
927                                         </doCatch>
928                                 </doTry>
929                         </route>
930                 </get>
931                 <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary"
932                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
933                         produces="application/json">
934                         <route>
935                                 <doTry>
936                                         <to
937                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" />
938                                         <to
939                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
940                                         <setProperty propertyName="DictionaryObject">
941                                                 <simple>${body}</simple>
942                                         </setProperty>
943                                         <to
944                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" />
945                                         <to
946                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
947                                         <doCatch>
948                                                 <exception>java.lang.Exception</exception>
949                                                 <handled>
950                                                         <constant>true</constant>
951                                                 </handled>
952                                                 <to
953                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
954                                                 <log loggingLevel="ERROR"
955                                                          message="PUT Dictionary request failed for: ${exception.stacktrace}" />
956                                                 <setHeader headerName="CamelHttpResponseCode">
957                                                         <constant>500</constant>
958                                                 </setHeader>
959                                                 <setBody>
960                                                         <simple>PUT Dictionary FAILED</simple>
961                                                 </setBody>
962                                         </doCatch>
963                                 </doTry>
964                         </route>
965                 </put>
966
967                 <put uri="/v2/dictionary/{name}"
968                         type="org.onap.clamp.tosca.Dictionary"
969                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
970                         produces="application/json">
971                         <route>
972                                 <removeHeaders pattern="*" excludePattern="name" />
973                                 <doTry>
974                                         <to
975                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" />
976                                         <to
977                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
978                                         <setProperty propertyName="DictionaryObject">
979                                                 <simple>${body}</simple>
980                                         </setProperty>
981                                         <to
982                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" />
983                                         <to
984                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
985                                         <doCatch>
986                                                 <exception>java.lang.Exception</exception>
987                                                 <handled>
988                                                         <constant>true</constant>
989                                                 </handled>
990                                                 <to
991                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
992                                                 <log loggingLevel="ERROR"
993                                                          message="PUT Dictionary request failed for: ${header.name}, ${exception.stacktrace}" />
994                                                 <setHeader headerName="CamelHttpResponseCode">
995                                                         <constant>500</constant>
996                                                 </setHeader>
997                                                 <setBody>
998                                                         <simple>PUT Dictionary FAILED</simple>
999                                                 </setBody>
1000                                         </doCatch>
1001                                 </doTry>
1002                         </route>
1003                 </put>
1004
1005                 <delete uri="/v2/dictionary/{name}" produces="application/json">
1006                         <route>
1007                                 <removeHeaders pattern="*" excludePattern="name" />
1008                                 <doTry>
1009                                         <to
1010                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" />
1011                                         <to
1012                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1013                                         <to
1014                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" />
1015                                         <to
1016                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1017                                         <doCatch>
1018                                                 <exception>java.lang.Exception</exception>
1019                                                 <handled>
1020                                                         <constant>true</constant>
1021                                                 </handled>
1022                                                 <to
1023                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1024                                                 <log loggingLevel="ERROR"
1025                                                          message="DELETE Dictionary request failed for: ${header.name}, ${exception.stacktrace}" />
1026                                                 <setHeader headerName="CamelHttpResponseCode">
1027                                                         <constant>500</constant>
1028                                                 </setHeader>
1029                                                 <setBody>
1030                                                         <simple>DELETE Dictionary FAILED</simple>
1031                                                 </setBody>
1032                                         </doCatch>
1033                                 </doTry>
1034                         </route>
1035                 </delete>
1036
1037                 <delete uri="/v2/dictionary/{name}/elements/{shortName}"
1038                         produces="application/json">
1039                         <route>
1040                                 <removeHeaders pattern="*"
1041                                         excludePattern="name|shortName" />
1042                                 <doTry>
1043                                         <to
1044                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" />
1045                                         <to
1046                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1047                                         <to
1048                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" />
1049                                         <to
1050                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1051                                         <doCatch>
1052                                                 <exception>java.lang.Exception</exception>
1053                                                 <handled>
1054                                                         <constant>true</constant>
1055                                                 </handled>
1056                                                 <to
1057                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1058                                                 <log loggingLevel="ERROR"
1059                                                          message="DELETE Dictionary element request failed for: ${header.name}, ${exception.stacktrace}" />
1060                                                 <setHeader headerName="CamelHttpResponseCode">
1061                                                         <constant>500</constant>
1062                                                 </setHeader>
1063                                                 <setBody>
1064                                                         <simple>DELETE Dictionary element FAILED</simple>
1065                                                 </setBody>
1066                                         </doCatch>
1067                                 </doTry>
1068                         </route>
1069                 </delete>
1070
1071                 <get uri="/v2/policyToscaModels"
1072                         outType="org.onap.clamp.loop.template.PolicyModel"
1073                         produces="application/json">
1074                         <route>
1075                                 <removeHeaders pattern="*" />
1076                                 <doTry>
1077                                         <to
1078                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" />
1079                                         <to
1080                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1081                                         <to
1082                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" />
1083                                         <to
1084                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1085                                         <doCatch>
1086                                                 <exception>java.lang.Exception</exception>
1087                                                 <handled>
1088                                                         <constant>true</constant>
1089                                                 </handled>
1090                                                 <to
1091                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1092                                                 <log loggingLevel="ERROR"
1093                                                          message="GET Policy Models request failed for: ${exception.stacktrace}" />
1094                                                 <setHeader headerName="CamelHttpResponseCode">
1095                                                         <constant>500</constant>
1096                                                 </setHeader>
1097                                                 <setBody>
1098                                                         <simple>GET Policy models FAILED</simple>
1099                                                 </setBody>
1100                                         </doCatch>
1101                                 </doTry>
1102                         </route>
1103                 </get>
1104                 <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
1105                         outType="org.onap.clamp.loop.template.PolicyModel"
1106                         produces="application/json">
1107                         <route>
1108                                 <removeHeaders pattern="*"
1109                                         excludePattern="policyModelType|policyModelVersion" />
1110                                 <doTry>
1111                                         <to
1112                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
1113                                         <to
1114                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1115                                         <to
1116                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
1117                                         <to
1118                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1119                                         <doCatch>
1120                                                 <exception>java.lang.Exception</exception>
1121                                                 <handled>
1122                                                         <constant>true</constant>
1123                                                 </handled>
1124                                                 <to
1125                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1126                                                 <log loggingLevel="ERROR"
1127                                                          message="GET Policy Model request failed for type: ${header.policyModelType}, ${exception.stacktrace}" />
1128                                                 <setHeader headerName="CamelHttpResponseCode">
1129                                                         <constant>500</constant>
1130                                                 </setHeader>
1131                                                 <setBody>
1132                                                         <simple>GET Policy model FAILED</simple>
1133                                                 </setBody>
1134                                         </doCatch>
1135                                 </doTry>
1136                         </route>
1137                 </get>
1138                 <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
1139                         outType="java.lang.String" produces="application/json">
1140                         <route>
1141                                 <removeHeaders pattern="*"
1142                                         excludePattern="policyModelType|policyModelVersion" />
1143                                 <doTry>
1144                                         <to
1145                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
1146                                         <to
1147                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1148                                         <to
1149                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
1150                                         <to
1151                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1152                                         <doCatch>
1153                                                 <exception>java.lang.Exception</exception>
1154                                                 <handled>
1155                                                         <constant>true</constant>
1156                                                 </handled>
1157                                                 <to
1158                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1159                                                 <log loggingLevel="ERROR"
1160                                                          message="GET Policy Model YAML request failed for type: ${header.policyModelType}, ${exception.stacktrace}" />
1161                                                 <setHeader headerName="CamelHttpResponseCode">
1162                                                         <constant>500</constant>
1163                                                 </setHeader>
1164                                                 <setBody>
1165                                                         <simple>GET Policy model YAML FAILED</simple>
1166                                                 </setBody>
1167                                         </doCatch>
1168                                 </doTry>
1169                         </route>
1170                 </get>
1171
1172                 <post uri="/v2/policyToscaModels"
1173                         type="java.lang.String"
1174                         outType="org.onap.clamp.loop.template.PolicyModel"
1175                         consumes="plain/text" produces="application/json">
1176                         <route>
1177                                 <removeHeaders pattern="*"/>
1178                                 <doTry>
1179                                         <to
1180                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
1181                                         <to
1182                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1183                                         <setProperty propertyName="PolicyModelTosca">
1184                                                 <simple>${body}</simple>
1185                                         </setProperty>
1186                                         <to
1187                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" />
1188                                         <to
1189                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1190                                         <doCatch>
1191                                                 <exception>java.lang.Exception</exception>
1192                                                 <handled>
1193                                                         <constant>true</constant>
1194                                                 </handled>
1195                                                 <to
1196                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1197                                                 <log loggingLevel="ERROR"
1198                                                          message="POST Policy Model YAML request failed: ${exception.stacktrace}" />
1199                                                 <setHeader headerName="CamelHttpResponseCode">
1200                                                         <constant>500</constant>
1201                                                 </setHeader>
1202                                                 <setBody>
1203                                                         <simple>POST Policy model YAML FAILED</simple>
1204                                                 </setBody>
1205                                         </doCatch>
1206                                 </doTry>
1207                         </route>
1208                 </post>
1209                 <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
1210                           type="java.lang.String"
1211                           outType="org.onap.clamp.loop.template.PolicyModel"
1212                           consumes="plain/text" produces="application/json">
1213                         <route>
1214                                 <removeHeaders pattern="*"
1215                                                            excludePattern="policyModelType|policyModelVersion" />
1216                                 <doTry>
1217                                         <to
1218                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
1219                                         <to
1220                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1221                                         <setProperty propertyName="PolicyModelTosca">
1222                                                 <simple>${body}</simple>
1223                                         </setProperty>
1224                                         <to
1225                                                         uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
1226                                         <to
1227                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1228                                         <doCatch>
1229                                                 <exception>java.lang.Exception</exception>
1230                                                 <handled>
1231                                                         <constant>true</constant>
1232                                                 </handled>
1233                                                 <to
1234                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1235                                                 <log loggingLevel="ERROR"
1236                                                          message="MODIFY Policy Model YAML request failed: ${exception.stacktrace}" />
1237                                                 <setHeader headerName="CamelHttpResponseCode">
1238                                                         <constant>500</constant>
1239                                                 </setHeader>
1240                                                 <setBody>
1241                                                         <simple>MODIFY Policy model YAML FAILED</simple>
1242                                                 </setBody>
1243                                         </doCatch>
1244                                 </doTry>
1245                         </route>
1246                 </put>
1247
1248                 <get uri="/v2/templates"
1249                         outType="org.onap.clamp.loop.template.LoopTemplate"
1250                         produces="application/json">
1251                         <route>
1252                                 <removeHeaders pattern="*" />
1253                                 <doTry>
1254                                         <to
1255                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" />
1256                                         <to
1257                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1258                                         <to
1259                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" />
1260                                         <to
1261                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1262                                         <doCatch>
1263                                                 <exception>java.lang.Exception</exception>
1264                                                 <handled>
1265                                                         <constant>true</constant>
1266                                                 </handled>
1267                                                 <to
1268                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1269                                                 <log loggingLevel="ERROR"
1270                                                          message="GET ALL templates request failed: ${exception.stacktrace}" />
1271                                                 <setHeader headerName="CamelHttpResponseCode">
1272                                                         <constant>500</constant>
1273                                                 </setHeader>
1274                                                 <setBody>
1275                                                         <simple>GET ALL templates FAILED</simple>
1276                                                 </setBody>
1277                                         </doCatch>
1278                                 </doTry>
1279                         </route>
1280                 </get>
1281                 <get uri="/v2/templates/{templateName}"
1282                         outType="org.onap.clamp.loop.template.LoopTemplate"
1283                         produces="application/json">
1284                         <route>
1285                                 <removeHeaders pattern="*"
1286                                         excludePattern="templateName" />
1287                                 <doTry>
1288                                         <to
1289                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" />
1290                                         <to
1291                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1292                                         <to
1293                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" />
1294                                         <to
1295                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1296                                         <doCatch>
1297                                                 <exception>java.lang.Exception</exception>
1298                                                 <handled>
1299                                                         <constant>true</constant>
1300                                                 </handled>
1301                                                 <to
1302                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1303                                                 <log loggingLevel="ERROR"
1304                                                          message="GET Template request failed for template: ${header.templateName},  ${exception.stacktrace}" />
1305                                                 <setHeader headerName="CamelHttpResponseCode">
1306                                                         <constant>500</constant>
1307                                                 </setHeader>
1308                                                 <setBody>
1309                                                         <simple>GET Template FAILED</simple>
1310                                                 </setBody>
1311                                         </doCatch>
1312                                 </doTry>
1313                         </route>
1314                 </get>
1315                 <get uri="/v2/templates/names" outType="java.lang.String[]"
1316                         produces="application/json">
1317                         <route>
1318                                 <removeHeaders pattern="*" />
1319                                 <doTry>
1320                                         <to
1321                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" />
1322                                         <to
1323                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1324                                         <to
1325                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" />
1326                                         <to
1327                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1328                                         <doCatch>
1329                                                 <exception>java.lang.Exception</exception>
1330                                                 <handled>
1331                                                         <constant>true</constant>
1332                                                 </handled>
1333                                                 <to
1334                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1335                                                 <log loggingLevel="ERROR"
1336                                                          message="GET All Template names request failed for template:  ${exception.stacktrace}" />
1337                                                 <setHeader headerName="CamelHttpResponseCode">
1338                                                         <constant>500</constant>
1339                                                 </setHeader>
1340                                                 <setBody>
1341                                                         <simple>GET All Template names FAILED</simple>
1342                                                 </setBody>
1343                                         </doCatch>
1344                                 </doTry>
1345                         </route>
1346                 </get>
1347                 <get uri="/v2/templates/{templateName}/svgRepresentation"
1348                          outType="java.lang.String" produces="application/xml">
1349                         <route>
1350                                 <removeHeaders pattern="*" excludePattern="templateName" />
1351                                 <doTry>
1352                                         <to
1353                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation for Loop template')" />
1354                                         <to
1355                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1356                                         <to
1357                                                         uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getSvgRepresentation(${header.templateName})" />
1358                                         <to
1359                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1360                                         <doCatch>
1361                                                 <exception>java.lang.Exception</exception>
1362                                                 <handled>
1363                                                         <constant>true</constant>
1364                                                 </handled>
1365                                                 <to
1366                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1367                                                 <log loggingLevel="ERROR"
1368                                                          message="GET SVG for template failed for template: ${header.templateName},  ${exception.stacktrace}" />
1369                                                 <setHeader headerName="CamelHttpResponseCode">
1370                                                         <constant>500</constant>
1371                                                 </setHeader>
1372                                                 <setBody>
1373                                                         <simple>GET SVG for Template FAILED</simple>
1374                                                 </setBody>
1375                                         </doCatch>
1376                                 </doTry>
1377                         </route>
1378                 </get>
1379                 <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation"
1380                          produces="application/json">
1381                         <to
1382                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" />
1383                 </get>
1384         </rest>
1385 </rests>