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