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