Fix the get status
[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                                         <to uri="direct:update-policy-status-for-loop" />
701                                         <to uri="direct:update-dcae-status-for-loop" />
702                                         <to uri="direct:update-loop-state" />
703
704                                         <to
705                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request successfully executed','INFO',${exchangeProperty[loopObject]})" />
706                                         <to
707                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
708                                         <doCatch>
709                                                 <exception>java.lang.Exception</exception>
710                                                 <handled>
711                                                         <constant>true</constant>
712                                                 </handled>
713                                                 <to
714                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
715                                                 <log loggingLevel="ERROR"
716                                                          message="GET STATUS request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
717                                                 <to
718                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('GET STATUS request failed, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
719                                         </doCatch>
720                                         <doFinally>
721                                                 <setBody>
722                                                         <simple>${exchangeProperty[loopObject]}</simple>
723                                                 </setBody>
724                                                 <setHeader headerName="CamelHttpResponseCode">
725                                                         <constant>200</constant>
726                                                 </setHeader>
727                                         </doFinally>
728                                 </doTry>
729                         </route>
730                 </get>
731
732                 <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}" outType="org.onap.clamp.loop.Loop" produces="application/json">
733                         <route>
734                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion" />
735                                 <doTry>
736                                         <to
737                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add operational Policy')" />
738                                         <to
739                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
740                                         <to uri="direct:load-loop" />
741                                         <to
742                                                         uri="bean:org.onap.clamp.loop.LoopController?method=addOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
743                                         <to
744                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
745                                         <to
746                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
747                                         <doCatch>
748                                                 <exception>java.lang.Exception</exception>
749                                                 <handled>
750                                                         <constant>true</constant>
751                                                 </handled>
752                                                 <to
753                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
754                                                 <log loggingLevel="ERROR"
755                                                          message="ADD operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
756                                                 <to
757                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
758                                                 <setHeader headerName="CamelHttpResponseCode">
759                                                         <constant>500</constant>
760                                                 </setHeader>
761                                                 <setBody>
762                                                         <simple>ADD Operational policy request FAILED</simple>
763                                                 </setBody>
764                                         </doCatch>
765                                 </doTry>
766                         </route>
767                 </put>
768                 <put uri="/v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}/{policyName}" outType="org.onap.clamp.loop.Loop" produces="application/json">
769                         <route>
770                                 <removeHeaders pattern="*" excludePattern="loopName|policyType|policyVersion|policyName" />
771                                 <doTry>
772                                         <to
773                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'REMOVE operational Policy')" />
774                                         <to
775                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
776                                         <to uri="direct:load-loop" />
777                                         <setProperty propertyName="policyName">
778                                                 <simple>${header.policyName}</simple>
779                                         </setProperty>
780                                         <setProperty propertyName="policy">
781                                                 <simple>${exchangeProperty[loopObject].getOperationalPolicy(header.policyName)}</simple>
782                                         </setProperty>
783                                         <setProperty propertyName="raiseHttpExceptionFlag">
784                                                 <simple resultType="java.lang.Boolean">false</simple>
785                                         </setProperty>
786                                         <to uri="direct:remove-one-policy-from-active-pdp-group" />
787                                         <setProperty propertyName="raiseHttpExceptionFlag">
788                                                 <simple resultType="java.lang.Boolean">false</simple>
789                                         </setProperty>
790                                         <to uri="direct:delete-policy" />
791                                         <to
792                                                         uri="bean:org.onap.clamp.loop.LoopController?method=removeOperationalPolicy(${header.loopName},${header.policyType},${header.policyVersion})" />
793                                         <to
794                                                         uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
795                                         <to
796                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
797                                         <doCatch>
798                                                 <exception>java.lang.Exception</exception>
799                                                 <handled>
800                                                         <constant>true</constant>
801                                                 </handled>
802                                                 <to
803                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
804                                                 <log loggingLevel="ERROR"
805                                                          message="REMOVE operational policy request FAILED for loop: ${header.loopName}, ${exception.stacktrace}" />
806                                                 <to
807                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('REMOVE OperationalPolicy request failed','ERROR',${exchangeProperty[loopObject]})" />
808                                                 <setHeader headerName="CamelHttpResponseCode">
809                                                         <constant>500</constant>
810                                                 </setHeader>
811                                                 <setBody>
812                                                         <simple>REMOVE Operational policy request FAILED</simple>
813                                                 </setBody>
814                                         </doCatch>
815                                 </doTry>
816                         </route>
817                 </put>
818                 <post
819                                 uri="/v2/loop/create/{loopName}?templateName={templateName}"
820                                 outType="org.onap.clamp.loop.Loop" consumes="application/json"
821                                 produces="application/json">
822                         <route>
823                                 <removeHeaders
824                                                 pattern="*"
825                                                 excludePattern="loopName|templateName" />
826                                 <doTry>
827                                         <to
828                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Create Loop')" />
829                                         <to
830                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
831                                         <to
832                                                         uri="bean:org.onap.clamp.loop.LoopController?method=createLoop(${header.loopName}, ${header.templateName})" />
833                                         <to
834                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
835                                         <doCatch>
836                                                 <exception>java.lang.Exception</exception>
837                                                 <handled>
838                                                         <constant>true</constant>
839                                                 </handled>
840                                                 <to
841                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
842                                                 <log loggingLevel="ERROR"
843                                                          message="CREATE Loop from Template request failed for loop: ${header.loopName}, ${exception.stacktrace}" />
844                                                 <to
845                                                                 uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('CREATE Loop from template request failed','ERROR',${exchangeProperty[loopObject]})" />
846                                                 <setHeader headerName="CamelHttpResponseCode">
847                                                         <constant>500</constant>
848                                                 </setHeader>
849                                                 <setBody>
850                                                         <simple>CREATE Loop from template FAILED</simple>
851                                                 </setBody>
852                                         </doCatch>
853                                 </doTry>
854                         </route>
855                 </post>
856                 <get uri="/v2/dictionary"
857                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
858                         <route>
859                                 <removeHeaders pattern="*" />
860                                 <doTry>
861                                         <to
862                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionaries')" />
863                                         <to
864                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
865                                         <to
866                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllDictionaries()" />
867                                         <to
868                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
869                                         <doCatch>
870                                                 <exception>java.lang.Exception</exception>
871                                                 <handled>
872                                                         <constant>true</constant>
873                                                 </handled>
874                                                 <to
875                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
876                                                 <log loggingLevel="ERROR"
877                                                          message="GET Dictionary request failed: ${exception.stacktrace}" />
878                                                 <setHeader headerName="CamelHttpResponseCode">
879                                                         <constant>500</constant>
880                                                 </setHeader>
881                                                 <setBody>
882                                                         <simple>GET Dictionary FAILED</simple>
883                                                 </setBody>
884                                         </doCatch>
885                                 </doTry>
886                         </route>
887                 </get>
888
889                 <get uri="/v2/dictionary/secondary/names"
890                         outType="java.lang.String[]" produces="application/json">
891                         <route>
892                                 <removeHeaders pattern="*" />
893                                 <doTry>
894                                         <to
895                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Secondary Dictionary Level Names')" />
896                                         <to
897                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
898                                         <to
899                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getAllSecondaryLevelDictionaryNames()" />
900                                         <to
901                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
902                                         <doCatch>
903                                                 <exception>java.lang.Exception</exception>
904                                                 <handled>
905                                                         <constant>true</constant>
906                                                 </handled>
907                                                 <to
908                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
909                                                 <log loggingLevel="ERROR"
910                                                          message="GET Dictionary request failed: ${exception.stacktrace}" />
911                                                 <setHeader headerName="CamelHttpResponseCode">
912                                                         <constant>500</constant>
913                                                 </setHeader>
914                                                 <setBody>
915                                                         <simple>GET Dictionary FAILED</simple>
916                                                 </setBody>
917                                         </doCatch>
918                                 </doTry>
919                         </route>
920                 </get>
921                 <get uri="/v2/dictionary/{dictionaryName}"
922                         outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
923                         <route>
924                                 <removeHeaders pattern="*"
925                                         excludePattern="dictionaryName" />
926                                 <doTry>
927                                         <to
928                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Dictionary Elements for a Dictionary Name')" />
929                                         <to
930                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
931                                         <to
932                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=getDictionary(${header.dictionaryName})" />
933                                         <to
934                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
935                                         <doCatch>
936                                                 <exception>java.lang.Exception</exception>
937                                                 <handled>
938                                                         <constant>true</constant>
939                                                 </handled>
940                                                 <to
941                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
942                                                 <log loggingLevel="ERROR"
943                                                          message="GET Dictionary request failed for: ${header.dictionaryName}, ${exception.stacktrace}" />
944                                                 <setHeader headerName="CamelHttpResponseCode">
945                                                         <constant>500</constant>
946                                                 </setHeader>
947                                                 <setBody>
948                                                         <simple>GET Dictionary FAILED</simple>
949                                                 </setBody>
950                                         </doCatch>
951                                 </doTry>
952                         </route>
953                 </get>
954                 <put uri="/v2/dictionary" type="org.onap.clamp.tosca.Dictionary"
955                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
956                         produces="application/json">
957                         <route>
958                                 <doTry>
959                                         <to
960                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary')" />
961                                         <to
962                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
963                                         <setProperty propertyName="DictionaryObject">
964                                                 <simple>${body}</simple>
965                                         </setProperty>
966                                         <to
967                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionary(${exchangeProperty[DictionaryObject]})" />
968                                         <to
969                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
970                                         <doCatch>
971                                                 <exception>java.lang.Exception</exception>
972                                                 <handled>
973                                                         <constant>true</constant>
974                                                 </handled>
975                                                 <to
976                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
977                                                 <log loggingLevel="ERROR"
978                                                          message="PUT Dictionary request failed for: ${exception.stacktrace}" />
979                                                 <setHeader headerName="CamelHttpResponseCode">
980                                                         <constant>500</constant>
981                                                 </setHeader>
982                                                 <setBody>
983                                                         <simple>PUT Dictionary FAILED</simple>
984                                                 </setBody>
985                                         </doCatch>
986                                 </doTry>
987                         </route>
988                 </put>
989
990                 <put uri="/v2/dictionary/{name}"
991                         type="org.onap.clamp.tosca.Dictionary"
992                         outType="org.onap.clamp.tosca.Dictionary" consumes="application/json"
993                         produces="application/json">
994                         <route>
995                                 <removeHeaders pattern="*" excludePattern="name" />
996                                 <doTry>
997                                         <to
998                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Add New or Update Dictionary Element')" />
999                                         <to
1000                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1001                                         <setProperty propertyName="DictionaryObject">
1002                                                 <simple>${body}</simple>
1003                                         </setProperty>
1004                                         <to
1005                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=saveOrUpdateDictionaryElement(${header.name}, ${exchangeProperty[DictionaryObject]})" />
1006                                         <to
1007                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1008                                         <doCatch>
1009                                                 <exception>java.lang.Exception</exception>
1010                                                 <handled>
1011                                                         <constant>true</constant>
1012                                                 </handled>
1013                                                 <to
1014                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1015                                                 <log loggingLevel="ERROR"
1016                                                          message="PUT Dictionary request failed for: ${header.name}, ${exception.stacktrace}" />
1017                                                 <setHeader headerName="CamelHttpResponseCode">
1018                                                         <constant>500</constant>
1019                                                 </setHeader>
1020                                                 <setBody>
1021                                                         <simple>PUT Dictionary FAILED</simple>
1022                                                 </setBody>
1023                                         </doCatch>
1024                                 </doTry>
1025                         </route>
1026                 </put>
1027
1028                 <delete uri="/v2/dictionary/{name}" produces="application/json">
1029                         <route>
1030                                 <removeHeaders pattern="*" excludePattern="name" />
1031                                 <doTry>
1032                                         <to
1033                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary')" />
1034                                         <to
1035                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1036                                         <to
1037                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionary(${header.name})" />
1038                                         <to
1039                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1040                                         <doCatch>
1041                                                 <exception>java.lang.Exception</exception>
1042                                                 <handled>
1043                                                         <constant>true</constant>
1044                                                 </handled>
1045                                                 <to
1046                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1047                                                 <log loggingLevel="ERROR"
1048                                                          message="DELETE Dictionary request failed for: ${header.name}, ${exception.stacktrace}" />
1049                                                 <setHeader headerName="CamelHttpResponseCode">
1050                                                         <constant>500</constant>
1051                                                 </setHeader>
1052                                                 <setBody>
1053                                                         <simple>DELETE Dictionary FAILED</simple>
1054                                                 </setBody>
1055                                         </doCatch>
1056                                 </doTry>
1057                         </route>
1058                 </delete>
1059
1060                 <delete uri="/v2/dictionary/{name}/elements/{shortName}"
1061                         produces="application/json">
1062                         <route>
1063                                 <removeHeaders pattern="*"
1064                                         excludePattern="name|shortName" />
1065                                 <doTry>
1066                                         <to
1067                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Delete Dictionary Element')" />
1068                                         <to
1069                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1070                                         <to
1071                                                 uri="bean:org.onap.clamp.tosca.DictionaryService?method=deleteDictionaryElement(${header.name}, ${header.shortName})" />
1072                                         <to
1073                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1074                                         <doCatch>
1075                                                 <exception>java.lang.Exception</exception>
1076                                                 <handled>
1077                                                         <constant>true</constant>
1078                                                 </handled>
1079                                                 <to
1080                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1081                                                 <log loggingLevel="ERROR"
1082                                                          message="DELETE Dictionary element request failed for: ${header.name}, ${exception.stacktrace}" />
1083                                                 <setHeader headerName="CamelHttpResponseCode">
1084                                                         <constant>500</constant>
1085                                                 </setHeader>
1086                                                 <setBody>
1087                                                         <simple>DELETE Dictionary element FAILED</simple>
1088                                                 </setBody>
1089                                         </doCatch>
1090                                 </doTry>
1091                         </route>
1092                 </delete>
1093
1094                 <get uri="/v2/policyToscaModels"
1095                         outType="org.onap.clamp.loop.template.PolicyModel"
1096                         produces="application/json">
1097                         <route>
1098                                 <removeHeaders pattern="*" />
1099                                 <doTry>
1100                                         <to
1101                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Tosca Policy Models')" />
1102                                         <to
1103                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1104                                         <to
1105                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getAllPolicyModels()" />
1106                                         <to
1107                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1108                                         <doCatch>
1109                                                 <exception>java.lang.Exception</exception>
1110                                                 <handled>
1111                                                         <constant>true</constant>
1112                                                 </handled>
1113                                                 <to
1114                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1115                                                 <log loggingLevel="ERROR"
1116                                                          message="GET Policy Models request failed for: ${exception.stacktrace}" />
1117                                                 <setHeader headerName="CamelHttpResponseCode">
1118                                                         <constant>500</constant>
1119                                                 </setHeader>
1120                                                 <setBody>
1121                                                         <simple>GET Policy models FAILED</simple>
1122                                                 </setBody>
1123                                         </doCatch>
1124                                 </doTry>
1125                         </route>
1126                 </get>
1127                 <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
1128                         outType="org.onap.clamp.loop.template.PolicyModel"
1129                         produces="application/json">
1130                         <route>
1131                                 <removeHeaders pattern="*"
1132                                         excludePattern="policyModelType|policyModelVersion" />
1133                                 <doTry>
1134                                         <to
1135                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
1136                                         <to
1137                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1138                                         <to
1139                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
1140                                         <to
1141                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1142                                         <doCatch>
1143                                                 <exception>java.lang.Exception</exception>
1144                                                 <handled>
1145                                                         <constant>true</constant>
1146                                                 </handled>
1147                                                 <to
1148                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1149                                                 <log loggingLevel="ERROR"
1150                                                          message="GET Policy Model request failed for type: ${header.policyModelType}, ${exception.stacktrace}" />
1151                                                 <setHeader headerName="CamelHttpResponseCode">
1152                                                         <constant>500</constant>
1153                                                 </setHeader>
1154                                                 <setBody>
1155                                                         <simple>GET Policy model FAILED</simple>
1156                                                 </setBody>
1157                                         </doCatch>
1158                                 </doTry>
1159                         </route>
1160                 </get>
1161                 <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
1162                         outType="java.lang.String" produces="application/json">
1163                         <route>
1164                                 <removeHeaders pattern="*"
1165                                         excludePattern="policyModelType|policyModelVersion" />
1166                                 <doTry>
1167                                         <to
1168                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
1169                                         <to
1170                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
1171                                         <to
1172                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
1173                                         <to
1174                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1175                                         <doCatch>
1176                                                 <exception>java.lang.Exception</exception>
1177                                                 <handled>
1178                                                         <constant>true</constant>
1179                                                 </handled>
1180                                                 <to
1181                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1182                                                 <log loggingLevel="ERROR"
1183                                                          message="GET Policy Model YAML request failed for type: ${header.policyModelType}, ${exception.stacktrace}" />
1184                                                 <setHeader headerName="CamelHttpResponseCode">
1185                                                         <constant>500</constant>
1186                                                 </setHeader>
1187                                                 <setBody>
1188                                                         <simple>GET Policy model YAML FAILED</simple>
1189                                                 </setBody>
1190                                         </doCatch>
1191                                 </doTry>
1192                         </route>
1193                 </get>
1194
1195                 <post uri="/v2/policyToscaModels"
1196                         type="java.lang.String"
1197                         outType="org.onap.clamp.loop.template.PolicyModel"
1198                         consumes="plain/text" produces="application/json">
1199                         <route>
1200                                 <removeHeaders pattern="*"/>
1201                                 <doTry>
1202                                         <to
1203                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
1204                                         <to
1205                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1206                                         <setProperty propertyName="PolicyModelTosca">
1207                                                 <simple>${body}</simple>
1208                                         </setProperty>
1209                                         <to
1210                                                 uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${exchangeProperty[PolicyModelTosca]})" />
1211                                         <to
1212                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1213                                         <doCatch>
1214                                                 <exception>java.lang.Exception</exception>
1215                                                 <handled>
1216                                                         <constant>true</constant>
1217                                                 </handled>
1218                                                 <to
1219                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1220                                                 <log loggingLevel="ERROR"
1221                                                          message="POST Policy Model YAML request failed: ${exception.stacktrace}" />
1222                                                 <setHeader headerName="CamelHttpResponseCode">
1223                                                         <constant>500</constant>
1224                                                 </setHeader>
1225                                                 <setBody>
1226                                                         <simple>POST Policy model YAML FAILED</simple>
1227                                                 </setBody>
1228                                         </doCatch>
1229                                 </doTry>
1230                         </route>
1231                 </post>
1232                 <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
1233                           type="java.lang.String"
1234                           outType="org.onap.clamp.loop.template.PolicyModel"
1235                           consumes="plain/text" produces="application/json">
1236                         <route>
1237                                 <removeHeaders pattern="*"
1238                                                            excludePattern="policyModelType|policyModelVersion" />
1239                                 <doTry>
1240                                         <to
1241                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
1242                                         <to
1243                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
1244                                         <setProperty propertyName="PolicyModelTosca">
1245                                                 <simple>${body}</simple>
1246                                         </setProperty>
1247                                         <to
1248                                                         uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
1249                                         <to
1250                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1251                                         <doCatch>
1252                                                 <exception>java.lang.Exception</exception>
1253                                                 <handled>
1254                                                         <constant>true</constant>
1255                                                 </handled>
1256                                                 <to
1257                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1258                                                 <log loggingLevel="ERROR"
1259                                                          message="MODIFY Policy Model YAML request failed: ${exception.stacktrace}" />
1260                                                 <setHeader headerName="CamelHttpResponseCode">
1261                                                         <constant>500</constant>
1262                                                 </setHeader>
1263                                                 <setBody>
1264                                                         <simple>MODIFY Policy model YAML FAILED</simple>
1265                                                 </setBody>
1266                                         </doCatch>
1267                                 </doTry>
1268                         </route>
1269                 </put>
1270
1271                 <get uri="/v2/templates"
1272                         outType="org.onap.clamp.loop.template.LoopTemplate"
1273                         produces="application/json">
1274                         <route>
1275                                 <removeHeaders pattern="*" />
1276                                 <doTry>
1277                                         <to
1278                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Templates')" />
1279                                         <to
1280                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1281                                         <to
1282                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getAllLoopTemplates()" />
1283                                         <to
1284                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1285                                         <doCatch>
1286                                                 <exception>java.lang.Exception</exception>
1287                                                 <handled>
1288                                                         <constant>true</constant>
1289                                                 </handled>
1290                                                 <to
1291                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1292                                                 <log loggingLevel="ERROR"
1293                                                          message="GET ALL templates request failed: ${exception.stacktrace}" />
1294                                                 <setHeader headerName="CamelHttpResponseCode">
1295                                                         <constant>500</constant>
1296                                                 </setHeader>
1297                                                 <setBody>
1298                                                         <simple>GET ALL templates FAILED</simple>
1299                                                 </setBody>
1300                                         </doCatch>
1301                                 </doTry>
1302                         </route>
1303                 </get>
1304                 <get uri="/v2/templates/{templateName}"
1305                         outType="org.onap.clamp.loop.template.LoopTemplate"
1306                         produces="application/json">
1307                         <route>
1308                                 <removeHeaders pattern="*"
1309                                         excludePattern="templateName" />
1310                                 <doTry>
1311                                         <to
1312                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET a Template by NAME')" />
1313                                         <to
1314                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1315                                         <to
1316                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplate(${header.templateName})" />
1317                                         <to
1318                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1319                                         <doCatch>
1320                                                 <exception>java.lang.Exception</exception>
1321                                                 <handled>
1322                                                         <constant>true</constant>
1323                                                 </handled>
1324                                                 <to
1325                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1326                                                 <log loggingLevel="ERROR"
1327                                                          message="GET Template request failed for template: ${header.templateName},  ${exception.stacktrace}" />
1328                                                 <setHeader headerName="CamelHttpResponseCode">
1329                                                         <constant>500</constant>
1330                                                 </setHeader>
1331                                                 <setBody>
1332                                                         <simple>GET Template FAILED</simple>
1333                                                 </setBody>
1334                                         </doCatch>
1335                                 </doTry>
1336                         </route>
1337                 </get>
1338                 <get uri="/v2/templates/names" outType="java.lang.String[]"
1339                         produces="application/json">
1340                         <route>
1341                                 <removeHeaders pattern="*" />
1342                                 <doTry>
1343                                         <to
1344                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET ALL Loop Template Names')" />
1345                                         <to
1346                                                 uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1347                                         <to
1348                                                 uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getLoopTemplateNames()" />
1349                                         <to
1350                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1351                                         <doCatch>
1352                                                 <exception>java.lang.Exception</exception>
1353                                                 <handled>
1354                                                         <constant>true</constant>
1355                                                 </handled>
1356                                                 <to
1357                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1358                                                 <log loggingLevel="ERROR"
1359                                                          message="GET All Template names request failed for template:  ${exception.stacktrace}" />
1360                                                 <setHeader headerName="CamelHttpResponseCode">
1361                                                         <constant>500</constant>
1362                                                 </setHeader>
1363                                                 <setBody>
1364                                                         <simple>GET All Template names FAILED</simple>
1365                                                 </setBody>
1366                                         </doCatch>
1367                                 </doTry>
1368                         </route>
1369                 </get>
1370                 <get uri="/v2/templates/{templateName}/svgRepresentation"
1371                          outType="java.lang.String" produces="application/xml">
1372                         <route>
1373                                 <removeHeaders pattern="*" excludePattern="templateName" />
1374                                 <doTry>
1375                                         <to
1376                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get SVG Representation for Loop template')" />
1377                                         <to
1378                                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'template','','read')" />
1379                                         <to
1380                                                         uri="bean:org.onap.clamp.loop.template.LoopTemplatesService?method=getSvgRepresentation(${header.templateName})" />
1381                                         <to
1382                                                         uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
1383                                         <doCatch>
1384                                                 <exception>java.lang.Exception</exception>
1385                                                 <handled>
1386                                                         <constant>true</constant>
1387                                                 </handled>
1388                                                 <to
1389                                                                 uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
1390                                                 <log loggingLevel="ERROR"
1391                                                          message="GET SVG for template failed for template: ${header.templateName},  ${exception.stacktrace}" />
1392                                                 <setHeader headerName="CamelHttpResponseCode">
1393                                                         <constant>500</constant>
1394                                                 </setHeader>
1395                                                 <setBody>
1396                                                         <simple>GET SVG for Template FAILED</simple>
1397                                                 </setBody>
1398                                         </doCatch>
1399                                 </doTry>
1400                         </route>
1401                 </get>
1402                 <get uri="/v2/clampInformation" outType="org.onap.clamp.clds.model.ClampInformation"
1403                          produces="application/json">
1404                         <to
1405                                         uri="bean:org.onap.clamp.authorization.AuthorizationController?method=getClampInformation()" />
1406                 </get>
1407         </rest>
1408 </rests>