Simplify the user management
[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>false</constant>
20                                                 </handled>
21                                                 <to
22                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
23                                         </doCatch>
24                                 </doTry>
25                         </route>
26                 </get>
27                 <get uri="/v2/loop/{loopName}" outType="org.onap.clamp.loop.Loop"
28                         produces="application/json">
29                         <route>
30                                 <removeHeaders pattern="*" excludePattern="loopName" />
31                                 <doTry>
32                                         <to
33                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Loop')" />
34                                         <to
35                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
36                                         <to
37                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
38                                         <to
39                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
40                                         <doCatch>
41                                                 <exception>java.lang.Exception</exception>
42                                                 <handled>
43                                                         <constant>false</constant>
44                                                 </handled>
45                                                 <to
46                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
47                                         </doCatch>
48                                 </doTry>
49                         </route>
50                 </get>
51                 <get uri="/v2/loop/svgRepresentation/{loopName}"
52                         outType="java.lang.String" produces="application/xml">
53                         <route>
54                                 <removeHeaders pattern="*" excludePattern="loopName" />
55                                 <doTry>
56                                         <to
57                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation')" />
58                                         <to
59                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
60                                         <to
61                                                 uri="bean:org.onap.clamp.loop.LoopController?method=getSvgRepresentation(${header.loopName})" />
62                                         <to
63                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
64                                         <doCatch>
65                                                 <exception>java.lang.Exception</exception>
66                                                 <handled>
67                                                         <constant>false</constant>
68                                                 </handled>
69                                                 <to
70                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
71                                         </doCatch>
72                                 </doTry>
73                         </route>
74                 </get>
75
76                 <post uri="/v2/loop/updateGlobalProperties/{loopName}"
77                         type="com.google.gson.JsonObject" consumes="application/json"
78                         outType="org.onap.clamp.loop.Loop" produces="application/json">
79                         <route>
80                                 <removeHeaders pattern="*" excludePattern="loopName" />
81                                 <doTry>
82                                         <to
83                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update the global properties')" />
84                                         <to
85                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
86                                         <setHeader headerName="GlobalPropertiesJson">
87                                                 <simple>${body}</simple>
88                                         </setHeader>
89                                         <to uri="direct:load-loop" />
90                                         <to
91                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateGlobalPropertiesJson(${header.loopName},${header.GlobalPropertiesJson})" />
92                                         <to
93                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Global Properties UPDATED','INFO',${exchangeProperty[loopObject]})" />
94                                         <to
95                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
96                                         <doCatch>
97                                                 <exception>java.lang.Exception</exception>
98                                                 <handled>
99                                                         <constant>false</constant>
100                                                 </handled>
101                                                 <to
102                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
103                                         </doCatch>
104                                 </doTry>
105                         </route>
106                 </post>
107                 <post uri="/v2/loop/updateOperationalPolicies/{loopName}"
108                         type="com.google.gson.JsonArray" consumes="application/json"
109                         outType="org.onap.clamp.loop.Loop" produces="application/json">
110                         <route>
111                                 <removeHeaders pattern="*" excludePattern="loopName" />
112                                 <doTry>
113                                         <to
114                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update operational policies')" />
115                                         <to
116                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
117                                         <setHeader headerName="OperationalPoliciesArray">
118                                                 <simple>${body}</simple>
119                                         </setHeader>
120                                         <to uri="direct:load-loop" />
121                                         <to
122                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateOperationalPolicies(${header.loopName},${header.OperationalPoliciesArray})" />
123                                         <to
124                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Operational and Guard policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
125                                         <to
126                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
127                                         <doCatch>
128                                                 <exception>java.lang.Exception</exception>
129                                                 <handled>
130                                                         <constant>false</constant>
131                                                 </handled>
132                                                 <to
133                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
134                                         </doCatch>
135                                 </doTry>
136                         </route>
137                 </post>
138                 <post uri="/v2/loop/updateMicroservicePolicy/{loopName}"
139                         type="org.onap.clamp.policy.microservice.MicroServicePolicy"
140                         consumes="application/json"
141                         outType="org.onap.clamp.policy.microservice.MicroServicePolicy"
142                         produces="application/json">
143                         <route>
144                                 <removeHeaders pattern="*" excludePattern="loopName" />
145                                 <doTry>
146                                         <to
147                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Update Microservice policies')" />
148                                         <to
149                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
150                                         <setProperty propertyName="MicroServicePolicyObject">
151                                                 <simple>${body}</simple>
152                                         </setProperty>
153
154                                         <to uri="direct:load-loop" />
155                                         <to
156                                                 uri="bean:org.onap.clamp.loop.LoopController?method=updateMicroservicePolicy(${header.loopName},${exchangeProperty[MicroServicePolicyObject]})" />
157                                         <to
158                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Micro Service policies UPDATED','INFO',${exchangeProperty[loopObject]})" />
159                                         <to
160                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
161                                         <doCatch>
162                                                 <exception>java.lang.Exception</exception>
163                                                 <handled>
164                                                         <constant>false</constant>
165                                                 </handled>
166                                                 <to
167                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
168                                         </doCatch>
169                                 </doTry>
170                         </route>
171                 </post>
172                 <put uri="/v2/loop/deploy/{loopName}"
173                         outType="org.onap.clamp.loop.Loop" produces="application/json">
174                         <route>
175                                 <removeHeaders pattern="*" excludePattern="loopName" />
176                                 <doTry>
177                                         <log loggingLevel="INFO"
178                                                 message="DCAE DEPLOY request for loop: ${header.loopName}" />
179                                         <to
180                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE DEPLOY request')" />
181                                         <to
182                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
183                                         <to uri="direct:load-loop" />
184                                         <to
185                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE DEPLOY request','INFO',${exchangeProperty[loopObject]})" />
186
187                                         <to uri="direct:deploy-loop" />
188
189                                         <log loggingLevel="INFO"
190                                                 message="DEPLOY request successfully executed for loop: ${header.loopName}" />
191                                         <to
192                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
193                                         <to
194                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
195                                         <doCatch>
196                                                 <exception>java.lang.Exception</exception>
197                                                 <handled>
198                                                         <constant>false</constant>
199                                                 </handled>
200                                                 <to
201                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
202                                                 <log loggingLevel="ERROR"
203                                                         message="DEPLOY request failed for loop: ${header.loopName}" />
204                                                 <to
205                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
206                                         </doCatch>
207                                 </doTry>
208                         </route>
209                 </put>
210                 <put uri="/v2/loop/refreshOpPolicyJsonSchema/{loopName}"
211                         outType="org.onap.clamp.loop.Loop" produces="application/json">
212                         <route>
213                                 <removeHeaders pattern="*" excludePattern="loopName" />
214                                 <doTry>
215                                         <log loggingLevel="INFO"
216                                                 message="Refresh Operational Policy UI for loop: ${header.loopName}" />
217                                         <to
218                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH OP Policy UI request')" />
219                                         <to
220                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
221                                         <to uri="direct:load-loop" />
222                                         <to
223                                                 uri="bean:org.onap.clamp.loop.LoopController?method=refreshOpPolicyJsonRepresentation(${header.loopName})" />
224                                         <log loggingLevel="INFO"
225                                                 message="REFRESH request successfully executed for loop: ${header.loopName}" />
226                                         <to
227                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH request successfully executed','INFO',${exchangeProperty[loopObject]})" />
228                                         <to
229                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
230                                         <doCatch>
231                                                 <exception>java.lang.Exception</exception>
232                                                 <handled>
233                                                         <constant>false</constant>
234                                                 </handled>
235                                                 <to
236                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
237                                                 <log loggingLevel="ERROR"
238                                                         message="REFRESH request failed for loop: ${header.loopName}" />
239                                                 <to
240                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
241                                         </doCatch>
242                                 </doTry>
243                         </route>
244                 </put>
245                 <put uri="/v2/loop/undeploy/{loopName}"
246                         outType="org.onap.clamp.loop.Loop" produces="application/json">
247                         <route>
248                                 <removeHeaders pattern="*" excludePattern="loopName" />
249                                 <doTry>
250                                         <log loggingLevel="INFO"
251                                                 message="DCAE UNDEPLOY request for loop: ${header.loopName}" />
252                                         <to
253                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" />
254                                         <to
255                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
256                                         <to uri="direct:load-loop" />
257                                         <to
258                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" />
259                                         <to uri="direct:undeploy-loop" />
260
261                                         <log loggingLevel="INFO"
262                                                 message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
263                                         <to
264                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
265                                         <to
266                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
267                                         <doCatch>
268                                                 <exception>java.lang.Exception</exception>
269                                                 <handled>
270                                                         <constant>false</constant>
271                                                 </handled>
272                                                 <to
273                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
274                                                 <log loggingLevel="ERROR"
275                                                         message="UNDEPLOY request failed for loop: ${header.loopName}" />
276                                                 <to
277                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
278                                         </doCatch>
279                                 </doTry>
280                         </route>
281                 </put>
282                 <put uri="/v2/loop/stop/{loopName}"
283                         outType="org.onap.clamp.loop.Loop" produces="application/json">
284                         <route>
285                                 <removeHeaders pattern="*" excludePattern="loopName" />
286                                 <doTry>
287                                         <log loggingLevel="INFO"
288                                                 message="STOP request for loop: ${header.loopName}" />
289                                         <to
290                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" />
291                                         <to
292                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
293                                         <to uri="direct:load-loop" />
294                                         <to
295                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" />
296
297                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
298                                         <log loggingLevel="INFO"
299                                                 message="STOP request successfully executed for loop: ${header.loopName}" />
300                                         <to
301                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
302                                         <to
303                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
304                                         <doCatch>
305                                                 <exception>java.lang.Exception</exception>
306                                                 <handled>
307                                                         <constant>false</constant>
308                                                 </handled>
309                                                 <to
310                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
311                                                 <log loggingLevel="ERROR"
312                                                         message="STOP request failed for loop: $${header.loopName}" />
313                                                 <to
314                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
315                                         </doCatch>
316                                 </doTry>
317                         </route>
318                 </put>
319                 <put uri="/v2/loop/restart/{loopName}"
320                         outType="org.onap.clamp.loop.Loop" produces="application/json">
321                         <route>
322                                 <removeHeaders pattern="*" excludePattern="loopName" />
323                                 <doTry>
324                                         <log loggingLevel="INFO"
325                                                 message="RESTART request for loop: ${header.loopName}" />
326                                         <to
327                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" />
328                                         <to
329                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
330                                         <to uri="direct:load-loop" />
331
332                                         <to
333                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" />
334
335                                         <to uri="direct:add-all-to-active-pdp-group" />
336                                         <log loggingLevel="INFO"
337                                                 message="RESTART request successfully executed for loop: ${header.loopName}" />
338                                         <to
339                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" />
340                                         <to
341                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
342                                         <doCatch>
343                                                 <exception>java.lang.Exception</exception>
344                                                 <handled>
345                                                         <constant>false</constant>
346                                                 </handled>
347                                                 <to
348                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
349                                                 <log loggingLevel="ERROR"
350                                                         message="RESTART request failed for loop: ${header.loopName}" />
351                                                 <to
352                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','INFO',${exchangeProperty[loopObject]})" />
353                                         </doCatch>
354                                 </doTry>
355                         </route>
356                 </put>
357                 <put uri="/v2/loop/submit/{loopName}"
358                         outType="org.onap.clamp.loop.Loop" produces="application/json">
359                         <route>
360                                 <removeHeaders pattern="*" excludePattern="loopName" />
361                                 <doTry>
362                                         <log loggingLevel="INFO"
363                                                 message="POLICY SUBMIT request for loop: ${header.loopName}" />
364                                         <to
365                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" />
366                                         <to
367                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
368                                         <to uri="direct:load-loop" />
369                                         <to
370                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
371                                         <setProperty propertyName="raiseHttpExceptionFlag">
372                                                 <simple resultType="java.lang.Boolean">false</simple>
373                                         </setProperty>
374                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
375                                         <log loggingLevel="INFO"
376                                                 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
377                                         <split>
378                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
379                                                 </simple>
380                                                 <setProperty propertyName="microServicePolicy">
381                                                         <simple>${body}</simple>
382                                                 </setProperty>
383                                                 <log loggingLevel="INFO"
384                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
385                                                 <setProperty propertyName="raiseHttpExceptionFlag">
386                                                         <simple resultType="java.lang.Boolean">false</simple>
387                                                 </setProperty>
388                                                 <to uri="direct:delete-micro-service-policy" />
389                                                 <to uri="direct:create-micro-service-policy" />
390                                         </split>
391                                         <log loggingLevel="INFO"
392                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
393                                         <split>
394                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
395                                                 </simple>
396                                                 <setProperty propertyName="operationalPolicy">
397                                                         <simple>${body}</simple>
398                                                 </setProperty>
399                                                 <log loggingLevel="INFO"
400                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
401                                                 <setProperty propertyName="raiseHttpExceptionFlag">
402                                                         <simple resultType="java.lang.Boolean">false</simple>
403                                                 </setProperty>
404
405                                                 <to uri="direct:delete-operational-policy" />
406                                                 <to uri="direct:create-operational-policy" />
407
408                                                 <log loggingLevel="INFO"
409                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
410                                                 <split>
411                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
412                                                         </simple>
413                                                         <setProperty propertyName="guardPolicy">
414                                                                 <simple>${body}</simple>
415                                                         </setProperty>
416                                                         <log loggingLevel="INFO"
417                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
418
419                                                         <setProperty propertyName="raiseHttpExceptionFlag">
420                                                                 <simple resultType="java.lang.Boolean">false</simple>
421                                                         </setProperty>
422                                                         <to uri="direct:delete-guard-policy" />
423                                                         <to uri="direct:create-guard-policy" />
424                                                 </split>
425                                         </split>
426
427                                         <delay>
428                                                 <constant>3000</constant>
429                                         </delay>
430
431                                         <to uri="direct:add-all-to-active-pdp-group" />
432
433                                         <log loggingLevel="INFO"
434                                                 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
435                                         <to
436                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
437                                         <to
438                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
439                                         <doCatch>
440                                                 <exception>java.lang.Exception</exception>
441                                                 <handled>
442                                                         <constant>false</constant>
443                                                 </handled>
444                                                 <to
445                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
446                                                 <log loggingLevel="ERROR"
447                                                         message="SUBMIT request failed for loop: ${header.loopName}" />
448                                                 <to
449                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
450                                         </doCatch>
451                                 </doTry>
452                         </route>
453                 </put>
454                 <put uri="/v2/loop/delete/{loopName}">
455                         <route>
456                                 <removeHeaders pattern="*" excludePattern="loopName" />
457                                 <doTry>
458                                         <log loggingLevel="INFO"
459                                                 message="DELETE request for loop: ${header.loopName}" />
460                                         <to
461                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
462                                         <to
463                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
464                                         <to uri="direct:load-loop" />
465                                         <to
466                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" />
467                                         <to uri="direct:undeploy-loop" />
468                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
469                                         <split>
470                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
471                                                 </simple>
472                                                 <setProperty propertyName="microServicePolicy">
473                                                         <simple>${body}</simple>
474                                                 </setProperty>
475                                                 <log loggingLevel="INFO"
476                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
477                                                 <to uri="direct:delete-micro-service-policy" />
478                                         </split>
479
480                                         <log loggingLevel="INFO"
481                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
482                                         <split>
483                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
484                                                 </simple>
485                                                 <setProperty propertyName="operationalPolicy">
486                                                         <simple>${body}</simple>
487                                                 </setProperty>
488                                                 <log loggingLevel="INFO"
489                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
490                                                 <to uri="direct:delete-operational-policy" />
491                                                 <log loggingLevel="INFO"
492                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
493                                                 <split>
494                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
495                                                         </simple>
496                                                         <setProperty propertyName="guardPolicy">
497                                                                 <simple>${body}</simple>
498                                                         </setProperty>
499                                                         <log loggingLevel="INFO"
500                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
501                                                         <to uri="direct:delete-guard-policy" />
502                                                 </split>
503                                         </split>
504                                         <to
505                                                 uri="bean:org.onap.clamp.loop.log.LoopService?method=deleteLoop(${header.loopName})" />
506                                         <log loggingLevel="INFO"
507                                                 message="DELETE request successfully executed for loop: ${header.loopName}" />
508                                         <to
509                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
510                                         <to
511                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
512                                         <doCatch>
513                                                 <exception>java.lang.Exception</exception>
514                                                 <handled>
515                                                         <constant>false</constant>
516                                                 </handled>
517                                                 <to
518                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
519                                                 <log loggingLevel="ERROR"
520                                                         message="DELETE request failed for loop: ${header.loopName}" />
521                                                 <to
522                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
523                                         </doCatch>
524                                 </doTry>
525                         </route>
526                 </put>
527                 <get uri="/v2/loop/getstatus/{loopName}"
528                         outType="org.onap.clamp.loop.Loop" produces="application/json">
529                         <route>
530                                 <removeHeaders pattern="*" excludePattern="loopName" />
531                                 <doTry>
532                                         <log loggingLevel="INFO"
533                                                 message="GET STATUS request for loop: ${header.loopName}" />
534                                         <to
535                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" />
536                                         <to
537                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
538                                         <to uri="direct:load-loop" />
539                                         <to
540                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
541                                         <doTry>
542                                                 <to uri="direct:update-policy-status-for-loop" />
543                                                 <to uri="direct:update-dcae-status-for-loop" />
544                                                 <to uri="direct:update-loop-state" />
545
546                                                 <to
547                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
548                                                 <to
549                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
550                                         </doTry>
551                                         <doCatch>
552                                                 <exception>java.lang.Exception</exception>
553                                                 <handled>
554                                                         <constant>false</constant>
555                                                 </handled>
556                                                 <to
557                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
558                                                 <log loggingLevel="ERROR"
559                                                         message="Get Status request failed for loop: ${header.loopName}" />
560                                                 <to
561                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
562                                         </doCatch>
563                                         <doFinally>
564                                                 <setBody>
565                                                         <simple>${exchangeProperty[loopObject]}</simple>
566                                                 </setBody>
567                                         </doFinally>
568                                 </doTry>
569                         </route>
570                 </get>
571
572                 <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}"
573                          outType="org.onap.clamp.loop.Loop" produces="application/json">
574                         <route>
575                                 <removeHeaders pattern="*" excludePattern="loopName" />
576                                 <doTry>
577                                         <log loggingLevel="INFO"
578                                                  message="ADD OperationalPolicy request for loop: ${header.loopName}" />
579                                         <to
580                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'ADD OperationalPolicy request')" />
581                                         <to
582                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','write')" />
583                                         <to uri="direct:load-loop" />
584                                         <to
585                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request','INFO',${exchangeProperty[loopObject]})" />
586                                         <doTry>
587                                                 <to
588                                                                 uri="bean:org.onap.clamp.loop.LoopService?method=addOperationalPolicy(${loopName},${policyType},${policyVersion})" />
589
590                                                 <to
591                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
592                                                 <to
593                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
594                                         </doTry>
595                                         <doCatch>
596                                                 <exception>java.lang.Exception</exception>
597                                                 <handled>
598                                                         <constant>false</constant>
599                                                 </handled>
600                                                 <to
601                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
602                                                 <log loggingLevel="ERROR"
603                                                          message="ADD OperationalPolicy request failed for loop: ${header.loopName}" />
604                                                 <to
605                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
606                                         </doCatch>
607                                         <doFinally>
608                                                 <setBody>
609                                                         <simple>${exchangeProperty[loopObject]}</simple>
610                                                 </setBody>
611                                         </doFinally>
612                                 </doTry>
613                         </route>
614                 </put>
615
616                 <get uri="/v2/dictionary"
617                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
618                         <route>
619                                 <removeHeaders pattern="*" />
620                                 <doTry>
621                                         <to
622                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" />
623                                         <to
624                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
625                                         <to
626                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" />
627                                         <to
628                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
629                                         <doCatch>
630                                                 <exception>java.lang.Exception</exception>
631                                                 <handled>
632                                                         <constant>false</constant>
633                                                 </handled>
634                                                 <to
635                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
636                                         </doCatch>
637                                 </doTry>
638                         </route>
639                 </get>
640
641                 <get uri="/v2/dictionary/secondary/names"
642                         outType="java.lang.String[]" produces="application/json">
643                         <route>
644                                 <removeHeaders pattern="*" />
645                                 <doTry>
646                                         <to
647                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" />
648                                         <to
649                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
650                                         <to
651                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" />
652                                         <to
653                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
654                                         <doCatch>
655                                                 <exception>java.lang.Exception</exception>
656                                                 <handled>
657                                                         <constant>false</constant>
658                                                 </handled>
659                                                 <to
660                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
661                                         </doCatch>
662                                 </doTry>
663                         </route>
664                 </get>
665                 <get uri="/v2/dictionary/{dictionaryName}"
666                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
667                         <route>
668                                 <removeHeaders pattern="*"
669                                         excludePattern="dictionaryName" />
670                                 <doTry>
671                                         <to
672                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" />
673                                         <to
674                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
675                                         <to
676                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" />
677                                         <to
678                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
679                                         <doCatch>
680                                                 <exception>java.lang.Exception</exception>
681                                                 <handled>
682                                                         <constant>false</constant>
683                                                 </handled>
684                                                 <to
685                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
686                                         </doCatch>
687                                 </doTry>
688                         </route>
689                 </get>
690                 <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary"
691                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
692                         produces="application/json">
693                         <route>
694                                 <doTry>
695                                         <to
696                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" />
697                                         <to
698                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
699                                         <setProperty propertyName="DictionaryObject">
700                                                 <simple>${body}</simple>
701                                         </setProperty>
702                                         <to
703                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" />
704                                         <to
705                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
706                                         <doCatch>
707                                                 <exception>java.lang.Exception</exception>
708                                                 <handled>
709                                                         <constant>false</constant>
710                                                 </handled>
711                                                 <to
712                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
713                                         </doCatch>
714                                 </doTry>
715                         </route>
716                 </put>
717
718                 <put uri="/v2/dictionary/{name}"
719                         type="org.onap.clamp.tosca.Dictionary"
720                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
721                         produces="application/json">
722                         <route>
723                                 <removeHeaders pattern="*" excludePattern="name" />
724                                 <doTry>
725                                         <to
726                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" />
727                                         <to
728                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
729                                         <setProperty propertyName="DictionaryObject">
730                                                 <simple>${body}</simple>
731                                         </setProperty>
732                                         <to
733                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" />
734                                         <to
735                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
736                                         <doCatch>
737                                                 <exception>java.lang.Exception</exception>
738                                                 <handled>
739                                                         <constant>false</constant>
740                                                 </handled>
741                                                 <to
742                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
743                                         </doCatch>
744                                 </doTry>
745                         </route>
746                 </put>
747
748                 <delete uri="/v2/dictionary/{name}" produces="application/json">
749                         <route>
750                                 <removeHeaders pattern="*" excludePattern="name" />
751                                 <doTry>
752                                         <to
753                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" />
754                                         <to
755                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
756                                         <to
757                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" />
758                                         <to
759                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
760                                         <doCatch>
761                                                 <exception>java.lang.Exception</exception>
762                                                 <handled>
763                                                         <constant>false</constant>
764                                                 </handled>
765                                                 <to
766                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
767                                         </doCatch>
768                                 </doTry>
769                         </route>
770                 </delete>
771
772                 <delete uri="/v2/dictionary/{name}/elements/{shortName}"
773                         produces="application/json">
774                         <route>
775                                 <removeHeaders pattern="*"
776                                         excludePattern="name|shortName" />
777                                 <doTry>
778                                         <to
779                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" />
780                                         <to
781                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
782                                         <to
783                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" />
784                                         <to
785                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
786                                         <doCatch>
787                                                 <exception>java.lang.Exception</exception>
788                                                 <handled>
789                                                         <constant>false</constant>
790                                                 </handled>
791                                                 <to
792                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
793                                         </doCatch>
794                                 </doTry>
795                         </route>
796                 </delete>
797
798                 <get uri="/v2/policyToscaModels"
799                         outType="org.onap.clamp.loop.template.PolicyModel"
800                         produces="application/json">
801                         <route>
802                                 <removeHeaders pattern="*" />
803                                 <doTry>
804                                         <to
805                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" />
806                                         <to
807                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
808                                         <to
809                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" />
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                                                 <setHeader headerName="CamelHttpResponseCode">
818                                                         <constant>500</constant>
819                                                 </setHeader>
820                                                 <transform>
821                                                         <simple>ERROR: ${exception.message}</simple>
822                                                 </transform>
823                                                 <to
824                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
825                                         </doCatch>
826                                 </doTry>
827                         </route>
828                 </get>
829                 <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
830                         outType="org.onap.clamp.loop.template.PolicyModel"
831                         produces="application/json">
832                         <route>
833                                 <removeHeaders pattern="*"
834                                         excludePattern="policyModelType|policyModelVersion" />
835                                 <doTry>
836                                         <to
837                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
838                                         <to
839                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
840                                         <to
841                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
842                                         <to
843                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
844                                         <doCatch>
845                                                 <exception>java.lang.Exception</exception>
846                                                 <handled>
847                                                         <constant>true</constant>
848                                                 </handled>
849                                                 <setHeader headerName="CamelHttpResponseCode">
850                                                         <constant>500</constant>
851                                                 </setHeader>
852                                                 <transform>
853                                                         <simple>ERROR: ${exception.message}</simple>
854                                                 </transform>
855                                                 <to
856                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
857                                         </doCatch>
858                                 </doTry>
859                         </route>
860                 </get>
861                 <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
862                         outType="java.lang.String" produces="application/json">
863                         <route>
864                                 <removeHeaders pattern="*"
865                                         excludePattern="policyModelType|policyModelVersion" />
866                                 <doTry>
867                                         <to
868                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
869                                         <to
870                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
871                                         <to
872                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
873                                         <to
874                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
875                                         <doCatch>
876                                                 <exception>java.lang.Exception</exception>
877                                                 <handled>
878                                                         <constant>true</constant>
879                                                 </handled>
880                                                 <setHeader headerName="CamelHttpResponseCode">
881                                                         <constant>500</constant>
882                                                 </setHeader>
883                                                 <transform>
884                                                         <simple>ERROR: ${exception.message}</simple>
885                                                 </transform>
886                                                 <to
887                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
888                                         </doCatch>
889                                 </doTry>
890                         </route>
891                 </get>
892
893                 <post uri="/v2/policyToscaModels/{policyModelType}"
894                         type="java.lang.String"
895                         outType="org.onap.clamp.loop.template.PolicyModel"
896                         consumes="plain/text" produces="application/json">
897                         <route>
898                                 <removeHeaders pattern="*"
899                                         excludePattern="policyModelType" />
900                                 <doTry>
901                                         <to
902                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
903                                         <to
904                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
905                                         <setProperty propertyName="PolicyModelTosca">
906                                                 <simple>${body}</simple>
907                                         </setProperty>
908                                         <to
909                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${header.policyModelType},${exchangeProperty[PolicyModelTosca]})" />
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                                                 <setHeader headerName="CamelHttpResponseCode">
918                                                         <constant>404</constant>
919                                                 </setHeader>
920                                                 <transform>
921                                                         <simple>ERROR: ${exception.message}</simple>
922                                                 </transform>
923                                                 <to
924                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
925                                         </doCatch>
926                                 </doTry>
927                         </route>
928                 </post>
929                 <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
930                           type="java.lang.String"
931                           outType="org.onap.clamp.loop.template.PolicyModel"
932                           consumes="plain/text" produces="application/json">
933                         <route>
934                                 <removeHeaders pattern="*"
935                                                            excludePattern="policyModelType|policyModelVersion" />
936                                 <doTry>
937                                         <to
938                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
939                                         <to
940                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
941                                         <setProperty propertyName="PolicyModelTosca">
942                                                 <simple>${body}</simple>
943                                         </setProperty>
944                                         <to
945                                                         uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
946                                         <to
947                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
948                                         <doCatch>
949                                                 <exception>java.lang.Exception</exception>
950                                                 <handled>
951                                                         <constant>true</constant>
952                                                 </handled>
953                                                 <setHeader headerName="CamelHttpResponseCode">
954                                                         <constant>404</constant>
955                                                 </setHeader>
956                                                 <transform>
957                                                         <simple>ERROR: ${exception.message}</simple>
958                                                 </transform>
959                                                 <to
960                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
961                                         </doCatch>
962                                 </doTry>
963                         </route>
964                 </put>
965
966                 <get uri="/v2/templates"
967                         outType="org.onap.clamp.loop.template.LoopTemplate"
968                         produces="application/json">
969                         <route>
970                                 <removeHeaders pattern="*" />
971                                 <doTry>
972                                         <to
973                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" />
974                                         <to
975                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
976                                         <to
977                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" />
978                                         <to
979                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
980                                         <doCatch>
981                                                 <exception>java.lang.Exception</exception>
982                                                 <handled>
983                                                         <constant>true</constant>
984                                                 </handled>
985                                                 <setHeader headerName="CamelHttpResponseCode">
986                                                         <constant>500</constant>
987                                                 </setHeader>
988                                                 <transform>
989                                                         <simple>ERROR: ${exception.message}</simple>
990                                                 </transform>
991                                                 <to
992                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
993                                         </doCatch>
994                                 </doTry>
995                         </route>
996                 </get>
997                 <get uri="/v2/templates/{templateName}"
998                         outType="org.onap.clamp.loop.template.LoopTemplate"
999                         produces="application/json">
1000                         <route>
1001                                 <removeHeaders pattern="*"
1002                                         excludePattern="templateName" />
1003                                 <doTry>
1004                                         <to
1005                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" />
1006                                         <to
1007                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1008                                         <to
1009                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" />
1010                                         <to
1011                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1012                                         <doCatch>
1013                                                 <exception>java.lang.Exception</exception>
1014                                                 <handled>
1015                                                         <constant>true</constant>
1016                                                 </handled>
1017                                                 <setHeader headerName="CamelHttpResponseCode">
1018                                                         <constant>500</constant>
1019                                                 </setHeader>
1020                                                 <transform>
1021                                                         <simple>ERROR: ${exception.message}</simple>
1022                                                 </transform>
1023                                                 <to
1024                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1025                                         </doCatch>
1026                                 </doTry>
1027                         </route>
1028                 </get>
1029                 <get uri="/v2/templates/names" outType="java.lang.String[]"
1030                         produces="application/json">
1031                         <route>
1032                                 <removeHeaders pattern="*" />
1033                                 <doTry>
1034                                         <to
1035                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" />
1036                                         <to
1037                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1038                                         <to
1039                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" />
1040                                         <to
1041                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1042                                         <doCatch>
1043                                                 <exception>java.lang.Exception</exception>
1044                                                 <handled>
1045                                                         <constant>false</constant>
1046                                                 </handled>
1047                                                 <to
1048                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1049                                         </doCatch>
1050                                 </doTry>
1051                         </route>
1052                 </get>
1053                 <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation"
1054                          produces="application/json">
1055                         <to
1056                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" />
1057                 </get>
1058         </rest>
1059 </rests>