Merge "CDS attributes are not shown properly in UI"
[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 and Guard 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.LoopController?method=refreshMicroServicePolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.microServicePolicyName}})" />
287                                         <log loggingLevel="INFO"
288                                                  message="REFRESH Micro Service policy request successfully executed for loop: ${header.loopName}" />
289                                         <to
290                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Micro Service policy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
291                                         <to
292                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
293                                         <doCatch>
294                                                 <exception>java.lang.Exception</exception>
295                                                 <handled>
296                                                         <constant>true</constant>
297                                                 </handled>
298                                                 <to
299                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
300                                                 <log loggingLevel="ERROR"
301                                                          message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
302                                                 <to
303                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
304                                                 <setHeader headerName="CamelHttpResponseCode">
305                                                         <constant>500</constant>
306                                                 </setHeader>
307                                                 <setBody>
308                                                         <simple>REFRESH json schema request FAILED</simple>
309                                                 </setBody>
310                                         </doCatch>
311                                 </doTry>
312                         </route>
313                 </put>
314                 <put uri="/v2/loop/refreshOperationalPolicyJsonSchema/{loopName}/{operationalPolicyName}"
315                         outType="org.onap.clamp.loop.Loop" produces="application/json">
316                         <route>
317                                 <removeHeaders pattern="*" excludePattern="loopName|operationalPolicyName" />
318                                 <doTry>
319                                         <log loggingLevel="INFO"
320                                                 message="Refresh Operational Policy UI for loop: ${header.loopName} and ${header.operationalPolicyName}" />
321                                         <to
322                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REFRESH Operational Policy UI request')" />
323                                         <to
324                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
325                                         <to uri="direct:load-loop" />
326                                         <to
327                                                 uri="bean:org.onap.clamp.loop.LoopController?method=refreshOperationalPolicyJsonRepresentation(${exchangeProperty[loopObject]},${header.operationalPolicyName}})" />
328                                         <log loggingLevel="INFO"
329                                                 message="REFRESH operational policy request successfully executed for loop: ${header.loopName}" />
330                                         <to
331                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH operational policy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
332                                         <to
333                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
334                                         <doCatch>
335                                                 <exception>java.lang.Exception</exception>
336                                                 <handled>
337                                                         <constant>true</constant>
338                                                 </handled>
339                                                 <to
340                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
341                                                 <log loggingLevel="ERROR"
342                                                          message="REFRESH json schema request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
343                                                 <to
344                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REFRESH Json schema request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
345                                                 <setHeader headerName="CamelHttpResponseCode">
346                                                         <constant>500</constant>
347                                                 </setHeader>
348                                                 <setBody>
349                                                         <simple>REFRESH json schema request FAILED</simple>
350                                                 </setBody>
351                                         </doCatch>
352                                 </doTry>
353                         </route>
354                 </put>
355                 <put uri="/v2/loop/undeploy/{loopName}"
356                         outType="org.onap.clamp.loop.Loop" produces="application/json">
357                         <route>
358                                 <removeHeaders pattern="*" excludePattern="loopName" />
359                                 <doTry>
360                                         <log loggingLevel="INFO"
361                                                 message="DCAE UNDEPLOY request for loop: ${header.loopName}" />
362                                         <to
363                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DCAE UNDEPLOY request')" />
364                                         <to
365                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
366                                         <to uri="direct:load-loop" />
367                                         <to
368                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})" />
369                                         <to uri="direct:undeploy-loop" />
370
371                                         <log loggingLevel="INFO"
372                                                 message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
373                                         <to
374                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
375                                         <to
376                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
377                                         <doCatch>
378                                                 <exception>java.lang.Exception</exception>
379                                                 <handled>
380                                                         <constant>true</constant>
381                                                 </handled>
382                                                 <to
383                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
384                                                 <log loggingLevel="ERROR"
385                                                          message="UNDEPLOY request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
386                                                 <to
387                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
388                                                 <setHeader headerName="CamelHttpResponseCode">
389                                                         <constant>500</constant>
390                                                 </setHeader>
391                                                 <setBody>
392                                                         <simple>UNDEPLOY request FAILED</simple>
393                                                 </setBody>
394                                         </doCatch>
395                                 </doTry>
396                         </route>
397                 </put>
398                 <put uri="/v2/loop/stop/{loopName}"
399                         outType="org.onap.clamp.loop.Loop" produces="application/json">
400                         <route>
401                                 <removeHeaders pattern="*" excludePattern="loopName" />
402                                 <doTry>
403                                         <log loggingLevel="INFO"
404                                                 message="STOP request for loop: ${header.loopName}" />
405                                         <to
406                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'STOP request')" />
407                                         <to
408                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
409                                         <to uri="direct:load-loop" />
410                                         <to
411                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request','INFO',${exchangeProperty[loopObject]})" />
412
413                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
414                                         <log loggingLevel="INFO"
415                                                 message="STOP request successfully executed for loop: ${header.loopName}" />
416                                         <to
417                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
418                                         <to
419                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
420                                         <doCatch>
421                                                 <exception>java.lang.Exception</exception>
422                                                 <handled>
423                                                         <constant>true</constant>
424                                                 </handled>
425                                                 <to
426                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
427                                                 <log loggingLevel="ERROR"
428                                                          message="STOP request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
429                                                 <to
430                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
431                                                 <setHeader headerName="CamelHttpResponseCode">
432                                                         <constant>500</constant>
433                                                 </setHeader>
434                                                 <setBody>
435                                                         <simple>STOP request FAILED</simple>
436                                                 </setBody>
437                                         </doCatch>
438                                 </doTry>
439                         </route>
440                 </put>
441                 <put uri="/v2/loop/restart/{loopName}"
442                         outType="org.onap.clamp.loop.Loop" produces="application/json">
443                         <route>
444                                 <removeHeaders pattern="*" excludePattern="loopName" />
445                                 <doTry>
446                                         <log loggingLevel="INFO"
447                                                 message="RESTART request for loop: ${header.loopName}" />
448                                         <to
449                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'RESTART request')" />
450                                         <to
451                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
452                                         <to uri="direct:load-loop" />
453
454                                         <to
455                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request','INFO',${exchangeProperty[loopObject]})" />
456
457                                         <to uri="direct:add-all-to-active-pdp-group" />
458                                         <log loggingLevel="INFO"
459                                                 message="RESTART request successfully executed for loop: ${header.loopName}" />
460                                         <to
461                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request successfully executed','INFO',${exchangeProperty[loopObject]})" />
462                                         <to
463                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
464                                         <doCatch>
465                                                 <exception>java.lang.Exception</exception>
466                                                 <handled>
467                                                         <constant>true</constant>
468                                                 </handled>
469                                                 <to
470                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
471                                                 <log loggingLevel="ERROR"
472                                                          message="RESTART request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
473                                                 <to
474                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('RESTART request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
475                                                 <setHeader headerName="CamelHttpResponseCode">
476                                                         <constant>500</constant>
477                                                 </setHeader>
478                                                 <setBody>
479                                                         <simple>RESTART request FAILED</simple>
480                                                 </setBody>
481                                         </doCatch>
482                                 </doTry>
483                         </route>
484                 </put>
485                 <put uri="/v2/loop/submit/{loopName}"
486                         outType="org.onap.clamp.loop.Loop" produces="application/json">
487                         <route>
488                                 <removeHeaders pattern="*" excludePattern="loopName" />
489                                 <doTry>
490                                         <log loggingLevel="INFO"
491                                                 message="POLICY SUBMIT request for loop: ${header.loopName}" />
492                                         <to
493                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'POLICY SUBMIT request')" />
494                                         <to
495                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
496                                         <to uri="direct:load-loop" />
497                                         <to
498                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('POLICY SUBMIT request','INFO',${exchangeProperty[loopObject]})" />
499                                         <setProperty propertyName="raiseHttpExceptionFlag">
500                                                 <simple resultType="java.lang.Boolean">false</simple>
501                                         </setProperty>
502                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
503                                         <log loggingLevel="INFO"
504                                                 message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
505                                         <split>
506                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
507                                                 </simple>
508                                                 <setProperty propertyName="policy">
509                                                         <simple>${body}</simple>
510                                                 </setProperty>
511                                                 <log loggingLevel="INFO"
512                                                         message="Processing Micro Service Policy: ${exchangeProperty[policy].getName()}" />
513                                                 <setProperty propertyName="raiseHttpExceptionFlag">
514                                                         <simple resultType="java.lang.Boolean">false</simple>
515                                                 </setProperty>
516                                                 <to uri="direct:delete-policy" />
517                                                 <to uri="direct:create-policy" />
518                                         </split>
519                                         <log loggingLevel="INFO"
520                                                 message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
521                                         <split>
522                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
523                                                 </simple>
524                                                 <setProperty propertyName="policy">
525                                                         <simple>${body}</simple>
526                                                 </setProperty>
527                                                 <log loggingLevel="INFO"
528                                                         message="Processing Operational Policy: ${exchangeProperty[policy].getName()}" />
529                                                 <setProperty propertyName="raiseHttpExceptionFlag">
530                                                         <simple resultType="java.lang.Boolean">false</simple>
531                                                 </setProperty>
532
533                                                 <to uri="direct:delete-policy" />
534                                                 <to uri="direct:create-policy" />
535                                                 <choice>
536                                                         <when>
537                                                                 <simple>${exchangeProperty['policy'].isLegacy()} == true
538                                                                 </simple>
539                                                                 <log loggingLevel="INFO"
540                                                                         message="Processing all GUARD policies (LEGACY) defined in loop ${exchangeProperty[loopObject].getName()}" />
541                                                                 <split>
542                                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
543                                                                         </simple>
544                                                                         <setProperty propertyName="guardPolicy">
545                                                                                 <simple>${body}</simple>
546                                                                         </setProperty>
547                                                                         <log loggingLevel="INFO"
548                                                                                 message="Processing Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
549
550                                                                         <setProperty propertyName="raiseHttpExceptionFlag">
551                                                                                 <simple resultType="java.lang.Boolean">false</simple>
552                                                                         </setProperty>
553                                                                         <to uri="direct:delete-guard-policy" />
554                                                                         <to uri="direct:create-guard-policy" />
555                                                                 </split>
556                                                         </when>
557                                                 </choice>
558                                         </split>
559
560                                         <delay>
561                                                 <constant>3000</constant>
562                                         </delay>
563
564                                         <to uri="direct:add-all-to-active-pdp-group" />
565
566                                         <log loggingLevel="INFO"
567                                                 message="SUBMIT request successfully executed for loop: ${header.loopName}" />
568                                         <to
569                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
570                                         <to
571                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
572                                         <doCatch>
573                                                 <exception>java.lang.Exception</exception>
574                                                 <handled>
575                                                         <constant>true</constant>
576                                                 </handled>
577                                                 <to
578                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
579                                                 <log loggingLevel="ERROR"
580                                                          message="SUBMIT request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
581                                                 <to
582                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
583                                                 <setHeader headerName="CamelHttpResponseCode">
584                                                         <constant>500</constant>
585                                                 </setHeader>
586                                                 <setBody>
587                                                         <simple>SUBMIT request FAILED</simple>
588                                                 </setBody>
589                                         </doCatch>
590                                 </doTry>
591                         </route>
592                 </put>
593                 <put uri="/v2/loop/delete/{loopName}">
594                         <route>
595                                 <removeHeaders pattern="*" excludePattern="loopName" />
596                                 <doTry>
597                                         <log loggingLevel="INFO"
598                                                 message="DELETE request for loop: ${header.loopName}" />
599                                         <to
600                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')" />
601                                         <to
602                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
603                                         <to uri="direct:load-loop" />
604                                         <to
605                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})" />
606                                         <to uri="direct:undeploy-loop" />
607                                         <to uri="direct:remove-all-policy-from-active-pdp-group" />
608                                         <log loggingLevel="INFO"
609                                                 message="Deleting all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
610                                         <split>
611                                                 <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
612                                                 </simple>
613                                                 <setProperty propertyName="policy">
614                                                         <simple>${body}</simple>
615                                                 </setProperty>
616                                                 <log loggingLevel="INFO"
617                                                         message="Deleting Micro Service Policy: ${exchangeProperty[policy].getName()}" />
618                                                 <setProperty propertyName="raiseHttpExceptionFlag">
619                                                         <simple resultType="java.lang.Boolean">false</simple>
620                                                 </setProperty>
621                                                 <to uri="direct:delete-policy" />
622                                         </split>
623                                         <log loggingLevel="INFO"
624                                                 message="Deleting all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
625                                         <split>
626                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
627                                                 </simple>
628                                                 <setProperty propertyName="policy">
629                                                         <simple>${body}</simple>
630                                                 </setProperty>
631                                                 <log loggingLevel="INFO"
632                                                         message="Deleting Operational Policy: ${exchangeProperty[policy].getName()}" />
633                                                 <setProperty propertyName="raiseHttpExceptionFlag">
634                                                         <simple resultType="java.lang.Boolean">false</simple>
635                                                 </setProperty>
636                                                 <to uri="direct:delete-policy" />
637                                                 <choice>
638                                                         <when>
639                                                                 <simple>${exchangeProperty['policy'].isLegacy()} == true
640                                                                 </simple>
641                                                                 <log loggingLevel="INFO"
642                                                                         message="Deleting all GUARD policies (LEGACY) defined in loop ${exchangeProperty[loopObject].getName()}" />
643                                                                 <split>
644                                                                         <simple>${exchangeProperty[operationalPolicy].createGuardPolicyPayloads().entrySet()}
645                                                                         </simple>
646                                                                         <setProperty propertyName="guardPolicy">
647                                                                                 <simple>${body}</simple>
648                                                                         </setProperty>
649                                                                         <log loggingLevel="INFO"
650                                                                                 message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}" />
651                                                                         <setProperty propertyName="raiseHttpExceptionFlag">
652                                                                                 <simple resultType="java.lang.Boolean">false</simple>
653                                                                         </setProperty>
654                                                                         <to uri="direct:delete-guard-policy" />
655                                                                 </split>
656                                                         </when>
657                                                 </choice>
658                                         </split>
659                                         <to
660                                                 uri="bean:org.onap.clamp.loop.LoopController?method=deleteLoop(${header.loopName})" />
661                                         <log loggingLevel="INFO"
662                                                 message="DELETE request successfully executed for loop: ${header.loopName}" />
663                                         <to
664                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
665                                         <doCatch>
666                                                 <exception>java.lang.Exception</exception>
667                                                 <handled>
668                                                         <constant>true</constant>
669                                                 </handled>
670                                                 <to
671                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
672                                                 <log loggingLevel="ERROR"
673                                                          message="DELETE request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
674                                                 <to
675                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
676                                                 <setHeader headerName="CamelHttpResponseCode">
677                                                         <constant>500</constant>
678                                                 </setHeader>
679                                                 <setBody>
680                                                         <simple>DELETE request FAILED</simple>
681                                                 </setBody>
682                                         </doCatch>
683                                 </doTry>
684                         </route>
685                 </put>
686                 <get uri="/v2/loop/getstatus/{loopName}"
687                         outType="org.onap.clamp.loop.Loop" produces="application/json">
688                         <route>
689                                 <removeHeaders pattern="*" excludePattern="loopName" />
690                                 <doTry>
691                                         <log loggingLevel="INFO"
692                                                 message="GET STATUS request for loop: ${header.loopName}" />
693                                         <to
694                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET STATUS request')" />
695                                         <to
696                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
697                                         <to uri="direct:load-loop" />
698                                         <to
699                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
700                                         <doTry>
701                                                 <to uri="direct:update-policy-status-for-loop" />
702                                                 <to uri="direct:update-dcae-status-for-loop" />
703                                                 <to uri="direct:update-loop-state" />
704
705                                                 <to
706                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request successfully executed','INFO',${exchangeProperty[loopObject]})" />
707                                                 <to
708                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
709                                         </doTry>
710                                         <doCatch>
711                                                 <exception>java.lang.Exception</exception>
712                                                 <handled>
713                                                         <constant>true</constant>
714                                                 </handled>
715                                                 <to
716                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
717                                                 <log loggingLevel="ERROR"
718                                                          message="GET STATUS request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
719                                                 <to
720                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
721                                                 <setHeader headerName="CamelHttpResponseCode">
722                                                         <constant>500</constant>
723                                                 </setHeader>
724                                                 <setBody>
725                                                         <simple>GET STATUS request FAILED</simple>
726                                                 </setBody>
727                                         </doCatch>
728                                         <doFinally>
729                                                 <setBody>
730                                                         <simple>${exchangeProperty[loopObject]}</simple>
731                                                 </setBody>
732                                         </doFinally>
733                                 </doTry>
734                         </route>
735                 </get>
736
737                 <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
738                         <route>
739                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
740                                 <doTry>
741                                         <to
742                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" />
743                                         <to
744                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
745                                         <to uri="direct:load-loop" />
746                                         <to
747                                                         uri="bean:org.onap.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
748                                         <to
749                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
750                                         <to
751                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
752                                         <doCatch>
753                                                 <exception>java.lang.Exception</exception>
754                                                 <handled>
755                                                         <constant>true</constant>
756                                                 </handled>
757                                                 <to
758                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
759                                                 <log loggingLevel="ERROR"
760                                                          message="ADD operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
761                                                 <to
762                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
763                                                 <setHeader headerName="CamelHttpResponseCode">
764                                                         <constant>500</constant>
765                                                 </setHeader>
766                                                 <setBody>
767                                                         <simple>ADD Operational policy request FAILED</simple>
768                                                 </setBody>
769                                         </doCatch>
770                                 </doTry>
771                         </route>
772                 </put>
773                 <put uri="/v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
774                         <route>
775                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
776                                 <doTry>
777                                         <to
778                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REMOVE operational Policy')" />
779                                         <to
780                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
781                                         <to uri="direct:load-loop" />
782                                         <to
783                                                         uri="bean:org.onap.clamp.loop.LoopController?method=removeOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
784                                         <to
785                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
786                                         <to
787                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
788                                         <doCatch>
789                                                 <exception>java.lang.Exception</exception>
790                                                 <handled>
791                                                         <constant>true</constant>
792                                                 </handled>
793                                                 <to
794                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
795                                                 <log loggingLevel="ERROR"
796                                                          message="REMOVE operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
797                                                 <to
798                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
799                                                 <setHeader headerName="CamelHttpResponseCode">
800                                                         <constant>500</constant>
801                                                 </setHeader>
802                                                 <setBody>
803                                                         <simple>REMOVE Operational policy request FAILED</simple>
804                                                 </setBody>
805                                         </doCatch>
806                                 </doTry>
807                         </route>
808                 </put>
809                 <post
810                                 uri="/v2/loop/create/{loopName}?templateName={templateName}"
811                                 outType="org.onap.clamp.loop.Loop" consumes="application/json"
812                                 produces="application/json">
813                         <route>
814                                 <removeHeaders
815                                                 pattern="*"
816                                                 excludePattern="loopName|templateName" />
817                                 <doTry>
818                                         <to
819                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" />
820                                         <to
821                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
822                                         <to
823                                                         uri="bean:org.onap.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" />
824                                         <to
825                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
826                                         <doCatch>
827                                                 <exception>java.lang.Exception</exception>
828                                                 <handled>
829                                                         <constant>true</constant>
830                                                 </handled>
831                                                 <to
832                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
833                                                 <log loggingLevel="ERROR"
834                                                          message="CREATE Loop from Template request failed for loop: ${header.loopName}, ${exception.stacktrace}" />
835                                                 <to
836                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('CREATE Loop from template request failed','ERROR',${exchangeProperty[loopObject]})" />
837                                                 <setHeader headerName="CamelHttpResponseCode">
838                                                         <constant>500</constant>
839                                                 </setHeader>
840                                                 <setBody>
841                                                         <simple>CREATE Loop from template FAILED</simple>
842                                                 </setBody>
843                                         </doCatch>
844                                 </doTry>
845                         </route>
846                 </post>
847                 <get uri="/v2/dictionary"
848                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
849                         <route>
850                                 <removeHeaders pattern="*" />
851                                 <doTry>
852                                         <to
853                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" />
854                                         <to
855                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
856                                         <to
857                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" />
858                                         <to
859                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
860                                         <doCatch>
861                                                 <exception>java.lang.Exception</exception>
862                                                 <handled>
863                                                         <constant>true</constant>
864                                                 </handled>
865                                                 <to
866                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
867                                                 <log loggingLevel="ERROR"
868                                                          message="GET Dictionary request failed: ${exception.stacktrace}" />
869                                                 <setHeader headerName="CamelHttpResponseCode">
870                                                         <constant>500</constant>
871                                                 </setHeader>
872                                                 <setBody>
873                                                         <simple>GET Dictionary FAILED</simple>
874                                                 </setBody>
875                                         </doCatch>
876                                 </doTry>
877                         </route>
878                 </get>
879
880                 <get uri="/v2/dictionary/secondary/names"
881                         outType="java.lang.String[]" produces="application/json">
882                         <route>
883                                 <removeHeaders pattern="*" />
884                                 <doTry>
885                                         <to
886                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" />
887                                         <to
888                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
889                                         <to
890                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" />
891                                         <to
892                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
893                                         <doCatch>
894                                                 <exception>java.lang.Exception</exception>
895                                                 <handled>
896                                                         <constant>true</constant>
897                                                 </handled>
898                                                 <to
899                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
900                                                 <log loggingLevel="ERROR"
901                                                          message="GET Dictionary request failed: ${exception.stacktrace}" />
902                                                 <setHeader headerName="CamelHttpResponseCode">
903                                                         <constant>500</constant>
904                                                 </setHeader>
905                                                 <setBody>
906                                                         <simple>GET Dictionary FAILED</simple>
907                                                 </setBody>
908                                         </doCatch>
909                                 </doTry>
910                         </route>
911                 </get>
912                 <get uri="/v2/dictionary/{dictionaryName}"
913                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
914                         <route>
915                                 <removeHeaders pattern="*"
916                                         excludePattern="dictionaryName" />
917                                 <doTry>
918                                         <to
919                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" />
920                                         <to
921                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
922                                         <to
923                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" />
924                                         <to
925                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
926                                         <doCatch>
927                                                 <exception>java.lang.Exception</exception>
928                                                 <handled>
929                                                         <constant>true</constant>
930                                                 </handled>
931                                                 <to
932                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
933                                                 <log loggingLevel="ERROR"
934                                                          message="GET Dictionary request failed for: ${header.dictionaryName}, ${exception.stacktrace}" />
935                                                 <setHeader headerName="CamelHttpResponseCode">
936                                                         <constant>500</constant>
937                                                 </setHeader>
938                                                 <setBody>
939                                                         <simple>GET Dictionary FAILED</simple>
940                                                 </setBody>
941                                         </doCatch>
942                                 </doTry>
943                         </route>
944                 </get>
945                 <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary"
946                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
947                         produces="application/json">
948                         <route>
949                                 <doTry>
950                                         <to
951                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" />
952                                         <to
953                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
954                                         <setProperty propertyName="DictionaryObject">
955                                                 <simple>${body}</simple>
956                                         </setProperty>
957                                         <to
958                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" />
959                                         <to
960                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
961                                         <doCatch>
962                                                 <exception>java.lang.Exception</exception>
963                                                 <handled>
964                                                         <constant>true</constant>
965                                                 </handled>
966                                                 <to
967                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
968                                                 <log loggingLevel="ERROR"
969                                                          message="PUT Dictionary request failed for: ${exception.stacktrace}" />
970                                                 <setHeader headerName="CamelHttpResponseCode">
971                                                         <constant>500</constant>
972                                                 </setHeader>
973                                                 <setBody>
974                                                         <simple>PUT Dictionary FAILED</simple>
975                                                 </setBody>
976                                         </doCatch>
977                                 </doTry>
978                         </route>
979                 </put>
980
981                 <put uri="/v2/dictionary/{name}"
982                         type="org.onap.clamp.tosca.Dictionary"
983                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
984                         produces="application/json">
985                         <route>
986                                 <removeHeaders pattern="*" excludePattern="name" />
987                                 <doTry>
988                                         <to
989                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" />
990                                         <to
991                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
992                                         <setProperty propertyName="DictionaryObject">
993                                                 <simple>${body}</simple>
994                                         </setProperty>
995                                         <to
996                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" />
997                                         <to
998                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
999                                         <doCatch>
1000                                                 <exception>java.lang.Exception</exception>
1001                                                 <handled>
1002                                                         <constant>true</constant>
1003                                                 </handled>
1004                                                 <to
1005                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1006                                                 <log loggingLevel="ERROR"
1007                                                          message="PUT Dictionary request failed for: ${header.name}, ${exception.stacktrace}" />
1008                                                 <setHeader headerName="CamelHttpResponseCode">
1009                                                         <constant>500</constant>
1010                                                 </setHeader>
1011                                                 <setBody>
1012                                                         <simple>PUT Dictionary FAILED</simple>
1013                                                 </setBody>
1014                                         </doCatch>
1015                                 </doTry>
1016                         </route>
1017                 </put>
1018
1019                 <delete uri="/v2/dictionary/{name}" produces="application/json">
1020                         <route>
1021                                 <removeHeaders pattern="*" excludePattern="name" />
1022                                 <doTry>
1023                                         <to
1024                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" />
1025                                         <to
1026                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1027                                         <to
1028                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" />
1029                                         <to
1030                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1031                                         <doCatch>
1032                                                 <exception>java.lang.Exception</exception>
1033                                                 <handled>
1034                                                         <constant>true</constant>
1035                                                 </handled>
1036                                                 <to
1037                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1038                                                 <log loggingLevel="ERROR"
1039                                                          message="DELETE Dictionary request failed for: ${header.name}, ${exception.stacktrace}" />
1040                                                 <setHeader headerName="CamelHttpResponseCode">
1041                                                         <constant>500</constant>
1042                                                 </setHeader>
1043                                                 <setBody>
1044                                                         <simple>DELETE Dictionary FAILED</simple>
1045                                                 </setBody>
1046                                         </doCatch>
1047                                 </doTry>
1048                         </route>
1049                 </delete>
1050
1051                 <delete uri="/v2/dictionary/{name}/elements/{shortName}"
1052                         produces="application/json">
1053                         <route>
1054                                 <removeHeaders pattern="*"
1055                                         excludePattern="name|shortName" />
1056                                 <doTry>
1057                                         <to
1058                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" />
1059                                         <to
1060                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1061                                         <to
1062                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" />
1063                                         <to
1064                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1065                                         <doCatch>
1066                                                 <exception>java.lang.Exception</exception>
1067                                                 <handled>
1068                                                         <constant>true</constant>
1069                                                 </handled>
1070                                                 <to
1071                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1072                                                 <log loggingLevel="ERROR"
1073                                                          message="DELETE Dictionary element request failed for: ${header.name}, ${exception.stacktrace}" />
1074                                                 <setHeader headerName="CamelHttpResponseCode">
1075                                                         <constant>500</constant>
1076                                                 </setHeader>
1077                                                 <setBody>
1078                                                         <simple>DELETE Dictionary element FAILED</simple>
1079                                                 </setBody>
1080                                         </doCatch>
1081                                 </doTry>
1082                         </route>
1083                 </delete>
1084
1085                 <get uri="/v2/policyToscaModels"
1086                         outType="org.onap.clamp.loop.template.PolicyModel"
1087                         produces="application/json">
1088                         <route>
1089                                 <removeHeaders pattern="*" />
1090                                 <doTry>
1091                                         <to
1092                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" />
1093                                         <to
1094                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1095                                         <to
1096                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" />
1097                                         <to
1098                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1099                                         <doCatch>
1100                                                 <exception>java.lang.Exception</exception>
1101                                                 <handled>
1102                                                         <constant>true</constant>
1103                                                 </handled>
1104                                                 <to
1105                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1106                                                 <log loggingLevel="ERROR"
1107                                                          message="GET Policy Models request failed for: ${exception.stacktrace}" />
1108                                                 <setHeader headerName="CamelHttpResponseCode">
1109                                                         <constant>500</constant>
1110                                                 </setHeader>
1111                                                 <setBody>
1112                                                         <simple>GET Policy models FAILED</simple>
1113                                                 </setBody>
1114                                         </doCatch>
1115                                 </doTry>
1116                         </route>
1117                 </get>
1118                 <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
1119                         outType="org.onap.clamp.loop.template.PolicyModel"
1120                         produces="application/json">
1121                         <route>
1122                                 <removeHeaders pattern="*"
1123                                         excludePattern="policyModelType|policyModelVersion" />
1124                                 <doTry>
1125                                         <to
1126                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
1127                                         <to
1128                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1129                                         <to
1130                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
1131                                         <to
1132                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1133                                         <doCatch>
1134                                                 <exception>java.lang.Exception</exception>
1135                                                 <handled>
1136                                                         <constant>true</constant>
1137                                                 </handled>
1138                                                 <to
1139                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1140                                                 <log loggingLevel="ERROR"
1141                                                          message="GET Policy Model request failed for type: ${header.policyModelType}, ${exception.stacktrace}" />
1142                                                 <setHeader headerName="CamelHttpResponseCode">
1143                                                         <constant>500</constant>
1144                                                 </setHeader>
1145                                                 <setBody>
1146                                                         <simple>GET Policy model FAILED</simple>
1147                                                 </setBody>
1148                                         </doCatch>
1149                                 </doTry>
1150                         </route>
1151                 </get>
1152                 <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
1153                         outType="java.lang.String" produces="application/json">
1154                         <route>
1155                                 <removeHeaders pattern="*"
1156                                         excludePattern="policyModelType|policyModelVersion" />
1157                                 <doTry>
1158                                         <to
1159                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
1160                                         <to
1161                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1162                                         <to
1163                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
1164                                         <to
1165                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1166                                         <doCatch>
1167                                                 <exception>java.lang.Exception</exception>
1168                                                 <handled>
1169                                                         <constant>true</constant>
1170                                                 </handled>
1171                                                 <to
1172                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1173                                                 <log loggingLevel="ERROR"
1174                                                          message="GET Policy Model YAML request failed for type: ${header.policyModelType}, ${exception.stacktrace}" />
1175                                                 <setHeader headerName="CamelHttpResponseCode">
1176                                                         <constant>500</constant>
1177                                                 </setHeader>
1178                                                 <setBody>
1179                                                         <simple>GET Policy model YAML FAILED</simple>
1180                                                 </setBody>
1181                                         </doCatch>
1182                                 </doTry>
1183                         </route>
1184                 </get>
1185
1186                 <post uri="/v2/policyToscaModels"
1187                         type="java.lang.String"
1188                         outType="org.onap.clamp.loop.template.PolicyModel"
1189                         consumes="plain/text" produces="application/json">
1190                         <route>
1191                                 <removeHeaders pattern="*"/>
1192                                 <doTry>
1193                                         <to
1194                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
1195                                         <to
1196                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1197                                         <setProperty propertyName="PolicyModelTosca">
1198                                                 <simple>${body}</simple>
1199                                         </setProperty>
1200                                         <to
1201                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" />
1202                                         <to
1203                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1204                                         <doCatch>
1205                                                 <exception>java.lang.Exception</exception>
1206                                                 <handled>
1207                                                         <constant>true</constant>
1208                                                 </handled>
1209                                                 <to
1210                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1211                                                 <log loggingLevel="ERROR"
1212                                                          message="POST Policy Model YAML request failed: ${exception.stacktrace}" />
1213                                                 <setHeader headerName="CamelHttpResponseCode">
1214                                                         <constant>500</constant>
1215                                                 </setHeader>
1216                                                 <setBody>
1217                                                         <simple>POST Policy model YAML FAILED</simple>
1218                                                 </setBody>
1219                                         </doCatch>
1220                                 </doTry>
1221                         </route>
1222                 </post>
1223                 <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
1224                           type="java.lang.String"
1225                           outType="org.onap.clamp.loop.template.PolicyModel"
1226                           consumes="plain/text" produces="application/json">
1227                         <route>
1228                                 <removeHeaders pattern="*"
1229                                                            excludePattern="policyModelType|policyModelVersion" />
1230                                 <doTry>
1231                                         <to
1232                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
1233                                         <to
1234                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1235                                         <setProperty propertyName="PolicyModelTosca">
1236                                                 <simple>${body}</simple>
1237                                         </setProperty>
1238                                         <to
1239                                                         uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
1240                                         <to
1241                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1242                                         <doCatch>
1243                                                 <exception>java.lang.Exception</exception>
1244                                                 <handled>
1245                                                         <constant>true</constant>
1246                                                 </handled>
1247                                                 <to
1248                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1249                                                 <log loggingLevel="ERROR"
1250                                                          message="MODIFY Policy Model YAML request failed: ${exception.stacktrace}" />
1251                                                 <setHeader headerName="CamelHttpResponseCode">
1252                                                         <constant>500</constant>
1253                                                 </setHeader>
1254                                                 <setBody>
1255                                                         <simple>MODIFY Policy model YAML FAILED</simple>
1256                                                 </setBody>
1257                                         </doCatch>
1258                                 </doTry>
1259                         </route>
1260                 </put>
1261
1262                 <get uri="/v2/templates"
1263                         outType="org.onap.clamp.loop.template.LoopTemplate"
1264                         produces="application/json">
1265                         <route>
1266                                 <removeHeaders pattern="*" />
1267                                 <doTry>
1268                                         <to
1269                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" />
1270                                         <to
1271                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1272                                         <to
1273                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" />
1274                                         <to
1275                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1276                                         <doCatch>
1277                                                 <exception>java.lang.Exception</exception>
1278                                                 <handled>
1279                                                         <constant>true</constant>
1280                                                 </handled>
1281                                                 <to
1282                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1283                                                 <log loggingLevel="ERROR"
1284                                                          message="GET ALL templates request failed: ${exception.stacktrace}" />
1285                                                 <setHeader headerName="CamelHttpResponseCode">
1286                                                         <constant>500</constant>
1287                                                 </setHeader>
1288                                                 <setBody>
1289                                                         <simple>GET ALL templates FAILED</simple>
1290                                                 </setBody>
1291                                         </doCatch>
1292                                 </doTry>
1293                         </route>
1294                 </get>
1295                 <get uri="/v2/templates/{templateName}"
1296                         outType="org.onap.clamp.loop.template.LoopTemplate"
1297                         produces="application/json">
1298                         <route>
1299                                 <removeHeaders pattern="*"
1300                                         excludePattern="templateName" />
1301                                 <doTry>
1302                                         <to
1303                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" />
1304                                         <to
1305                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1306                                         <to
1307                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" />
1308                                         <to
1309                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1310                                         <doCatch>
1311                                                 <exception>java.lang.Exception</exception>
1312                                                 <handled>
1313                                                         <constant>true</constant>
1314                                                 </handled>
1315                                                 <to
1316                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1317                                                 <log loggingLevel="ERROR"
1318                                                          message="GET Template request failed for template: ${header.templateName},  ${exception.stacktrace}" />
1319                                                 <setHeader headerName="CamelHttpResponseCode">
1320                                                         <constant>500</constant>
1321                                                 </setHeader>
1322                                                 <setBody>
1323                                                         <simple>GET Template FAILED</simple>
1324                                                 </setBody>
1325                                         </doCatch>
1326                                 </doTry>
1327                         </route>
1328                 </get>
1329                 <get uri="/v2/templates/names" outType="java.lang.String[]"
1330                         produces="application/json">
1331                         <route>
1332                                 <removeHeaders pattern="*" />
1333                                 <doTry>
1334                                         <to
1335                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" />
1336                                         <to
1337                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1338                                         <to
1339                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" />
1340                                         <to
1341                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1342                                         <doCatch>
1343                                                 <exception>java.lang.Exception</exception>
1344                                                 <handled>
1345                                                         <constant>true</constant>
1346                                                 </handled>
1347                                                 <to
1348                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1349                                                 <log loggingLevel="ERROR"
1350                                                          message="GET All Template names request failed for template:  ${exception.stacktrace}" />
1351                                                 <setHeader headerName="CamelHttpResponseCode">
1352                                                         <constant>500</constant>
1353                                                 </setHeader>
1354                                                 <setBody>
1355                                                         <simple>GET All Template names FAILED</simple>
1356                                                 </setBody>
1357                                         </doCatch>
1358                                 </doTry>
1359                         </route>
1360                 </get>
1361                 <get uri="/v2/templates/{templateName}/svgRepresentation"
1362                          outType="java.lang.String" produces="application/xml">
1363                         <route>
1364                                 <removeHeaders pattern="*" excludePattern="templateName" />
1365                                 <doTry>
1366                                         <to
1367                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation for Loop template')" />
1368                                         <to
1369                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1370                                         <to
1371                                                         uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getSvgRepresentation(${header.templateName})" />
1372                                         <to
1373                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1374                                         <doCatch>
1375                                                 <exception>java.lang.Exception</exception>
1376                                                 <handled>
1377                                                         <constant>true</constant>
1378                                                 </handled>
1379                                                 <to
1380                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1381                                                 <log loggingLevel="ERROR"
1382                                                          message="GET SVG for template failed for template: ${header.templateName},  ${exception.stacktrace}" />
1383                                                 <setHeader headerName="CamelHttpResponseCode">
1384                                                         <constant>500</constant>
1385                                                 </setHeader>
1386                                                 <setBody>
1387                                                         <simple>GET SVG for Template FAILED</simple>
1388                                                 </setBody>
1389                                         </doCatch>
1390                                 </doTry>
1391                         </route>
1392                 </get>
1393                 <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation"
1394                          produces="application/json">
1395                         <to
1396                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" />
1397                 </get>
1398         </rest>
1399 </rests>