Merge "Upload Tosca Model changes to remove policy model type parsing from UI. Dictio...
[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.LoopController?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}" outType="org.onap.clamp.loop.Loop" produces="application/json">
573                         <route>
574                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
575                                 <doTry>
576                                         <to
577                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" />
578                                         <to
579                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
580                                         <to uri="direct:load-loop" />
581                                         <to
582                                                         uri="bean:org.onap.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
583                                         <to
584                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
585                                         <to
586                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
587                                         <doCatch>
588                                                 <exception>java.lang.Exception</exception>
589                                                 <handled>
590                                                         <constant>false</constant>
591                                                 </handled>
592                                                 <to
593                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
594                                                 <log loggingLevel="ERROR"
595                                                          message="ADD OperationalPolicy request failed for loop: ${header.loopName}" />
596                                                 <to
597                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
598                                         </doCatch>
599                                 </doTry>
600                         </route>
601                 </put>
602                 <post
603                                 uri="/v2/loop/create/{loopName}?templateName={templateName}"
604                                 outType="org.onap.clamp.loop.Loop" consumes="application/json"
605                                 produces="application/json">
606                         <route>
607                                 <removeHeaders
608                                                 pattern="*"
609                                                 excludePattern="loopName|templateName" />
610                                 <doTry>
611                                         <to
612                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" />
613                                         <to
614                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
615                                         <to
616                                                         uri="bean:org.onap.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" />
617                                         <to
618                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
619                                         <doCatch>
620                                                 <exception>java.lang.Exception</exception>
621                                                 <handled>
622                                                         <constant>true</constant>
623                                                 </handled>
624                                                 <setHeader headerName="CamelHttpResponseCode">
625                                                         <constant>500</constant>
626                                                 </setHeader>
627                                                 <transform>
628                                                         <simple>ERROR: ${exception.message}</simple>
629                                         </transform>
630                                                 <to
631                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
632                                         </doCatch>
633                                 </doTry>
634                         </route>
635                 </post>
636                 <get uri="/v2/dictionary"
637                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
638                         <route>
639                                 <removeHeaders pattern="*" />
640                                 <doTry>
641                                         <to
642                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" />
643                                         <to
644                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
645                                         <to
646                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" />
647                                         <to
648                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
649                                         <doCatch>
650                                                 <exception>java.lang.Exception</exception>
651                                                 <handled>
652                                                         <constant>false</constant>
653                                                 </handled>
654                                                 <to
655                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
656                                         </doCatch>
657                                 </doTry>
658                         </route>
659                 </get>
660
661                 <get uri="/v2/dictionary/secondary/names"
662                         outType="java.lang.String[]" produces="application/json">
663                         <route>
664                                 <removeHeaders pattern="*" />
665                                 <doTry>
666                                         <to
667                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" />
668                                         <to
669                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
670                                         <to
671                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" />
672                                         <to
673                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
674                                         <doCatch>
675                                                 <exception>java.lang.Exception</exception>
676                                                 <handled>
677                                                         <constant>false</constant>
678                                                 </handled>
679                                                 <to
680                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
681                                         </doCatch>
682                                 </doTry>
683                         </route>
684                 </get>
685                 <get uri="/v2/dictionary/{dictionaryName}"
686                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
687                         <route>
688                                 <removeHeaders pattern="*"
689                                         excludePattern="dictionaryName" />
690                                 <doTry>
691                                         <to
692                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" />
693                                         <to
694                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
695                                         <to
696                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" />
697                                         <to
698                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
699                                         <doCatch>
700                                                 <exception>java.lang.Exception</exception>
701                                                 <handled>
702                                                         <constant>false</constant>
703                                                 </handled>
704                                                 <to
705                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
706                                         </doCatch>
707                                 </doTry>
708                         </route>
709                 </get>
710                 <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary"
711                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
712                         produces="application/json">
713                         <route>
714                                 <doTry>
715                                         <to
716                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" />
717                                         <to
718                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
719                                         <setProperty propertyName="DictionaryObject">
720                                                 <simple>${body}</simple>
721                                         </setProperty>
722                                         <to
723                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" />
724                                         <to
725                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
726                                         <doCatch>
727                                                 <exception>java.lang.Exception</exception>
728                                                 <handled>
729                                                         <constant>false</constant>
730                                                 </handled>
731                                                 <to
732                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
733                                         </doCatch>
734                                 </doTry>
735                         </route>
736                 </put>
737
738                 <put uri="/v2/dictionary/{name}"
739                         type="org.onap.clamp.tosca.Dictionary"
740                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
741                         produces="application/json">
742                         <route>
743                                 <removeHeaders pattern="*" excludePattern="name" />
744                                 <doTry>
745                                         <to
746                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" />
747                                         <to
748                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
749                                         <setProperty propertyName="DictionaryObject">
750                                                 <simple>${body}</simple>
751                                         </setProperty>
752                                         <to
753                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" />
754                                         <to
755                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
756                                         <doCatch>
757                                                 <exception>java.lang.Exception</exception>
758                                                 <handled>
759                                                         <constant>false</constant>
760                                                 </handled>
761                                                 <to
762                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
763                                         </doCatch>
764                                 </doTry>
765                         </route>
766                 </put>
767
768                 <delete uri="/v2/dictionary/{name}" produces="application/json">
769                         <route>
770                                 <removeHeaders pattern="*" excludePattern="name" />
771                                 <doTry>
772                                         <to
773                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" />
774                                         <to
775                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
776                                         <to
777                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" />
778                                         <to
779                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
780                                         <doCatch>
781                                                 <exception>java.lang.Exception</exception>
782                                                 <handled>
783                                                         <constant>false</constant>
784                                                 </handled>
785                                                 <to
786                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
787                                         </doCatch>
788                                 </doTry>
789                         </route>
790                 </delete>
791
792                 <delete uri="/v2/dictionary/{name}/elements/{shortName}"
793                         produces="application/json">
794                         <route>
795                                 <removeHeaders pattern="*"
796                                         excludePattern="name|shortName" />
797                                 <doTry>
798                                         <to
799                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" />
800                                         <to
801                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
802                                         <to
803                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" />
804                                         <to
805                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
806                                         <doCatch>
807                                                 <exception>java.lang.Exception</exception>
808                                                 <handled>
809                                                         <constant>false</constant>
810                                                 </handled>
811                                                 <to
812                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
813                                         </doCatch>
814                                 </doTry>
815                         </route>
816                 </delete>
817
818                 <get uri="/v2/policyToscaModels"
819                         outType="org.onap.clamp.loop.template.PolicyModel"
820                         produces="application/json">
821                         <route>
822                                 <removeHeaders pattern="*" />
823                                 <doTry>
824                                         <to
825                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" />
826                                         <to
827                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
828                                         <to
829                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" />
830                                         <to
831                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
832                                         <doCatch>
833                                                 <exception>java.lang.Exception</exception>
834                                                 <handled>
835                                                         <constant>true</constant>
836                                                 </handled>
837                                                 <setHeader headerName="CamelHttpResponseCode">
838                                                         <constant>500</constant>
839                                                 </setHeader>
840                                                 <transform>
841                                                         <simple>ERROR: ${exception.message}</simple>
842                                                 </transform>
843                                                 <to
844                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
845                                         </doCatch>
846                                 </doTry>
847                         </route>
848                 </get>
849                 <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
850                         outType="org.onap.clamp.loop.template.PolicyModel"
851                         produces="application/json">
852                         <route>
853                                 <removeHeaders pattern="*"
854                                         excludePattern="policyModelType|policyModelVersion" />
855                                 <doTry>
856                                         <to
857                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
858                                         <to
859                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
860                                         <to
861                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
862                                         <to
863                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
864                                         <doCatch>
865                                                 <exception>java.lang.Exception</exception>
866                                                 <handled>
867                                                         <constant>true</constant>
868                                                 </handled>
869                                                 <setHeader headerName="CamelHttpResponseCode">
870                                                         <constant>500</constant>
871                                                 </setHeader>
872                                                 <transform>
873                                                         <simple>ERROR: ${exception.message}</simple>
874                                                 </transform>
875                                                 <to
876                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
877                                         </doCatch>
878                                 </doTry>
879                         </route>
880                 </get>
881                 <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
882                         outType="java.lang.String" produces="application/json">
883                         <route>
884                                 <removeHeaders pattern="*"
885                                         excludePattern="policyModelType|policyModelVersion" />
886                                 <doTry>
887                                         <to
888                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
889                                         <to
890                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
891                                         <to
892                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
893                                         <to
894                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
895                                         <doCatch>
896                                                 <exception>java.lang.Exception</exception>
897                                                 <handled>
898                                                         <constant>true</constant>
899                                                 </handled>
900                                                 <setHeader headerName="CamelHttpResponseCode">
901                                                         <constant>500</constant>
902                                                 </setHeader>
903                                                 <transform>
904                                                         <simple>ERROR: ${exception.message}</simple>
905                                                 </transform>
906                                                 <to
907                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
908                                         </doCatch>
909                                 </doTry>
910                         </route>
911                 </get>
912
913                 <post uri="/v2/policyToscaModels"
914                         type="java.lang.String"
915                         outType="org.onap.clamp.loop.template.PolicyModel"
916                         consumes="plain/text" produces="application/json">
917                         <route>
918                                 <removeHeaders pattern="*"/>
919                                 <doTry>
920                                         <to
921                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
922                                         <to
923                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
924                                         <setProperty propertyName="PolicyModelTosca">
925                                                 <simple>${body}</simple>
926                                         </setProperty>
927                                         <to
928                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" />
929                                         <to
930                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
931                                         <doCatch>
932                                                 <exception>java.lang.Exception</exception>
933                                                 <handled>
934                                                         <constant>true</constant>
935                                                 </handled>
936                                                 <setHeader headerName="CamelHttpResponseCode">
937                                                         <constant>404</constant>
938                                                 </setHeader>
939                                                 <transform>
940                                                         <simple>ERROR: ${exception.message}</simple>
941                                                 </transform>
942                                                 <to
943                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
944                                         </doCatch>
945                                 </doTry>
946                         </route>
947                 </post>
948                 <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
949                           type="java.lang.String"
950                           outType="org.onap.clamp.loop.template.PolicyModel"
951                           consumes="plain/text" produces="application/json">
952                         <route>
953                                 <removeHeaders pattern="*"
954                                                            excludePattern="policyModelType|policyModelVersion" />
955                                 <doTry>
956                                         <to
957                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
958                                         <to
959                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
960                                         <setProperty propertyName="PolicyModelTosca">
961                                                 <simple>${body}</simple>
962                                         </setProperty>
963                                         <to
964                                                         uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
965                                         <to
966                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
967                                         <doCatch>
968                                                 <exception>java.lang.Exception</exception>
969                                                 <handled>
970                                                         <constant>true</constant>
971                                                 </handled>
972                                                 <setHeader headerName="CamelHttpResponseCode">
973                                                         <constant>404</constant>
974                                                 </setHeader>
975                                                 <transform>
976                                                         <simple>ERROR: ${exception.message}</simple>
977                                                 </transform>
978                                                 <to
979                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
980                                         </doCatch>
981                                 </doTry>
982                         </route>
983                 </put>
984
985                 <get uri="/v2/templates"
986                         outType="org.onap.clamp.loop.template.LoopTemplate"
987                         produces="application/json">
988                         <route>
989                                 <removeHeaders pattern="*" />
990                                 <doTry>
991                                         <to
992                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" />
993                                         <to
994                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
995                                         <to
996                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" />
997                                         <to
998                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
999                                         <doCatch>
1000                                                 <exception>java.lang.Exception</exception>
1001                                                 <handled>
1002                                                         <constant>true</constant>
1003                                                 </handled>
1004                                                 <setHeader headerName="CamelHttpResponseCode">
1005                                                         <constant>500</constant>
1006                                                 </setHeader>
1007                                                 <transform>
1008                                                         <simple>ERROR: ${exception.message}</simple>
1009                                                 </transform>
1010                                                 <to
1011                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1012                                         </doCatch>
1013                                 </doTry>
1014                         </route>
1015                 </get>
1016                 <get uri="/v2/templates/{templateName}"
1017                         outType="org.onap.clamp.loop.template.LoopTemplate"
1018                         produces="application/json">
1019                         <route>
1020                                 <removeHeaders pattern="*"
1021                                         excludePattern="templateName" />
1022                                 <doTry>
1023                                         <to
1024                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" />
1025                                         <to
1026                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1027                                         <to
1028                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" />
1029                                         <to
1030                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1031                                         <doCatch>
1032                                                 <exception>java.lang.Exception</exception>
1033                                                 <handled>
1034                                                         <constant>true</constant>
1035                                                 </handled>
1036                                                 <setHeader headerName="CamelHttpResponseCode">
1037                                                         <constant>500</constant>
1038                                                 </setHeader>
1039                                                 <transform>
1040                                                         <simple>ERROR: ${exception.message}</simple>
1041                                                 </transform>
1042                                                 <to
1043                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1044                                         </doCatch>
1045                                 </doTry>
1046                         </route>
1047                 </get>
1048                 <get uri="/v2/templates/names" outType="java.lang.String[]"
1049                         produces="application/json">
1050                         <route>
1051                                 <removeHeaders pattern="*" />
1052                                 <doTry>
1053                                         <to
1054                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" />
1055                                         <to
1056                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1057                                         <to
1058                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" />
1059                                         <to
1060                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1061                                         <doCatch>
1062                                                 <exception>java.lang.Exception</exception>
1063                                                 <handled>
1064                                                         <constant>false</constant>
1065                                                 </handled>
1066                                                 <to
1067                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1068                                         </doCatch>
1069                                 </doTry>
1070                         </route>
1071                 </get>
1072                 <get uri="/v2/templates/{templateName}/svgRepresentation"
1073                          outType="java.lang.String" produces="application/xml">
1074                         <route>
1075                                 <removeHeaders pattern="*" excludePattern="templateName" />
1076                                 <doTry>
1077                                         <to
1078                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation for Loop template')" />
1079                                         <to
1080                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1081                                         <to
1082                                                         uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getSvgRepresentation(${header.templateName})" />
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>false</constant>
1089                                                 </handled>
1090                                                 <to
1091                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1092                                         </doCatch>
1093                                 </doTry>
1094                         </route>
1095                 </get>
1096                 <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation"
1097                          produces="application/json">
1098                         <to
1099                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" />
1100                 </get>
1101         </rest>
1102 </rests>