d1c191dc7115b5f62336fafad36d15453364dde1
[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="policy">
381                                                         <simple>${body}</simple>
382                                                 </setProperty>
383                                                 <log loggingLevel="INFO"
384                                                         message="Processing Micro Service Policy: ${exchangeProperty[policy].getName()}" />
385                                                 <setProperty propertyName="raiseHttpExceptionFlag">
386                                                         <simple resultType="java.lang.Boolean">false</simple>
387                                                 </setProperty>
388                                                 <to uri="direct:delete-policy" />
389                                                 <to uri="direct:create-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="policy">
397                                                         <simple>${body}</simple>
398                                                 </setProperty>
399                                                 <log loggingLevel="INFO"
400                                                         message="Processing Operational Policy: ${exchangeProperty[policy].getName()}" />
401                                                 <setProperty propertyName="raiseHttpExceptionFlag">
402                                                         <simple resultType="java.lang.Boolean">false</simple>
403                                                 </setProperty>
404
405                                                 <to uri="direct:delete-policy" />
406                                                 <to uri="direct:create-policy" />
407                                                 <choice>
408                                                         <when>
409                                                                 <simple>${exchangeProperty['policy'].isLegacy()} == true
410                                                                 </simple>
411                                                                 <log loggingLevel="INFO"
412                                                                         message="Processing all GUARD policies (LEGACY) defined in loop ${exchangeProperty[loopObject].getName()}" />
413                                                                 <split>
414                                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
415                                                                         </simple>
416                                                                         <setProperty propertyName="guardPolicy">
417                                                                                 <simple>${body}</simple>
418                                                                         </setProperty>
419                                                                         <log loggingLevel="INFO"
420                                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
421
422                                                                         <setProperty propertyName="raiseHttpExceptionFlag">
423                                                                                 <simple resultType="java.lang.Boolean">false</simple>
424                                                                         </setProperty>
425                                                                         <to uri="direct:delete-guard-policy" />
426                                                                         <to uri="direct:create-guard-policy" />
427                                                                 </split>
428                                                         </when>
429                                                 </choice>
430                                         </split>
431
432                                         <delay>
433                                                 <constant>3000</constant>
434                                         </delay>
435
436                                         <to uri="direct:add-all-to-active-pdp-group" />
437
438                                         <log loggingLevel="INFO"
439                                                 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
440                                         <to
441                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
442                                         <to
443                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
444                                         <doCatch>
445                                                 <exception>java.lang.Exception</exception>
446                                                 <handled>
447                                                         <constant>false</constant>
448                                                 </handled>
449                                                 <to
450                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
451                                                 <log loggingLevel="ERROR"
452                                                         message="SUBMIT request failed for loop: ${header.loopName}" />
453                                                 <to
454                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
455                                         </doCatch>
456                                 </doTry>
457                         </route>
458                 </put>
459                 <put uri="/v2/loop/delete/{loopName}">
460                         <route>
461                                 <removeHeaders pattern="*" excludePattern="loopName" />
462                                 <doTry>
463                                         <log loggingLevel="INFO"
464                                                 message="DELETE request for loop: ${header.loopName}" />
465                                         <to
466                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
467                                         <to
468                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
469                                         <to uri="direct:load-loop" />
470                                         <to
471                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" />
472                                         <to uri="direct:undeploy-loop" />
473                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
474                                         <split>
475                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
476                                                 </simple>
477                                                 <setProperty propertyName="microServicePolicy">
478                                                         <simple>${body}</simple>
479                                                 </setProperty>
480                                                 <log loggingLevel="INFO"
481                                                         message="Processing Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}" />
482                                                 <to uri="direct:delete-micro-service-policy" />
483                                         </split>
484
485                                         <log loggingLevel="INFO"
486                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
487                                         <split>
488                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
489                                                 </simple>
490                                                 <setProperty propertyName="operationalPolicy">
491                                                         <simple>${body}</simple>
492                                                 </setProperty>
493                                                 <log loggingLevel="INFO"
494                                                         message="Processing Operational Policy: ${exchangeProperty[operationalPolicy].getName()}" />
495                                                 <to uri="direct:delete-operational-policy" />
496                                                 <log loggingLevel="INFO"
497                                                         message="Processing all GUARD policies defined in loop ${exchangeProperty[loopObject].getName()}" />
498                                                 <split>
499                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
500                                                         </simple>
501                                                         <setProperty propertyName="guardPolicy">
502                                                                 <simple>${body}</simple>
503                                                         </setProperty>
504                                                         <log loggingLevel="INFO"
505                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
506                                                         <to uri="direct:delete-guard-policy" />
507                                                 </split>
508                                         </split>
509                                         <to
510                                                 uri="bean:org.onap.clamp.loop.log.LoopController?method=deleteLoop(${header.loopName})" />
511                                         <log loggingLevel="INFO"
512                                                 message="DELETE request successfully executed for loop: ${header.loopName}" />
513                                         <to
514                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request successfully executed','INFO',${exchangeProperty[loopObject]})" />
515                                         <to
516                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
517                                         <doCatch>
518                                                 <exception>java.lang.Exception</exception>
519                                                 <handled>
520                                                         <constant>false</constant>
521                                                 </handled>
522                                                 <to
523                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
524                                                 <log loggingLevel="ERROR"
525                                                         message="DELETE request failed for loop: ${header.loopName}" />
526                                                 <to
527                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
528                                         </doCatch>
529                                 </doTry>
530                         </route>
531                 </put>
532                 <get uri="/v2/loop/getstatus/{loopName}"
533                         outType="org.onap.clamp.loop.Loop" produces="application/json">
534                         <route>
535                                 <removeHeaders pattern="*" excludePattern="loopName" />
536                                 <doTry>
537                                         <log loggingLevel="INFO"
538                                                 message="GET STATUS request for loop: ${header.loopName}" />
539                                         <to
540                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" />
541                                         <to
542                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
543                                         <to uri="direct:load-loop" />
544                                         <to
545                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
546                                         <doTry>
547                                                 <to uri="direct:update-policy-status-for-loop" />
548                                                 <to uri="direct:update-dcae-status-for-loop" />
549                                                 <to uri="direct:update-loop-state" />
550
551                                                 <to
552                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
553                                                 <to
554                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
555                                         </doTry>
556                                         <doCatch>
557                                                 <exception>java.lang.Exception</exception>
558                                                 <handled>
559                                                         <constant>false</constant>
560                                                 </handled>
561                                                 <to
562                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
563                                                 <log loggingLevel="ERROR"
564                                                         message="Get Status request failed for loop: ${header.loopName}" />
565                                                 <to
566                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
567                                         </doCatch>
568                                         <doFinally>
569                                                 <setBody>
570                                                         <simple>${exchangeProperty[loopObject]}</simple>
571                                                 </setBody>
572                                         </doFinally>
573                                 </doTry>
574                         </route>
575                 </get>
576
577                 <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
578                         <route>
579                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
580                                 <doTry>
581                                         <to
582                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" />
583                                         <to
584                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
585                                         <to uri="direct:load-loop" />
586                                         <to
587                                                         uri="bean:org.onap.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
588                                         <to
589                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
590                                         <to
591                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
592                                         <doCatch>
593                                                 <exception>java.lang.Exception</exception>
594                                                 <handled>
595                                                         <constant>false</constant>
596                                                 </handled>
597                                                 <to
598                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
599                                                 <log loggingLevel="ERROR"
600                                                          message="ADD OperationalPolicy request failed for loop: ${header.loopName}" />
601                                                 <to
602                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
603                                         </doCatch>
604                                 </doTry>
605                         </route>
606                 </put>
607                 <put uri="/v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
608                         <route>
609                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
610                                 <doTry>
611                                         <to
612                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REMOVE operational Policy')" />
613                                         <to
614                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
615                                         <to uri="direct:load-loop" />
616                                         <to
617                                                         uri="bean:org.onap.clamp.loop.LoopController?method=removeOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
618                                         <to
619                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
620                                         <to
621                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
622                                         <doCatch>
623                                                 <exception>java.lang.Exception</exception>
624                                                 <handled>
625                                                         <constant>false</constant>
626                                                 </handled>
627                                                 <to
628                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
629                                                 <log loggingLevel="ERROR"
630                                                          message="REMOVE OperationalPolicy request failed for loop: ${header.loopName}" />
631                                                 <to
632                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
633                                         </doCatch>
634                                 </doTry>
635                         </route>
636                 </put>
637                 <post
638                                 uri="/v2/loop/create/{loopName}?templateName={templateName}"
639                                 outType="org.onap.clamp.loop.Loop" consumes="application/json"
640                                 produces="application/json">
641                         <route>
642                                 <removeHeaders
643                                                 pattern="*"
644                                                 excludePattern="loopName|templateName" />
645                                 <doTry>
646                                         <to
647                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" />
648                                         <to
649                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
650                                         <to
651                                                         uri="bean:org.onap.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" />
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>true</constant>
658                                                 </handled>
659                                                 <setHeader headerName="CamelHttpResponseCode">
660                                                         <constant>500</constant>
661                                                 </setHeader>
662                                                 <transform>
663                                                         <simple>ERROR: ${exception.message}</simple>
664                                         </transform>
665                                                 <to
666                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
667                                         </doCatch>
668                                 </doTry>
669                         </route>
670                 </post>
671                 <get uri="/v2/dictionary"
672                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
673                         <route>
674                                 <removeHeaders pattern="*" />
675                                 <doTry>
676                                         <to
677                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" />
678                                         <to
679                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
680                                         <to
681                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" />
682                                         <to
683                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
684                                         <doCatch>
685                                                 <exception>java.lang.Exception</exception>
686                                                 <handled>
687                                                         <constant>false</constant>
688                                                 </handled>
689                                                 <to
690                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
691                                         </doCatch>
692                                 </doTry>
693                         </route>
694                 </get>
695
696                 <get uri="/v2/dictionary/secondary/names"
697                         outType="java.lang.String[]" produces="application/json">
698                         <route>
699                                 <removeHeaders pattern="*" />
700                                 <doTry>
701                                         <to
702                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" />
703                                         <to
704                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
705                                         <to
706                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" />
707                                         <to
708                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
709                                         <doCatch>
710                                                 <exception>java.lang.Exception</exception>
711                                                 <handled>
712                                                         <constant>false</constant>
713                                                 </handled>
714                                                 <to
715                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
716                                         </doCatch>
717                                 </doTry>
718                         </route>
719                 </get>
720                 <get uri="/v2/dictionary/{dictionaryName}"
721                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
722                         <route>
723                                 <removeHeaders pattern="*"
724                                         excludePattern="dictionaryName" />
725                                 <doTry>
726                                         <to
727                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" />
728                                         <to
729                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
730                                         <to
731                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" />
732                                         <to
733                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
734                                         <doCatch>
735                                                 <exception>java.lang.Exception</exception>
736                                                 <handled>
737                                                         <constant>false</constant>
738                                                 </handled>
739                                                 <to
740                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
741                                         </doCatch>
742                                 </doTry>
743                         </route>
744                 </get>
745                 <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary"
746                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
747                         produces="application/json">
748                         <route>
749                                 <doTry>
750                                         <to
751                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" />
752                                         <to
753                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
754                                         <setProperty propertyName="DictionaryObject">
755                                                 <simple>${body}</simple>
756                                         </setProperty>
757                                         <to
758                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" />
759                                         <to
760                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
761                                         <doCatch>
762                                                 <exception>java.lang.Exception</exception>
763                                                 <handled>
764                                                         <constant>false</constant>
765                                                 </handled>
766                                                 <to
767                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
768                                         </doCatch>
769                                 </doTry>
770                         </route>
771                 </put>
772
773                 <put uri="/v2/dictionary/{name}"
774                         type="org.onap.clamp.tosca.Dictionary"
775                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
776                         produces="application/json">
777                         <route>
778                                 <removeHeaders pattern="*" excludePattern="name" />
779                                 <doTry>
780                                         <to
781                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" />
782                                         <to
783                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
784                                         <setProperty propertyName="DictionaryObject">
785                                                 <simple>${body}</simple>
786                                         </setProperty>
787                                         <to
788                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" />
789                                         <to
790                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
791                                         <doCatch>
792                                                 <exception>java.lang.Exception</exception>
793                                                 <handled>
794                                                         <constant>false</constant>
795                                                 </handled>
796                                                 <to
797                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
798                                         </doCatch>
799                                 </doTry>
800                         </route>
801                 </put>
802
803                 <delete uri="/v2/dictionary/{name}" produces="application/json">
804                         <route>
805                                 <removeHeaders pattern="*" excludePattern="name" />
806                                 <doTry>
807                                         <to
808                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" />
809                                         <to
810                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
811                                         <to
812                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" />
813                                         <to
814                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
815                                         <doCatch>
816                                                 <exception>java.lang.Exception</exception>
817                                                 <handled>
818                                                         <constant>false</constant>
819                                                 </handled>
820                                                 <to
821                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
822                                         </doCatch>
823                                 </doTry>
824                         </route>
825                 </delete>
826
827                 <delete uri="/v2/dictionary/{name}/elements/{shortName}"
828                         produces="application/json">
829                         <route>
830                                 <removeHeaders pattern="*"
831                                         excludePattern="name|shortName" />
832                                 <doTry>
833                                         <to
834                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" />
835                                         <to
836                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
837                                         <to
838                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" />
839                                         <to
840                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
841                                         <doCatch>
842                                                 <exception>java.lang.Exception</exception>
843                                                 <handled>
844                                                         <constant>false</constant>
845                                                 </handled>
846                                                 <to
847                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
848                                         </doCatch>
849                                 </doTry>
850                         </route>
851                 </delete>
852
853                 <get uri="/v2/policyToscaModels"
854                         outType="org.onap.clamp.loop.template.PolicyModel"
855                         produces="application/json">
856                         <route>
857                                 <removeHeaders pattern="*" />
858                                 <doTry>
859                                         <to
860                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" />
861                                         <to
862                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
863                                         <to
864                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" />
865                                         <to
866                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
867                                         <doCatch>
868                                                 <exception>java.lang.Exception</exception>
869                                                 <handled>
870                                                         <constant>true</constant>
871                                                 </handled>
872                                                 <setHeader headerName="CamelHttpResponseCode">
873                                                         <constant>500</constant>
874                                                 </setHeader>
875                                                 <transform>
876                                                         <simple>ERROR: ${exception.message}</simple>
877                                                 </transform>
878                                                 <to
879                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
880                                         </doCatch>
881                                 </doTry>
882                         </route>
883                 </get>
884                 <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
885                         outType="org.onap.clamp.loop.template.PolicyModel"
886                         produces="application/json">
887                         <route>
888                                 <removeHeaders pattern="*"
889                                         excludePattern="policyModelType|policyModelVersion" />
890                                 <doTry>
891                                         <to
892                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
893                                         <to
894                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
895                                         <to
896                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
897                                         <to
898                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
899                                         <doCatch>
900                                                 <exception>java.lang.Exception</exception>
901                                                 <handled>
902                                                         <constant>true</constant>
903                                                 </handled>
904                                                 <setHeader headerName="CamelHttpResponseCode">
905                                                         <constant>500</constant>
906                                                 </setHeader>
907                                                 <transform>
908                                                         <simple>ERROR: ${exception.message}</simple>
909                                                 </transform>
910                                                 <to
911                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
912                                         </doCatch>
913                                 </doTry>
914                         </route>
915                 </get>
916                 <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
917                         outType="java.lang.String" produces="application/json">
918                         <route>
919                                 <removeHeaders pattern="*"
920                                         excludePattern="policyModelType|policyModelVersion" />
921                                 <doTry>
922                                         <to
923                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
924                                         <to
925                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
926                                         <to
927                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
928                                         <to
929                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
930                                         <doCatch>
931                                                 <exception>java.lang.Exception</exception>
932                                                 <handled>
933                                                         <constant>true</constant>
934                                                 </handled>
935                                                 <setHeader headerName="CamelHttpResponseCode">
936                                                         <constant>500</constant>
937                                                 </setHeader>
938                                                 <transform>
939                                                         <simple>ERROR: ${exception.message}</simple>
940                                                 </transform>
941                                                 <to
942                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
943                                         </doCatch>
944                                 </doTry>
945                         </route>
946                 </get>
947
948                 <post uri="/v2/policyToscaModels"
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                                 <doTry>
955                                         <to
956                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
957                                         <to
958                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
959                                         <setProperty propertyName="PolicyModelTosca">
960                                                 <simple>${body}</simple>
961                                         </setProperty>
962                                         <to
963                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" />
964                                         <to
965                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
966                                         <doCatch>
967                                                 <exception>java.lang.Exception</exception>
968                                                 <handled>
969                                                         <constant>true</constant>
970                                                 </handled>
971                                                 <setHeader headerName="CamelHttpResponseCode">
972                                                         <constant>404</constant>
973                                                 </setHeader>
974                                                 <transform>
975                                                         <simple>ERROR: ${exception.message}</simple>
976                                                 </transform>
977                                                 <to
978                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
979                                         </doCatch>
980                                 </doTry>
981                         </route>
982                 </post>
983                 <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
984                           type="java.lang.String"
985                           outType="org.onap.clamp.loop.template.PolicyModel"
986                           consumes="plain/text" produces="application/json">
987                         <route>
988                                 <removeHeaders pattern="*"
989                                                            excludePattern="policyModelType|policyModelVersion" />
990                                 <doTry>
991                                         <to
992                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
993                                         <to
994                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
995                                         <setProperty propertyName="PolicyModelTosca">
996                                                 <simple>${body}</simple>
997                                         </setProperty>
998                                         <to
999                                                         uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
1000                                         <to
1001                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1002                                         <doCatch>
1003                                                 <exception>java.lang.Exception</exception>
1004                                                 <handled>
1005                                                         <constant>true</constant>
1006                                                 </handled>
1007                                                 <setHeader headerName="CamelHttpResponseCode">
1008                                                         <constant>404</constant>
1009                                                 </setHeader>
1010                                                 <transform>
1011                                                         <simple>ERROR: ${exception.message}</simple>
1012                                                 </transform>
1013                                                 <to
1014                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1015                                         </doCatch>
1016                                 </doTry>
1017                         </route>
1018                 </put>
1019
1020                 <get uri="/v2/templates"
1021                         outType="org.onap.clamp.loop.template.LoopTemplate"
1022                         produces="application/json">
1023                         <route>
1024                                 <removeHeaders pattern="*" />
1025                                 <doTry>
1026                                         <to
1027                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" />
1028                                         <to
1029                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1030                                         <to
1031                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" />
1032                                         <to
1033                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1034                                         <doCatch>
1035                                                 <exception>java.lang.Exception</exception>
1036                                                 <handled>
1037                                                         <constant>true</constant>
1038                                                 </handled>
1039                                                 <setHeader headerName="CamelHttpResponseCode">
1040                                                         <constant>500</constant>
1041                                                 </setHeader>
1042                                                 <transform>
1043                                                         <simple>ERROR: ${exception.message}</simple>
1044                                                 </transform>
1045                                                 <to
1046                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1047                                         </doCatch>
1048                                 </doTry>
1049                         </route>
1050                 </get>
1051                 <get uri="/v2/templates/{templateName}"
1052                         outType="org.onap.clamp.loop.template.LoopTemplate"
1053                         produces="application/json">
1054                         <route>
1055                                 <removeHeaders pattern="*"
1056                                         excludePattern="templateName" />
1057                                 <doTry>
1058                                         <to
1059                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" />
1060                                         <to
1061                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1062                                         <to
1063                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" />
1064                                         <to
1065                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1066                                         <doCatch>
1067                                                 <exception>java.lang.Exception</exception>
1068                                                 <handled>
1069                                                         <constant>true</constant>
1070                                                 </handled>
1071                                                 <setHeader headerName="CamelHttpResponseCode">
1072                                                         <constant>500</constant>
1073                                                 </setHeader>
1074                                                 <transform>
1075                                                         <simple>ERROR: ${exception.message}</simple>
1076                                                 </transform>
1077                                                 <to
1078                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1079                                         </doCatch>
1080                                 </doTry>
1081                         </route>
1082                 </get>
1083                 <get uri="/v2/templates/names" outType="java.lang.String[]"
1084                         produces="application/json">
1085                         <route>
1086                                 <removeHeaders pattern="*" />
1087                                 <doTry>
1088                                         <to
1089                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" />
1090                                         <to
1091                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1092                                         <to
1093                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" />
1094                                         <to
1095                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1096                                         <doCatch>
1097                                                 <exception>java.lang.Exception</exception>
1098                                                 <handled>
1099                                                         <constant>false</constant>
1100                                                 </handled>
1101                                                 <to
1102                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1103                                         </doCatch>
1104                                 </doTry>
1105                         </route>
1106                 </get>
1107                 <get uri="/v2/templates/{templateName}/svgRepresentation"
1108                          outType="java.lang.String" produces="application/xml">
1109                         <route>
1110                                 <removeHeaders pattern="*" excludePattern="templateName" />
1111                                 <doTry>
1112                                         <to
1113                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation for Loop template')" />
1114                                         <to
1115                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1116                                         <to
1117                                                         uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getSvgRepresentation(${header.templateName})" />
1118                                         <to
1119                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1120                                         <doCatch>
1121                                                 <exception>java.lang.Exception</exception>
1122                                                 <handled>
1123                                                         <constant>false</constant>
1124                                                 </handled>
1125                                                 <to
1126                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1127                                         </doCatch>
1128                                 </doTry>
1129                         </route>
1130                 </get>
1131                 <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation"
1132                          produces="application/json">
1133                         <to
1134                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" />
1135                 </get>
1136         </rest>
1137 </rests>