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